[llvm-commits] [llvm] r106518 - in /llvm/trunk: include/llvm/Module.h lib/Analysis/DebugInfo.cpp lib/CodeGen/AsmPrinter/DwarfDebug.cpp lib/VMCore/Module.cpp
Devang Patel
dpatel at apple.com
Mon Jun 21 18:19:39 PDT 2010
Author: dpatel
Date: Mon Jun 21 20:19:38 2010
New Revision: 106518
URL: http://llvm.org/viewvc/llvm-project?rev=106518&view=rev
Log:
Use single interface, using twine, to get named metadata.
getNamedMetadata().
Modified:
llvm/trunk/include/llvm/Module.h
llvm/trunk/lib/Analysis/DebugInfo.cpp
llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
llvm/trunk/lib/VMCore/Module.cpp
Modified: llvm/trunk/include/llvm/Module.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Module.h?rev=106518&r1=106517&r2=106518&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Module.h (original)
+++ llvm/trunk/include/llvm/Module.h Mon Jun 21 20:19:38 2010
@@ -325,8 +325,7 @@
/// 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
Modified: llvm/trunk/lib/Analysis/DebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/DebugInfo.cpp?rev=106518&r1=106517&r2=106518&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/DebugInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/DebugInfo.cpp Mon Jun 21 20:19:38 2010
@@ -1062,8 +1062,7 @@
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);
Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=106518&r1=106517&r2=106518&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon Jun 21 20:19:38 2010
@@ -2260,8 +2260,8 @@
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))
Modified: llvm/trunk/lib/VMCore/Module.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Module.cpp?rev=106518&r1=106517&r2=106518&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Module.cpp (original)
+++ llvm/trunk/lib/VMCore/Module.cpp Mon Jun 21 20:19:38 2010
@@ -313,11 +313,7 @@
/// 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);
More information about the llvm-commits
mailing list