Revert "DI: Fold constant arguments into a single MDString"
This reverts commit r218914 while I investigate some bots.
llvm-svn: 218918
diff --git a/llvm/lib/IR/DebugLoc.cpp b/llvm/lib/IR/DebugLoc.cpp
index 718da85..e8bdcce 100644
--- a/llvm/lib/IR/DebugLoc.cpp
+++ b/llvm/lib/IR/DebugLoc.cpp
@@ -79,8 +79,14 @@
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();
}