diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-10-02 22:15:31 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-10-02 22:15:31 +0000 |
commit | 786cd049fc467bfaf85021b4fcfb19bbf134329b (patch) | |
tree | 55f7a8b314704fe5d4b3a947b22b6009c1a23ded /llvm/lib/IR/DebugLoc.cpp | |
parent | 834c265e85e4ee433cd9089e907bf6bccdb25313 (diff) | |
download | bcm5719-llvm-786cd049fc467bfaf85021b4fcfb19bbf134329b.tar.gz bcm5719-llvm-786cd049fc467bfaf85021b4fcfb19bbf134329b.zip |
Revert "DI: Fold constant arguments into a single MDString"
This reverts commit r218914 while I investigate some bots.
llvm-svn: 218918
Diffstat (limited to 'llvm/lib/IR/DebugLoc.cpp')
-rw-r--r-- | llvm/lib/IR/DebugLoc.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/IR/DebugLoc.cpp b/llvm/lib/IR/DebugLoc.cpp index 718da852fec..e8bdccebae9 100644 --- a/llvm/lib/IR/DebugLoc.cpp +++ b/llvm/lib/IR/DebugLoc.cpp @@ -79,8 +79,14 @@ MDNode *DebugLoc::getScopeNode(const LLVMContext &Ctx) const { 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); + 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(); } |