From b4165c39d73bae9f8415d38fe65208f7f5b250e1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 26 Jul 2006 21:12:04 +0000 Subject: [PATCH] Rename RelocModel::PIC to PIC_, to avoid conflicts with -DPIC. llvm-svn: 29307 --- include/llvm/Target/TargetMachine.h | 2 +- lib/Target/PowerPC/PPCAsmPrinter.cpp | 6 +++--- lib/Target/PowerPC/PPCISelLowering.cpp | 6 +++--- lib/Target/PowerPC/PPCTargetMachine.cpp | 2 +- lib/Target/TargetMachine.cpp | 2 +- lib/Target/X86/X86ATTAsmPrinter.cpp | 4 ++-- lib/Target/X86/X86ISelLowering.cpp | 8 ++++---- lib/Target/X86/X86TargetMachine.cpp | 2 +- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/llvm/Target/TargetMachine.h b/include/llvm/Target/TargetMachine.h index 0b1cb3866d2..da6027c21d1 100644 --- a/include/llvm/Target/TargetMachine.h +++ b/include/llvm/Target/TargetMachine.h @@ -39,7 +39,7 @@ namespace Reloc { enum Model { Default, Static, - PIC, + PIC_, // Cannot be named PIC due to collision with -DPIC DynamicNoPIC }; } diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index cbadca8a171..6e75f3ceb7f 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -173,7 +173,7 @@ namespace { } else { O << "ha16("; printOp(MI->getOperand(OpNo)); - if (TM.getRelocationModel() == Reloc::PIC) + if (TM.getRelocationModel() == Reloc::PIC_) O << "-\"L" << getFunctionNumber() << "$pb\")"; else O << ')'; @@ -185,7 +185,7 @@ namespace { } else { O << "lo16("; printOp(MI->getOperand(OpNo)); - if (TM.getRelocationModel() == Reloc::PIC) + if (TM.getRelocationModel() == Reloc::PIC_) O << "-\"L" << getFunctionNumber() << "$pb\")"; else O << ')'; @@ -599,7 +599,7 @@ bool DarwinAsmPrinter::doFinalization(Module &M) { bool isPPC64 = TD->getPointerSizeInBits() == 64; // Output stubs for dynamically-linked functions - if (TM.getRelocationModel() == Reloc::PIC) { + if (TM.getRelocationModel() == Reloc::PIC_) { for (std::set::iterator i = FnStubs.begin(), e = FnStubs.end(); i != e; ++i) { SwitchToTextSection(".section __TEXT,__picsymbolstub1,symbol_stubs," diff --git a/lib/Target/PowerPC/PPCISelLowering.cpp b/lib/Target/PowerPC/PPCISelLowering.cpp index bc764bcd689..b761aa8936e 100644 --- a/lib/Target/PowerPC/PPCISelLowering.cpp +++ b/lib/Target/PowerPC/PPCISelLowering.cpp @@ -619,7 +619,7 @@ static SDOperand LowerConstantPool(SDOperand Op, SelectionDAG &DAG) { return DAG.getNode(ISD::ADD, PtrVT, Hi, Lo); } - if (TM.getRelocationModel() == Reloc::PIC) { + if (TM.getRelocationModel() == Reloc::PIC_) { // With PIC, the first instruction is actually "GR+hi(&G)". Hi = DAG.getNode(ISD::ADD, PtrVT, DAG.getNode(PPCISD::GlobalBaseReg, PtrVT), Hi); @@ -649,7 +649,7 @@ static SDOperand LowerJumpTable(SDOperand Op, SelectionDAG &DAG) { return DAG.getNode(ISD::ADD, PtrVT, Hi, Lo); } - if (TM.getRelocationModel() == Reloc::PIC) { + if (TM.getRelocationModel() == Reloc::PIC_) { // With PIC, the first instruction is actually "GR+hi(&G)". Hi = DAG.getNode(ISD::ADD, PtrVT, DAG.getNode(PPCISD::GlobalBaseReg, MVT::i32), Hi); @@ -680,7 +680,7 @@ static SDOperand LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG) { return DAG.getNode(ISD::ADD, PtrVT, Hi, Lo); } - if (TM.getRelocationModel() == Reloc::PIC) { + if (TM.getRelocationModel() == Reloc::PIC_) { // With PIC, the first instruction is actually "GR+hi(&G)". Hi = DAG.getNode(ISD::ADD, PtrVT, DAG.getNode(PPCISD::GlobalBaseReg, PtrVT), Hi); diff --git a/lib/Target/PowerPC/PPCTargetMachine.cpp b/lib/Target/PowerPC/PPCTargetMachine.cpp index 12c22e7dd80..deb479a4c34 100644 --- a/lib/Target/PowerPC/PPCTargetMachine.cpp +++ b/lib/Target/PowerPC/PPCTargetMachine.cpp @@ -94,7 +94,7 @@ PPCTargetMachine::PPCTargetMachine(const Module &M, const std::string &FS, if (Subtarget.isDarwin()) setRelocationModel(Reloc::DynamicNoPIC); else - setRelocationModel(Reloc::PIC); + setRelocationModel(Reloc::PIC_); } PPC32TargetMachine::PPC32TargetMachine(const Module &M, const std::string &FS) diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp index 1fbad7d19ab..d1ffaa70d7c 100644 --- a/lib/Target/TargetMachine.cpp +++ b/lib/Target/TargetMachine.cpp @@ -66,7 +66,7 @@ namespace { "Target default relocation model"), clEnumValN(Reloc::Static, "static", "Non-relocatable code"), - clEnumValN(Reloc::PIC, "pic", + clEnumValN(Reloc::PIC_, "pic", "Fully relocatable, position independent code"), clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic", "Relocatable external references, non-relocatable code"), diff --git a/lib/Target/X86/X86ATTAsmPrinter.cpp b/lib/Target/X86/X86ATTAsmPrinter.cpp index e94bf3a5705..769aa73b417 100755 --- a/lib/Target/X86/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/X86ATTAsmPrinter.cpp @@ -152,7 +152,7 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo, O << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << "_" << MO.getConstantPoolIndex(); if (Subtarget->TargetType == X86Subtarget::isDarwin && - TM.getRelocationModel() == Reloc::PIC) + TM.getRelocationModel() == Reloc::PIC_) O << "-\"L" << getFunctionNumber() << "$pb\""; int Offset = MO.getOffset(); if (Offset > 0) @@ -185,7 +185,7 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo, } else { O << Mang->getValueName(GV); } - if (!isCallOp && TM.getRelocationModel() == Reloc::PIC) + if (!isCallOp && TM.getRelocationModel() == Reloc::PIC_) O << "-\"L" << getFunctionNumber() << "$pb\""; } else O << Mang->getValueName(MO.getGlobal()); diff --git a/lib/Target/X86/X86ISelLowering.cpp b/lib/Target/X86/X86ISelLowering.cpp index 4ebe4caad09..2061c660c5c 100644 --- a/lib/Target/X86/X86ISelLowering.cpp +++ b/lib/Target/X86/X86ISelLowering.cpp @@ -2746,7 +2746,7 @@ X86TargetLowering::LowerConstantPool(SDOperand Op, SelectionDAG &DAG) { CP->getAlignment())); if (Subtarget->isTargetDarwin()) { // With PIC, the address is actually $g + Offset. - if (getTargetMachine().getRelocationModel() == Reloc::PIC) + if (getTargetMachine().getRelocationModel() == Reloc::PIC_) Result = DAG.getNode(ISD::ADD, getPointerTy(), DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()), Result); } @@ -2762,7 +2762,7 @@ X86TargetLowering::LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG) { getPointerTy())); if (Subtarget->isTargetDarwin()) { // With PIC, the address is actually $g + Offset. - if (getTargetMachine().getRelocationModel() == Reloc::PIC) + if (getTargetMachine().getRelocationModel() == Reloc::PIC_) Result = DAG.getNode(ISD::ADD, getPointerTy(), DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()), Result); @@ -2788,7 +2788,7 @@ X86TargetLowering::LowerExternalSymbol(SDOperand Op, SelectionDAG &DAG) { getPointerTy())); if (Subtarget->isTargetDarwin()) { // With PIC, the address is actually $g + Offset. - if (getTargetMachine().getRelocationModel() == Reloc::PIC) + if (getTargetMachine().getRelocationModel() == Reloc::PIC_) Result = DAG.getNode(ISD::ADD, getPointerTy(), DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()), Result); @@ -3173,7 +3173,7 @@ SDOperand X86TargetLowering::LowerJumpTable(SDOperand Op, SelectionDAG &DAG) { getPointerTy())); if (Subtarget->isTargetDarwin()) { // With PIC, the address is actually $g + Offset. - if (getTargetMachine().getRelocationModel() == Reloc::PIC) + if (getTargetMachine().getRelocationModel() == Reloc::PIC_) Result = DAG.getNode(ISD::ADD, getPointerTy(), DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()), Result); diff --git a/lib/Target/X86/X86TargetMachine.cpp b/lib/Target/X86/X86TargetMachine.cpp index e4b6a941a46..69e651f9954 100644 --- a/lib/Target/X86/X86TargetMachine.cpp +++ b/lib/Target/X86/X86TargetMachine.cpp @@ -78,7 +78,7 @@ X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS) if (Subtarget.isTargetDarwin()) setRelocationModel(Reloc::DynamicNoPIC); else - setRelocationModel(Reloc::PIC); + setRelocationModel(Reloc::PIC_); }