diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-27 23:15:57 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2016-06-27 23:15:57 +0000 |
commit | 3beef8d6db3688b8265728a3b05970cd9628f523 (patch) | |
tree | 310d78331dae592b820e026554e21456ed5535d7 /llvm/lib/CodeGen/Analysis.cpp | |
parent | 990ff38786ce2300a38eeaaba510c40170223ef6 (diff) | |
download | bcm5719-llvm-3beef8d6db3688b8265728a3b05970cd9628f523.tar.gz bcm5719-llvm-3beef8d6db3688b8265728a3b05970cd9628f523.zip |
Move shouldAssumeDSOLocal to Target.
Should fix the shared library build.
llvm-svn: 273958
Diffstat (limited to 'llvm/lib/CodeGen/Analysis.cpp')
-rw-r--r-- | llvm/lib/CodeGen/Analysis.cpp | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/llvm/lib/CodeGen/Analysis.cpp b/llvm/lib/CodeGen/Analysis.cpp index d3b3a9de110..d69073458cd 100644 --- a/llvm/lib/CodeGen/Analysis.cpp +++ b/llvm/lib/CodeGen/Analysis.cpp @@ -638,48 +638,6 @@ bool llvm::canBeOmittedFromSymbolTable(const GlobalValue *GV) { return GV->hasAtLeastLocalUnnamedAddr(); } -// FIXME: make this a proper option -static bool CanUseCopyRelocWithPIE = false; - -bool llvm::shouldAssumeDSOLocal(Reloc::Model RM, const Triple &TT, - const Module &M, const GlobalValue *GV) { - // DLLImport explicitly marks the GV as external. - if (GV && GV->hasDLLImportStorageClass()) - return false; - - // Every other GV is local on COFF - if (TT.isOSBinFormatCOFF()) - return true; - - if (GV && (GV->hasLocalLinkage() || !GV->hasDefaultVisibility())) - return true; - - if (TT.isOSBinFormatMachO()) { - if (RM == Reloc::Static) - return true; - return GV && GV->isStrongDefinitionForLinker(); - } - - assert(TT.isOSBinFormatELF()); - assert(RM != Reloc::DynamicNoPIC); - - bool IsExecutable = - RM == Reloc::Static || M.getPIELevel() != PIELevel::Default; - if (IsExecutable) { - // If the symbol is defined, it cannot be preempted. - if (GV && !GV->isDeclarationForLinker()) - return true; - - bool IsTLS = GV && GV->isThreadLocal(); - // Check if we can use copy relocations. - if (!IsTLS && (RM == Reloc::Static || CanUseCopyRelocWithPIE)) - return true; - } - - // ELF supports preemption of other symbols. - return false; -} - static void collectFuncletMembers( DenseMap<const MachineBasicBlock *, int> &FuncletMembership, int Funclet, const MachineBasicBlock *MBB) { |