]> granicus.if.org Git - clang/commitdiff
use the new optimized debug info metadata accessors. In
authorChris Lattner <sabre@nondot.org>
Wed, 31 Mar 2010 03:36:01 +0000 (03:36 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 31 Mar 2010 03:36:01 +0000 (03:36 +0000)
addition to the inherent win, this eliminates the pointless
cost of going through the name -> mdkind stringmap that we
were paying.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99983 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDebugInfo.cpp
lib/CodeGen/CodeGenModule.cpp

index 426f1551728f8d62e9c555a1c655784d0c676790..fc7c0c52ebb8abe9f440630b8137c1a01f8b5395 100644 (file)
@@ -1602,7 +1602,7 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag,
   llvm::DILocation DO(NULL);
   llvm::DILocation DL = DebugFactory.CreateLocation(Line, Column, DS, DO);
   
-  Call->setMetadata("dbg", DL.getNode());
+  Call->setDbgMetadata(DL.getNode());
 }
 
 /// EmitDeclare - Emit local variable declaration debug info.
@@ -1670,7 +1670,7 @@ void CGDebugInfo::EmitDeclare(const BlockDeclRefExpr *BDRE, unsigned Tag,
   llvm::DILocation DL = 
     DebugFactory.CreateLocation(Line, PLoc.getColumn(), DS, DO);
   
-  Call->setMetadata("dbg", DL.getNode());
+  Call->setDbgMetadata(DL.getNode());
 }
 
 void CGDebugInfo::EmitDeclareOfAutoVariable(const VarDecl *VD,
index c44b311972279270db277ce7d8e504caaf34e3c6..65aceb741ac5e93f71a0a98d143996d13bcfccd9 100644 (file)
@@ -1246,8 +1246,8 @@ static void ReplaceUsesOfNonProtoTypeWithRealFunction(llvm::GlobalValue *Old,
       CI->replaceAllUsesWith(NewCall);
 
     // Copy any custom metadata attached with CI.
-    if (llvm::MDNode *DbgNode = CI->getMetadata("dbg"))
-      NewCall->setMetadata("dbg", DbgNode);
+    if (llvm::MDNode *DbgNode = CI->getDbgMetadata())
+      NewCall->setDbgMetadata(DbgNode);
     CI->eraseFromParent();
   }
 }