[WebAssembly] Factor out settings common to wasm32 and wasm64. NFC.
authorDan Gohman <dan433584@gmail.com>
Tue, 23 Jan 2018 20:22:12 +0000 (20:22 +0000)
committerDan Gohman <dan433584@gmail.com>
Tue, 23 Jan 2018 20:22:12 +0000 (20:22 +0000)
MaxAtomicPromoteWidth and MaxAtomicInlineWidth are 64 on both
wasm32 and wasm64, so they can be set in shared code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@323253 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets/WebAssembly.h

index b07e849949ece20b23a330164fbcac330cb84759..b01613aa8a0f5189723391b1429325b0845d1113 100644 (file)
@@ -45,6 +45,7 @@ public:
     SigAtomicType = SignedLong;
     LongDoubleWidth = LongDoubleAlign = 128;
     LongDoubleFormat = &llvm::APFloat::IEEEquad();
+    MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
     SizeType = UnsignedInt;
     PtrDiffType = SignedInt;
     IntPtrType = SignedInt;
@@ -118,7 +119,6 @@ public:
   explicit WebAssembly32TargetInfo(const llvm::Triple &T,
                                    const TargetOptions &Opts)
       : WebAssemblyTargetInfo(T, Opts) {
-    MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
     resetDataLayout("e-m:e-p:32:32-i64:64-n32:64-S128");
   }
 
@@ -135,7 +135,6 @@ public:
       : WebAssemblyTargetInfo(T, Opts) {
     LongAlign = LongWidth = 64;
     PointerAlign = PointerWidth = 64;
-    MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
     SizeType = UnsignedLong;
     PtrDiffType = SignedLong;
     IntPtrType = SignedLong;