コード例 #1
0
ファイル: DebugLoc.cpp プロジェクト: Drup/llvm
DebugLoc DebugLoc::getFnDebugLoc(const LLVMContext &Ctx) const {
  const MDNode *Scope = getScopeNode(Ctx);
  DISubprogram SP = getDISubprogram(Scope);
  if (SP.isSubprogram())
    return DebugLoc::get(SP.getScopeLineNumber(), 0, SP);

  return DebugLoc();
}
コード例 #2
0
ファイル: DebugLoc.cpp プロジェクト: chapuni/llvm
DebugLoc DebugLoc::getFnDebugLoc() const {
  // FIXME: Add a method on \a MDLocation that does this work.
  const MDNode *Scope = getInlinedAtScope();
  DISubprogram SP = getDISubprogram(Scope);
  if (SP.isSubprogram())
    return DebugLoc::get(SP.getScopeLineNumber(), 0, SP);

  return DebugLoc();
}
コード例 #3
0
ファイル: DebugLoc.cpp プロジェクト: ADonut/LLVM-GPGPU
DebugLoc DebugLoc::getFnDebugLoc(const LLVMContext &Ctx) {
  const MDNode *Scope = getScopeNode(Ctx);
  DISubprogram SP = getDISubprogram(Scope);
  if (SP.isSubprogram()) {
    // Check for number of operands since the compatibility is
    // cheap here.  FIXME: Name the magic constant.
    if (SP->getNumOperands() > 19)
      return DebugLoc::get(SP.getScopeLineNumber(), 0, SP);
    else
      return DebugLoc::get(SP.getLineNumber(), 0, SP);
  }

  return DebugLoc();
}