enum Model {
Default,
Static,
- PIC,
+ PIC_, // Cannot be named PIC due to collision with -DPIC
DynamicNoPIC
};
}
} else {
O << "ha16(";
printOp(MI->getOperand(OpNo));
- if (TM.getRelocationModel() == Reloc::PIC)
+ if (TM.getRelocationModel() == Reloc::PIC_)
O << "-\"L" << getFunctionNumber() << "$pb\")";
else
O << ')';
} else {
O << "lo16(";
printOp(MI->getOperand(OpNo));
- if (TM.getRelocationModel() == Reloc::PIC)
+ if (TM.getRelocationModel() == Reloc::PIC_)
O << "-\"L" << getFunctionNumber() << "$pb\")";
else
O << ')';
bool isPPC64 = TD->getPointerSizeInBits() == 64;
// 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();
i != e; ++i) {
SwitchToTextSection(".section __TEXT,__picsymbolstub1,symbol_stubs,"
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);
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);
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);
if (Subtarget.isDarwin())
setRelocationModel(Reloc::DynamicNoPIC);
else
- setRelocationModel(Reloc::PIC);
+ setRelocationModel(Reloc::PIC_);
}
PPC32TargetMachine::PPC32TargetMachine(const Module &M, const std::string &FS)
"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"),
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)
} 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());
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);
}
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);
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);
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);
if (Subtarget.isTargetDarwin())
setRelocationModel(Reloc::DynamicNoPIC);
else
- setRelocationModel(Reloc::PIC);
+ setRelocationModel(Reloc::PIC_);
}