[llvm] r292252 - [WebAssembly] Add triple support for the new wasm object format
Galina Kistanova via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 17 14:37:12 PST 2017
Thank you!
Thanks
Galina
On Tue, Jan 17, 2017 at 2:06 PM, Dan Gohman <sunfish at mozilla.com> wrote:
> This is now fixed in clang r292269.
>
> Dan
>
>
> On Tue, Jan 17, 2017 at 1:56 PM, Galina Kistanova <gkistanova at gmail.com>
> wrote:
>
>> Actually more the one builder affected, here another one:
>>
>> http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/4552
>>
>> llvm.src/tools/clang/lib/CodeGen/BackendUtil.cpp:997:11: warning: enumeration value 'Wasm' not handled in switch [-Wswitch]
>> llvm.src/tools/clang/lib/CodeGen/BackendUtil.cpp:1009:11: warning: enumeration value 'Wasm' not handled in switch [-Wswitch]
>> llvm.src/tools/clang/lib/CodeGen/CodeGenModule.cpp:3339:11: warning: enumeration value 'Wasm' not handled in switch [-Wswitch]
>>
>> Thanks
>>
>> Galina
>>
>>
>> On Tue, Jan 17, 2017 at 1:46 PM, Galina Kistanova <gkistanova at gmail.com>
>> wrote:
>>
>>> Hello Dan,
>>>
>>> It look like this commit added warnings to one of our builders:
>>> http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei
>>> -ps4-windows10pro-fast/builds/4040
>>>
>>> C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pr
>>> o-fast\llvm.src\tools\clang\lib\CodeGen\BackendUtil.cpp(1004): warning
>>> C4062: enumerator 'llvm::Triple::Wasm' in switch of enum
>>> 'llvm::Triple::ObjectFormatType' is not handled
>>> C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pr
>>> o-fast\llvm.src\tools\clang\lib\CodeGen\BackendUtil.cpp(1016): warning
>>> C4062: enumerator 'llvm::Triple::Wasm' in switch of enum
>>> 'llvm::Triple::ObjectFormatType' is not handled
>>> C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pr
>>> o-fast\llvm.src\tools\clang\lib\CodeGen\CodeGenModule.cpp(3349):
>>> warning C4062: enumerator 'llvm::Triple::Wasm' in switch of enum
>>> 'llvm::Triple::ObjectFormatType' is not handled
>>>
>>> Please have a look at this?
>>>
>>> Thanks
>>>
>>> Galina
>>>
>>> On Tue, Jan 17, 2017 at 12:34 PM, Dan Gohman via llvm-commits <
>>> llvm-commits at lists.llvm.org> wrote:
>>>
>>>> Author: djg
>>>> Date: Tue Jan 17 14:34:09 2017
>>>> New Revision: 292252
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=292252&view=rev
>>>> Log:
>>>> [WebAssembly] Add triple support for the new wasm object format
>>>>
>>>> Differential Revision: https://reviews.llvm.org/D26701
>>>>
>>>> Modified:
>>>> llvm/trunk/include/llvm/ADT/Triple.h
>>>> llvm/trunk/lib/MC/MCObjectFileInfo.cpp
>>>> llvm/trunk/lib/ProfileData/InstrProf.cpp
>>>> llvm/trunk/lib/Support/Triple.cpp
>>>> llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
>>>> llvm/trunk/unittests/ADT/TripleTest.cpp
>>>>
>>>> Modified: llvm/trunk/include/llvm/ADT/Triple.h
>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/
>>>> ADT/Triple.h?rev=292252&r1=292251&r2=292252&view=diff
>>>> ============================================================
>>>> ==================
>>>> --- llvm/trunk/include/llvm/ADT/Triple.h (original)
>>>> +++ llvm/trunk/include/llvm/ADT/Triple.h Tue Jan 17 14:34:09 2017
>>>> @@ -206,6 +206,7 @@ public:
>>>> COFF,
>>>> ELF,
>>>> MachO,
>>>> + Wasm,
>>>> };
>>>>
>>>> private:
>>>> @@ -576,6 +577,11 @@ public:
>>>> return getObjectFormat() == Triple::MachO;
>>>> }
>>>>
>>>> + /// Tests whether the OS uses the Wasm binary format.
>>>> + bool isOSBinFormatWasm() const {
>>>> + return getObjectFormat() == Triple::Wasm;
>>>> + }
>>>> +
>>>> /// Tests whether the target is the PS4 CPU
>>>> bool isPS4CPU() const {
>>>> return getArch() == Triple::x86_64 &&
>>>>
>>>> Modified: llvm/trunk/lib/MC/MCObjectFileInfo.cpp
>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCObje
>>>> ctFileInfo.cpp?rev=292252&r1=292251&r2=292252&view=diff
>>>> ============================================================
>>>> ==================
>>>> --- llvm/trunk/lib/MC/MCObjectFileInfo.cpp (original)
>>>> +++ llvm/trunk/lib/MC/MCObjectFileInfo.cpp Tue Jan 17 14:34:09 2017
>>>> @@ -843,6 +843,9 @@ void MCObjectFileInfo::InitMCObjectFileI
>>>> Env = IsELF;
>>>> initELFMCObjectFileInfo(TT);
>>>> break;
>>>> + case Triple::Wasm:
>>>> + report_fatal_error("Cannot initialize MC for wasm object file
>>>> format yet.");
>>>> + break;
>>>> case Triple::UnknownObjectFormat:
>>>> report_fatal_error("Cannot initialize MC for unknown object file
>>>> format.");
>>>> break;
>>>>
>>>> Modified: llvm/trunk/lib/ProfileData/InstrProf.cpp
>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ProfileDa
>>>> ta/InstrProf.cpp?rev=292252&r1=292251&r2=292252&view=diff
>>>> ============================================================
>>>> ==================
>>>> --- llvm/trunk/lib/ProfileData/InstrProf.cpp (original)
>>>> +++ llvm/trunk/lib/ProfileData/InstrProf.cpp Tue Jan 17 14:34:09 2017
>>>> @@ -794,7 +794,7 @@ bool needsComdatForCounter(const Functio
>>>> return true;
>>>>
>>>> Triple TT(M.getTargetTriple());
>>>> - if (!TT.isOSBinFormatELF())
>>>> + if (!TT.isOSBinFormatELF() && !TT.isOSBinFormatWasm())
>>>> return false;
>>>>
>>>> // See createPGOFuncNameVar for more details. To avoid link errors,
>>>> profile
>>>>
>>>> Modified: llvm/trunk/lib/Support/Triple.cpp
>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/T
>>>> riple.cpp?rev=292252&r1=292251&r2=292252&view=diff
>>>> ============================================================
>>>> ==================
>>>> --- llvm/trunk/lib/Support/Triple.cpp (original)
>>>> +++ llvm/trunk/lib/Support/Triple.cpp Tue Jan 17 14:34:09 2017
>>>> @@ -510,6 +510,7 @@ static Triple::ObjectFormatType parseFor
>>>> .EndsWith("coff", Triple::COFF)
>>>> .EndsWith("elf", Triple::ELF)
>>>> .EndsWith("macho", Triple::MachO)
>>>> + .EndsWith("wasm", Triple::Wasm)
>>>> .Default(Triple::UnknownObjectFormat);
>>>> }
>>>>
>>>> @@ -581,6 +582,7 @@ static StringRef getObjectFormatTypeName
>>>> case Triple::COFF: return "coff";
>>>> case Triple::ELF: return "elf";
>>>> case Triple::MachO: return "macho";
>>>> + case Triple::Wasm: return "wasm";
>>>> }
>>>> llvm_unreachable("unknown object format type");
>>>> }
>>>>
>>>> Modified: llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.c
>>>> pp
>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transform
>>>> s/Instrumentation/AddressSanitizer.cpp?rev=292252&r1=292251&
>>>> r2=292252&view=diff
>>>> ============================================================
>>>> ==================
>>>> --- llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp
>>>> (original)
>>>> +++ llvm/trunk/lib/Transforms/Instrumentation/AddressSanitizer.cpp Tue
>>>> Jan 17 14:34:09 2017
>>>> @@ -1853,7 +1853,8 @@ bool AddressSanitizerModule::InstrumentG
>>>> GlobalValue *InstrumentedGlobal = NewGlobal;
>>>>
>>>> bool CanUsePrivateAliases =
>>>> - TargetTriple.isOSBinFormatELF() ||
>>>> TargetTriple.isOSBinFormatMachO();
>>>> + TargetTriple.isOSBinFormatELF() ||
>>>> TargetTriple.isOSBinFormatMachO() ||
>>>> + TargetTriple.isOSBinFormatWasm();
>>>> if (CanUsePrivateAliases && ClUsePrivateAliasForGlobals) {
>>>> // Create local alias for NewGlobal to avoid crash on ODR between
>>>> // instrumented and non-instrumented libraries.
>>>>
>>>> Modified: llvm/trunk/unittests/ADT/TripleTest.cpp
>>>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/ADT
>>>> /TripleTest.cpp?rev=292252&r1=292251&r2=292252&view=diff
>>>> ============================================================
>>>> ==================
>>>> --- llvm/trunk/unittests/ADT/TripleTest.cpp (original)
>>>> +++ llvm/trunk/unittests/ADT/TripleTest.cpp Tue Jan 17 14:34:09 2017
>>>> @@ -888,6 +888,9 @@ TEST(TripleTest, FileFormat) {
>>>> EXPECT_EQ(Triple::ELF, Triple("i686-pc-windows-msvc-e
>>>> lf").getObjectFormat());
>>>> EXPECT_EQ(Triple::ELF, Triple("i686-pc-cygwin-elf").g
>>>> etObjectFormat());
>>>>
>>>> + EXPECT_EQ(Triple::Wasm, Triple("wasm32-unknown-unknown
>>>> -wasm").getObjectFormat());
>>>> + EXPECT_EQ(Triple::Wasm, Triple("wasm64-unknown-unknown
>>>> -wasm").getObjectFormat());
>>>> +
>>>> Triple MSVCNormalized(Triple::normalize("i686-pc-windows-msvc-elf")
>>>> );
>>>> EXPECT_EQ(Triple::ELF, MSVCNormalized.getObjectFormat());
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> llvm-commits mailing list
>>>> llvm-commits at lists.llvm.org
>>>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>>>
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170117/31cf0b33/attachment.html>
More information about the llvm-commits
mailing list