aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/llvm-ifs/llvm-ifs.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2022-06-25 11:55:57 -0700
committerKazu Hirata <kazu@google.com>2022-06-25 11:55:57 -0700
commitaa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d (patch)
treed207b35cfb445636f41204bcfe51f6ca3a94a3ba /llvm/tools/llvm-ifs/llvm-ifs.cpp
parentb8df4093e4d82c67a419911a46b63482043643e5 (diff)
downloadllvm-aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.zip
llvm-aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.tar.gz
llvm-aa8feeefd3ac6c78ee8f67bf033976fc7d68bc6d.tar.bz2
Don't use Optional::hasValue (NFC)
Diffstat (limited to 'llvm/tools/llvm-ifs/llvm-ifs.cpp')
-rw-r--r--llvm/tools/llvm-ifs/llvm-ifs.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/llvm/tools/llvm-ifs/llvm-ifs.cpp b/llvm/tools/llvm-ifs/llvm-ifs.cpp
index f9b6a8c..6909bd1 100644
--- a/llvm/tools/llvm-ifs/llvm-ifs.cpp
+++ b/llvm/tools/llvm-ifs/llvm-ifs.cpp
@@ -533,34 +533,33 @@ int main(int argc, char *argv[]) {
<< "Triple should be defined when output format is TBD";
return -1;
}
- return writeTbdStub(llvm::Triple(Stub.Target.Triple.getValue()),
+ return writeTbdStub(llvm::Triple(Stub.Target.Triple.value()),
Stub.Symbols, "TBD", Out);
}
case FileFormat::IFS: {
Stub.IfsVersion = IfsVersionCurrent;
- if (Config.InputFormat.getValue() == FileFormat::ELF &&
+ if (Config.InputFormat.value() == FileFormat::ELF &&
Config.HintIfsTarget) {
std::error_code HintEC(1, std::generic_category());
IFSTarget HintTarget = parseTriple(*Config.HintIfsTarget);
- if (Stub.Target.Arch.getValue() != HintTarget.Arch.getValue())
+ if (Stub.Target.Arch.value() != HintTarget.Arch.value())
fatalError(make_error<StringError>(
"Triple hint does not match the actual architecture", HintEC));
- if (Stub.Target.Endianness.getValue() !=
- HintTarget.Endianness.getValue())
+ if (Stub.Target.Endianness.value() != HintTarget.Endianness.value())
fatalError(make_error<StringError>(
"Triple hint does not match the actual endianness", HintEC));
- if (Stub.Target.BitWidth.getValue() != HintTarget.BitWidth.getValue())
+ if (Stub.Target.BitWidth.value() != HintTarget.BitWidth.value())
fatalError(make_error<StringError>(
"Triple hint does not match the actual bit width", HintEC));
stripIFSTarget(Stub, true, false, false, false);
- Stub.Target.Triple = Config.HintIfsTarget.getValue();
+ Stub.Target.Triple = Config.HintIfsTarget.value();
} else {
stripIFSTarget(Stub, Config.StripIfsTarget, Config.StripIfsArch,
Config.StripIfsEndianness, Config.StripIfsBitwidth);
}
Error IFSWriteError =
- writeIFS(Config.Output.getValue(), Stub, Config.WriteIfChanged);
+ writeIFS(Config.Output.value(), Stub, Config.WriteIfChanged);
if (IFSWriteError)
fatalError(std::move(IFSWriteError));
break;
@@ -589,29 +588,28 @@ int main(int argc, char *argv[]) {
}
if (Config.OutputIfs) {
Stub.IfsVersion = IfsVersionCurrent;
- if (Config.InputFormat.getValue() == FileFormat::ELF &&
+ if (Config.InputFormat.value() == FileFormat::ELF &&
Config.HintIfsTarget) {
std::error_code HintEC(1, std::generic_category());
IFSTarget HintTarget = parseTriple(*Config.HintIfsTarget);
- if (Stub.Target.Arch.getValue() != HintTarget.Arch.getValue())
+ if (Stub.Target.Arch.value() != HintTarget.Arch.value())
fatalError(make_error<StringError>(
"Triple hint does not match the actual architecture", HintEC));
- if (Stub.Target.Endianness.getValue() !=
- HintTarget.Endianness.getValue())
+ if (Stub.Target.Endianness.value() != HintTarget.Endianness.value())
fatalError(make_error<StringError>(
"Triple hint does not match the actual endianness", HintEC));
- if (Stub.Target.BitWidth.getValue() != HintTarget.BitWidth.getValue())
+ if (Stub.Target.BitWidth.value() != HintTarget.BitWidth.value())
fatalError(make_error<StringError>(
"Triple hint does not match the actual bit width", HintEC));
stripIFSTarget(Stub, true, false, false, false);
- Stub.Target.Triple = Config.HintIfsTarget.getValue();
+ Stub.Target.Triple = Config.HintIfsTarget.value();
} else {
stripIFSTarget(Stub, Config.StripIfsTarget, Config.StripIfsArch,
Config.StripIfsEndianness, Config.StripIfsBitwidth);
}
Error IFSWriteError =
- writeIFS(Config.OutputIfs.getValue(), Stub, Config.WriteIfChanged);
+ writeIFS(Config.OutputIfs.value(), Stub, Config.WriteIfChanged);
if (IFSWriteError)
fatalError(std::move(IFSWriteError));
}
@@ -628,8 +626,8 @@ int main(int argc, char *argv[]) {
<< "Triple should be defined when output format is TBD";
return -1;
}
- return writeTbdStub(llvm::Triple(Stub.Target.Triple.getValue()),
- Stub.Symbols, "TBD", Out);
+ return writeTbdStub(llvm::Triple(*Stub.Target.Triple), Stub.Symbols,
+ "TBD", Out);
}
}
return 0;