Fix build with gcc-4.4: it doesn't like PICStyle

being both a namespace and a variable name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60208 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan Sands 2008-11-28 09:29:37 +00:00
parent 7605730ba8
commit f9a67a8943
3 changed files with 15 additions and 15 deletions

View File

@ -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)

View File

@ -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; }

View File

@ -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);
}
}