[WebAssembly] Don't default to ELF in the triple.
authorDan Gohman <dan433584@gmail.com>
Mon, 17 Aug 2015 22:37:56 +0000 (22:37 +0000)
committerDan Gohman <dan433584@gmail.com>
Mon, 17 Aug 2015 22:37:56 +0000 (22:37 +0000)
WebAssembly doesn't yet have a specified binary format, and it may not
end up being ELF, so we don't want the Triple class defaulting to ELF
for it at this time.

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

lib/Support/Triple.cpp

index a2a88d2cb716a116613b00cdc28b4b30450c6d55..201d352b85d347364b7fec0077d70138371b4951 100644 (file)
@@ -539,6 +539,11 @@ static Triple::ObjectFormatType getDefaultFormat(const Triple &T) {
     if (T.isOSDarwin())
       return Triple::MachO;
     return Triple::ELF;
+
+  case Triple::wasm32:
+  case Triple::wasm64:
+    // Unknown for now, until an object format is specified.
+    return Triple::UnknownObjectFormat;
   }
 
   if (T.isOSDarwin())