Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/ir/metadata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,6 @@ void copyBetweenFunctions(Expression* origin,
}
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"

// Given two expressions to use as keys, see if they have identical values (or
// are both absent) in two maps.
template<typename T, typename V>
Expand Down Expand Up @@ -138,6 +135,4 @@ bool equal(Function* a, Function* b) {
return true;
}

#pragma GCC diagnostic pop

} // namespace wasm::metadata
5 changes: 0 additions & 5 deletions src/parser/wast-parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,9 +520,6 @@ Result<WASTCommand> command(Lexer& in) {
return *module;
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"

Result<WASTScript> wast(Lexer& in) {
WASTScript cmds;
while (!in.empty()) {
Expand All @@ -548,8 +545,6 @@ Result<WASTScript> wast(Lexer& in) {
return cmds;
}

#pragma GCC diagnostic pop

} // anonymous namespace

Result<WASTScript> parseScript(std::string_view in) {
Expand Down
5 changes: 0 additions & 5 deletions src/parser/wat-parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,12 @@ Result<> parseModuleBody(Module& wasm, Lexer& lexer);

Result<Literal> parseConst(Lexer& lexer);

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"

struct InvokeAction {
std::optional<Name> base;
Name name;
Literals args;
};

#pragma GCC diagnostic pop

struct GetAction {
std::optional<Name> base;
Name name;
Expand Down
5 changes: 0 additions & 5 deletions src/passes/Strip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@

namespace wasm {

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"

struct Strip : public Pass {
bool requiresNonNullableLocalFixups() override { return false; }

Expand Down Expand Up @@ -77,6 +74,4 @@ Pass* createStripProducersPass() {
});
}

#pragma GCC diagnostic pop

} // namespace wasm
10 changes: 3 additions & 7 deletions src/support/istring.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ struct IString {
static std::string_view interned(std::string_view s, bool reuse = true);

public:
const std::string_view str;
std::string_view str;

IString() = default;
IString(const IString& other) = default;
IString& operator=(const IString& other) = default;

// TODO: This is a wildly unsafe default inherited from the previous
// implementation. Change it?
Expand All @@ -49,12 +51,6 @@ struct IString {
IString(const char* str) : str(interned(str, false)) {}
IString(const std::string& str) : str(interned(str, false)) {}

IString(const IString& other) = default;

IString& operator=(const IString& other) {
return *(new (this) IString(other));
}

bool operator==(const IString& other) const {
// Fast! No need to compare contents due to interning
return str.data() == other.str.data();
Expand Down
5 changes: 0 additions & 5 deletions src/support/string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,6 @@ std::ostream& writeWTF16CodePoint(std::ostream& os, uint32_t u) {
return os;
}

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"

bool convertWTF8ToWTF16(std::ostream& os, std::string_view str) {
bool valid = true;
bool lastWasLeadingSurrogate = false;
Expand All @@ -393,8 +390,6 @@ bool convertWTF8ToWTF16(std::ostream& os, std::string_view str) {
return valid;
}

#pragma GCC diagnostic pop

bool convertWTF16ToWTF8(std::ostream& os, std::string_view str) {
return doConvertWTF16ToWTF8(os, str, true);
}
Expand Down
7 changes: 1 addition & 6 deletions src/wasm-interpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -4457,10 +4457,7 @@ class ModuleRunnerBase : public ExpressionRunner<SubType> {
const auto& seg = *wasm.getDataSegment(curr->segment);
auto elemBytes = element.getByteSize();

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"

uint64_t end;
uint64_t end = 0;
if (std::ckd_add(&end, offset, size * elemBytes) || end > seg.data.size()) {
trap("out of bounds segment access in array.new_data");
}
Expand All @@ -4473,8 +4470,6 @@ class ModuleRunnerBase : public ExpressionRunner<SubType> {
contents.push_back(this->makeFromMemory(addr, element));
}

#pragma GCC diagnostic pop

return self()->makeGCData(std::move(contents), curr->type);
}
Flow visitArrayNewElem(ArrayNewElem* curr) {
Expand Down
2 changes: 1 addition & 1 deletion src/wasm-type.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class HeapType {
// stack, `HeapType` is used to describe the structures that reference types
// refer to. HeapTypes are canonicalized and interned exactly like Types and
// should also be passed by value.
uintptr_t id;
uintptr_t id = 0;

static constexpr int TypeBits = 2;
static constexpr int UsedBits = TypeBits + 1;
Expand Down
Loading