summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2018-07-26 10:48:20 +0000
committerMartin Storsjo <martin@martin.st>2018-07-26 10:48:20 +0000
commit078cc9c528cea6b1a0544cda99e53afdf25ea248 (patch)
tree170d92f0f94a7a4c7d7d54d7e0f313a259a388ec /include
parenta0882e9c6c7bb534f852c4c77ee92737e88a4101 (diff)
Revert "[COFF] Use comdat shared constants for MinGW as well"
This reverts commit r337951. While that kind of shared constant generally works fine in a MinGW setting, it broke some cases of inline assembly that worked before: $ cat const-asm.c int MULH(int a, int b) { int rt, dummy; __asm__ ( "imull %3" :"=d"(rt), "=a"(dummy) :"a"(a), "rm"(b) ); return rt; } int func(int a) { return MULH(a, 1); } $ clang -target x86_64-win32-gnu -c const-asm.c -O2 const-asm.c:4:9: error: invalid variant '00000001' "imull %3" ^ <inline asm>:1:15: note: instantiated into assembly here imull __real@00000001(%rip) ^ A similar error is produced for i686 as well. The same test with a target of x86_64-win32-msvc or i686-win32-msvc works fine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338018 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/MC/MCAsmInfo.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/MC/MCAsmInfo.h b/include/llvm/MC/MCAsmInfo.h
index 0a0f37966fc..120fb8fa749 100644
--- a/include/llvm/MC/MCAsmInfo.h
+++ b/include/llvm/MC/MCAsmInfo.h
@@ -89,6 +89,10 @@ protected:
/// them.
bool HasCOFFAssociativeComdats = false;
+ /// True if this is a non-GNU COFF target. For GNU targets, we don't generate
+ /// constants into comdat sections.
+ bool HasCOFFComdatConstants = false;
+
/// This is the maximum possible length of an instruction, which is needed to
/// compute the size of an inline asm. Defaults to 4.
unsigned MaxInstLength = 4;
@@ -469,6 +473,7 @@ public:
bool hasMachoZeroFillDirective() const { return HasMachoZeroFillDirective; }
bool hasMachoTBSSDirective() const { return HasMachoTBSSDirective; }
bool hasCOFFAssociativeComdats() const { return HasCOFFAssociativeComdats; }
+ bool hasCOFFComdatConstants() const { return HasCOFFComdatConstants; }
unsigned getMaxInstLength() const { return MaxInstLength; }
unsigned getMinInstAlignment() const { return MinInstAlignment; }
bool getDollarIsPC() const { return DollarIsPC; }