[llvm-commits] [llvm] r60208 - in /llvm/trunk/lib/Target/X86: X86Subtarget.cpp X86Subtarget.h X86TargetMachine.cpp

Duncan Sands baldrick at free.fr
Fri Nov 28 01:29:39 PST 2008


Author: baldrick
Date: Fri Nov 28 03:29:37 2008
New Revision: 60208

URL: http://llvm.org/viewvc/llvm-project?rev=60208&view=rev
Log:
Fix build with gcc-4.4: it doesn't like PICStyle
being both a namespace and a variable name.

Modified:
    llvm/trunk/lib/Target/X86/X86Subtarget.cpp
    llvm/trunk/lib/Target/X86/X86Subtarget.h
    llvm/trunk/lib/Target/X86/X86TargetMachine.cpp

Modified: llvm/trunk/lib/Target/X86/X86Subtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.cpp?rev=60208&r1=60207&r2=60208&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.cpp Fri Nov 28 03:29:37 2008
@@ -239,7 +239,7 @@
 
 X86Subtarget::X86Subtarget(const Module &M, const std::string &FS, bool is64Bit)
   : AsmFlavor(AsmWriterFlavor)
-  , PICStyle(PICStyle::None)
+  , PICStyle(PICStyles::None)
   , X86SSELevel(NoMMXSSE)
   , X863DNowLevel(NoThreeDNow)
   , HasX86_64(false)

Modified: llvm/trunk/lib/Target/X86/X86Subtarget.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86Subtarget.h?rev=60208&r1=60207&r2=60208&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86Subtarget.h (original)
+++ llvm/trunk/lib/Target/X86/X86Subtarget.h Fri Nov 28 03:29:37 2008
@@ -23,7 +23,7 @@
 class GlobalValue;
 class TargetMachine;
   
-namespace PICStyle {
+namespace PICStyles {
 enum Style {
   Stub, GOT, RIPRel, WinPIC, None
 };
@@ -51,7 +51,7 @@
 
   /// PICStyle - Which PIC style to use
   ///
-  PICStyle::Style PICStyle;
+  PICStyles::Style PICStyle;
   
   /// X86SSELevel - MMX, SSE1, SSE2, SSE3, SSSE3, SSE41, SSE42, or
   /// none supported.
@@ -114,8 +114,8 @@
 
   bool is64Bit() const { return Is64Bit; }
 
-  PICStyle::Style getPICStyle() const { return PICStyle; }
-  void setPICStyle(PICStyle::Style Style)  { PICStyle = Style; }
+  PICStyles::Style getPICStyle() const { return PICStyle; }
+  void setPICStyle(PICStyles::Style Style)  { PICStyle = Style; }
 
   bool hasMMX() const { return X86SSELevel >= MMX; }
   bool hasSSE1() const { return X86SSELevel >= SSE1; }
@@ -160,11 +160,11 @@
     return std::string(p);
   }
 
-  bool isPICStyleSet() const { return PICStyle != PICStyle::None; }
-  bool isPICStyleGOT() const { return PICStyle == PICStyle::GOT; }
-  bool isPICStyleStub() const { return PICStyle == PICStyle::Stub; }
-  bool isPICStyleRIPRel() const { return PICStyle == PICStyle::RIPRel; }
-  bool isPICStyleWinPIC() const { return PICStyle == PICStyle:: WinPIC; }
+  bool isPICStyleSet() const { return PICStyle != PICStyles::None; }
+  bool isPICStyleGOT() const { return PICStyle == PICStyles::GOT; }
+  bool isPICStyleStub() const { return PICStyle == PICStyles::Stub; }
+  bool isPICStyleRIPRel() const { return PICStyle == PICStyles::RIPRel; }
+  bool isPICStyleWinPIC() const { return PICStyle == PICStyles:: WinPIC; }
   
   /// getDarwinVers - Return the darwin version number, 8 = tiger, 9 = leopard.
   unsigned getDarwinVers() const { return DarwinVers; }

Modified: llvm/trunk/lib/Target/X86/X86TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86TargetMachine.cpp?rev=60208&r1=60207&r2=60208&view=diff

==============================================================================
--- llvm/trunk/lib/Target/X86/X86TargetMachine.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86TargetMachine.cpp Fri Nov 28 03:29:37 2008
@@ -162,17 +162,17 @@
   }
 
   if (Subtarget.isTargetCygMing())
-    Subtarget.setPICStyle(PICStyle::WinPIC);
+    Subtarget.setPICStyle(PICStyles::WinPIC);
   else if (Subtarget.isTargetDarwin()) {
     if (Subtarget.is64Bit())
-      Subtarget.setPICStyle(PICStyle::RIPRel);
+      Subtarget.setPICStyle(PICStyles::RIPRel);
     else
-      Subtarget.setPICStyle(PICStyle::Stub);
+      Subtarget.setPICStyle(PICStyles::Stub);
   } else if (Subtarget.isTargetELF()) {
     if (Subtarget.is64Bit())
-      Subtarget.setPICStyle(PICStyle::RIPRel);
+      Subtarget.setPICStyle(PICStyles::RIPRel);
     else
-      Subtarget.setPICStyle(PICStyle::GOT);
+      Subtarget.setPICStyle(PICStyles::GOT);
   }
 }
 





More information about the llvm-commits mailing list