add another helper
authorChris Lattner <sabre@nondot.org>
Fri, 15 Jan 2010 23:25:11 +0000 (23:25 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 15 Jan 2010 23:25:11 +0000 (23:25 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93577 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/AsmPrinter.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp

index bd902389397a40db0f67c63a5018236789a09a1b..19634cf943fcc64c633ab7cf65ac56b1eba86808 100644 (file)
@@ -343,6 +343,12 @@ namespace llvm {
     /// 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;
index 680afc001c12d650a8e2c88b3ceb6290a940fd96..013889b5b2a0ac92674353af6f4195ecd398ab40 100644 (file)
@@ -1706,6 +1706,17 @@ MCSymbol *AsmPrinter::GetGlobalValueSymbol(const GlobalValue *GV) const {
   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 {