[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp

Anton Korobeynikov asl at math.spbu.ru
Fri Jan 12 11:21:19 PST 2007



Changes in directory llvm/lib/VMCore:

AsmWriter.cpp updated: 1.251 -> 1.252
---
Log message:

* PIC codegen for X86/Linux has been implemented
* PIC-aware internal structures in X86 Codegen have been refactored
* Visibility (default/weak) has been added
* Docs fixes (external weak linkage, visibility, formatting)


---
Diffs of the changes:  (+17 -3)

 AsmWriter.cpp |   20 +++++++++++++++++---
 1 files changed, 17 insertions(+), 3 deletions(-)


Index: llvm/lib/VMCore/AsmWriter.cpp
diff -u llvm/lib/VMCore/AsmWriter.cpp:1.251 llvm/lib/VMCore/AsmWriter.cpp:1.252
--- llvm/lib/VMCore/AsmWriter.cpp:1.251	Fri Jan 12 01:25:20 2007
+++ llvm/lib/VMCore/AsmWriter.cpp	Fri Jan 12 13:20:47 2007
@@ -858,8 +858,7 @@
      case GlobalValue::DLLImportLinkage:   Out << "dllimport "; break;
      case GlobalValue::ExternalWeakLinkage: Out << "extern_weak "; break;
      default: Out << "external "; break;
-    }
-  else
+    } else {
     switch (GV->getLinkage()) {
     case GlobalValue::InternalLinkage:     Out << "internal "; break;
     case GlobalValue::LinkOnceLinkage:     Out << "linkonce "; break;
@@ -873,7 +872,15 @@
       cerr << "GhostLinkage not allowed in AsmWriter!\n";
       abort();
     }
-
+    switch (GV->getVisibility()) {
+    case GlobalValue::DefaultVisibility: break;
+    case GlobalValue::HiddenVisibility: Out << "hidden "; break;
+    default:
+     cerr << "Invalid visibility style!\n";
+     abort();
+    }
+  }
+  
   Out << (GV->isConstant() ? "constant " : "global ");
   printType(GV->getType()->getElementType());
 
@@ -974,6 +981,13 @@
       cerr << "GhostLinkage not allowed in AsmWriter!\n";
       abort();
     }
+    switch (F->getVisibility()) {
+    case GlobalValue::DefaultVisibility: break;
+    case GlobalValue::HiddenVisibility: Out << "hidden "; break;
+    default:
+     cerr << "Invalid visibility style!\n";
+     abort();
+    }
   }
 
   // Print the calling convention.






More information about the llvm-commits mailing list