clang format

llvm-svn: 323622
This commit is contained in:
Sam Clegg 2018-01-28 19:57:02 +00:00
parent 24b3dcd4bf
commit fc50c62311
6 changed files with 21 additions and 21 deletions

View File

@ -122,7 +122,9 @@ public:
const ObjFile *F)
: InputChunk(F, InputChunk::Function), Signature(S), Function(Func) {}
static bool classof(const InputChunk *C) { return C->kind() == InputChunk::Function; }
static bool classof(const InputChunk *C) {
return C->kind() == InputChunk::Function;
}
virtual StringRef getName() const { return Function->Name; }
StringRef getComdat() const override { return Function->Comdat; }

View File

@ -259,8 +259,8 @@ void ObjFile::initializeSymbols() {
case WasmSymbol::SymbolType::GLOBAL_EXPORT: {
InputSegment *Segment = getSegment(WasmSym);
if (!isExcludedByComdat(Segment)) {
S = createDefined(WasmSym, Symbol::Kind::DefinedGlobalKind,
Segment, getGlobalValue(WasmSym));
S = createDefined(WasmSym, Symbol::Kind::DefinedGlobalKind, Segment,
getGlobalValue(WasmSym));
break;
} else {
Segment->Discarded = true;
@ -306,8 +306,7 @@ Symbol *ObjFile::createDefined(const WasmSymbol &Sym, Symbol::Kind Kind,
S->update(Kind, this, Sym.Flags, Chunk, Address);
return S;
}
return Symtab->addDefined(Sym.Name, Kind, Sym.Flags, this, Chunk,
Address);
return Symtab->addDefined(Sym.Name, Kind, Sym.Flags, this, Chunk, Address);
}
void ArchiveFile::parse() {

View File

@ -121,8 +121,8 @@ static void checkSymbolTypes(const Symbol &Existing, const InputFile &F,
static void checkSymbolTypes(const Symbol &Existing, const InputFile &F,
Symbol::Kind Kind, const InputChunk *Chunk) {
const WasmSignature* Sig = nullptr;
if (auto* F = dyn_cast_or_null<InputFunction>(Chunk))
const WasmSignature *Sig = nullptr;
if (auto *F = dyn_cast_or_null<InputFunction>(Chunk))
Sig = &F->Signature;
return checkSymbolTypes(Existing, F, Kind, Sig);
}
@ -163,8 +163,8 @@ Symbol *SymbolTable::addDefinedGlobal(StringRef Name) {
}
Symbol *SymbolTable::addDefined(StringRef Name, Symbol::Kind Kind,
uint32_t Flags, InputFile *F,
InputChunk *Chunk, uint32_t Address) {
uint32_t Flags, InputFile *F, InputChunk *Chunk,
uint32_t Address) {
DEBUG(dbgs() << "addDefined: " << Name << " addr:" << Address << "\n");
Symbol *S;
bool WasInserted;

View File

@ -50,8 +50,8 @@ public:
ObjFile *findComdat(StringRef Name) const;
Symbol *addDefined(StringRef Name, Symbol::Kind Kind, uint32_t Flags,
InputFile *F,
InputChunk *Chunk = nullptr, uint32_t Address = 0);
InputFile *F, InputChunk *Chunk = nullptr,
uint32_t Address = 0);
Symbol *addUndefined(StringRef Name, Symbol::Kind Kind, uint32_t Flags,
InputFile *F, const WasmSignature *Signature = nullptr);
Symbol *addUndefinedFunction(StringRef Name, const WasmSignature *Type);

View File

@ -39,17 +39,18 @@ void Symbol::setFunctionType(const WasmSignature *Type) {
uint32_t Symbol::getVirtualAddress() const {
assert(isGlobal());
DEBUG(dbgs() << "getVirtualAddress: " << getName() << "\n");
return Chunk ? dyn_cast<InputSegment>(Chunk)->translateVA(VirtualAddress) : VirtualAddress;
return Chunk ? dyn_cast<InputSegment>(Chunk)->translateVA(VirtualAddress)
: VirtualAddress;
}
bool Symbol::hasOutputIndex() const {
if (auto* F = dyn_cast_or_null<InputFunction>(Chunk))
if (auto *F = dyn_cast_or_null<InputFunction>(Chunk))
return F->hasOutputIndex();
return OutputIndex.hasValue();
}
uint32_t Symbol::getOutputIndex() const {
if (auto* F = dyn_cast_or_null<InputFunction>(Chunk))
if (auto *F = dyn_cast_or_null<InputFunction>(Chunk))
return F->getOutputIndex();
return OutputIndex.getValue();
}
@ -68,13 +69,13 @@ void Symbol::setOutputIndex(uint32_t Index) {
}
uint32_t Symbol::getTableIndex() const {
if (auto* F = dyn_cast_or_null<InputFunction>(Chunk))
if (auto *F = dyn_cast_or_null<InputFunction>(Chunk))
return F->getTableIndex();
return TableIndex.getValue();
}
bool Symbol::hasTableIndex() const {
if (auto* F = dyn_cast_or_null<InputFunction>(Chunk))
if (auto *F = dyn_cast_or_null<InputFunction>(Chunk))
return F->hasTableIndex();
return TableIndex.hasValue();
}
@ -83,7 +84,7 @@ void Symbol::setTableIndex(uint32_t Index) {
// For imports, we set the table index here on the Symbol; for defined
// functions we set the index on the InputFunction so that we don't export
// the same thing twice (keeps the table size down).
if (auto* F = dyn_cast_or_null<InputFunction>(Chunk)) {
if (auto *F = dyn_cast_or_null<InputFunction>(Chunk)) {
F->setTableIndex(Index);
return;
}
@ -92,8 +93,7 @@ void Symbol::setTableIndex(uint32_t Index) {
TableIndex = Index;
}
void Symbol::update(Kind K, InputFile *F, uint32_t Flags_,
InputChunk *Chunk_,
void Symbol::update(Kind K, InputFile *F, uint32_t Flags_, InputChunk *Chunk_,
uint32_t Address) {
SymbolKind = K;
File = F;

View File

@ -92,8 +92,7 @@ public:
void setVirtualAddress(uint32_t VA);
void update(Kind K, InputFile *F = nullptr, uint32_t Flags = 0,
InputChunk *chunk = nullptr,
uint32_t Address = UINT32_MAX);
InputChunk *chunk = nullptr, uint32_t Address = UINT32_MAX);
void setArchiveSymbol(const Archive::Symbol &Sym) { ArchiveSymbol = Sym; }
const Archive::Symbol &getArchiveSymbol() { return ArchiveSymbol; }