summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2006-02-22 20:19:42 +0000
committerEvan Cheng <evan.cheng@apple.com>2006-02-22 20:19:42 +0000
commit73136dfecceeadfd549d5ac2c00ed1df023e5b20 (patch)
treea6aab29afc7200b4253a7c278ee6c1c03fe69264 /llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
parent2fa33a989dfd4bf53e282b73858f235651bc77a9 (diff)
downloadbcm5719-llvm-73136dfecceeadfd549d5ac2c00ed1df023e5b20.tar.gz
bcm5719-llvm-73136dfecceeadfd549d5ac2c00ed1df023e5b20.zip
- Added option -relocation-model to set relocation model. Valid values include static, pic,
dynamic-no-pic, and default. PPC and x86 default is dynamic-no-pic for Darwin, pic for others. - Removed options -enable-pic and -ppc-static. llvm-svn: 26315
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
index bc19f1659d9..714a36d1e7d 100644
--- a/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
+++ b/llvm/lib/Target/PowerPC/PPCAsmPrinter.cpp
@@ -132,7 +132,7 @@ namespace {
}
void printCallOperand(const MachineInstr *MI, unsigned OpNo) {
const MachineOperand &MO = MI->getOperand(OpNo);
- if (!PPCGenerateStaticCode) {
+ if (TM.getRelocationModel() != Reloc::Static) {
if (MO.getType() == MachineOperand::MO_GlobalAddress) {
GlobalValue *GV = MO.getGlobal();
if (((GV->isExternal() || GV->hasWeakLinkage() ||
@@ -167,7 +167,7 @@ namespace {
} else {
O << "ha16(";
printOp(MI->getOperand(OpNo));
- if (PICEnabled)
+ if (TM.getRelocationModel() == Reloc::PIC)
O << "-\"L" << getFunctionNumber() << "$pb\")";
else
O << ')';
@@ -179,7 +179,7 @@ namespace {
} else {
O << "lo16(";
printOp(MI->getOperand(OpNo));
- if (PICEnabled)
+ if (TM.getRelocationModel() == Reloc::PIC)
O << "-\"L" << getFunctionNumber() << "$pb\")";
else
O << ')';
@@ -362,7 +362,7 @@ void PPCAsmPrinter::printOp(const MachineOperand &MO) {
return;
case MachineOperand::MO_ExternalSymbol:
// Computing the address of an external symbol, not calling it.
- if (!PPCGenerateStaticCode) {
+ if (TM.getRelocationModel() != Reloc::Static) {
std::string Name(GlobalPrefix); Name += MO.getSymbolName();
GVStubs.insert(Name);
O << "L" << Name << "$non_lazy_ptr";
@@ -377,7 +377,7 @@ void PPCAsmPrinter::printOp(const MachineOperand &MO) {
int offset = MO.getOffset();
// External or weakly linked global variables need non-lazily-resolved stubs
- if (!PPCGenerateStaticCode) {
+ if (TM.getRelocationModel() != Reloc::Static) {
if (((GV->isExternal() || GV->hasWeakLinkage() ||
GV->hasLinkOnceLinkage()))) {
GVStubs.insert(Name);
@@ -585,7 +585,7 @@ bool DarwinAsmPrinter::doFinalization(Module &M) {
}
// Output stubs for dynamically-linked functions
- if (PICEnabled) {
+ if (TM.getRelocationModel() == Reloc::PIC) {
for (std::set<std::string>::iterator i = FnStubs.begin(), e = FnStubs.end();
i != e; ++i) {
SwitchSection(".section __TEXT,__picsymbolstub1,symbol_stubs,"
OpenPOWER on IntegriCloud