summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2019-03-29 22:00:18 +0000
committerThomas Lively <tlively@google.com>2019-03-29 22:00:18 +0000
commit5f0c4c67bbff5374b196578486a16147cb786548 (patch)
treee66d05e4810f760c273b7a4a3d477ceefd008103 /llvm/lib/Target/WebAssembly
parent32fd32bc6f6de46b96c9e09575694d34f248d6ee (diff)
downloadbcm5719-llvm-5f0c4c67bbff5374b196578486a16147cb786548.tar.gz
bcm5719-llvm-5f0c4c67bbff5374b196578486a16147cb786548.zip
[WebAssembly] Add mutable globals feature
Summary: This feature is not actually used for anything in the WebAssembly backend, but adding it allows users to get it into the target features sections of their objects, which makes these objects future-compatible. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, jdoerfert, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D60013 llvm-svn: 357321
Diffstat (limited to 'llvm/lib/Target/WebAssembly')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssembly.td4
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h2
2 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssembly.td b/llvm/lib/Target/WebAssembly/WebAssembly.td
index 230c1208e54..9138683d498 100644
--- a/llvm/lib/Target/WebAssembly/WebAssembly.td
+++ b/llvm/lib/Target/WebAssembly/WebAssembly.td
@@ -51,6 +51,10 @@ def FeatureBulkMemory :
SubtargetFeature<"bulk-memory", "HasBulkMemory", "true",
"Enable bulk memory operations">;
+def FeatureMutableGlobals :
+ SubtargetFeature<"mutable-globals", "HasMutableGlobals", "true",
+ "Enable mutable globals">;
+
//===----------------------------------------------------------------------===//
// Architectures.
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h b/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h
index ae1f3fe3946..22e11726f33 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h
+++ b/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.h
@@ -44,6 +44,7 @@ class WebAssemblySubtarget final : public WebAssemblyGenSubtargetInfo {
bool HasSignExt = false;
bool HasExceptionHandling = false;
bool HasBulkMemory = false;
+ bool HasMutableGlobals = false;
/// String name of used CPU.
std::string CPUString;
@@ -97,6 +98,7 @@ public:
bool hasSignExt() const { return HasSignExt; }
bool hasExceptionHandling() const { return HasExceptionHandling; }
bool hasBulkMemory() const { return HasBulkMemory; }
+ bool hasMutableGlobals() const { return HasMutableGlobals; }
/// Parses features string setting specified subtarget options. Definition of
/// function is auto generated by tblgen.
OpenPOWER on IntegriCloud