summaryrefslogtreecommitdiff
path: root/lib/Transforms/Utils/CloneFunction.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-07-20 23:09:34 +0000
committerDan Gohman <gohman@apple.com>2010-07-20 23:09:34 +0000
commit7bc230ec6aad867333db43636f7beda68bb628ae (patch)
tree306f644057fa8207deabf241f80516d2049e37bf /lib/Transforms/Utils/CloneFunction.cpp
parent6e8154354fd879d64c2406131370d61a6b123103 (diff)
downloadllvm-7bc230ec6aad867333db43636f7beda68bb628ae.tar.gz
llvm-7bc230ec6aad867333db43636f7beda68bb628ae.tar.bz2
llvm-7bc230ec6aad867333db43636f7beda68bb628ae.tar.xz
Don't look up the "dbg" metadata kind by name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108961 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Utils/CloneFunction.cpp')
-rw-r--r--lib/Transforms/Utils/CloneFunction.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib/Transforms/Utils/CloneFunction.cpp b/lib/Transforms/Utils/CloneFunction.cpp
index 1dcfd57878..2aea51abdb 100644
--- a/lib/Transforms/Utils/CloneFunction.cpp
+++ b/lib/Transforms/Utils/CloneFunction.cpp
@@ -408,10 +408,9 @@ void llvm::CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
//
BasicBlock::iterator I = NewBB->begin();
- unsigned DbgKind = OldFunc->getContext().getMDKindID("dbg");
MDNode *TheCallMD = NULL;
if (TheCall && TheCall->hasMetadata())
- TheCallMD = TheCall->getMetadata(DbgKind);
+ TheCallMD = TheCall->getMetadata(LLVMContext::MD_dbg);
// Handle PHI nodes specially, as we have to remove references to dead
// blocks.
@@ -421,14 +420,14 @@ void llvm::CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
for (; (PN = dyn_cast<PHINode>(I)); ++I, ++OldI) {
if (I->hasMetadata()) {
if (TheCallMD) {
- if (MDNode *IMD = I->getMetadata(DbgKind)) {
+ if (MDNode *IMD = I->getMetadata(LLVMContext::MD_dbg)) {
MDNode *NewMD = UpdateInlinedAtInfo(IMD, TheCallMD);
- I->setMetadata(DbgKind, NewMD);
+ I->setMetadata(LLVMContext::MD_dbg, NewMD);
}
} else {
// The cloned instruction has dbg info but the call instruction
// does not have dbg info. Remove dbg info from cloned instruction.
- I->setMetadata(DbgKind, 0);
+ I->setMetadata(LLVMContext::MD_dbg, 0);
}
}
PHIToResolve.push_back(cast<PHINode>(OldI));
@@ -445,14 +444,14 @@ void llvm::CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
for (; I != NewBB->end(); ++I) {
if (I->hasMetadata()) {
if (TheCallMD) {
- if (MDNode *IMD = I->getMetadata(DbgKind)) {
+ if (MDNode *IMD = I->getMetadata(LLVMContext::MD_dbg)) {
MDNode *NewMD = UpdateInlinedAtInfo(IMD, TheCallMD);
- I->setMetadata(DbgKind, NewMD);
+ I->setMetadata(LLVMContext::MD_dbg, NewMD);
}
} else {
// The cloned instruction has dbg info but the call instruction
// does not have dbg info. Remove dbg info from cloned instruction.
- I->setMetadata(DbgKind, 0);
+ I->setMetadata(LLVMContext::MD_dbg, 0);
}
}
RemapInstruction(I, VMap);