[lld] r277794 - Simplify. NFC.
Rui Ueyama via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 4 18:25:46 PDT 2016
Author: ruiu
Date: Thu Aug 4 20:25:45 2016
New Revision: 277794
URL: http://llvm.org/viewvc/llvm-project?rev=277794&view=rev
Log:
Simplify. NFC.
Modified:
lld/trunk/ELF/LinkerScript.cpp
Modified: lld/trunk/ELF/LinkerScript.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/LinkerScript.cpp?rev=277794&r1=277793&r2=277794&view=diff
==============================================================================
--- lld/trunk/ELF/LinkerScript.cpp (original)
+++ lld/trunk/ELF/LinkerScript.cpp Thu Aug 4 20:25:45 2016
@@ -567,12 +567,8 @@ void ScriptParser::readAsNeeded() {
expect("(");
bool Orig = Config->AsNeeded;
Config->AsNeeded = true;
- while (!Error) {
- StringRef Tok = next();
- if (Tok == ")")
- break;
- addFile(Tok);
- }
+ while (!Error && !skip(")"))
+ addFile(next());
Config->AsNeeded = Orig;
}
@@ -587,25 +583,18 @@ void ScriptParser::readEntry() {
void ScriptParser::readExtern() {
expect("(");
- while (!Error) {
- StringRef Tok = next();
- if (Tok == ")")
- return;
- Config->Undefined.push_back(Tok);
- }
+ while (!Error && !skip(")"))
+ Config->Undefined.push_back(next());
}
void ScriptParser::readGroup() {
expect("(");
- while (!Error) {
+ while (!Error && !skip(")")) {
StringRef Tok = next();
- if (Tok == ")")
- return;
- if (Tok == "AS_NEEDED") {
+ if (Tok == "AS_NEEDED")
readAsNeeded();
- continue;
- }
- addFile(Tok);
+ else
+ addFile(Tok);
}
}
More information about the llvm-commits
mailing list