diff options
Diffstat (limited to 'llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp index d13e1ece9bf..2c97aadd7f9 100644 --- a/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp +++ b/llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyWasmObjectWriter.cpp @@ -43,25 +43,25 @@ WebAssemblyWasmObjectWriter::WebAssemblyWasmObjectWriter(bool Is64Bit) : MCWasmObjectTargetWriter(Is64Bit) {} // Test whether the given expression computes a function address. -static bool IsFunctionExpr(const MCExpr *Expr) { +static bool isFunctionExpr(const MCExpr *Expr) { if (auto SyExp = dyn_cast<MCSymbolRefExpr>(Expr)) return cast<MCSymbolWasm>(SyExp->getSymbol()).isFunction(); if (auto BinOp = dyn_cast<MCBinaryExpr>(Expr)) - return IsFunctionExpr(BinOp->getLHS()) != IsFunctionExpr(BinOp->getRHS()); + return isFunctionExpr(BinOp->getLHS()) != isFunctionExpr(BinOp->getRHS()); if (auto UnOp = dyn_cast<MCUnaryExpr>(Expr)) - return IsFunctionExpr(UnOp->getSubExpr()); + return isFunctionExpr(UnOp->getSubExpr()); return false; } -static bool IsFunctionType(const MCValue &Target) { +static bool isFunctionType(const MCValue &Target) { const MCSymbolRefExpr *RefA = Target.getSymA(); return RefA && RefA->getKind() == MCSymbolRefExpr::VK_WebAssembly_TYPEINDEX; } -static const MCSection *GetFixupSection(const MCExpr *Expr) { +static const MCSection *getFixupSection(const MCExpr *Expr) { if (auto SyExp = dyn_cast<MCSymbolRefExpr>(Expr)) { if (SyExp->getSymbol().isInSection()) return &SyExp->getSymbol().getSection(); @@ -69,23 +69,23 @@ static const MCSection *GetFixupSection(const MCExpr *Expr) { } if (auto BinOp = dyn_cast<MCBinaryExpr>(Expr)) { - auto SectionLHS = GetFixupSection(BinOp->getLHS()); - auto SectionRHS = GetFixupSection(BinOp->getRHS()); + auto SectionLHS = getFixupSection(BinOp->getLHS()); + auto SectionRHS = getFixupSection(BinOp->getRHS()); return SectionLHS == SectionRHS ? nullptr : SectionLHS; } if (auto UnOp = dyn_cast<MCUnaryExpr>(Expr)) - return GetFixupSection(UnOp->getSubExpr()); + return getFixupSection(UnOp->getSubExpr()); return nullptr; } -static bool IsGlobalType(const MCValue &Target) { +static bool isGlobalType(const MCValue &Target) { const MCSymbolRefExpr *RefA = Target.getSymA(); return RefA && RefA->getKind() == MCSymbolRefExpr::VK_WebAssembly_GLOBAL; } -static bool IsEventType(const MCValue &Target) { +static bool isEventType(const MCValue &Target) { const MCSymbolRefExpr *RefA = Target.getSymA(); return RefA && RefA->getKind() == MCSymbolRefExpr::VK_WebAssembly_EVENT; } @@ -94,7 +94,7 @@ unsigned WebAssemblyWasmObjectWriter::getRelocType(const MCValue &Target, const MCFixup &Fixup) const { // WebAssembly functions are not allocated in the data address space. To // resolve a pointer to a function, we must use a special relocation type. - bool IsFunction = IsFunctionExpr(Fixup.getValue()); + bool IsFunction = isFunctionExpr(Fixup.getValue()); switch (unsigned(Fixup.getKind())) { case WebAssembly::fixup_code_sleb128_i32: @@ -104,20 +104,20 @@ unsigned WebAssemblyWasmObjectWriter::getRelocType(const MCValue &Target, case WebAssembly::fixup_code_sleb128_i64: llvm_unreachable("fixup_sleb128_i64 not implemented yet"); case WebAssembly::fixup_code_uleb128_i32: - if (IsGlobalType(Target)) + if (isGlobalType(Target)) return wasm::R_WASM_GLOBAL_INDEX_LEB; - if (IsFunctionType(Target)) + if (isFunctionType(Target)) return wasm::R_WASM_TYPE_INDEX_LEB; if (IsFunction) return wasm::R_WASM_FUNCTION_INDEX_LEB; - if (IsEventType(Target)) + if (isEventType(Target)) return wasm::R_WASM_EVENT_INDEX_LEB; return wasm::R_WASM_MEMORY_ADDR_LEB; case FK_Data_4: if (IsFunction) return wasm::R_WASM_TABLE_INDEX_I32; if (auto Section = static_cast<const MCSectionWasm *>( - GetFixupSection(Fixup.getValue()))) { + getFixupSection(Fixup.getValue()))) { if (Section->getKind().isText()) return wasm::R_WASM_FUNCTION_OFFSET_I32; else if (!Section->isWasmData()) |