[lld] 5cff514 - Use value instead of getValue (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 15 20:03:25 PDT 2022
Author: Kazu Hirata
Date: 2022-07-15T20:03:13-07:00
New Revision: 5cff5142a894a184d5eef05339e1a5b41fb4c144
URL: https://github.com/llvm/llvm-project/commit/5cff5142a894a184d5eef05339e1a5b41fb4c144
DIFF: https://github.com/llvm/llvm-project/commit/5cff5142a894a184d5eef05339e1a5b41fb4c144.diff
LOG: Use value instead of getValue (NFC)
Added:
Modified:
clang-tools-extra/clang-doc/HTMLGenerator.cpp
clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp
clang-tools-extra/clangd/AST.cpp
clang-tools-extra/clangd/ClangdLSPServer.cpp
clang-tools-extra/clangd/ClangdServer.cpp
clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp
clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp
clang-tools-extra/clangd/unittests/HeaderSourceSwitchTests.cpp
clang-tools-extra/clangd/unittests/LSPBinderTests.cpp
clang-tools-extra/unittests/clang-tidy/NamespaceAliaserTest.cpp
clang-tools-extra/unittests/clang-tidy/UsingInserterTest.cpp
lld/ELF/InputFiles.cpp
lld/MachO/SectionPriorities.cpp
lld/wasm/InputChunks.h
lld/wasm/InputElement.h
lld/wasm/Writer.cpp
lldb/include/lldb/Target/MemoryRegionInfo.h
lldb/source/API/SBMemoryRegionInfo.cpp
lldb/source/Commands/CommandObjectFrame.cpp
lldb/source/Commands/CommandObjectMemory.cpp
lldb/source/Core/DumpDataExtractor.cpp
lldb/source/Core/ValueObjectChild.cpp
lldb/source/Host/common/File.cpp
lldb/source/Host/common/Terminal.cpp
lldb/source/Plugins/ABI/X86/ABIX86.cpp
lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
lldb/source/Target/Thread.cpp
lldb/source/Target/UnixSignals.cpp
lldb/source/Utility/SelectHelper.cpp
lldb/unittests/Host/ConnectionFileDescriptorTest.cpp
lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
lldb/unittests/Process/minidump/MinidumpParserTest.cpp
lldb/unittests/Target/FindFileTest.cpp
lldb/unittests/Utility/StringExtractorGDBRemoteTest.cpp
polly/lib/Exchange/JSONExporter.cpp
polly/lib/Transform/ManualOptimizer.cpp
polly/lib/Transform/MatmulOptimizer.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-doc/HTMLGenerator.cpp b/clang-tools-extra/clang-doc/HTMLGenerator.cpp
index 3e5a5331b7906..7456d96941dec 100644
--- a/clang-tools-extra/clang-doc/HTMLGenerator.cpp
+++ b/clang-tools-extra/clang-doc/HTMLGenerator.cpp
@@ -653,10 +653,10 @@ genHTML(const EnumInfo &I, const ClangDocContext &CDCtx) {
if (I.DefLoc) {
if (!CDCtx.RepositoryUrl)
- Out.emplace_back(writeFileDefinition(I.DefLoc.getValue()));
+ Out.emplace_back(writeFileDefinition(I.DefLoc.value()));
else
Out.emplace_back(writeFileDefinition(
- I.DefLoc.getValue(), StringRef{CDCtx.RepositoryUrl.getValue()}));
+ I.DefLoc.value(), StringRef{CDCtx.RepositoryUrl.value()}));
}
std::string Description;
@@ -702,10 +702,10 @@ genHTML(const FunctionInfo &I, const ClangDocContext &CDCtx,
if (I.DefLoc) {
if (!CDCtx.RepositoryUrl)
- Out.emplace_back(writeFileDefinition(I.DefLoc.getValue()));
+ Out.emplace_back(writeFileDefinition(I.DefLoc.value()));
else
Out.emplace_back(writeFileDefinition(
- I.DefLoc.getValue(), StringRef{CDCtx.RepositoryUrl.getValue()}));
+ I.DefLoc.value(), StringRef{CDCtx.RepositoryUrl.value()}));
}
std::string Description;
@@ -768,10 +768,10 @@ genHTML(const RecordInfo &I, Index &InfoIndex, const ClangDocContext &CDCtx,
if (I.DefLoc) {
if (!CDCtx.RepositoryUrl)
- Out.emplace_back(writeFileDefinition(I.DefLoc.getValue()));
+ Out.emplace_back(writeFileDefinition(I.DefLoc.value()));
else
Out.emplace_back(writeFileDefinition(
- I.DefLoc.getValue(), StringRef{CDCtx.RepositoryUrl.getValue()}));
+ I.DefLoc.value(), StringRef{CDCtx.RepositoryUrl.value()}));
}
std::string Description;
diff --git a/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp
index b2579e9ea615f..0f6a97eb84851 100644
--- a/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp
+++ b/clang-tools-extra/clang-tidy/bugprone/NotNullTerminatedResultCheck.cpp
@@ -818,7 +818,7 @@ void NotNullTerminatedResultCheck::check(
}
if (AreSafeFunctionsWanted)
- UseSafeFunctions = AreSafeFunctionsWanted.getValue();
+ UseSafeFunctions = AreSafeFunctionsWanted.value();
}
StringRef Name = FunctionExpr->getDirectCallee()->getName();
diff --git a/clang-tools-extra/clangd/AST.cpp b/clang-tools-extra/clangd/AST.cpp
index 4df043d18cfb7..53adf230beae0 100644
--- a/clang-tools-extra/clangd/AST.cpp
+++ b/clang-tools-extra/clangd/AST.cpp
@@ -793,7 +793,7 @@ class ForwardingCallVisitor
}
auto OptPackLocation = findPack(Args);
if (OptPackLocation) {
- size_t PackLocation = OptPackLocation.getValue();
+ size_t PackLocation = OptPackLocation.value();
ArrayRef<ParmVarDecl *> MatchingParams =
Callee->parameters().slice(PackLocation, Parameters.size());
// Check whether the function has a parameter pack as the last template
@@ -937,7 +937,7 @@ resolveForwardingParameters(const FunctionDecl *D, unsigned MaxDepth) {
break;
}
// If we found something: Fill in non-pack parameters
- auto Info = V.Info.getValue();
+ auto Info = V.Info.value();
HeadIt = std::copy(Info.Head.begin(), Info.Head.end(), HeadIt);
TailIt = std::copy(Info.Tail.rbegin(), Info.Tail.rend(), TailIt);
// Prepare next recursion level
diff --git a/clang-tools-extra/clangd/ClangdLSPServer.cpp b/clang-tools-extra/clangd/ClangdLSPServer.cpp
index faef5de14f3fb..0cc3792a0fdd2 100644
--- a/clang-tools-extra/clangd/ClangdLSPServer.cpp
+++ b/clang-tools-extra/clangd/ClangdLSPServer.cpp
@@ -665,8 +665,8 @@ void ClangdLSPServer::onDocumentDidChange(
const DidChangeTextDocumentParams &Params) {
auto WantDiags = WantDiagnostics::Auto;
if (Params.wantDiagnostics)
- WantDiags = Params.wantDiagnostics.getValue() ? WantDiagnostics::Yes
- : WantDiagnostics::No;
+ WantDiags = Params.wantDiagnostics.value() ? WantDiagnostics::Yes
+ : WantDiagnostics::No;
PathRef File = Params.textDocument.uri.file();
auto Code = Server->getDraft(File);
diff --git a/clang-tools-extra/clangd/ClangdServer.cpp b/clang-tools-extra/clangd/ClangdServer.cpp
index f28b322c0bbdd..c3e7242c19342 100644
--- a/clang-tools-extra/clangd/ClangdServer.cpp
+++ b/clang-tools-extra/clangd/ClangdServer.cpp
@@ -415,7 +415,7 @@ void ClangdServer::codeComplete(PathRef File, Position Pos,
if (SpecFuzzyFind && SpecFuzzyFind->NewReq) {
std::lock_guard<std::mutex> Lock(CachedCompletionFuzzyFindRequestMutex);
CachedCompletionFuzzyFindRequestByFile[File] =
- SpecFuzzyFind->NewReq.getValue();
+ SpecFuzzyFind->NewReq.value();
}
// SpecFuzzyFind is only destroyed after speculative fuzzy find finishes.
// We don't want `codeComplete` to wait for the async call if it doesn't use
diff --git a/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp b/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp
index 35c6fd4c89a0c..6af1e3bb74111 100644
--- a/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp
+++ b/clang-tools-extra/clangd/unittests/ConfigYAMLTests.cpp
@@ -82,12 +82,12 @@ CompileFlags: { Add: [foo, bar] }
EXPECT_THAT(Results[1].CompileFlags.Add, ElementsAre(val("b\naz\n")));
ASSERT_TRUE(Results[2].Index.Background);
- EXPECT_EQ("Skip", *Results[2].Index.Background.getValue());
+ EXPECT_EQ("Skip", *Results[2].Index.Background.value());
EXPECT_THAT(Results[3].Diagnostics.ClangTidy.CheckOptions,
ElementsAre(PairVal("IgnoreMacros", "true"),
PairVal("example-check.ExampleOption", "0")));
EXPECT_TRUE(Results[3].Diagnostics.UnusedIncludes);
- EXPECT_EQ("Strict", *Results[3].Diagnostics.UnusedIncludes.getValue());
+ EXPECT_EQ("Strict", *Results[3].Diagnostics.UnusedIncludes.value());
}
TEST(ParseYAML, Locations) {
@@ -163,10 +163,10 @@ TEST(ParseYAML, ExternalBlockNone) {
ASSERT_THAT(Diags.Diagnostics, IsEmpty());
ASSERT_EQ(Results.size(), 1u);
ASSERT_TRUE(Results[0].Index.External);
- EXPECT_FALSE(Results[0].Index.External.getValue()->File.has_value());
- EXPECT_FALSE(Results[0].Index.External.getValue()->MountPoint.has_value());
- EXPECT_FALSE(Results[0].Index.External.getValue()->Server.has_value());
- EXPECT_THAT(*Results[0].Index.External.getValue()->IsNone, testing::Eq(true));
+ EXPECT_FALSE(Results[0].Index.External.value()->File.has_value());
+ EXPECT_FALSE(Results[0].Index.External.value()->MountPoint.has_value());
+ EXPECT_FALSE(Results[0].Index.External.value()->Server.has_value());
+ EXPECT_THAT(*Results[0].Index.External.value()->IsNone, testing::Eq(true));
}
TEST(ParseYAML, ExternalBlock) {
@@ -182,10 +182,10 @@ TEST(ParseYAML, ExternalBlock) {
Fragment::parseYAML(YAML.code(), "config.yaml", Diags.callback());
ASSERT_EQ(Results.size(), 1u);
ASSERT_TRUE(Results[0].Index.External);
- EXPECT_THAT(*Results[0].Index.External.getValue()->File, val("foo"));
- EXPECT_THAT(*Results[0].Index.External.getValue()->MountPoint, val("baz"));
+ EXPECT_THAT(*Results[0].Index.External.value()->File, val("foo"));
+ EXPECT_THAT(*Results[0].Index.External.value()->MountPoint, val("baz"));
ASSERT_THAT(Diags.Diagnostics, IsEmpty());
- EXPECT_THAT(*Results[0].Index.External.getValue()->Server, val("bar"));
+ EXPECT_THAT(*Results[0].Index.External.value()->Server, val("bar"));
}
TEST(ParseYAML, AllScopes) {
diff --git a/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp b/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp
index e335c78a7364c..554cb0484a071 100644
--- a/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp
+++ b/clang-tools-extra/clangd/unittests/GlobalCompilationDatabaseTests.cpp
@@ -332,9 +332,9 @@ TEST(GlobalCompilationDatabaseTest, CompileFlagsDirectory) {
DirectoryBasedGlobalCompilationDatabase CDB(FS);
auto Commands = CDB.getCompileCommand(testPath("x/y.cpp"));
ASSERT_TRUE(Commands.has_value());
- EXPECT_THAT(Commands.getValue().CommandLine, Contains("-DFOO"));
+ EXPECT_THAT(Commands.value().CommandLine, Contains("-DFOO"));
// Make sure we pick the right working directory.
- EXPECT_EQ(testPath("x"), Commands.getValue().Directory);
+ EXPECT_EQ(testPath("x"), Commands.value().Directory);
}
MATCHER_P(hasArg, Flag, "") {
diff --git a/clang-tools-extra/clangd/unittests/HeaderSourceSwitchTests.cpp b/clang-tools-extra/clangd/unittests/HeaderSourceSwitchTests.cpp
index 97c10544a8a2b..a467da419972a 100644
--- a/clang-tools-extra/clangd/unittests/HeaderSourceSwitchTests.cpp
+++ b/clang-tools-extra/clangd/unittests/HeaderSourceSwitchTests.cpp
@@ -34,11 +34,11 @@ TEST(HeaderSourceSwitchTest, FileHeuristic) {
Optional<Path> PathResult =
getCorrespondingHeaderOrSource(FooCpp, FS.view(llvm::None));
EXPECT_TRUE(PathResult.has_value());
- ASSERT_EQ(PathResult.getValue(), FooH);
+ ASSERT_EQ(PathResult.value(), FooH);
PathResult = getCorrespondingHeaderOrSource(FooH, FS.view(llvm::None));
EXPECT_TRUE(PathResult.has_value());
- ASSERT_EQ(PathResult.getValue(), FooCpp);
+ ASSERT_EQ(PathResult.value(), FooCpp);
// Test with header file in capital letters and
diff erent extension, source
// file with
diff erent extension
@@ -49,7 +49,7 @@ TEST(HeaderSourceSwitchTest, FileHeuristic) {
FS.Files[FooHH];
PathResult = getCorrespondingHeaderOrSource(FooC, FS.view(llvm::None));
EXPECT_TRUE(PathResult.has_value());
- ASSERT_EQ(PathResult.getValue(), FooHH);
+ ASSERT_EQ(PathResult.value(), FooHH);
// Test with both capital letters
auto Foo2C = testPath("foo2.C");
@@ -58,7 +58,7 @@ TEST(HeaderSourceSwitchTest, FileHeuristic) {
FS.Files[Foo2HH];
PathResult = getCorrespondingHeaderOrSource(Foo2C, FS.view(llvm::None));
EXPECT_TRUE(PathResult.has_value());
- ASSERT_EQ(PathResult.getValue(), Foo2HH);
+ ASSERT_EQ(PathResult.value(), Foo2HH);
// Test with source file as capital letter and .hxx header file
auto Foo3C = testPath("foo3.C");
@@ -68,7 +68,7 @@ TEST(HeaderSourceSwitchTest, FileHeuristic) {
FS.Files[Foo3HXX];
PathResult = getCorrespondingHeaderOrSource(Foo3C, FS.view(llvm::None));
EXPECT_TRUE(PathResult.has_value());
- ASSERT_EQ(PathResult.getValue(), Foo3HXX);
+ ASSERT_EQ(PathResult.value(), Foo3HXX);
// Test if asking for a corresponding file that doesn't exist returns an empty
// string.
diff --git a/clang-tools-extra/clangd/unittests/LSPBinderTests.cpp b/clang-tools-extra/clangd/unittests/LSPBinderTests.cpp
index 97067b5382590..f640a4220bdeb 100644
--- a/clang-tools-extra/clangd/unittests/LSPBinderTests.cpp
+++ b/clang-tools-extra/clangd/unittests/LSPBinderTests.cpp
@@ -94,18 +94,18 @@ TEST(LSPBinderTest, IncomingCalls) {
auto &RawPlusOne = RawHandlers.MethodHandlers["plusOne"];
RawPlusOne(1, capture(Reply));
ASSERT_TRUE(Reply.has_value());
- EXPECT_THAT_EXPECTED(Reply.getValue(), llvm::HasValue(2));
+ EXPECT_THAT_EXPECTED(Reply.value(), llvm::HasValue(2));
RawPlusOne("foo", capture(Reply));
ASSERT_TRUE(Reply.has_value());
EXPECT_THAT_EXPECTED(
- Reply.getValue(),
+ Reply.value(),
llvm::FailedWithMessage(
HasSubstr("failed to decode plusOne request: expected integer")));
auto &RawFail = RawHandlers.MethodHandlers["fail"];
RawFail(2, capture(Reply));
ASSERT_TRUE(Reply.has_value());
- EXPECT_THAT_EXPECTED(Reply.getValue(), llvm::FailedWithMessage("X=2"));
+ EXPECT_THAT_EXPECTED(Reply.value(), llvm::FailedWithMessage("X=2"));
auto &RawNotify = RawHandlers.NotificationHandlers["notify"];
RawNotify(42);
@@ -118,7 +118,7 @@ TEST(LSPBinderTest, IncomingCalls) {
auto &RawCmdPlusOne = RawHandlers.CommandHandlers["cmdPlusOne"];
RawCmdPlusOne(1, capture(Reply));
ASSERT_TRUE(Reply.has_value());
- EXPECT_THAT_EXPECTED(Reply.getValue(), llvm::HasValue(2));
+ EXPECT_THAT_EXPECTED(Reply.value(), llvm::HasValue(2));
// None of this generated any outgoing traffic.
EXPECT_THAT(RawOutgoing.Received, IsEmpty());
@@ -140,7 +140,7 @@ TEST(LSPBinderTest, OutgoingCalls) {
Echo(Foo{2}, capture(Reply));
EXPECT_THAT(RawOutgoing.take("echo"), ElementsAre(llvm::json::Value(2)));
ASSERT_TRUE(Reply.has_value());
- EXPECT_THAT_EXPECTED(Reply.getValue(), llvm::HasValue(Foo{2}));
+ EXPECT_THAT_EXPECTED(Reply.value(), llvm::HasValue(Foo{2}));
// JSON response is integer, can't be parsed as string.
llvm::Optional<llvm::Expected<std::string>> WrongTypeReply;
@@ -148,14 +148,14 @@ TEST(LSPBinderTest, OutgoingCalls) {
EXPECT_THAT(RawOutgoing.take("wrongSignature"),
ElementsAre(llvm::json::Value(2)));
ASSERT_TRUE(Reply.has_value());
- EXPECT_THAT_EXPECTED(WrongTypeReply.getValue(),
+ EXPECT_THAT_EXPECTED(WrongTypeReply.value(),
llvm::FailedWithMessage(
HasSubstr("failed to decode wrongSignature reply")));
Fail(Foo{2}, capture(Reply));
EXPECT_THAT(RawOutgoing.take("fail"), ElementsAre(llvm::json::Value(2)));
ASSERT_TRUE(Reply.has_value());
- EXPECT_THAT_EXPECTED(Reply.getValue(), llvm::FailedWithMessage("Params=2"));
+ EXPECT_THAT_EXPECTED(Reply.value(), llvm::FailedWithMessage("Params=2"));
}
} // namespace
diff --git a/clang-tools-extra/unittests/clang-tidy/NamespaceAliaserTest.cpp b/clang-tools-extra/unittests/clang-tidy/NamespaceAliaserTest.cpp
index aa51231d363da..86a9a0fa2ac17 100644
--- a/clang-tools-extra/unittests/clang-tidy/NamespaceAliaserTest.cpp
+++ b/clang-tools-extra/unittests/clang-tidy/NamespaceAliaserTest.cpp
@@ -35,7 +35,7 @@ class InsertAliasCheck : public ClangTidyCheck {
auto Hint = Aliaser->createAlias(*Result.Context, *Call, "::foo::bar",
{"b", "some_alias"});
if (Hint)
- diag(Call->getBeginLoc(), "Fix for testing") << Hint.getValue();
+ diag(Call->getBeginLoc(), "Fix for testing") << Hint.value();
diag(Call->getBeginLoc(), "insert call") << FixItHint::CreateInsertion(
Call->getBeginLoc(),
diff --git a/clang-tools-extra/unittests/clang-tidy/UsingInserterTest.cpp b/clang-tools-extra/unittests/clang-tidy/UsingInserterTest.cpp
index edd644c452d33..9072befa6caa1 100644
--- a/clang-tools-extra/unittests/clang-tidy/UsingInserterTest.cpp
+++ b/clang-tools-extra/unittests/clang-tidy/UsingInserterTest.cpp
@@ -38,7 +38,7 @@ class InsertUsingCheck : public clang::tidy::ClangTidyCheck {
Inserter->createUsingDeclaration(*Result.Context, *Call, "::foo::func");
if (Hint)
- diag(Call->getBeginLoc(), "Fix for testing") << Hint.getValue();
+ diag(Call->getBeginLoc(), "Fix for testing") << Hint.value();
diag(Call->getBeginLoc(), "insert call")
<< clang::FixItHint::CreateReplacement(
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 0ea2a2c74b639..1feddf0b4033e 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -739,7 +739,7 @@ static void updateSupportedARMFeatures(const ARMAttributeParser &attributes) {
attributes.getAttributeValue(ARMBuildAttrs::CPU_arch);
if (!attr)
return;
- auto arch = attr.getValue();
+ auto arch = attr.value();
switch (arch) {
case ARMBuildAttrs::Pre_v4:
case ARMBuildAttrs::v4:
diff --git a/lld/MachO/SectionPriorities.cpp b/lld/MachO/SectionPriorities.cpp
index ac4878343ac04..fbc7796c3f8a7 100644
--- a/lld/MachO/SectionPriorities.cpp
+++ b/lld/MachO/SectionPriorities.cpp
@@ -370,7 +370,7 @@ macho::PriorityBuilder::buildInputSectionPriorities() {
if (!symbolPriority)
return;
size_t &priority = sectionPriorities[sym->isec];
- priority = std::max(priority, symbolPriority.getValue());
+ priority = std::max(priority, symbolPriority.value());
};
// TODO: Make sure this handles weak symbols correctly.
diff --git a/lld/wasm/InputChunks.h b/lld/wasm/InputChunks.h
index 49283e142b4de..203ad5ad947d3 100644
--- a/lld/wasm/InputChunks.h
+++ b/lld/wasm/InputChunks.h
@@ -274,10 +274,10 @@ class InputFunction : public InputChunk {
void setExportName(std::string exportName) { this->exportName = exportName; }
uint32_t getFunctionInputOffset() const { return getInputSectionOffset(); }
uint32_t getFunctionCodeOffset() const { return function->CodeOffset; }
- uint32_t getFunctionIndex() const { return functionIndex.getValue(); }
+ uint32_t getFunctionIndex() const { return functionIndex.value(); }
bool hasFunctionIndex() const { return functionIndex.has_value(); }
void setFunctionIndex(uint32_t index);
- uint32_t getTableIndex() const { return tableIndex.getValue(); }
+ uint32_t getTableIndex() const { return tableIndex.value(); }
bool hasTableIndex() const { return tableIndex.has_value(); }
void setTableIndex(uint32_t index);
void writeCompressed(uint8_t *buf) const;
diff --git a/lld/wasm/InputElement.h b/lld/wasm/InputElement.h
index 66f8e85ff3b7c..7d77a92bc7424 100644
--- a/lld/wasm/InputElement.h
+++ b/lld/wasm/InputElement.h
@@ -27,7 +27,7 @@ class InputElement {
public:
StringRef getName() const { return name; }
- uint32_t getAssignedIndex() const { return assignedIndex.getValue(); }
+ uint32_t getAssignedIndex() const { return assignedIndex.value(); }
bool hasAssignedIndex() const { return assignedIndex.has_value(); }
void assignIndex(uint32_t index) {
assert(!hasAssignedIndex());
diff --git a/lld/wasm/Writer.cpp b/lld/wasm/Writer.cpp
index fc5462a18bb78..f98c95526c9e0 100644
--- a/lld/wasm/Writer.cpp
+++ b/lld/wasm/Writer.cpp
@@ -449,7 +449,7 @@ void Writer::populateTargetFeatures() {
bool inferFeatures = !config->features.has_value();
if (!inferFeatures) {
- auto &explicitFeatures = config->features.getValue();
+ auto &explicitFeatures = config->features.value();
allowed.insert(explicitFeatures.begin(), explicitFeatures.end());
if (!config->checkFeatures)
goto done;
diff --git a/lldb/include/lldb/Target/MemoryRegionInfo.h b/lldb/include/lldb/Target/MemoryRegionInfo.h
index 3ef66b403e14b..cf38b6ea3345f 100644
--- a/lldb/include/lldb/Target/MemoryRegionInfo.h
+++ b/lldb/include/lldb/Target/MemoryRegionInfo.h
@@ -132,7 +132,7 @@ class MemoryRegionInfo {
void SetDirtyPageList(std::vector<lldb::addr_t> pagelist) {
if (m_dirty_pages)
- m_dirty_pages.getValue().clear();
+ m_dirty_pages.value().clear();
m_dirty_pages = std::move(pagelist);
}
diff --git a/lldb/source/API/SBMemoryRegionInfo.cpp b/lldb/source/API/SBMemoryRegionInfo.cpp
index e811bf31c7223..23d22fbe86c82 100644
--- a/lldb/source/API/SBMemoryRegionInfo.cpp
+++ b/lldb/source/API/SBMemoryRegionInfo.cpp
@@ -136,7 +136,7 @@ uint32_t SBMemoryRegionInfo::GetNumDirtyPages() {
const llvm::Optional<std::vector<addr_t>> &dirty_page_list =
m_opaque_up->GetDirtyPageList();
if (dirty_page_list)
- num_dirty_pages = dirty_page_list.getValue().size();
+ num_dirty_pages = dirty_page_list.value().size();
return num_dirty_pages;
}
@@ -147,8 +147,8 @@ addr_t SBMemoryRegionInfo::GetDirtyPageAddressAtIndex(uint32_t idx) {
addr_t dirty_page_addr = LLDB_INVALID_ADDRESS;
const llvm::Optional<std::vector<addr_t>> &dirty_page_list =
m_opaque_up->GetDirtyPageList();
- if (dirty_page_list && idx < dirty_page_list.getValue().size())
- dirty_page_addr = dirty_page_list.getValue()[idx];
+ if (dirty_page_list && idx < dirty_page_list.value().size())
+ dirty_page_addr = dirty_page_list.value()[idx];
return dirty_page_addr;
}
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index 8fdf8b08523fa..23954dd3c9fdc 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -144,10 +144,10 @@ class CommandObjectFrameDiagnose : public CommandObjectParsed {
"`frame diagnose --address` is incompatible with other arguments.");
return false;
}
- valobj_sp = frame_sp->GuessValueForAddress(m_options.address.getValue());
+ valobj_sp = frame_sp->GuessValueForAddress(m_options.address.value());
} else if (m_options.reg) {
valobj_sp = frame_sp->GuessValueForRegisterAndOffset(
- m_options.reg.getValue(), m_options.offset.value_or(0));
+ m_options.reg.value(), m_options.offset.value_or(0));
} else {
StopInfoSP stop_info_sp = thread->GetStopInfo();
if (!stop_info_sp) {
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index c11ae115c45eb..3c07d19b35b26 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -1739,7 +1739,7 @@ class CommandObjectMemoryRegion : public CommandObjectParsed {
const llvm::Optional<std::vector<addr_t>> &dirty_page_list =
range_info.GetDirtyPageList();
if (dirty_page_list) {
- const size_t page_count = dirty_page_list.getValue().size();
+ const size_t page_count = dirty_page_list.value().size();
result.AppendMessageWithFormat(
"Modified memory (dirty) page list provided, %zu entries.\n",
page_count);
diff --git a/lldb/source/Core/DumpDataExtractor.cpp b/lldb/source/Core/DumpDataExtractor.cpp
index dc96a3454b724..c48250b07d168 100644
--- a/lldb/source/Core/DumpDataExtractor.cpp
+++ b/lldb/source/Core/DumpDataExtractor.cpp
@@ -119,7 +119,7 @@ static lldb::offset_t DumpAPInt(Stream *s, const DataExtractor &data,
bool is_signed, unsigned radix) {
llvm::Optional<llvm::APInt> apint = GetAPInt(data, &offset, byte_size);
if (apint) {
- std::string apint_str = toString(apint.getValue(), radix, is_signed);
+ std::string apint_str = toString(apint.value(), radix, is_signed);
switch (radix) {
case 2:
s->Write("0b", 2);
@@ -672,7 +672,7 @@ lldb::offset_t lldb_private::DumpDataExtractor(
llvm::Optional<llvm::APInt> apint =
GetAPInt(DE, &offset, semantics_byte_size);
if (apint) {
- llvm::APFloat apfloat(semantics, apint.getValue());
+ llvm::APFloat apfloat(semantics, apint.value());
apfloat.toString(sv, format_precision, format_max_padding);
if (!sv.empty()) {
s->Printf("%*.*s", (int)sv.size(), (int)sv.size(), sv.data());
diff --git a/lldb/source/Core/ValueObjectChild.cpp b/lldb/source/Core/ValueObjectChild.cpp
index d61d2021c3180..ec29c029c1741 100644
--- a/lldb/source/Core/ValueObjectChild.cpp
+++ b/lldb/source/Core/ValueObjectChild.cpp
@@ -83,7 +83,7 @@ ConstString ValueObjectChild::GetDisplayTypeName() {
LazyBool ValueObjectChild::CanUpdateWithInvalidExecutionContext() {
if (m_can_update_with_invalid_exe_ctx)
- return m_can_update_with_invalid_exe_ctx.getValue();
+ return m_can_update_with_invalid_exe_ctx.value();
if (m_parent) {
ValueObject *opinionated_parent =
m_parent->FollowParentChain([](ValueObject *valobj) -> bool {
@@ -93,11 +93,11 @@ LazyBool ValueObjectChild::CanUpdateWithInvalidExecutionContext() {
if (opinionated_parent)
return (m_can_update_with_invalid_exe_ctx =
opinionated_parent->CanUpdateWithInvalidExecutionContext())
- .getValue();
+ .value();
}
return (m_can_update_with_invalid_exe_ctx =
this->ValueObject::CanUpdateWithInvalidExecutionContext())
- .getValue();
+ .value();
}
bool ValueObjectChild::UpdateValue() {
diff --git a/lldb/source/Host/common/File.cpp b/lldb/source/Host/common/File.cpp
index 760fb98fb496e..ce5283a613755 100644
--- a/lldb/source/Host/common/File.cpp
+++ b/lldb/source/Host/common/File.cpp
@@ -833,22 +833,20 @@ SerialPort::Create(int fd, OpenOptions options, Options serial_options,
if (llvm::Error error = term.SetRaw())
return std::move(error);
if (serial_options.BaudRate) {
- if (llvm::Error error =
- term.SetBaudRate(serial_options.BaudRate.getValue()))
+ if (llvm::Error error = term.SetBaudRate(serial_options.BaudRate.value()))
return std::move(error);
}
if (serial_options.Parity) {
- if (llvm::Error error = term.SetParity(serial_options.Parity.getValue()))
+ if (llvm::Error error = term.SetParity(serial_options.Parity.value()))
return std::move(error);
}
if (serial_options.ParityCheck) {
if (llvm::Error error =
- term.SetParityCheck(serial_options.ParityCheck.getValue()))
+ term.SetParityCheck(serial_options.ParityCheck.value()))
return std::move(error);
}
if (serial_options.StopBits) {
- if (llvm::Error error =
- term.SetStopBits(serial_options.StopBits.getValue()))
+ if (llvm::Error error = term.SetStopBits(serial_options.StopBits.value()))
return std::move(error);
}
diff --git a/lldb/source/Host/common/Terminal.cpp b/lldb/source/Host/common/Terminal.cpp
index 831e9dff4eb18..5da5ee8f14683 100644
--- a/lldb/source/Host/common/Terminal.cpp
+++ b/lldb/source/Host/common/Terminal.cpp
@@ -281,11 +281,11 @@ llvm::Error Terminal::SetBaudRate(unsigned int baud_rate) {
return llvm::createStringError(llvm::inconvertibleErrorCode(),
"baud rate %d unsupported by the platform",
baud_rate);
- if (::cfsetispeed(&fd_termios, val.getValue()) != 0)
+ if (::cfsetispeed(&fd_termios, val.value()) != 0)
return llvm::createStringError(
std::error_code(errno, std::generic_category()),
"setting input baud rate failed");
- if (::cfsetospeed(&fd_termios, val.getValue()) != 0)
+ if (::cfsetospeed(&fd_termios, val.value()) != 0)
return llvm::createStringError(
std::error_code(errno, std::generic_category()),
"setting output baud rate failed");
diff --git a/lldb/source/Plugins/ABI/X86/ABIX86.cpp b/lldb/source/Plugins/ABI/X86/ABIX86.cpp
index 2cd653fe2c5e8..ee568310d387e 100644
--- a/lldb/source/Plugins/ABI/X86/ABIX86.cpp
+++ b/lldb/source/Plugins/ABI/X86/ABIX86.cpp
@@ -100,8 +100,8 @@ addCombinedRegisters(std::vector<DynamicRegisterInfo::Register> ®s,
if (regdata1->subreg_name != regdata2->subreg_name)
continue;
- uint32_t base_index1 = regdata1->base_index.getValue();
- uint32_t base_index2 = regdata2->base_index.getValue();
+ uint32_t base_index1 = regdata1->base_index.value();
+ uint32_t base_index2 = regdata2->base_index.value();
if (regs[base_index1].byte_size != base_size ||
regs[base_index2].byte_size != base_size)
continue;
diff --git a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
index a774d5b61cfe7..fb404e985f803 100644
--- a/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
+++ b/lldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
@@ -1379,13 +1379,13 @@ const char *DisassemblerLLVMC::SymbolLookup(uint64_t value, uint64_t *type_ptr,
// then this is a pc-relative address calculation.
if (*type_ptr == LLVMDisassembler_ReferenceType_In_ARM64_ADDXri &&
m_adrp_insn && m_adrp_address == pc - 4 &&
- (m_adrp_insn.getValue() & 0x1f) == ((value >> 5) & 0x1f)) {
+ (m_adrp_insn.value() & 0x1f) == ((value >> 5) & 0x1f)) {
uint32_t addxri_inst;
uint64_t adrp_imm, addxri_imm;
// Get immlo and immhi bits, OR them together to get the ADRP imm
// value.
- adrp_imm = ((m_adrp_insn.getValue() & 0x00ffffe0) >> 3) |
- ((m_adrp_insn.getValue() >> 29) & 0x3);
+ adrp_imm = ((m_adrp_insn.value() & 0x00ffffe0) >> 3) |
+ ((m_adrp_insn.value() >> 29) & 0x3);
// if high bit of immhi after right-shifting set, sign extend
if (adrp_imm & (1ULL << 20))
adrp_imm |= ~((1ULL << 21) - 1);
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
index 89bee3e000c03..019b73780037c 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -218,10 +218,10 @@ void CPlusPlusLanguage::MethodName::Parse() {
} else {
CPlusPlusNameParser parser(m_full.GetStringRef());
if (auto function = parser.ParseAsFunctionDefinition()) {
- m_basename = function.getValue().name.basename;
- m_context = function.getValue().name.context;
- m_arguments = function.getValue().arguments;
- m_qualifiers = function.getValue().qualifiers;
+ m_basename = function.value().name.basename;
+ m_context = function.value().name.context;
+ m_arguments = function.value().arguments;
+ m_qualifiers = function.value().qualifiers;
m_parse_error = false;
} else {
m_parse_error = true;
@@ -329,8 +329,8 @@ bool CPlusPlusLanguage::ExtractContextAndIdentifier(
CPlusPlusNameParser parser(name);
if (auto full_name = parser.ParseAsFullName()) {
- identifier = full_name.getValue().basename;
- context = full_name.getValue().context;
+ identifier = full_name.value().basename;
+ context = full_name.value().context;
return true;
}
return false;
diff --git a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
index eca36fff18f83..a9a4e98775d93 100644
--- a/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
+++ b/lldb/source/Plugins/Language/CPlusPlus/CPlusPlusNameParser.cpp
@@ -55,8 +55,8 @@ Optional<ParsedName> CPlusPlusNameParser::ParseAsFullName() {
if (HasMoreTokens())
return None;
ParsedName result;
- result.basename = GetTextForRange(name_ranges.getValue().basename_range);
- result.context = GetTextForRange(name_ranges.getValue().context_range);
+ result.basename = GetTextForRange(name_ranges.value().basename_range);
+ result.context = GetTextForRange(name_ranges.value().context_range);
return result;
}
@@ -125,8 +125,8 @@ CPlusPlusNameParser::ParseFunctionImpl(bool expect_return_type) {
size_t end_position = GetCurrentPosition();
ParsedFunction result;
- result.name.basename = GetTextForRange(maybe_name.getValue().basename_range);
- result.name.context = GetTextForRange(maybe_name.getValue().context_range);
+ result.name.basename = GetTextForRange(maybe_name.value().basename_range);
+ result.name.context = GetTextForRange(maybe_name.value().context_range);
result.arguments = GetTextForRange(Range(argument_start, qualifiers_start));
result.qualifiers = GetTextForRange(Range(qualifiers_start, end_position));
start_position.Remove();
@@ -617,9 +617,9 @@ CPlusPlusNameParser::ParseFullNameImpl() {
ParsedNameRanges result;
if (last_coloncolon_position) {
result.context_range = Range(start_position.GetSavedPosition(),
- last_coloncolon_position.getValue());
+ last_coloncolon_position.value());
result.basename_range =
- Range(last_coloncolon_position.getValue() + 1, GetCurrentPosition());
+ Range(last_coloncolon_position.value() + 1, GetCurrentPosition());
} else {
result.basename_range =
Range(start_position.GetSavedPosition(), GetCurrentPosition());
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 81229dbe00459..a27e64d158ae2 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -6517,7 +6517,7 @@ bool ObjectFileMachO::SaveCore(const lldb::ProcessSP &process_sp,
const llvm::Optional<std::vector<addr_t>> &dirty_page_list =
range_info.GetDirtyPageList();
if (dirty_pages_only && dirty_page_list) {
- for (addr_t dirtypage : dirty_page_list.getValue()) {
+ for (addr_t dirtypage : dirty_page_list.value()) {
page_object obj;
obj.addr = dirtypage;
obj.size = pagesize;
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index 3803748be2971..f63b57fd4e628 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -2022,7 +2022,8 @@ lldb::ValueObjectSP Thread::GetSiginfoValue() {
llvm::Optional<uint64_t> type_size = type.GetByteSize(nullptr);
assert(type_size);
- llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>> data = GetSiginfo(type_size.getValue());
+ llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>> data =
+ GetSiginfo(type_size.value());
if (!data)
return ValueObjectConstResult::Create(&target, Status(data.takeError()));
diff --git a/lldb/source/Target/UnixSignals.cpp b/lldb/source/Target/UnixSignals.cpp
index 4ae848a98eddd..3ece3ee24cbe6 100644
--- a/lldb/source/Target/UnixSignals.cpp
+++ b/lldb/source/Target/UnixSignals.cpp
@@ -300,14 +300,13 @@ UnixSignals::GetFilteredSignals(llvm::Optional<bool> should_suppress,
// If any of filtering conditions are not met, we move on to the next
// signal.
- if (should_suppress &&
- signal_suppress != should_suppress.getValue())
+ if (should_suppress && signal_suppress != should_suppress.value())
continue;
- if (should_stop && signal_stop != should_stop.getValue())
+ if (should_stop && signal_stop != should_stop.value())
continue;
- if (should_notify && signal_notify != should_notify.getValue())
+ if (should_notify && signal_notify != should_notify.value())
continue;
result.push_back(signo);
diff --git a/lldb/source/Utility/SelectHelper.cpp b/lldb/source/Utility/SelectHelper.cpp
index a25bdfdaee8ec..05dbd1cce09d6 100644
--- a/lldb/source/Utility/SelectHelper.cpp
+++ b/lldb/source/Utility/SelectHelper.cpp
@@ -197,8 +197,8 @@ lldb_private::Status SelectHelper::Select() {
// Setup out relative timeout based on the end time if we have one
if (m_end_time) {
tv_ptr = &tv;
- const auto remaining_dur = duration_cast<microseconds>(
- m_end_time.getValue() - steady_clock::now());
+ const auto remaining_dur =
+ duration_cast<microseconds>(m_end_time.value() - steady_clock::now());
if (remaining_dur.count() > 0) {
// Wait for a specific amount of time
const auto dur_secs = duration_cast<seconds>(remaining_dur);
diff --git a/lldb/unittests/Host/ConnectionFileDescriptorTest.cpp b/lldb/unittests/Host/ConnectionFileDescriptorTest.cpp
index eb4b824c6c147..0c99d14dd6280 100644
--- a/lldb/unittests/Host/ConnectionFileDescriptorTest.cpp
+++ b/lldb/unittests/Host/ConnectionFileDescriptorTest.cpp
@@ -28,7 +28,7 @@ class ConnectionFileDescriptorTest : public testing::Test {
std::string uri(connection_file_descriptor.GetURI());
EXPECT_EQ((URI{"connect", ip, socket->GetRemotePortNumber(), "/"}),
- URI::Parse(uri).getValue());
+ URI::Parse(uri).value());
}
};
diff --git a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
index a57890c0733de..b80c44dfae828 100644
--- a/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
+++ b/lldb/unittests/Process/gdb-remote/GDBRemoteCommunicationClientTest.cpp
@@ -192,12 +192,12 @@ TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfo) {
auto result = async_result.get();
ASSERT_TRUE(result.has_value());
ASSERT_EQ(1u, result->size());
- EXPECT_EQ("/foo/bar.so", result.getValue()[0].GetFileSpec().GetPath());
- EXPECT_EQ(triple, result.getValue()[0].GetArchitecture().GetTriple());
+ EXPECT_EQ("/foo/bar.so", result.value()[0].GetFileSpec().GetPath());
+ EXPECT_EQ(triple, result.value()[0].GetArchitecture().GetTriple());
EXPECT_EQ(UUID::fromData("@ABCDEFGHIJKLMNO", 16),
- result.getValue()[0].GetUUID());
- EXPECT_EQ(0u, result.getValue()[0].GetObjectOffset());
- EXPECT_EQ(1234u, result.getValue()[0].GetObjectSize());
+ result.value()[0].GetUUID());
+ EXPECT_EQ(0u, result.value()[0].GetObjectOffset());
+ EXPECT_EQ(1234u, result.value()[0].GetObjectSize());
}
TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfo_UUID20) {
@@ -217,12 +217,12 @@ TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfo_UUID20) {
auto result = async_result.get();
ASSERT_TRUE(result.has_value());
ASSERT_EQ(1u, result->size());
- EXPECT_EQ("/foo/bar.so", result.getValue()[0].GetFileSpec().GetPath());
- EXPECT_EQ(triple, result.getValue()[0].GetArchitecture().GetTriple());
+ EXPECT_EQ("/foo/bar.so", result.value()[0].GetFileSpec().GetPath());
+ EXPECT_EQ(triple, result.value()[0].GetArchitecture().GetTriple());
EXPECT_EQ(UUID::fromData("@ABCDEFGHIJKLMNOPQRS", 20),
- result.getValue()[0].GetUUID());
- EXPECT_EQ(0u, result.getValue()[0].GetObjectOffset());
- EXPECT_EQ(1234u, result.getValue()[0].GetObjectSize());
+ result.value()[0].GetUUID());
+ EXPECT_EQ(0u, result.value()[0].GetObjectOffset());
+ EXPECT_EQ(1234u, result.value()[0].GetObjectSize());
}
TEST_F(GDBRemoteCommunicationClientTest, GetModulesInfoInvalidResponse) {
diff --git a/lldb/unittests/Process/minidump/MinidumpParserTest.cpp b/lldb/unittests/Process/minidump/MinidumpParserTest.cpp
index 55e1609aa5a78..ec6378dd5b820 100644
--- a/lldb/unittests/Process/minidump/MinidumpParserTest.cpp
+++ b/lldb/unittests/Process/minidump/MinidumpParserTest.cpp
@@ -219,7 +219,7 @@ TEST_F(MinidumpParserTest, GetPid) {
llvm::Succeeded());
llvm::Optional<lldb::pid_t> pid = parser->GetPid();
ASSERT_TRUE(pid.has_value());
- ASSERT_EQ(16001UL, pid.getValue());
+ ASSERT_EQ(16001UL, pid.value());
}
TEST_F(MinidumpParserTest, GetFilteredModuleList) {
@@ -545,14 +545,14 @@ TEST_F(MinidumpParserTest, GetMiscInfoWindows) {
ASSERT_NE(nullptr, misc_info);
llvm::Optional<lldb::pid_t> pid = misc_info->GetPid();
ASSERT_TRUE(pid.has_value());
- ASSERT_EQ(4440UL, pid.getValue());
+ ASSERT_EQ(4440UL, pid.value());
}
TEST_F(MinidumpParserTest, GetPidWindows) {
SetUpData("fizzbuzz_no_heap.dmp");
llvm::Optional<lldb::pid_t> pid = parser->GetPid();
ASSERT_TRUE(pid.has_value());
- ASSERT_EQ(4440UL, pid.getValue());
+ ASSERT_EQ(4440UL, pid.value());
}
// wow64
@@ -560,7 +560,7 @@ TEST_F(MinidumpParserTest, GetPidWow64) {
SetUpData("fizzbuzz_wow64.dmp");
llvm::Optional<lldb::pid_t> pid = parser->GetPid();
ASSERT_TRUE(pid.has_value());
- ASSERT_EQ(7836UL, pid.getValue());
+ ASSERT_EQ(7836UL, pid.value());
}
// Register tests
diff --git a/lldb/unittests/Target/FindFileTest.cpp b/lldb/unittests/Target/FindFileTest.cpp
index 77d374d1f498d..9e991605e13c4 100644
--- a/lldb/unittests/Target/FindFileTest.cpp
+++ b/lldb/unittests/Target/FindFileTest.cpp
@@ -56,7 +56,7 @@ static void TestFileFindings(const PathMappingList &map,
llvm::Optional<FileSpec> remapped;
EXPECT_TRUE(bool(remapped = map.FindFile(match.original)));
- EXPECT_TRUE(FileSpec(remapped.getValue()).GetPath() ==
+ EXPECT_TRUE(FileSpec(remapped.value()).GetPath() ==
ConstString(match.remapped).GetStringRef());
}
}
diff --git a/lldb/unittests/Utility/StringExtractorGDBRemoteTest.cpp b/lldb/unittests/Utility/StringExtractorGDBRemoteTest.cpp
index 88362c028a9db..922167c342d90 100644
--- a/lldb/unittests/Utility/StringExtractorGDBRemoteTest.cpp
+++ b/lldb/unittests/Utility/StringExtractorGDBRemoteTest.cpp
@@ -109,77 +109,77 @@ TEST(StringExtractorGDBRemoteTest, GetPidTid) {
// pure thread id
ex.Reset("-1");
- EXPECT_THAT(ex.GetPidTid(100).getValue(),
+ EXPECT_THAT(ex.GetPidTid(100).value(),
::testing::Pair(100, StringExtractorGDBRemote::AllThreads));
ex.Reset("1234");
- EXPECT_THAT(ex.GetPidTid(100).getValue(), ::testing::Pair(100, 0x1234ULL));
+ EXPECT_THAT(ex.GetPidTid(100).value(), ::testing::Pair(100, 0x1234ULL));
ex.Reset("123456789ABCDEF0");
- EXPECT_THAT(ex.GetPidTid(100).getValue(),
+ EXPECT_THAT(ex.GetPidTid(100).value(),
::testing::Pair(100, 0x123456789ABCDEF0ULL));
// pure process id
ex.Reset("p-1");
- EXPECT_THAT(ex.GetPidTid(100).getValue(),
+ EXPECT_THAT(ex.GetPidTid(100).value(),
::testing::Pair(StringExtractorGDBRemote::AllProcesses,
StringExtractorGDBRemote::AllThreads));
ex.Reset("p1234");
- EXPECT_THAT(ex.GetPidTid(100).getValue(),
+ EXPECT_THAT(ex.GetPidTid(100).value(),
::testing::Pair(0x1234ULL, StringExtractorGDBRemote::AllThreads));
ex.Reset("p123456789ABCDEF0");
- EXPECT_THAT(ex.GetPidTid(100).getValue(),
+ EXPECT_THAT(ex.GetPidTid(100).value(),
::testing::Pair(0x123456789ABCDEF0ULL,
StringExtractorGDBRemote::AllThreads));
ex.Reset("pFFFFFFFFFFFFFFFF");
- EXPECT_THAT(ex.GetPidTid(100).getValue(),
+ EXPECT_THAT(ex.GetPidTid(100).value(),
::testing::Pair(StringExtractorGDBRemote::AllProcesses,
StringExtractorGDBRemote::AllThreads));
// combined thread id + process id
ex.Reset("p-1.-1");
- EXPECT_THAT(ex.GetPidTid(100).getValue(),
+ EXPECT_THAT(ex.GetPidTid(100).value(),
::testing::Pair(StringExtractorGDBRemote::AllProcesses,
StringExtractorGDBRemote::AllThreads));
ex.Reset("p1234.-1");
- EXPECT_THAT(ex.GetPidTid(100).getValue(),
+ EXPECT_THAT(ex.GetPidTid(100).value(),
::testing::Pair(0x1234ULL, StringExtractorGDBRemote::AllThreads));
ex.Reset("p1234.123456789ABCDEF0");
- EXPECT_THAT(ex.GetPidTid(100).getValue(),
+ EXPECT_THAT(ex.GetPidTid(100).value(),
::testing::Pair(0x1234ULL, 0x123456789ABCDEF0ULL));
ex.Reset("p123456789ABCDEF0.-1");
- EXPECT_THAT(ex.GetPidTid(100).getValue(),
+ EXPECT_THAT(ex.GetPidTid(100).value(),
::testing::Pair(0x123456789ABCDEF0ULL,
StringExtractorGDBRemote::AllThreads));
ex.Reset("p123456789ABCDEF0.1234");
- EXPECT_THAT(ex.GetPidTid(100).getValue(),
+ EXPECT_THAT(ex.GetPidTid(100).value(),
::testing::Pair(0x123456789ABCDEF0ULL, 0x1234ULL));
ex.Reset("p123456789ABCDEF0.123456789ABCDEF0");
- EXPECT_THAT(ex.GetPidTid(100).getValue(),
+ EXPECT_THAT(ex.GetPidTid(100).value(),
::testing::Pair(0x123456789ABCDEF0ULL, 0x123456789ABCDEF0ULL));
ex.Reset("p123456789ABCDEF0.123456789ABCDEF0");
- EXPECT_THAT(ex.GetPidTid(100).getValue(),
+ EXPECT_THAT(ex.GetPidTid(100).value(),
::testing::Pair(0x123456789ABCDEF0ULL, 0x123456789ABCDEF0ULL));
}
TEST(StringExtractorGDBRemoteTest, GetPidTidMultipleValues) {
StringExtractorGDBRemote ex("1234;p12;p1234.-1");
- ASSERT_THAT(ex.GetPidTid(100).getValue(), ::testing::Pair(100, 0x1234ULL));
+ ASSERT_THAT(ex.GetPidTid(100).value(), ::testing::Pair(100, 0x1234ULL));
ASSERT_EQ(ex.GetChar(), ';');
- ASSERT_THAT(ex.GetPidTid(100).getValue(),
+ ASSERT_THAT(ex.GetPidTid(100).value(),
::testing::Pair(0x12ULL, StringExtractorGDBRemote::AllThreads));
ASSERT_EQ(ex.GetChar(), ';');
- ASSERT_THAT(ex.GetPidTid(100).getValue(),
+ ASSERT_THAT(ex.GetPidTid(100).value(),
::testing::Pair(0x1234ULL, StringExtractorGDBRemote::AllThreads));
}
diff --git a/polly/lib/Exchange/JSONExporter.cpp b/polly/lib/Exchange/JSONExporter.cpp
index ca9c1b8b6ef63..995af209035bb 100644
--- a/polly/lib/Exchange/JSONExporter.cpp
+++ b/polly/lib/Exchange/JSONExporter.cpp
@@ -218,8 +218,8 @@ static bool importContext(Scop &S, const json::Object &JScop) {
return false;
}
- isl::set NewContext = isl::set{S.getIslCtx().get(),
- JScop.getString("context").getValue().str()};
+ isl::set NewContext =
+ isl::set{S.getIslCtx().get(), JScop.getString("context").value().str()};
// Check whether the context was parsed successfully.
if (NewContext.is_null()) {
@@ -293,7 +293,7 @@ static bool importSchedule(Scop &S, const json::Object &JScop,
assert(Schedule.has_value() &&
"Schedules that contain extension nodes require special handling.");
isl_map *Map = isl_map_read_from_str(S.getIslCtx().get(),
- Schedule.getValue().str().c_str());
+ Schedule.value().str().c_str());
// Check whether the schedule was parsed successfully
if (!Map) {
@@ -575,14 +575,14 @@ static bool areArraysEqual(ScopArrayInfo *SAI, const json::Object &Array) {
for (unsigned i = 1; i < Array.getArray("sizes")->size(); i++) {
SAI->getDimensionSize(i)->print(RawStringOstream);
const json::Array &SizesArray = *Array.getArray("sizes");
- if (RawStringOstream.str() != SizesArray[i].getAsString().getValue())
+ if (RawStringOstream.str() != SizesArray[i].getAsString().value())
return false;
Buffer.clear();
}
// Check if key 'type'
diff ers from the current one or is not valid.
SAI->getElementType()->print(RawStringOstream);
- if (RawStringOstream.str() != Array.getString("type").getValue()) {
+ if (RawStringOstream.str() != Array.getString("type").value()) {
errs() << "Array has not a valid type.\n";
return false;
}
@@ -653,7 +653,7 @@ static bool importArrays(Scop &S, const json::Object &JScop) {
for (; ArrayIdx < Arrays.size(); ArrayIdx++) {
const json::Object &Array = *Arrays[ArrayIdx].getAsObject();
auto *ElementType =
- parseTextType(Array.get("type")->getAsString().getValue().str(),
+ parseTextType(Array.get("type")->getAsString().value().str(),
S.getSE()->getContext());
if (!ElementType) {
errs() << "Error while parsing element type for new array.\n";
@@ -674,10 +674,10 @@ static bool importArrays(Scop &S, const json::Object &JScop) {
}
auto NewSAI = S.createScopArrayInfo(
- ElementType, Array.getString("name").getValue().str(), DimSizes);
+ ElementType, Array.getString("name").value().str(), DimSizes);
if (Array.get("allocation")) {
- NewSAI->setIsOnHeap(Array.getString("allocation").getValue() == "heap");
+ NewSAI->setIsOnHeap(Array.getString("allocation").value() == "heap");
}
}
diff --git a/polly/lib/Transform/ManualOptimizer.cpp b/polly/lib/Transform/ManualOptimizer.cpp
index 640ae0a859af8..cf1aa6c7491bd 100644
--- a/polly/lib/Transform/ManualOptimizer.cpp
+++ b/polly/lib/Transform/ManualOptimizer.cpp
@@ -43,7 +43,7 @@ static TransformationMode hasUnrollTransformation(MDNode *LoopID) {
Optional<int> Count =
getOptionalIntLoopAttribute(LoopID, "llvm.loop.unroll.count");
if (Count)
- return Count.getValue() == 1 ? TM_SuppressedByUser : TM_ForcedByUser;
+ return Count.value() == 1 ? TM_SuppressedByUser : TM_ForcedByUser;
if (getBooleanLoopAttribute(LoopID, "llvm.loop.unroll.enable"))
return TM_ForcedByUser;
diff --git a/polly/lib/Transform/MatmulOptimizer.cpp b/polly/lib/Transform/MatmulOptimizer.cpp
index 4120cd82a8e05..3e0e06cef869c 100644
--- a/polly/lib/Transform/MatmulOptimizer.cpp
+++ b/polly/lib/Transform/MatmulOptimizer.cpp
@@ -568,20 +568,20 @@ static void getTargetCacheParameters(const llvm::TargetTransformInfo *TTI) {
auto L2DCache = llvm::TargetTransformInfo::CacheLevel::L2D;
if (FirstCacheLevelSize == -1) {
if (TTI->getCacheSize(L1DCache))
- FirstCacheLevelSize = TTI->getCacheSize(L1DCache).getValue();
+ FirstCacheLevelSize = TTI->getCacheSize(L1DCache).value();
else
FirstCacheLevelSize = static_cast<int>(FirstCacheLevelDefaultSize);
}
if (SecondCacheLevelSize == -1) {
if (TTI->getCacheSize(L2DCache))
- SecondCacheLevelSize = TTI->getCacheSize(L2DCache).getValue();
+ SecondCacheLevelSize = TTI->getCacheSize(L2DCache).value();
else
SecondCacheLevelSize = static_cast<int>(SecondCacheLevelDefaultSize);
}
if (FirstCacheLevelAssociativity == -1) {
if (TTI->getCacheAssociativity(L1DCache))
FirstCacheLevelAssociativity =
- TTI->getCacheAssociativity(L1DCache).getValue();
+ TTI->getCacheAssociativity(L1DCache).value();
else
FirstCacheLevelAssociativity =
static_cast<int>(FirstCacheLevelDefaultAssociativity);
@@ -589,7 +589,7 @@ static void getTargetCacheParameters(const llvm::TargetTransformInfo *TTI) {
if (SecondCacheLevelAssociativity == -1) {
if (TTI->getCacheAssociativity(L2DCache))
SecondCacheLevelAssociativity =
- TTI->getCacheAssociativity(L2DCache).getValue();
+ TTI->getCacheAssociativity(L2DCache).value();
else
SecondCacheLevelAssociativity =
static_cast<int>(SecondCacheLevelDefaultAssociativity);
More information about the llvm-commits
mailing list