Test commit access (email fix)
[oota-llvm.git] / lib / IR / DebugLoc.cpp
index 43360d38662cffbc1c83af68c328b5f9149fa1b5..718da852fec34ae94ffa29c73808597dfe867f64 100644 (file)
@@ -76,17 +76,11 @@ MDNode *DebugLoc::getScopeNode(const LLVMContext &Ctx) const {
   return getScope(Ctx);
 }
 
-DebugLoc DebugLoc::getFnDebugLoc(const LLVMContext &Ctx) {
+DebugLoc DebugLoc::getFnDebugLoc(const LLVMContext &Ctx) const {
   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);
-  }
+  if (SP.isSubprogram())
+    return DebugLoc::get(SP.getScopeLineNumber(), 0, SP);
 
   return DebugLoc();
 }