[ELF] - Apply clang-format to LinkerScript.cpp, NFC.

llvm-svn: 280911
This commit is contained in:
George Rimar 2016-09-08 08:20:30 +00:00
parent 884e786d38
commit 6c55f0e35e

View File

@ -44,8 +44,7 @@ using namespace lld::elf;
LinkerScriptBase *elf::ScriptBase; LinkerScriptBase *elf::ScriptBase;
ScriptConfiguration *elf::ScriptConfig; ScriptConfiguration *elf::ScriptConfig;
template <class ELFT> template <class ELFT> static void addRegular(SymbolAssignment *Cmd) {
static void addRegular(SymbolAssignment *Cmd) {
Symbol *Sym = Symtab<ELFT>::X->addRegular(Cmd->Name, STB_GLOBAL, STV_DEFAULT); Symbol *Sym = Symtab<ELFT>::X->addRegular(Cmd->Name, STB_GLOBAL, STV_DEFAULT);
Sym->Visibility = Cmd->Hidden ? STV_HIDDEN : STV_DEFAULT; Sym->Visibility = Cmd->Hidden ? STV_HIDDEN : STV_DEFAULT;
Cmd->Sym = Sym->body(); Cmd->Sym = Sym->body();
@ -214,8 +213,7 @@ LinkerScript<ELFT>::createInputSectionList(OutputSectionCommand &OutCmd) {
return Ret; return Ret;
} }
template <class ELFT> template <class ELFT> void LinkerScript<ELFT>::createAssignments() {
void LinkerScript<ELFT>::createAssignments() {
for (const std::unique_ptr<SymbolAssignment> &Cmd : Opt.Assignments) { for (const std::unique_ptr<SymbolAssignment> &Cmd : Opt.Assignments) {
if (shouldDefine<ELFT>(Cmd.get())) if (shouldDefine<ELFT>(Cmd.get()))
addRegular<ELFT>(Cmd.get()); addRegular<ELFT>(Cmd.get());
@ -842,7 +840,7 @@ void ScriptParser::readOutputFormat() {
next(); next();
StringRef Tok = next(); StringRef Tok = next();
if (Tok == ")") if (Tok == ")")
return; return;
if (Tok != ",") { if (Tok != ",") {
setError("unexpected token: " + Tok); setError("unexpected token: " + Tok);
return; return;
@ -1354,18 +1352,18 @@ std::vector<StringRef> ScriptParser::readOutputSectionPhdrs() {
unsigned ScriptParser::readPhdrType() { unsigned ScriptParser::readPhdrType() {
StringRef Tok = next(); StringRef Tok = next();
unsigned Ret = StringSwitch<unsigned>(Tok) unsigned Ret = StringSwitch<unsigned>(Tok)
.Case("PT_NULL", PT_NULL) .Case("PT_NULL", PT_NULL)
.Case("PT_LOAD", PT_LOAD) .Case("PT_LOAD", PT_LOAD)
.Case("PT_DYNAMIC", PT_DYNAMIC) .Case("PT_DYNAMIC", PT_DYNAMIC)
.Case("PT_INTERP", PT_INTERP) .Case("PT_INTERP", PT_INTERP)
.Case("PT_NOTE", PT_NOTE) .Case("PT_NOTE", PT_NOTE)
.Case("PT_SHLIB", PT_SHLIB) .Case("PT_SHLIB", PT_SHLIB)
.Case("PT_PHDR", PT_PHDR) .Case("PT_PHDR", PT_PHDR)
.Case("PT_TLS", PT_TLS) .Case("PT_TLS", PT_TLS)
.Case("PT_GNU_EH_FRAME", PT_GNU_EH_FRAME) .Case("PT_GNU_EH_FRAME", PT_GNU_EH_FRAME)
.Case("PT_GNU_STACK", PT_GNU_STACK) .Case("PT_GNU_STACK", PT_GNU_STACK)
.Case("PT_GNU_RELRO", PT_GNU_RELRO) .Case("PT_GNU_RELRO", PT_GNU_RELRO)
.Default(-1); .Default(-1);
if (Ret == (unsigned)-1) { if (Ret == (unsigned)-1) {
setError("invalid program header type: " + Tok); setError("invalid program header type: " + Tok);