aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-06-22 01:19:38 +0000
committerDevang Patel <dpatel@apple.com>2010-06-22 01:19:38 +0000
commit8fa7adcbc5b4d12c6bebec5371379666fda75ef2 (patch)
treebe044c6b7bc7e60f47ec8c8528b98eb218d6db2e
parent8bed85099fd6ea5f408e5dbaa7c1e60dade7e159 (diff)
downloadexternal_llvm-8fa7adcbc5b4d12c6bebec5371379666fda75ef2.zip
external_llvm-8fa7adcbc5b4d12c6bebec5371379666fda75ef2.tar.gz
external_llvm-8fa7adcbc5b4d12c6bebec5371379666fda75ef2.tar.bz2
Use single interface, using twine, to get named metadata.
getNamedMetadata(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106518 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/Module.h3
-rw-r--r--lib/Analysis/DebugInfo.cpp3
-rw-r--r--lib/CodeGen/AsmPrinter/DwarfDebug.cpp4
-rw-r--r--lib/VMCore/Module.cpp6
4 files changed, 5 insertions, 11 deletions
diff --git a/include/llvm/Module.h b/include/llvm/Module.h
index 15e0a17..994184f 100644
--- a/include/llvm/Module.h
+++ b/include/llvm/Module.h
@@ -325,8 +325,7 @@ public:
/// 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 *getNamedMetadata(StringRef Name) const;
- NamedMDNode *getNamedMetadataUsingTwine(Twine Name) const;
+ NamedMDNode *getNamedMetadata(const Twine &Name) const;
/// getOrInsertNamedMetadata - Return the first named MDNode in the module
/// with the specified name. This method returns a new NamedMDNode if a
diff --git a/lib/Analysis/DebugInfo.cpp b/lib/Analysis/DebugInfo.cpp
index fe19ff8..feb7a30 100644
--- a/lib/Analysis/DebugInfo.cpp
+++ b/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/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index d47359c..89993ae 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/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/lib/VMCore/Module.cpp b/lib/VMCore/Module.cpp
index a06911f..38a51df 100644
--- a/lib/VMCore/Module.cpp
+++ b/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);