mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
Rename RelocModel::PIC to PIC_, to avoid conflicts with -DPIC.
llvm-svn: 29307
This commit is contained in:
parent
d23d7bb97b
commit
b4165c39d7
@ -39,7 +39,7 @@ namespace Reloc {
|
|||||||
enum Model {
|
enum Model {
|
||||||
Default,
|
Default,
|
||||||
Static,
|
Static,
|
||||||
PIC,
|
PIC_, // Cannot be named PIC due to collision with -DPIC
|
||||||
DynamicNoPIC
|
DynamicNoPIC
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,7 @@ namespace {
|
|||||||
} else {
|
} else {
|
||||||
O << "ha16(";
|
O << "ha16(";
|
||||||
printOp(MI->getOperand(OpNo));
|
printOp(MI->getOperand(OpNo));
|
||||||
if (TM.getRelocationModel() == Reloc::PIC)
|
if (TM.getRelocationModel() == Reloc::PIC_)
|
||||||
O << "-\"L" << getFunctionNumber() << "$pb\")";
|
O << "-\"L" << getFunctionNumber() << "$pb\")";
|
||||||
else
|
else
|
||||||
O << ')';
|
O << ')';
|
||||||
@ -185,7 +185,7 @@ namespace {
|
|||||||
} else {
|
} else {
|
||||||
O << "lo16(";
|
O << "lo16(";
|
||||||
printOp(MI->getOperand(OpNo));
|
printOp(MI->getOperand(OpNo));
|
||||||
if (TM.getRelocationModel() == Reloc::PIC)
|
if (TM.getRelocationModel() == Reloc::PIC_)
|
||||||
O << "-\"L" << getFunctionNumber() << "$pb\")";
|
O << "-\"L" << getFunctionNumber() << "$pb\")";
|
||||||
else
|
else
|
||||||
O << ')';
|
O << ')';
|
||||||
@ -599,7 +599,7 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
|
|||||||
bool isPPC64 = TD->getPointerSizeInBits() == 64;
|
bool isPPC64 = TD->getPointerSizeInBits() == 64;
|
||||||
|
|
||||||
// Output stubs for dynamically-linked functions
|
// Output stubs for dynamically-linked functions
|
||||||
if (TM.getRelocationModel() == Reloc::PIC) {
|
if (TM.getRelocationModel() == Reloc::PIC_) {
|
||||||
for (std::set<std::string>::iterator i = FnStubs.begin(), e = FnStubs.end();
|
for (std::set<std::string>::iterator i = FnStubs.begin(), e = FnStubs.end();
|
||||||
i != e; ++i) {
|
i != e; ++i) {
|
||||||
SwitchToTextSection(".section __TEXT,__picsymbolstub1,symbol_stubs,"
|
SwitchToTextSection(".section __TEXT,__picsymbolstub1,symbol_stubs,"
|
||||||
|
@ -619,7 +619,7 @@ static SDOperand LowerConstantPool(SDOperand Op, SelectionDAG &DAG) {
|
|||||||
return DAG.getNode(ISD::ADD, PtrVT, Hi, Lo);
|
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)".
|
// With PIC, the first instruction is actually "GR+hi(&G)".
|
||||||
Hi = DAG.getNode(ISD::ADD, PtrVT,
|
Hi = DAG.getNode(ISD::ADD, PtrVT,
|
||||||
DAG.getNode(PPCISD::GlobalBaseReg, PtrVT), Hi);
|
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);
|
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)".
|
// With PIC, the first instruction is actually "GR+hi(&G)".
|
||||||
Hi = DAG.getNode(ISD::ADD, PtrVT,
|
Hi = DAG.getNode(ISD::ADD, PtrVT,
|
||||||
DAG.getNode(PPCISD::GlobalBaseReg, MVT::i32), Hi);
|
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);
|
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)".
|
// With PIC, the first instruction is actually "GR+hi(&G)".
|
||||||
Hi = DAG.getNode(ISD::ADD, PtrVT,
|
Hi = DAG.getNode(ISD::ADD, PtrVT,
|
||||||
DAG.getNode(PPCISD::GlobalBaseReg, PtrVT), Hi);
|
DAG.getNode(PPCISD::GlobalBaseReg, PtrVT), Hi);
|
||||||
|
@ -94,7 +94,7 @@ PPCTargetMachine::PPCTargetMachine(const Module &M, const std::string &FS,
|
|||||||
if (Subtarget.isDarwin())
|
if (Subtarget.isDarwin())
|
||||||
setRelocationModel(Reloc::DynamicNoPIC);
|
setRelocationModel(Reloc::DynamicNoPIC);
|
||||||
else
|
else
|
||||||
setRelocationModel(Reloc::PIC);
|
setRelocationModel(Reloc::PIC_);
|
||||||
}
|
}
|
||||||
|
|
||||||
PPC32TargetMachine::PPC32TargetMachine(const Module &M, const std::string &FS)
|
PPC32TargetMachine::PPC32TargetMachine(const Module &M, const std::string &FS)
|
||||||
|
@ -66,7 +66,7 @@ namespace {
|
|||||||
"Target default relocation model"),
|
"Target default relocation model"),
|
||||||
clEnumValN(Reloc::Static, "static",
|
clEnumValN(Reloc::Static, "static",
|
||||||
"Non-relocatable code"),
|
"Non-relocatable code"),
|
||||||
clEnumValN(Reloc::PIC, "pic",
|
clEnumValN(Reloc::PIC_, "pic",
|
||||||
"Fully relocatable, position independent code"),
|
"Fully relocatable, position independent code"),
|
||||||
clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic",
|
clEnumValN(Reloc::DynamicNoPIC, "dynamic-no-pic",
|
||||||
"Relocatable external references, non-relocatable code"),
|
"Relocatable external references, non-relocatable code"),
|
||||||
|
@ -152,7 +152,7 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
|
|||||||
O << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << "_"
|
O << PrivateGlobalPrefix << "CPI" << getFunctionNumber() << "_"
|
||||||
<< MO.getConstantPoolIndex();
|
<< MO.getConstantPoolIndex();
|
||||||
if (Subtarget->TargetType == X86Subtarget::isDarwin &&
|
if (Subtarget->TargetType == X86Subtarget::isDarwin &&
|
||||||
TM.getRelocationModel() == Reloc::PIC)
|
TM.getRelocationModel() == Reloc::PIC_)
|
||||||
O << "-\"L" << getFunctionNumber() << "$pb\"";
|
O << "-\"L" << getFunctionNumber() << "$pb\"";
|
||||||
int Offset = MO.getOffset();
|
int Offset = MO.getOffset();
|
||||||
if (Offset > 0)
|
if (Offset > 0)
|
||||||
@ -185,7 +185,7 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo,
|
|||||||
} else {
|
} else {
|
||||||
O << Mang->getValueName(GV);
|
O << Mang->getValueName(GV);
|
||||||
}
|
}
|
||||||
if (!isCallOp && TM.getRelocationModel() == Reloc::PIC)
|
if (!isCallOp && TM.getRelocationModel() == Reloc::PIC_)
|
||||||
O << "-\"L" << getFunctionNumber() << "$pb\"";
|
O << "-\"L" << getFunctionNumber() << "$pb\"";
|
||||||
} else
|
} else
|
||||||
O << Mang->getValueName(MO.getGlobal());
|
O << Mang->getValueName(MO.getGlobal());
|
||||||
|
@ -2746,7 +2746,7 @@ X86TargetLowering::LowerConstantPool(SDOperand Op, SelectionDAG &DAG) {
|
|||||||
CP->getAlignment()));
|
CP->getAlignment()));
|
||||||
if (Subtarget->isTargetDarwin()) {
|
if (Subtarget->isTargetDarwin()) {
|
||||||
// With PIC, the address is actually $g + Offset.
|
// With PIC, the address is actually $g + Offset.
|
||||||
if (getTargetMachine().getRelocationModel() == Reloc::PIC)
|
if (getTargetMachine().getRelocationModel() == Reloc::PIC_)
|
||||||
Result = DAG.getNode(ISD::ADD, getPointerTy(),
|
Result = DAG.getNode(ISD::ADD, getPointerTy(),
|
||||||
DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()), Result);
|
DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()), Result);
|
||||||
}
|
}
|
||||||
@ -2762,7 +2762,7 @@ X86TargetLowering::LowerGlobalAddress(SDOperand Op, SelectionDAG &DAG) {
|
|||||||
getPointerTy()));
|
getPointerTy()));
|
||||||
if (Subtarget->isTargetDarwin()) {
|
if (Subtarget->isTargetDarwin()) {
|
||||||
// With PIC, the address is actually $g + Offset.
|
// With PIC, the address is actually $g + Offset.
|
||||||
if (getTargetMachine().getRelocationModel() == Reloc::PIC)
|
if (getTargetMachine().getRelocationModel() == Reloc::PIC_)
|
||||||
Result = DAG.getNode(ISD::ADD, getPointerTy(),
|
Result = DAG.getNode(ISD::ADD, getPointerTy(),
|
||||||
DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()),
|
DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()),
|
||||||
Result);
|
Result);
|
||||||
@ -2788,7 +2788,7 @@ X86TargetLowering::LowerExternalSymbol(SDOperand Op, SelectionDAG &DAG) {
|
|||||||
getPointerTy()));
|
getPointerTy()));
|
||||||
if (Subtarget->isTargetDarwin()) {
|
if (Subtarget->isTargetDarwin()) {
|
||||||
// With PIC, the address is actually $g + Offset.
|
// With PIC, the address is actually $g + Offset.
|
||||||
if (getTargetMachine().getRelocationModel() == Reloc::PIC)
|
if (getTargetMachine().getRelocationModel() == Reloc::PIC_)
|
||||||
Result = DAG.getNode(ISD::ADD, getPointerTy(),
|
Result = DAG.getNode(ISD::ADD, getPointerTy(),
|
||||||
DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()),
|
DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()),
|
||||||
Result);
|
Result);
|
||||||
@ -3173,7 +3173,7 @@ SDOperand X86TargetLowering::LowerJumpTable(SDOperand Op, SelectionDAG &DAG) {
|
|||||||
getPointerTy()));
|
getPointerTy()));
|
||||||
if (Subtarget->isTargetDarwin()) {
|
if (Subtarget->isTargetDarwin()) {
|
||||||
// With PIC, the address is actually $g + Offset.
|
// With PIC, the address is actually $g + Offset.
|
||||||
if (getTargetMachine().getRelocationModel() == Reloc::PIC)
|
if (getTargetMachine().getRelocationModel() == Reloc::PIC_)
|
||||||
Result = DAG.getNode(ISD::ADD, getPointerTy(),
|
Result = DAG.getNode(ISD::ADD, getPointerTy(),
|
||||||
DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()),
|
DAG.getNode(X86ISD::GlobalBaseReg, getPointerTy()),
|
||||||
Result);
|
Result);
|
||||||
|
@ -78,7 +78,7 @@ X86TargetMachine::X86TargetMachine(const Module &M, const std::string &FS)
|
|||||||
if (Subtarget.isTargetDarwin())
|
if (Subtarget.isTargetDarwin())
|
||||||
setRelocationModel(Reloc::DynamicNoPIC);
|
setRelocationModel(Reloc::DynamicNoPIC);
|
||||||
else
|
else
|
||||||
setRelocationModel(Reloc::PIC);
|
setRelocationModel(Reloc::PIC_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user