diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 426f1551728f..fc7c0c52ebb8 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -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, diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index c44b31197227..65aceb741ac5 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -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(); } }