From 7fd4ea58475f6c41a5c524dff3e971238e06cff3 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Fri, 28 Nov 2008 09:29:37 +0000 Subject: [PATCH] Fix build with gcc-4.4: it doesn't like PICStyle being both a namespace and a variable name. llvm-svn: 60208 --- lib/Target/X86/X86Subtarget.cpp | 2 +- lib/Target/X86/X86Subtarget.h | 18 +++++++++--------- lib/Target/X86/X86TargetMachine.cpp | 10 +++++----- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp index 871e7af83f1..c17f2dc6825 100644 --- a/lib/Target/X86/X86Subtarget.cpp +++ b/lib/Target/X86/X86Subtarget.cpp @@ -239,7 +239,7 @@ static const char *GetCurrentX86CPU() { 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) diff --git a/lib/Target/X86/X86Subtarget.h b/lib/Target/X86/X86Subtarget.h index b95a2e45e5e..f49008ad69e 100644 --- a/lib/Target/X86/X86Subtarget.h +++ b/lib/Target/X86/X86Subtarget.h @@ -23,7 +23,7 @@ class Module; class GlobalValue; class TargetMachine; -namespace PICStyle { +namespace PICStyles { enum Style { Stub, GOT, RIPRel, WinPIC, None }; @@ -51,7 +51,7 @@ protected: /// 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 @@ public: 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 @@ public: 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; } diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index 1e90c0fe8ca..ce4b090c2c6 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -162,17 +162,17 @@ X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS, } 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); } }