[lld] r347273 - [WebAssembly] Fix inaccurate comments / assertion messages

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 19 15:31:28 PST 2018


Author: aheejin
Date: Mon Nov 19 15:31:28 2018
New Revision: 347273

URL: http://llvm.org/viewvc/llvm-project?rev=347273&view=rev
Log:
[WebAssembly] Fix inaccurate comments / assertion messages

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

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

Modified:
    lld/trunk/wasm/InputFiles.cpp
    lld/trunk/wasm/SymbolTable.cpp
    lld/trunk/wasm/Symbols.h

Modified: lld/trunk/wasm/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/InputFiles.cpp?rev=347273&r1=347272&r2=347273&view=diff
==============================================================================
--- lld/trunk/wasm/InputFiles.cpp (original)
+++ lld/trunk/wasm/InputFiles.cpp Mon Nov 19 15:31:28 2018
@@ -62,7 +62,7 @@ void ObjFile::dumpInfo() const {
 
 // 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]);

Modified: lld/trunk/wasm/SymbolTable.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/SymbolTable.cpp?rev=347273&r1=347272&r2=347273&view=diff
==============================================================================
--- lld/trunk/wasm/SymbolTable.cpp (original)
+++ lld/trunk/wasm/SymbolTable.cpp Mon Nov 19 15:31:28 2018
@@ -97,6 +97,8 @@ static void reportTypeError(const Symbol
         " 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 @@ static void checkFunctionType(Symbol *Ex
          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)) {

Modified: lld/trunk/wasm/Symbols.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/wasm/Symbols.h?rev=347273&r1=347272&r2=347273&view=diff
==============================================================================
--- lld/trunk/wasm/Symbols.h (original)
+++ lld/trunk/wasm/Symbols.h Mon Nov 19 15:31:28 2018
@@ -245,8 +245,6 @@ protected:
                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 @@ template <typename T, typename... ArgT>
 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), "SymbolUnion too small");
   static_assert(alignof(T) <= alignof(SymbolUnion),
                 "SymbolUnion not aligned enough");
   assert(static_cast<Symbol *>(static_cast<T *>(nullptr)) == nullptr &&




More information about the llvm-commits mailing list