finally give Mangler a getSymbol method, which returns an MCSymbol
for a global instead of messing around with string buffers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98366 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/Mangler.cpp b/lib/Target/Mangler.cpp
index 3eab58c..c630062 100644
--- a/lib/Target/Mangler.cpp
+++ b/lib/Target/Mangler.cpp
@@ -179,3 +179,16 @@
   getNameWithPrefix(Buf, GV, isImplicitlyPrivate);
   return std::string(Buf.begin(), Buf.end());
 }
+
+/// getSymbol - Return the MCSymbol for the specified global value.  This
+/// symbol is the main label that is the address of the global.
+MCSymbol *Mangler::getSymbol(const GlobalValue *GV) {
+  SmallString<60> NameStr;
+  getNameWithPrefix(NameStr, GV, false);
+  if (!GV->hasPrivateLinkage())
+    return Context.GetOrCreateSymbol(NameStr.str());
+  
+  return Context.GetOrCreateTemporarySymbol(NameStr.str());
+}
+
+