From 9f5094df36b318be34426f9bbde07f6e0bb9fff2 Mon Sep 17 00:00:00 2001 From: Eugene Zelenko Date: Fri, 21 Apr 2017 22:03:05 +0000 Subject: [Object] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). llvm-svn: 301049 --- llvm/lib/Object/WasmObjectFile.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Object/WasmObjectFile.cpp') diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp index fc1dca35..5b254b2 100644 --- a/llvm/lib/Object/WasmObjectFile.cpp +++ b/llvm/lib/Object/WasmObjectFile.cpp @@ -11,6 +11,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringRef.h" #include "llvm/ADT/Triple.h" +#include "llvm/MC/SubtargetFeature.h" #include "llvm/Object/Binary.h" #include "llvm/Object/Error.h" #include "llvm/Object/ObjectFile.h" @@ -22,7 +23,9 @@ #include "llvm/Support/LEB128.h" #include "llvm/Support/Wasm.h" #include +#include #include +#include #include using namespace llvm; @@ -180,7 +183,7 @@ static Error readSection(WasmSection &Section, const uint8_t *&Ptr, } WasmObjectFile::WasmObjectFile(MemoryBufferRef Buffer, Error &Err) - : ObjectFile(Binary::ID_Wasm, Buffer), StartFunction(-1) { + : ObjectFile(Binary::ID_Wasm, Buffer) { ErrorAsOutParameter ErrAsOutParam(&Err); Header.Magic = getData().substr(0, 4); if (Header.Magic != StringRef("\0asm", 4)) { @@ -252,7 +255,7 @@ Error WasmObjectFile::parseNameSection(const uint8_t *Ptr, const uint8_t *End) { while (Count--) { /*uint32_t Index =*/readVaruint32(Ptr); StringRef Name = readString(Ptr); - if (Name.size()) + if (!Name.empty()) Symbols.emplace_back(Name, WasmSymbol::SymbolType::DEBUG_FUNCTION_NAME); } -- cgit v1.1