obj2yaml: Use the correct relocation type for different machine types
[oota-llvm.git] / lib / IR / Mangler.cpp
index 9c18e6f3001fddd3e5faefb942d3261e00309b83..d82388fdbf41229995ba1fd3a6154008b3181191 100644 (file)
@@ -76,12 +76,15 @@ static void AddFastCallStdCallSuffix(raw_ostream &OS, const Function *F,
   OS << '@' << ArgWords;
 }
 
-void Mangler::getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV) const {
+void Mangler::getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV,
+                                bool CannotUsePrivateLabel) const {
   ManglerPrefixTy PrefixTy = Mangler::Default;
-  if (GV->hasPrivateLinkage())
-    PrefixTy = Mangler::Private;
-  else if (GV->hasLinkerPrivateLinkage() || GV->hasLinkerPrivateWeakLinkage())
-    PrefixTy = Mangler::LinkerPrivate;
+  if (GV->hasPrivateLinkage()) {
+    if (CannotUsePrivateLabel)
+      PrefixTy = Mangler::LinkerPrivate;
+    else
+      PrefixTy = Mangler::Private;
+  }
 
   if (!GV->hasName()) {
     // Get the ID for the global, assigning a new one if we haven't got one
@@ -134,7 +137,8 @@ void Mangler::getNameWithPrefix(raw_ostream &OS, const GlobalValue *GV) const {
 }
 
 void Mangler::getNameWithPrefix(SmallVectorImpl<char> &OutName,
-                                const GlobalValue *GV) const {
+                                const GlobalValue *GV,
+                                bool CannotUsePrivateLabel) const {
   raw_svector_ostream OS(OutName);
-  getNameWithPrefix(OS, GV);
+  getNameWithPrefix(OS, GV, CannotUsePrivateLabel);
 }