diff options
| author | 2019-06-23 21:36:31 +0000 | |
|---|---|---|
| committer | 2019-06-23 21:36:31 +0000 | |
| commit | 23f101f37937a1bd4a29726cab2f76e0fb038b35 (patch) | |
| tree | f7da7d6b32c2e07114da399150bfa88d72187012 /gnu/llvm/lib/Target/TargetMachine.cpp | |
| parent | sort previous; ok deraadt (diff) | |
| download | wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.tar.xz wireguard-openbsd-23f101f37937a1bd4a29726cab2f76e0fb038b35.zip | |
Import LLVM 8.0.0 release including clang, lld and lldb.
Diffstat (limited to 'gnu/llvm/lib/Target/TargetMachine.cpp')
| -rw-r--r-- | gnu/llvm/lib/Target/TargetMachine.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/gnu/llvm/lib/Target/TargetMachine.cpp b/gnu/llvm/lib/Target/TargetMachine.cpp index 092f5ea4104..39d5705b2a5 100644 --- a/gnu/llvm/lib/Target/TargetMachine.cpp +++ b/gnu/llvm/lib/Target/TargetMachine.cpp @@ -40,12 +40,7 @@ TargetMachine::TargetMachine(const Target &T, StringRef DataLayoutString, RequireStructuredCFG(false), DefaultOptions(Options), Options(Options) { } -TargetMachine::~TargetMachine() { - delete AsmInfo; - delete MRI; - delete MII; - delete STI; -} +TargetMachine::~TargetMachine() = default; bool TargetMachine::isPositionIndependent() const { return getRelocationModel() == Reloc::PIC_; @@ -141,6 +136,15 @@ bool TargetMachine::shouldAssumeDSOLocal(const Module &M, if (GV && GV->hasDLLImportStorageClass()) return false; + // On MinGW, variables that haven't been declared with DLLImport may still + // end up automatically imported by the linker. To make this feasible, + // don't assume the variables to be DSO local unless we actually know + // that for sure. This only has to be done for variables; for functions + // the linker can insert thunks for calling functions from another DLL. + if (TT.isWindowsGNUEnvironment() && GV && GV->isDeclarationForLinker() && + isa<GlobalVariable>(GV)) + return false; + // Every other GV is local on COFF. // Make an exception for windows OS in the triple: Some firmware builds use // *-win32-macho triples. This (accidentally?) produced windows relocations |
