[WebAssembly] Update Config member to match command line option
authorSam Clegg <sbc@chromium.org>
Thu, 27 Sep 2018 00:46:54 +0000 (00:46 +0000)
committerSam Clegg <sbc@chromium.org>
Thu, 27 Sep 2018 00:46:54 +0000 (00:46 +0000)
Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

Differential Revision: https://reviews.llvm.org/D50976

llvm-svn: 343157

lld/wasm/Config.h
lld/wasm/Driver.cpp
lld/wasm/InputChunks.cpp
lld/wasm/InputChunks.h

index ae8989f15d74f88fc4dbcb062b53a868f5b483a5..e100ab82a590193ee7e90b44aa944764b2350975 100644 (file)
@@ -20,7 +20,7 @@ namespace wasm {
 
 struct Configuration {
   bool AllowUndefined;
-  bool CompressRelocTargets;
+  bool CompressRelocations;
   bool Demangle;
   bool DisableVerify;
   bool ExportAll;
index 789bda90b1a8597526b06273c1f9e0002d78ffa8..897855873046040383151231d50eda46e486052d 100644 (file)
@@ -396,7 +396,7 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
   Config->SearchPaths = args::getStrings(Args, OPT_L);
   Config->StripAll = Args.hasArg(OPT_strip_all);
   Config->StripDebug = Args.hasArg(OPT_strip_debug);
-  Config->CompressRelocTargets = Args.hasArg(OPT_compress_relocations);
+  Config->CompressRelocations = Args.hasArg(OPT_compress_relocations);
   Config->StackFirst = Args.hasArg(OPT_stack_first);
   Config->ThinLTOCacheDir = Args.getLastArgValue(OPT_thinlto_cache_dir);
   Config->ThinLTOCachePolicy = CHECK(
@@ -412,7 +412,7 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
   Config->ZStackSize =
       args::getZOptionValue(Args, OPT_z, "stack-size", WasmPageSize);
 
-  if (!Config->StripDebug && !Config->StripAll && Config->CompressRelocTargets)
+  if (!Config->StripDebug && !Config->StripAll && Config->CompressRelocations)
     error("--compress-relocations is incompatible with output debug"
           " information. Please pass --strip-debug or --strip-all");
 
@@ -442,7 +442,7 @@ void LinkerDriver::link(ArrayRef<const char *> ArgsArr) {
       error("entry point specified for relocatable output file");
     if (Config->GcSections)
       error("-r and --gc-sections may not be used together");
-    if (Config->CompressRelocTargets)
+    if (Config->CompressRelocations)
       error("-r -and --compress-relocations may not be used together");
     if (Args.hasArg(OPT_undefined))
       error("-r -and --undefined may not be used together");
index ed658366b5dc08ef29d342831420fa9b1e0da593..87aac5a4af527f1cbae8e1669a35df117bb8ea31 100644 (file)
@@ -220,7 +220,7 @@ static unsigned getRelocWidth(const WasmRelocation &Rel, uint32_t Value) {
 // This function only computes the final output size.  It must be called
 // before getSize() is used to calculate of layout of the code section.
 void InputFunction::calculateSize() {
-  if (!File || !Config->CompressRelocTargets)
+  if (!File || !Config->CompressRelocations)
     return;
 
   LLVM_DEBUG(dbgs() << "calculateSize: " << getName() << "\n");
@@ -255,7 +255,7 @@ void InputFunction::calculateSize() {
 // Override the default writeTo method so that we can (optionally) write the
 // compressed version of the function.
 void InputFunction::writeTo(uint8_t *Buf) const {
-  if (!File || !Config->CompressRelocTargets)
+  if (!File || !Config->CompressRelocations)
     return InputChunk::writeTo(Buf);
 
   Buf += OutputOffset;
index 2ab4ae8983adbc02303474c16028f114773f7245..f899d697c6dc17c5ceb5753823978969cc4bd3ba 100644 (file)
@@ -138,7 +138,7 @@ public:
   uint32_t getFunctionInputOffset() const { return getInputSectionOffset(); }
   uint32_t getFunctionCodeOffset() const { return Function->CodeOffset; }
   uint32_t getSize() const override {
-    if (Config->CompressRelocTargets && File) {
+    if (Config->CompressRelocations && File) {
       assert(CompressedSize);
       return CompressedSize;
     }
@@ -165,7 +165,7 @@ public:
 
 protected:
   ArrayRef<uint8_t> data() const override {
-    assert(!Config->CompressRelocTargets);
+    assert(!Config->CompressRelocations);
     return File->CodeSection->Content.slice(getInputSectionOffset(),
                                             Function->Size);
   }