diff options
author | Rui Ueyama <ruiu@google.com> | 2017-10-08 03:45:49 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2017-10-08 03:45:49 +0000 |
commit | 0ae2c24c5d7ebf70a82abe38cae0d6eabb0df97f (patch) | |
tree | ccf75da2f5ef3622e3c07ffd2d7d58d4e8e2d2cc /lld/ELF/ScriptParser.cpp | |
parent | 656be311740744ad0a051b58dd080d1fe10aaf82 (diff) | |
download | bcm5719-llvm-0ae2c24c5d7ebf70a82abe38cae0d6eabb0df97f.tar.gz bcm5719-llvm-0ae2c24c5d7ebf70a82abe38cae0d6eabb0df97f.zip |
Use llvm::Optional instead of UINT_MAX to represent a null value.
llvm-svn: 315168
Diffstat (limited to 'lld/ELF/ScriptParser.cpp')
-rw-r--r-- | lld/ELF/ScriptParser.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lld/ELF/ScriptParser.cpp b/lld/ELF/ScriptParser.cpp index acd8b87fd74..6aa900380bd 100644 --- a/lld/ELF/ScriptParser.cpp +++ b/lld/ELF/ScriptParser.cpp @@ -388,25 +388,26 @@ void ScriptParser::readOutputFormat() { void ScriptParser::readPhdrs() { expect("{"); - while (!ErrorCount && !consume("}")) { - Script->Opt.PhdrsCommands.push_back( - {next(), PT_NULL, false, false, UINT_MAX, nullptr}); - PhdrsCommand &PhdrCmd = Script->Opt.PhdrsCommands.back(); - PhdrCmd.Type = readPhdrType(); + while (!ErrorCount && !consume("}")) { + PhdrsCommand Cmd; + Cmd.Name = next(); + Cmd.Type = readPhdrType(); while (!ErrorCount && !consume(";")) { if (consume("FILEHDR")) - PhdrCmd.HasFilehdr = true; + Cmd.HasFilehdr = true; else if (consume("PHDRS")) - PhdrCmd.HasPhdrs = true; + Cmd.HasPhdrs = true; else if (consume("AT")) - PhdrCmd.LMAExpr = readParenExpr(); + Cmd.LMAExpr = readParenExpr(); else if (consume("FLAGS")) - PhdrCmd.Flags = readParenExpr()().getValue(); + Cmd.Flags = readParenExpr()().getValue(); else setError("unexpected header attribute: " + next()); } + + Script->Opt.PhdrsCommands.push_back(Cmd); } } |