[WebAssembly] Don't depend on the flags set by handleTargetFeatures in initFeatureMap.
authorCraig Topper <craig.topper@intel.com>
Wed, 12 Aug 2020 18:35:08 +0000 (11:35 -0700)
committerCraig Topper <craig.topper@intel.com>
Wed, 12 Aug 2020 18:43:46 +0000 (11:43 -0700)
commit2b8ad6b6040833f4f8702721ebaa7749e5c23e60
treee07c4f6ca29fb58a21a83fb36b1308050f6ab9c3
parent2ff14957e88715dbe760cf94367bd99aff5867db
[WebAssembly] Don't depend on the flags set by handleTargetFeatures in initFeatureMap.

Properly set "simd128" in the feature map when "unimplemented-simd128"
is requested.

initFeatureMap is used to create the feature vector used by
handleTargetFeatures. There are later calls to initFeatureMap in
CodeGen that were using these flags to recreate the map. But the
original feature vector should be passed to those calls. So that
should be enough to rebuild the map.

The only issue seemed to be that simd128 was not enabled in the
map by the first call to initFeatureMap. Using the SIMDLevel set
by handleTargetFeatures in the later calls allowed simd128 to be
set in the later versions of the map.

To fix this I've added an override of setFeatureEnabled that
will update the map the first time with the correct simd dependency.

Differential Revision: https://reviews.llvm.org/D85806
clang/lib/Basic/Targets/WebAssembly.cpp
clang/lib/Basic/Targets/WebAssembly.h