summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LinkerScript.cpp
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-10-08 03:45:49 +0000
committerRui Ueyama <ruiu@google.com>2017-10-08 03:45:49 +0000
commit0ae2c24c5d7ebf70a82abe38cae0d6eabb0df97f (patch)
treeccf75da2f5ef3622e3c07ffd2d7d58d4e8e2d2cc /lld/ELF/LinkerScript.cpp
parent656be311740744ad0a051b58dd080d1fe10aaf82 (diff)
downloadbcm5719-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/LinkerScript.cpp')
-rw-r--r--lld/ELF/LinkerScript.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp
index fcb1f847272..78c14d08d79 100644
--- a/lld/ELF/LinkerScript.cpp
+++ b/lld/ELF/LinkerScript.cpp
@@ -815,8 +815,7 @@ std::vector<PhdrEntry *> LinkerScript::createPhdrs() {
// Process PHDRS and FILEHDR keywords because they are not
// real output sections and cannot be added in the following loop.
for (const PhdrsCommand &Cmd : Opt.PhdrsCommands) {
- PhdrEntry *Phdr =
- make<PhdrEntry>(Cmd.Type, Cmd.Flags == UINT_MAX ? PF_R : Cmd.Flags);
+ PhdrEntry *Phdr = make<PhdrEntry>(Cmd.Type, Cmd.Flags ? *Cmd.Flags : PF_R);
if (Cmd.HasFilehdr)
Phdr->add(Out::ElfHeader);
@@ -835,7 +834,7 @@ std::vector<PhdrEntry *> LinkerScript::createPhdrs() {
// Assign headers specified by linker script
for (size_t Id : getPhdrIndices(Sec)) {
Ret[Id]->add(Sec);
- if (Opt.PhdrsCommands[Id].Flags == UINT_MAX)
+ if (!Opt.PhdrsCommands[Id].Flags.hasValue())
Ret[Id]->p_flags |= Sec->getPhdrFlags();
}
}
OpenPOWER on IntegriCloud