diff options
| author | Reid Kleckner <rnk@google.com> | 2019-07-08 21:05:20 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2019-07-08 21:05:20 +0000 |
| commit | 2f07c2e9d9cc66c5c560a28ae7a706756efce2c4 (patch) | |
| tree | 1d293dda4407e93472d1a3fcd0b1f32c7a6dcf7a /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
| parent | f0d3dcec97a1e335452071440a73081908da712f (diff) | |
| download | bcm5719-llvm-2f07c2e9d9cc66c5c560a28ae7a706756efce2c4.tar.gz bcm5719-llvm-2f07c2e9d9cc66c5c560a28ae7a706756efce2c4.zip | |
Standardize on MSVC behavior for triples with no environment
Summary:
This makes it so that IR files using triples without an environment work
out of the box, without normalizing them.
Typically, the MSVC behavior is more desirable. For example, it tends to
enable things like constant merging, use of associative comdats, etc.
Addresses PR42491
Reviewers: compnerd
Subscribers: hiraditya, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D64109
llvm-svn: 365387
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index b3aa8c6e634..4c18152ea8d 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -1470,7 +1470,7 @@ void TargetLoweringObjectFileCOFF::Initialize(MCContext &Ctx, const TargetMachine &TM) { TargetLoweringObjectFile::Initialize(Ctx, TM); const Triple &T = TM.getTargetTriple(); - if (T.isKnownWindowsMSVCEnvironment() || T.isWindowsItaniumEnvironment()) { + if (T.isWindowsMSVCEnvironment() || T.isWindowsItaniumEnvironment()) { StaticCtorSection = Ctx.getCOFFSection(".CRT$XCU", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA | COFF::IMAGE_SCN_MEM_READ, @@ -1496,7 +1496,7 @@ static MCSectionCOFF *getCOFFStaticStructorSection(MCContext &Ctx, unsigned Priority, const MCSymbol *KeySym, MCSectionCOFF *Default) { - if (T.isKnownWindowsMSVCEnvironment() || T.isWindowsItaniumEnvironment()) { + if (T.isWindowsMSVCEnvironment() || T.isWindowsItaniumEnvironment()) { // If the priority is the default, use .CRT$XCU, possibly associative. if (Priority == 65535) return Ctx.getAssociativeCOFFSection(Default, KeySym, 0); @@ -1556,9 +1556,7 @@ const MCExpr *TargetLoweringObjectFileCOFF::lowerRelativeReference( const GlobalValue *LHS, const GlobalValue *RHS, const TargetMachine &TM) const { const Triple &T = TM.getTargetTriple(); - if (!T.isKnownWindowsMSVCEnvironment() && - !T.isWindowsItaniumEnvironment() && - !T.isWindowsCoreCLREnvironment()) + if (T.isOSCygMing()) return nullptr; // Our symbols should exist in address space zero, cowardly no-op if |

