diff options
Diffstat (limited to 'lib/Target')
-rw-r--r-- | lib/Target/ARM/ARMAsmPrinter.cpp | 2 | ||||
-rw-r--r-- | lib/Target/ARM/ARMISelLowering.cpp | 4 | ||||
-rw-r--r-- | lib/Target/Alpha/AlphaISelLowering.cpp | 2 | ||||
-rw-r--r-- | lib/Target/CBackend/CBackend.cpp | 10 | ||||
-rw-r--r-- | lib/Target/IA64/IA64AsmPrinter.cpp | 6 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCAsmPrinter.cpp | 4 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCSubtarget.cpp | 2 | ||||
-rwxr-xr-x | lib/Target/X86/X86ATTAsmPrinter.cpp | 6 | ||||
-rwxr-xr-x | lib/Target/X86/X86IntelAsmPrinter.cpp | 6 | ||||
-rw-r--r-- | lib/Target/X86/X86Subtarget.cpp | 4 |
10 files changed, 23 insertions, 23 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index 0412bc58ac..dee4640d2e 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -264,7 +264,7 @@ void ARMAsmPrinter::printOperand(const MachineInstr *MI, int opNum, bool isCallOp = Modifier && !strcmp(Modifier, "call"); GlobalValue *GV = MO.getGlobal(); std::string Name = Mang->getValueName(GV); - bool isExt = (GV->isExternal() || GV->hasWeakLinkage() || + bool isExt = (GV->isDeclaration() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()); if (isExt && isCallOp && Subtarget->isTargetDarwin() && TM.getRelocationModel() != Reloc::Static) { diff --git a/lib/Target/ARM/ARMISelLowering.cpp b/lib/Target/ARM/ARMISelLowering.cpp index 55b22aae39..24357cfe16 100644 --- a/lib/Target/ARM/ARMISelLowering.cpp +++ b/lib/Target/ARM/ARMISelLowering.cpp @@ -467,7 +467,7 @@ SDOperand ARMTargetLowering::LowerCALL(SDOperand Op, SelectionDAG &DAG) { GlobalValue *GV = G->getGlobal(); Callee = DAG.getTargetGlobalAddress(GV, getPointerTy()); isDirect = true; - bool isExt = (GV->isExternal() || GV->hasWeakLinkage() || + bool isExt = (GV->isDeclaration() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()); bool isStub = (isExt && Subtarget->isTargetDarwin()) && getTargetMachine().getRelocationModel() != Reloc::Static; @@ -632,7 +632,7 @@ static SDOperand LowerConstantPool(SDOperand Op, SelectionDAG &DAG) { /// even in dynamic-no-pic mode. static bool GVIsIndirectSymbol(GlobalValue *GV) { return (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || - (GV->isExternal() && !GV->hasNotBeenReadFromBytecode())); + (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode())); } SDOperand ARMTargetLowering::LowerGlobalAddress(SDOperand Op, diff --git a/lib/Target/Alpha/AlphaISelLowering.cpp b/lib/Target/Alpha/AlphaISelLowering.cpp index 7df996dd0f..0d1cacf83c 100644 --- a/lib/Target/Alpha/AlphaISelLowering.cpp +++ b/lib/Target/Alpha/AlphaISelLowering.cpp @@ -427,7 +427,7 @@ SDOperand AlphaTargetLowering::LowerOperation(SDOperand Op, SelectionDAG &DAG) { GlobalValue *GV = GSDN->getGlobal(); SDOperand GA = DAG.getTargetGlobalAddress(GV, MVT::i64, GSDN->getOffset()); - // if (!GV->hasWeakLinkage() && !GV->isExternal() && !GV->hasLinkOnceLinkage()) { + // if (!GV->hasWeakLinkage() && !GV->isDeclaration() && !GV->hasLinkOnceLinkage()) { if (GV->hasInternalLinkage()) { SDOperand Hi = DAG.getNode(AlphaISD::GPRelHi, MVT::i64, GA, DAG.getNode(ISD::GLOBAL_OFFSET_TABLE, MVT::i64)); diff --git a/lib/Target/CBackend/CBackend.cpp b/lib/Target/CBackend/CBackend.cpp index a6d3fb5227..785e7643e4 100644 --- a/lib/Target/CBackend/CBackend.cpp +++ b/lib/Target/CBackend/CBackend.cpp @@ -305,7 +305,7 @@ bool CBackendNameAllUsedStructsAndMergeFunctions::runOnModule(Module &M) { std::map<std::string, GlobalValue*> ExtSymbols; for (Module::iterator I = M.begin(), E = M.end(); I != E;) { Function *GV = I++; - if (GV->isExternal() && GV->hasName()) { + if (GV->isDeclaration() && GV->hasName()) { std::pair<std::map<std::string, GlobalValue*>::iterator, bool> X = ExtSymbols.insert(std::make_pair(GV->getName(), GV)); if (!X.second) { @@ -321,7 +321,7 @@ bool CBackendNameAllUsedStructsAndMergeFunctions::runOnModule(Module &M) { for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E;) { GlobalVariable *GV = I++; - if (GV->isExternal() && GV->hasName()) { + if (GV->isDeclaration() && GV->hasName()) { std::pair<std::map<std::string, GlobalValue*>::iterator, bool> X = ExtSymbols.insert(std::make_pair(GV->getName(), GV)); if (!X.second) { @@ -1525,7 +1525,7 @@ bool CWriter::doInitialization(Module &M) { Out << "\n\n/* Global Variable Declarations */\n"; for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) - if (!I->isExternal()) { + if (!I->isDeclaration()) { // Ignore special globals, such as debug info. if (getGlobalVariableClass(I)) continue; @@ -1554,7 +1554,7 @@ bool CWriter::doInitialization(Module &M) { Out << "\n\n/* Global Variable Definitions and Initialization */\n"; for (Module::global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) - if (!I->isExternal()) { + if (!I->isDeclaration()) { // Ignore special globals, such as debug info. if (getGlobalVariableClass(I)) continue; @@ -1777,7 +1777,7 @@ void CWriter::printFunctionSignature(const Function *F, bool Prototype) { FunctionInnards << Mang->getValueName(F) << '('; bool PrintedArg = false; - if (!F->isExternal()) { + if (!F->isDeclaration()) { if (!F->arg_empty()) { Function::const_arg_iterator I = F->arg_begin(), E = F->arg_end(); diff --git a/lib/Target/IA64/IA64AsmPrinter.cpp b/lib/Target/IA64/IA64AsmPrinter.cpp index 2adb53e893..d576c4cf57 100644 --- a/lib/Target/IA64/IA64AsmPrinter.cpp +++ b/lib/Target/IA64/IA64AsmPrinter.cpp @@ -193,17 +193,17 @@ void IA64AsmPrinter::printOp(const MachineOperand &MO, bool Needfptr=false; // if we're computing an address @ltoff(X), do // we need to decorate it so it becomes // @ltoff(@fptr(X)) ? - if (F && !isBRCALLinsn /*&& F->isExternal()*/) + if (F && !isBRCALLinsn /*&& F->isDeclaration()*/) Needfptr=true; // if this is the target of a call instruction, we should define // the function somewhere (GNU gas has no problem without this, but // Intel ias rightly complains of an 'undefined symbol') - if (F /*&& isBRCALLinsn*/ && F->isExternal()) + if (F /*&& isBRCALLinsn*/ && F->isDeclaration()) ExternalFunctionNames.insert(Mang->getValueName(MO.getGlobal())); else - if (GV->isExternal()) // e.g. stuff like 'stdin' + if (GV->isDeclaration()) // e.g. stuff like 'stdin' ExternalObjectNames.insert(Mang->getValueName(MO.getGlobal())); if (!isBRCALLinsn) diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index 7126af2867..efd6d10c33 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -183,7 +183,7 @@ namespace { if (TM.getRelocationModel() != Reloc::Static) { if (MO.getType() == MachineOperand::MO_GlobalAddress) { GlobalValue *GV = MO.getGlobal(); - if (((GV->isExternal() || GV->hasWeakLinkage() || + if (((GV->isDeclaration() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()))) { // Dynamically-resolved functions need a stub for the function. std::string Name = Mang->getValueName(GV); @@ -381,7 +381,7 @@ void PPCAsmPrinter::printOp(const MachineOperand &MO) { // External or weakly linked global variables need non-lazily-resolved stubs if (TM.getRelocationModel() != Reloc::Static) { - if (((GV->isExternal() || GV->hasWeakLinkage() || + if (((GV->isDeclaration() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()))) { GVStubs.insert(Name); O << "L" << Name << "$non_lazy_ptr"; diff --git a/lib/Target/PowerPC/PPCSubtarget.cpp b/lib/Target/PowerPC/PPCSubtarget.cpp index 235b9d591d..62f8995bb8 100644 --- a/lib/Target/PowerPC/PPCSubtarget.cpp +++ b/lib/Target/PowerPC/PPCSubtarget.cpp @@ -137,5 +137,5 @@ bool PPCSubtarget::hasLazyResolverStub(const GlobalValue *GV) const { return false; return GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || - (GV->isExternal() && !GV->hasNotBeenReadFromBytecode()); + (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode()); } diff --git a/lib/Target/X86/X86ATTAsmPrinter.cpp b/lib/Target/X86/X86ATTAsmPrinter.cpp index 92abfc5947..91b22d1981 100755 --- a/lib/Target/X86/X86ATTAsmPrinter.cpp +++ b/lib/Target/X86/X86ATTAsmPrinter.cpp @@ -281,7 +281,7 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo, if (printStub(TM, Subtarget)) { // Link-once, External, or Weakly-linked global variables need // non-lazily-resolved stubs - if (GV->isExternal() || + if (GV->isDeclaration() || GV->hasWeakLinkage() || GV->hasLinkOnceLinkage()) { // Dynamically-resolved functions need a stub for the function. @@ -310,10 +310,10 @@ void X86ATTAsmPrinter::printOperand(const MachineInstr *MI, unsigned OpNo, if (isCallOp && isa<Function>(GV)) { if (printGOT(TM, Subtarget)) { // Assemble call via PLT for non-local symbols - if (!GV->hasHiddenVisibility() || GV->isExternal()) + if (!GV->hasHiddenVisibility() || GV->isDeclaration()) O << "@PLT"; } - if (Subtarget->isTargetCygMing() && GV->isExternal()) + if (Subtarget->isTargetCygMing() && GV->isDeclaration()) // Save function name for later type emission FnStubs.insert(Name); } diff --git a/lib/Target/X86/X86IntelAsmPrinter.cpp b/lib/Target/X86/X86IntelAsmPrinter.cpp index 66a2a493e3..946840ea4b 100755 --- a/lib/Target/X86/X86IntelAsmPrinter.cpp +++ b/lib/Target/X86/X86IntelAsmPrinter.cpp @@ -347,7 +347,7 @@ bool X86IntelAsmPrinter::doInitialization(Module &M) { // Emit declarations for external functions. for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) - if (I->isExternal()) { + if (I->isDeclaration()) { std::string Name = Mang->getValueName(I); X86SharedAsmPrinter::decorateName(Name, I); @@ -362,7 +362,7 @@ bool X86IntelAsmPrinter::doInitialization(Module &M) { // external globals to have type byte, and if that's good enough for VC++... for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) { - if (I->isExternal()) { + if (I->isDeclaration()) { std::string Name = Mang->getValueName(I); O << "\textern " ; @@ -382,7 +382,7 @@ bool X86IntelAsmPrinter::doFinalization(Module &M) { // Print out module-level global variables here. for (Module::const_global_iterator I = M.global_begin(), E = M.global_end(); I != E; ++I) { - if (I->isExternal()) continue; // External global require no code + if (I->isDeclaration()) continue; // External global require no code // Check to see if this is a special global used by LLVM, if so, emit it. if (EmitSpecialLLVMGlobal(I)) diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp index 50746d7e1c..89f69d9feb 100644 --- a/lib/Target/X86/X86Subtarget.cpp +++ b/lib/Target/X86/X86Subtarget.cpp @@ -40,11 +40,11 @@ bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue* GV, if (isTargetDarwin()) { return (!isDirectCall && (GV->hasWeakLinkage() || GV->hasLinkOnceLinkage() || - (GV->isExternal() && !GV->hasNotBeenReadFromBytecode()))); + (GV->isDeclaration() && !GV->hasNotBeenReadFromBytecode()))); } else if (TM.getRelocationModel() == Reloc::PIC_ && isPICStyleGOT()) { // Extra load is needed for all non-statics. return (!isDirectCall && - (GV->isExternal() || !GV->hasInternalLinkage())); + (GV->isDeclaration() || !GV->hasInternalLinkage())); } else if (isTargetCygMing() || isTargetWindows()) { return (GV->hasDLLImportLinkage()); } |