summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/WasmObjectWriter.cpp
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2018-11-02 19:25:09 +0000
committerHeejin Ahn <aheejin@gmail.com>2018-11-02 19:25:09 +0000
commit4808914a5829ebdb19d0eb5ab93281169db8ad2d (patch)
tree6abc7e088fdc03dba56c28a6ff68f1bbfb167d34 /llvm/lib/MC/WasmObjectWriter.cpp
parent78f7a6eaa601bfdd6ae70ffd3da2254c21ff77f9 (diff)
downloadbcm5719-llvm-4808914a5829ebdb19d0eb5ab93281169db8ad2d.tar.gz
bcm5719-llvm-4808914a5829ebdb19d0eb5ab93281169db8ad2d.zip
[WebAssembly] Change indices types to unsined int (NFC)
Summary: This changes int types to unsigned int in a few places: function indices and `wasm::Valtype` (which is unsigend int enum). Currently these values cannot have negative values anyway, so this should not be a functional change for now. Reviewers: sbc100 Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D54044 llvm-svn: 346031
Diffstat (limited to 'llvm/lib/MC/WasmObjectWriter.cpp')
-rw-r--r--llvm/lib/MC/WasmObjectWriter.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/MC/WasmObjectWriter.cpp b/llvm/lib/MC/WasmObjectWriter.cpp
index f9318ad5801..c1e0b7aa7ab 100644
--- a/llvm/lib/MC/WasmObjectWriter.cpp
+++ b/llvm/lib/MC/WasmObjectWriter.cpp
@@ -92,9 +92,9 @@ struct WasmFunctionTypeDenseMapInfo {
static unsigned getHashValue(const WasmFunctionType &FuncTy) {
uintptr_t Value = FuncTy.State;
for (wasm::ValType Ret : FuncTy.Returns)
- Value += DenseMapInfo<int32_t>::getHashValue(int32_t(Ret));
+ Value += DenseMapInfo<uint32_t>::getHashValue(uint32_t(Ret));
for (wasm::ValType Param : FuncTy.Params)
- Value += DenseMapInfo<int32_t>::getHashValue(int32_t(Param));
+ Value += DenseMapInfo<uint32_t>::getHashValue(uint32_t(Param));
return Value;
}
static bool isEqual(const WasmFunctionType &LHS,
@@ -118,7 +118,7 @@ struct WasmDataSegment {
// A wasm function to be written into the function section.
struct WasmFunction {
- int32_t Type;
+ uint32_t Type;
const MCSymbolWasm *Sym;
};
@@ -231,7 +231,7 @@ class WasmObjectWriter : public MCObjectWriter {
// Map from section to defining function symbol.
DenseMap<const MCSection *, const MCSymbol *> SectionFunctions;
- DenseMap<WasmFunctionType, int32_t, WasmFunctionTypeDenseMapInfo>
+ DenseMap<WasmFunctionType, uint32_t, WasmFunctionTypeDenseMapInfo>
FunctionTypeIndices;
SmallVector<WasmFunctionType, 4> FunctionTypes;
SmallVector<WasmGlobal, 4> Globals;
OpenPOWER on IntegriCloud