diff options
| author | Devang Patel <dpatel@apple.com> | 2010-06-22 01:19:38 +0000 |
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2010-06-22 01:19:38 +0000 |
| commit | b6e058da187de7d9ec86a57d78044379543d0203 (patch) | |
| tree | dc4e07bd16bff9f415f296ef948d081d514bce68 /llvm/lib | |
| parent | 37bb617f8a15788787a7a88f7c25c1e6ac3cadb4 (diff) | |
| download | bcm5719-llvm-b6e058da187de7d9ec86a57d78044379543d0203.tar.gz bcm5719-llvm-b6e058da187de7d9ec86a57d78044379543d0203.zip | |
Use single interface, using twine, to get named metadata.
getNamedMetadata().
llvm-svn: 106518
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/DebugInfo.cpp | 3 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 4 | ||||
| -rw-r--r-- | llvm/lib/VMCore/Module.cpp | 6 |
3 files changed, 4 insertions, 9 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp index fe19ff8dbdb..feb7a303d0e 100644 --- a/llvm/lib/Analysis/DebugInfo.cpp +++ b/llvm/lib/Analysis/DebugInfo.cpp @@ -1062,8 +1062,7 @@ DIVariable DIFactory::CreateVariable(unsigned Tag, DIDescriptor Context, char One = '\1'; if (FName.startswith(StringRef(&One, 1))) FName = FName.substr(1); - NamedMDNode *FnLocals = - M.getNamedMetadataUsingTwine(Twine("llvm.dbg.lv.", FName)); + NamedMDNode *FnLocals = M.getNamedMetadata(Twine("llvm.dbg.lv.", FName)); if (!FnLocals) FnLocals = NamedMDNode::Create(VMContext, Twine("llvm.dbg.lv.", FName), NULL, 0, &M); diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index d47359c02b1..89993ae9fd4 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -2260,8 +2260,8 @@ void DwarfDebug::collectVariableInfo(const MachineFunction *MF) { const Function *F = MF->getFunction(); const Module *M = F->getParent(); if (NamedMDNode *NMD = - M->getNamedMetadataUsingTwine(Twine("llvm.dbg.lv.", - getRealLinkageName(F->getName())))) { + M->getNamedMetadata(Twine("llvm.dbg.lv.", + getRealLinkageName(F->getName())))) { for (unsigned i = 0, e = NMD->getNumOperands(); i != e; ++i) { DIVariable DV(cast_or_null<MDNode>(NMD->getOperand(i))); if (!DV || !Processed.insert(DV)) diff --git a/llvm/lib/VMCore/Module.cpp b/llvm/lib/VMCore/Module.cpp index a06911f77ad..38a51dfd5d3 100644 --- a/llvm/lib/VMCore/Module.cpp +++ b/llvm/lib/VMCore/Module.cpp @@ -313,11 +313,7 @@ GlobalAlias *Module::getNamedAlias(StringRef Name) const { /// getNamedMetadata - Return the first NamedMDNode in the module with the /// specified name. This method returns null if a NamedMDNode with the /// specified name is not found. -NamedMDNode *Module::getNamedMetadata(StringRef Name) const { - return NamedMDSymTab->lookup(Name); -} - -NamedMDNode *Module::getNamedMetadataUsingTwine(Twine Name) const { +NamedMDNode *Module::getNamedMetadata(const Twine &Name) const { SmallString<256> NameData; StringRef NameRef = Name.toStringRef(NameData); return NamedMDSymTab->lookup(NameRef); |

