[PATCH] D54688: [WebAssembly] Fix inaccurate comments / assertion messages
Heejin Ahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Nov 19 00:42:49 PST 2018
aheejin created this revision.
aheejin added a reviewer: sbc100.
Herald added subscribers: llvm-commits, sunfish, jgravelle-google, dschuff.
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D54688
Files:
wasm/InputFiles.cpp
wasm/SymbolTable.cpp
wasm/Symbols.h
Index: wasm/Symbols.h
===================================================================
--- wasm/Symbols.h
+++ wasm/Symbols.h
@@ -245,8 +245,6 @@
const WasmGlobalType *GlobalType)
: Symbol(Name, K, Flags, F), GlobalType(GlobalType) {}
- // Explicit function type, needed for undefined or synthetic functions only.
- // For regular defined globals this information comes from the InputChunk.
const WasmGlobalType *GlobalType;
uint32_t GlobalIndex = INVALID_INDEX;
};
@@ -338,7 +336,7 @@
T *replaceSymbol(Symbol *S, ArgT &&... Arg) {
static_assert(std::is_trivially_destructible<T>(),
"Symbol types must be trivially destructible");
- static_assert(sizeof(T) <= sizeof(SymbolUnion), "Symbol too small");
+ static_assert(sizeof(T) <= sizeof(SymbolUnion), "Symbol too large");
static_assert(alignof(T) <= alignof(SymbolUnion),
"SymbolUnion not aligned enough");
assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr &&
Index: wasm/SymbolTable.cpp
===================================================================
--- wasm/SymbolTable.cpp
+++ wasm/SymbolTable.cpp
@@ -97,6 +97,8 @@
" in " + toString(File));
}
+// Check the type of new symbol matches that of the symbol is replacing.
+// For functions this can also involve verifying that the signatures match.
static void checkFunctionType(Symbol *Existing, const InputFile *File,
const WasmSignature *NewSig) {
auto ExistingFunction = dyn_cast<FunctionSymbol>(Existing);
@@ -121,8 +123,6 @@
toString(*NewSig) + " in " + toString(File));
}
-// Check the type of new symbol matches that of the symbol is replacing.
-// For functions this can also involve verifying that the signatures match.
static void checkGlobalType(const Symbol *Existing, const InputFile *File,
const WasmGlobalType *NewType) {
if (!isa<GlobalSymbol>(Existing)) {
Index: wasm/InputFiles.cpp
===================================================================
--- wasm/InputFiles.cpp
+++ wasm/InputFiles.cpp
@@ -62,7 +62,7 @@
// Relocations contain either symbol or type indices. This function takes a
// relocation and returns relocated index (i.e. translates from the input
-// sybmol/type space to the output symbol/type space).
+// symbol/type space to the output symbol/type space).
uint32_t ObjFile::calcNewIndex(const WasmRelocation &Reloc) const {
if (Reloc.Type == R_WEBASSEMBLY_TYPE_INDEX_LEB) {
assert(TypeIsUsed[Reloc.Index]);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54688.174564.patch
Type: text/x-patch
Size: 2559 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181119/b8e116b4/attachment.bin>
More information about the llvm-commits
mailing list