Commit bbbc1238 authored by Noemi Erli's avatar Noemi Erli
Browse files

Backed out changeset 6fceae307b7c (bug 1830962) for causing build bustages in rlbox.wasm.h

parent 7e05aad3
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -9,8 +9,8 @@ origin:
  description: wasm2c fork used for rlbox sandboxing
  url: https://github.com/WebAssembly/wabt

  release: 5abbeaab97eb802acccf866d9c8cc021c1f7e570 (2023-05-02T18:27:21Z).
  revision: 5abbeaab97eb802acccf866d9c8cc021c1f7e570
  release: 805bebffde3c41fe4f1255deccc7bcb5b7e05dfa (2023-04-26T15:06:45Z).
  revision: 805bebffde3c41fe4f1255deccc7bcb5b7e05dfa

  license: Apache-2.0
  license-file: LICENSE
@@ -44,4 +44,3 @@ vendoring:
    - src/tools/wast*
    - src/tools/wat*
    - src/tools/wasm2w*
    - wasm2c/wasm-rt-exceptions*
+0 −3
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@

#include <functional>
#include "wabt/common.h"
#include "wabt/feature.h"
#include "wabt/ir.h"

namespace wabt {
@@ -29,8 +28,6 @@ class Stream;

struct WriteCOptions {
  std::string_view module_name;
  /* Set of wasm features enabled for wasm2c */
  Features* features;
  /*
   * name_to_output_file_index takes const iterators to begin and end of a list
   * of all functions in the module, number of imported functions, and number of
+9 −22
Original line number Diff line number Diff line
@@ -297,7 +297,6 @@ class CWriter {
  static void SerializeFuncType(const FuncType&, std::string&);

  std::string GetGlobalName(ModuleFieldType, const std::string&) const;
  std::string GetLocalName(const std::string&, bool is_label) const;

  void Indent(int size = INDENT_SIZE);
  void Dedent(int size = INDENT_SIZE);
@@ -368,7 +367,6 @@ class CWriter {
                                  const std::string&);
  void WriteCallIndirectFuncDeclaration(const FuncDeclaration&,
                                        const std::string&);
  void WriteFeatureMacros();
  void WriteModuleInstance();
  void WriteGlobals();
  void WriteGlobal(const Global&, const std::string&);
@@ -912,13 +910,6 @@ std::string CWriter::DefineLocalScopeName(std::string_view name,
      kLocalSymbolPrefix + MangleName(StripLeadingDollar(name)));
}

std::string CWriter::GetLocalName(const std::string& name,
                                  bool is_label) const {
  std::string mangled = name + (is_label ? kLabelSuffix : kParamSuffix);
  assert(local_sym_map_.count(mangled) == 1);
  return local_sym_map_.at(mangled);
}

std::string CWriter::DefineParamName(std::string_view name) {
  return DefineLocalScopeName(name, false);
}
@@ -1030,15 +1021,21 @@ void CWriter::Write(std::string_view s) {
}

void CWriter::Write(const ParamName& name) {
  Write(GetLocalName(name.name, false));
  std::string mangled = name.name + kParamSuffix;
  assert(local_sym_map_.count(mangled) == 1);
  Write(local_sym_map_[mangled]);
}

void CWriter::Write(const LabelName& name) {
  Write(GetLocalName(name.name, true));
  std::string mangled = name.name + kLabelSuffix;
  assert(local_sym_map_.count(mangled) == 1);
  Write(local_sym_map_[mangled]);
}

void CWriter::Write(const GlobalName& name) {
  Write(GetGlobalName(name.type, name.name));
  std::string mangled = name.name + MangleField(name.type);
  assert(global_sym_map_.count(mangled) == 1);
  Write(global_sym_map_.at(mangled));
}

void CWriter::Write(const ExternalPtr& name) {
@@ -1790,15 +1787,6 @@ void CWriter::WriteCallIndirectFuncDeclaration(const FuncDeclaration& decl,
  Write(")");
}

void CWriter::WriteFeatureMacros() {
  if (options_.features->exceptions_enabled()) {
    Write("#define WASM_RT_ENABLE_EXCEPTION_HANDLING", Newline(), Newline());
  }
  if (options_.features->simd_enabled()) {
    Write("#define WASM_RT_ENABLE_SIMD", Newline(), Newline());
  }
}

void CWriter::WriteModuleInstance() {
  BeginInstance();
  WriteGlobals();
@@ -5132,7 +5120,6 @@ void CWriter::WriteCHeader() {
  Write("#ifndef ", guard, Newline());
  Write("#define ", guard, Newline());
  Write(Newline());
  WriteFeatureMacros();
  Write(s_header_top);
  Write(Newline());
  WriteModuleInstance();
+0 −7
Original line number Diff line number Diff line
@@ -4,13 +4,6 @@ R"w2c_template(
#include "wasm-rt.h"
)w2c_template"
R"w2c_template(
#if defined(WASM_RT_ENABLE_EXCEPTION_HANDLING)
)w2c_template"
R"w2c_template(#include "wasm-rt-exceptions.h"
)w2c_template"
R"w2c_template(#endif
)w2c_template"
R"w2c_template(
#if defined(WASM_RT_ENABLE_SIMD)
)w2c_template"
R"w2c_template(#include "simde/wasm/simd128.h"
+2 −3
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ examples:

static const std::string supported_features[] = {
    "multi-memory", "multi-value", "sign-extension", "saturating-float-to-int",
    "exceptions",   "memory64",    "extended-const", "simd"};
    "exceptions",   "memory64",    "extended-const"};

static bool IsFeatureSupported(const std::string& feature) {
  return std::find(std::begin(supported_features), std::end(supported_features),
@@ -100,13 +100,12 @@ static void ParseOptions(int argc, char** argv) {
                       ConvertBackslashToSlash(&s_infile);
                     });
  parser.Parse(argc, argv);
  s_write_c_options.features = &s_features;

  bool any_non_supported_feature = false;
#define WABT_FEATURE(variable, flag, default_, help)   \
  any_non_supported_feature |=                         \
      (s_features.variable##_enabled() != default_) && \
      s_features.variable##_enabled() && !IsFeatureSupported(flag);
      !IsFeatureSupported(flag);
#include "wabt/feature.def"
#undef WABT_FEATURE

Loading