[llvm-commits] [llvm] r93577 - in /llvm/trunk: include/llvm/CodeGen/AsmPrinter.h lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Chris Lattner sabre at nondot.org
Fri Jan 15 15:25:11 PST 2010


Author: lattner
Date: Fri Jan 15 17:25:11 2010
New Revision: 93577

URL: http://llvm.org/viewvc/llvm-project?rev=93577&view=rev
Log:
add another helper

Modified:
    llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp

Modified: llvm/trunk/include/llvm/CodeGen/AsmPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/AsmPrinter.h?rev=93577&r1=93576&r2=93577&view=diff

==============================================================================
--- llvm/trunk/include/llvm/CodeGen/AsmPrinter.h (original)
+++ llvm/trunk/include/llvm/CodeGen/AsmPrinter.h Fri Jan 15 17:25:11 2010
@@ -343,6 +343,12 @@
     /// value.
     MCSymbol *GetGlobalValueSymbol(const GlobalValue *GV) const;
 
+    /// GetPrivateGlobalValueSymbolStub - Return the MCSymbol for a symbol with
+    /// global value name as its base, with the specified suffix, and where the
+    /// symbol is forced to have private linkage.
+    MCSymbol *GetPrivateGlobalValueSymbolStub(const GlobalValue *GV,
+                                              StringRef Suffix) const;
+    
     /// GetExternalSymbolSymbol - Return the MCSymbol for the specified
     /// ExternalSymbol.
     MCSymbol *GetExternalSymbolSymbol(StringRef Sym) const;

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=93577&r1=93576&r2=93577&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Fri Jan 15 17:25:11 2010
@@ -1706,6 +1706,17 @@
   return OutContext.GetOrCreateSymbol(NameStr.str());
 }
 
+/// GetPrivateGlobalValueSymbolStub - Return the MCSymbol for a symbol with
+/// global value name as its base, with the specified suffix, and where the
+/// symbol is forced to have private linkage.
+MCSymbol *AsmPrinter::GetPrivateGlobalValueSymbolStub(const GlobalValue *GV,
+                                                      StringRef Suffix) const {
+  SmallString<60> NameStr;
+  Mang->getNameWithPrefix(NameStr, GV, true);
+  NameStr.append(Suffix.begin(), Suffix.end());
+  return OutContext.GetOrCreateSymbol(NameStr.str());
+}
+
 /// GetExternalSymbolSymbol - Return the MCSymbol for the specified
 /// ExternalSymbol.
 MCSymbol *AsmPrinter::GetExternalSymbolSymbol(StringRef Sym) const {





More information about the llvm-commits mailing list