[clang] cb2c8f6 - [clang] Use value instead of getValue (NFC)
Kazu Hirata via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 13 23:39:39 PDT 2022
Author: Kazu Hirata
Date: 2022-07-13T23:39:33-07:00
New Revision: cb2c8f694db15c488f46de6db5a7db444a189fc4
URL: https://github.com/llvm/llvm-project/commit/cb2c8f694db15c488f46de6db5a7db444a189fc4
DIFF: https://github.com/llvm/llvm-project/commit/cb2c8f694db15c488f46de6db5a7db444a189fc4.diff
LOG: [clang] Use value instead of getValue (NFC)
Added:
Modified:
clang/include/clang/AST/PropertiesBase.td
clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h
clang/include/clang/Support/RISCVVIntrinsicUtils.h
clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
clang/lib/AST/AttrImpl.cpp
clang/lib/Analysis/BodyFarm.cpp
clang/lib/Analysis/FlowSensitive/ControlFlowContext.cpp
clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp
clang/lib/Analysis/PathDiagnostic.cpp
clang/lib/Analysis/UninitializedValues.cpp
clang/lib/Basic/Targets/RISCV.cpp
clang/lib/CodeGen/CGClass.cpp
clang/lib/Driver/Driver.cpp
clang/lib/Driver/ToolChains/AVR.cpp
clang/lib/Driver/ToolChains/Clang.cpp
clang/lib/Driver/ToolChains/Gnu.cpp
clang/lib/Driver/ToolChains/Hexagon.cpp
clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
clang/lib/Frontend/CompilerInstance.cpp
clang/lib/Frontend/CompilerInvocation.cpp
clang/lib/Frontend/InitPreprocessor.cpp
clang/lib/Lex/DependencyDirectivesScanner.cpp
clang/lib/Lex/MacroInfo.cpp
clang/lib/Lex/ModuleMap.cpp
clang/lib/Lex/PPMacroExpansion.cpp
clang/lib/Lex/PreprocessingRecord.cpp
clang/lib/Parse/ParseOpenMP.cpp
clang/lib/Sema/SemaCUDA.cpp
clang/lib/Sema/SemaChecking.cpp
clang/lib/Sema/SemaDecl.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/lib/Sema/SemaOpenMP.cpp
clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
clang/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp
clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
clang/lib/Support/RISCVVIntrinsicUtils.cpp
clang/tools/driver/driver.cpp
clang/tools/libclang/CIndex.cpp
clang/unittests/Analysis/MacroExpansionContextTest.cpp
clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp
clang/unittests/Lex/HeaderSearchTest.cpp
clang/utils/TableGen/RISCVVEmitter.cpp
Removed:
################################################################################
diff --git a/clang/include/clang/AST/PropertiesBase.td b/clang/include/clang/AST/PropertiesBase.td
index 559f29edcf0fe..ec310a459927d 100644
--- a/clang/include/clang/AST/PropertiesBase.td
+++ b/clang/include/clang/AST/PropertiesBase.td
@@ -520,15 +520,15 @@ let Class = PropertyTypeCase<APValue, "LValue"> in {
if (hasBase) {
if (isTypeInfo) {
base = APValue::LValueBase::getTypeInfo(
- TypeInfoLValue(typeInfo.getValue().getTypePtr()), type.getValue());
+ TypeInfoLValue(typeInfo.value().getTypePtr()), type.value());
elemTy = base.getTypeInfoType();
} else if (isExpr) {
- base = APValue::LValueBase(cast<Expr>(stmt.getValue()),
- callIndex.getValue(), version.getValue());
+ base = APValue::LValueBase(cast<Expr>(stmt.value()),
+ callIndex.value(), version.value());
elemTy = base.get<const Expr *>()->getType();
} else {
- base = APValue::LValueBase(cast<ValueDecl>(decl.getValue()),
- callIndex.getValue(), version.getValue());
+ base = APValue::LValueBase(cast<ValueDecl>(decl.value()),
+ callIndex.value(), version.value());
elemTy = base.get<const ValueDecl *>()->getType();
}
}
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
index 15295e4f6e4ac..50a27a211ef0f 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
@@ -1019,7 +1019,7 @@ class CXXAllocatorCall : public AnyFunctionCall {
SVal getObjectUnderConstruction() const {
return ExprEngine::getObjectUnderConstruction(getState(), getOriginExpr(),
getLocationContext())
- .getValue();
+ .value();
}
/// Number of non-placement arguments to the call. It is equal to 2 for
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
index f1f5169f63c0b..22b405919bc17 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ConstraintManager.h
@@ -53,10 +53,10 @@ class ConditionTruthVal {
}
/// Return true if the constraint is perfectly constrained to 'true'.
- bool isConstrainedTrue() const { return Val && Val.getValue(); }
+ bool isConstrainedTrue() const { return Val && Val.value(); }
/// Return true if the constraint is perfectly constrained to 'false'.
- bool isConstrainedFalse() const { return Val && !Val.getValue(); }
+ bool isConstrainedFalse() const { return Val && !Val.value(); }
/// Return true if the constrained is perfectly constrained.
bool isConstrained() const { return Val.has_value(); }
diff --git a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h
index 61cab28918dbe..cf515c5a809a1 100644
--- a/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h
+++ b/clang/include/clang/StaticAnalyzer/Core/PathSensitive/SMTConstraintManager.h
@@ -344,7 +344,7 @@ class SMTConstraintManager : public clang::ento::SimpleConstraintManager {
if (!res)
Cached[hash] = ConditionTruthVal();
else
- Cached[hash] = ConditionTruthVal(res.getValue());
+ Cached[hash] = ConditionTruthVal(res.value());
return Cached[hash];
}
diff --git a/clang/include/clang/Support/RISCVVIntrinsicUtils.h b/clang/include/clang/Support/RISCVVIntrinsicUtils.h
index 3331f57728d1a..a5e7e6d35cc8c 100644
--- a/clang/include/clang/Support/RISCVVIntrinsicUtils.h
+++ b/clang/include/clang/Support/RISCVVIntrinsicUtils.h
@@ -209,8 +209,8 @@ class RVVType {
}
bool isValid() const { return Valid; }
- bool isScalar() const { return Scale && Scale.getValue() == 0; }
- bool isVector() const { return Scale && Scale.getValue() != 0; }
+ bool isScalar() const { return Scale && Scale.value() == 0; }
+ bool isVector() const { return Scale && Scale.value() != 0; }
bool isVector(unsigned Width) const {
return isVector() && ElementBitwidth == Width;
}
diff --git a/clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h b/clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
index 219c68933a363..b3882c227eaff 100644
--- a/clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
+++ b/clang/include/clang/Tooling/DependencyScanning/DependencyScanningFilesystem.h
@@ -96,7 +96,7 @@ class CachedFileSystemEntry {
if (auto *Directives = Contents->DepDirectives.load()) {
if (Directives->has_value())
return ArrayRef<dependency_directives_scan::Directive>(
- Directives->getValue());
+ Directives->value());
}
return None;
}
diff --git a/clang/lib/AST/AttrImpl.cpp b/clang/lib/AST/AttrImpl.cpp
index c1e7435b22dac..deb28bee5ed8c 100644
--- a/clang/lib/AST/AttrImpl.cpp
+++ b/clang/lib/AST/AttrImpl.cpp
@@ -169,7 +169,7 @@ llvm::Optional<OMPDeclareTargetDeclAttr::MapTypeTy>
OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration(const ValueDecl *VD) {
llvm::Optional<OMPDeclareTargetDeclAttr *> ActiveAttr = getActiveAttr(VD);
if (ActiveAttr)
- return ActiveAttr.getValue()->getMapType();
+ return ActiveAttr.value()->getMapType();
return llvm::None;
}
@@ -177,7 +177,7 @@ llvm::Optional<OMPDeclareTargetDeclAttr::DevTypeTy>
OMPDeclareTargetDeclAttr::getDeviceType(const ValueDecl *VD) {
llvm::Optional<OMPDeclareTargetDeclAttr *> ActiveAttr = getActiveAttr(VD);
if (ActiveAttr)
- return ActiveAttr.getValue()->getDevType();
+ return ActiveAttr.value()->getDevType();
return llvm::None;
}
@@ -185,7 +185,7 @@ llvm::Optional<SourceLocation>
OMPDeclareTargetDeclAttr::getLocation(const ValueDecl *VD) {
llvm::Optional<OMPDeclareTargetDeclAttr *> ActiveAttr = getActiveAttr(VD);
if (ActiveAttr)
- return ActiveAttr.getValue()->getRange().getBegin();
+ return ActiveAttr.value()->getRange().getBegin();
return llvm::None;
}
diff --git a/clang/lib/Analysis/BodyFarm.cpp b/clang/lib/Analysis/BodyFarm.cpp
index 23d37b881069f..38f100ae0a4fc 100644
--- a/clang/lib/Analysis/BodyFarm.cpp
+++ b/clang/lib/Analysis/BodyFarm.cpp
@@ -699,7 +699,7 @@ static Stmt *create_OSAtomicCompareAndSwap(ASTContext &C, const FunctionDecl *D)
Stmt *BodyFarm::getBody(const FunctionDecl *D) {
Optional<Stmt *> &Val = Bodies[D];
if (Val)
- return Val.getValue();
+ return Val.value();
Val = nullptr;
@@ -874,7 +874,7 @@ Stmt *BodyFarm::getBody(const ObjCMethodDecl *D) {
Optional<Stmt *> &Val = Bodies[D];
if (Val)
- return Val.getValue();
+ return Val.value();
Val = nullptr;
// For now, we only synthesize getters.
diff --git a/clang/lib/Analysis/FlowSensitive/ControlFlowContext.cpp b/clang/lib/Analysis/FlowSensitive/ControlFlowContext.cpp
index fe9907a7c99b0..58708b5b5efb6 100644
--- a/clang/lib/Analysis/FlowSensitive/ControlFlowContext.cpp
+++ b/clang/lib/Analysis/FlowSensitive/ControlFlowContext.cpp
@@ -36,7 +36,7 @@ buildStmtToBasicBlockMap(const CFG &Cfg) {
if (!Stmt)
continue;
- StmtToBlock[Stmt.getValue().getStmt()] = Block;
+ StmtToBlock[Stmt.value().getStmt()] = Block;
}
if (const Stmt *TerminatorStmt = Block->getTerminatorStmt())
StmtToBlock[TerminatorStmt] = Block;
diff --git a/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp b/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
index 052ab33b74a19..305d9d346089a 100644
--- a/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
+++ b/clang/lib/Analysis/FlowSensitive/DebugSupport.cpp
@@ -104,7 +104,7 @@ Constraints
auto StatusString = debugString(Result.getStatus());
auto Solution = Result.getSolution();
auto SolutionString =
- Solution.hasValue() ? "\n" + debugString(Solution.getValue()) : "";
+ Solution.hasValue() ? "\n" + debugString(Solution.value()) : "";
return formatv(
Template,
diff --git a/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp b/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp
index 6443fc1b64226..6ce9dd55914d7 100644
--- a/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp
+++ b/clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp
@@ -51,7 +51,7 @@ class StmtToEnvMapImpl : public StmtToEnvMap {
assert(BlockIT != CFCtx.getStmtToBlock().end());
const auto &State = BlockToState[BlockIT->getSecond()->getBlockID()];
assert(State);
- return &State.getValue().Env;
+ return &State.value().Env;
}
private:
@@ -212,7 +212,7 @@ static TypeErasedDataflowAnalysisState computeBlockInputState(
if (!MaybePredState)
continue;
- TypeErasedDataflowAnalysisState PredState = MaybePredState.getValue();
+ TypeErasedDataflowAnalysisState PredState = MaybePredState.value();
if (ApplyBuiltinTransfer) {
if (const Stmt *PredTerminatorStmt = Pred->getTerminatorStmt()) {
const StmtToEnvMapImpl StmtToEnv(CFCtx, BlockStates);
@@ -370,7 +370,7 @@ runTypeErasedDataflowAnalysis(
transferBlock(CFCtx, BlockStates, *Block, InitEnv, Analysis);
if (OldBlockState &&
- Analysis.isEqualTypeErased(OldBlockState.getValue().Lattice,
+ Analysis.isEqualTypeErased(OldBlockState.value().Lattice,
NewBlockState.Lattice) &&
OldBlockState->Env.equivalentTo(NewBlockState.Env, Analysis)) {
// The state of `Block` didn't change after transfer so there's no need to
diff --git a/clang/lib/Analysis/PathDiagnostic.cpp b/clang/lib/Analysis/PathDiagnostic.cpp
index 8a7305000746e..bb5f116d69405 100644
--- a/clang/lib/Analysis/PathDiagnostic.cpp
+++ b/clang/lib/Analysis/PathDiagnostic.cpp
@@ -320,7 +320,7 @@ static Optional<bool> comparePath(const PathPieces &X, const PathPieces &Y) {
for ( ; X_I != X_end && Y_I != Y_end; ++X_I, ++Y_I) {
Optional<bool> b = comparePiece(**X_I, **Y_I);
if (b)
- return b.getValue();
+ return b.value();
}
return None;
@@ -397,7 +397,7 @@ static bool compare(const PathDiagnostic &X, const PathDiagnostic &Y) {
}
Optional<bool> b = comparePath(X.path, Y.path);
assert(b);
- return b.getValue();
+ return b.value();
}
void PathDiagnosticConsumer::FlushDiagnostics(
diff --git a/clang/lib/Analysis/UninitializedValues.cpp b/clang/lib/Analysis/UninitializedValues.cpp
index 800943a99d871..7f44685355e08 100644
--- a/clang/lib/Analysis/UninitializedValues.cpp
+++ b/clang/lib/Analysis/UninitializedValues.cpp
@@ -149,7 +149,7 @@ class CFGBlockValues {
const VarDecl *vd) {
const Optional<unsigned> &idx = declToIndex.getValueIndex(vd);
assert(idx);
- return getValueVector(block)[idx.getValue()];
+ return getValueVector(block)[idx.value()];
}
};
@@ -210,7 +210,7 @@ void CFGBlockValues::resetScratch() {
ValueVector::reference CFGBlockValues::operator[](const VarDecl *vd) {
const Optional<unsigned> &idx = declToIndex.getValueIndex(vd);
assert(idx);
- return scratch[idx.getValue()];
+ return scratch[idx.value()];
}
//------------------------------------------------------------------------====//
diff --git a/clang/lib/Basic/Targets/RISCV.cpp b/clang/lib/Basic/Targets/RISCV.cpp
index 32dd2bad2c5c5..cb2cdb50e18e5 100644
--- a/clang/lib/Basic/Targets/RISCV.cpp
+++ b/clang/lib/Basic/Targets/RISCV.cpp
@@ -252,7 +252,7 @@ bool RISCVTargetInfo::hasFeature(StringRef Feature) const {
.Case("64bit", Is64Bit)
.Default(None);
if (Result)
- return Result.getValue();
+ return Result.value();
if (ISAInfo->isSupportedExtensionFeature(Feature))
return ISAInfo->hasExtension(Feature);
diff --git a/clang/lib/CodeGen/CGClass.cpp b/clang/lib/CodeGen/CGClass.cpp
index 153f299a1c4b4..cde31711a7db6 100644
--- a/clang/lib/CodeGen/CGClass.cpp
+++ b/clang/lib/CodeGen/CGClass.cpp
@@ -1783,14 +1783,14 @@ namespace {
StartIndex = FieldIndex;
} else if (StartIndex) {
EHStack.pushCleanup<SanitizeDtorFieldRange>(
- NormalAndEHCleanup, DD, StartIndex.getValue(), FieldIndex);
+ NormalAndEHCleanup, DD, StartIndex.value(), FieldIndex);
StartIndex = None;
}
}
void End() {
if (StartIndex)
EHStack.pushCleanup<SanitizeDtorFieldRange>(NormalAndEHCleanup, DD,
- StartIndex.getValue(), -1);
+ StartIndex.value(), -1);
}
};
} // end anonymous namespace
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp
index 5a53c4bb5308b..3a8400a557416 100644
--- a/clang/lib/Driver/Driver.cpp
+++ b/clang/lib/Driver/Driver.cpp
@@ -3326,7 +3326,7 @@ class OffloadingActionBuilder final {
AssociatedOffloadKind);
if (CompileDeviceOnly && CurPhase == FinalPhase && BundleOutput &&
- BundleOutput.getValue()) {
+ BundleOutput.value()) {
for (unsigned I = 0, E = GpuArchList.size(); I != E; ++I) {
OffloadAction::DeviceDependences DDep;
DDep.add(*CudaDeviceActions[I], *ToolChains.front(), GpuArchList[I],
diff --git a/clang/lib/Driver/ToolChains/AVR.cpp b/clang/lib/Driver/ToolChains/AVR.cpp
index 1faefc1148e64..89d408823270a 100644
--- a/clang/lib/Driver/ToolChains/AVR.cpp
+++ b/clang/lib/Driver/ToolChains/AVR.cpp
@@ -475,8 +475,8 @@ void AVR::Linker::ConstructJob(Compilation &C, const JobAction &JA,
}
if (SectionAddressData) {
- std::string DataSectionArg = std::string("-Tdata=0x") +
- llvm::utohexstr(SectionAddressData.getValue());
+ std::string DataSectionArg =
+ std::string("-Tdata=0x") + llvm::utohexstr(SectionAddressData.value());
CmdArgs.push_back(Args.MakeArgString(DataSectionArg));
} else {
// We do not have an entry for this CPU in the address mapping table yet.
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index 6dd4a6eeb32d5..b94ca887a056c 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -2329,7 +2329,7 @@ void Clang::AddHexagonTargetArgs(const ArgList &Args,
if (auto G = toolchains::HexagonToolChain::getSmallDataThreshold(Args)) {
CmdArgs.push_back("-mllvm");
CmdArgs.push_back(Args.MakeArgString("-hexagon-small-data-threshold=" +
- Twine(G.getValue())));
+ Twine(G.value())));
}
if (!Args.hasArg(options::OPT_fno_short_enums))
diff --git a/clang/lib/Driver/ToolChains/Gnu.cpp b/clang/lib/Driver/ToolChains/Gnu.cpp
index f52bb8af5ec96..34396b0b59c2b 100644
--- a/clang/lib/Driver/ToolChains/Gnu.cpp
+++ b/clang/lib/Driver/ToolChains/Gnu.cpp
@@ -2087,7 +2087,7 @@ void Generic_GCC::GCCInstallationDetector::print(raw_ostream &OS) const {
bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
if (BiarchSibling) {
- M = BiarchSibling.getValue();
+ M = BiarchSibling.value();
return true;
}
return false;
diff --git a/clang/lib/Driver/ToolChains/Hexagon.cpp b/clang/lib/Driver/ToolChains/Hexagon.cpp
index 9142dba81d54a..ed07e710fc49b 100644
--- a/clang/lib/Driver/ToolChains/Hexagon.cpp
+++ b/clang/lib/Driver/ToolChains/Hexagon.cpp
@@ -340,8 +340,8 @@ constructHexagonLinkArgs(Compilation &C, const JobAction &JA,
CmdArgs.push_back("-pie");
if (auto G = toolchains::HexagonToolChain::getSmallDataThreshold(Args)) {
- CmdArgs.push_back(Args.MakeArgString("-G" + Twine(G.getValue())));
- UseG0 = G.getValue() == 0;
+ CmdArgs.push_back(Args.MakeArgString("-G" + Twine(G.value())));
+ UseG0 = G.value() == 0;
}
CmdArgs.push_back("-o");
diff --git a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
index c4797cea333fe..709b781968bf7 100644
--- a/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
+++ b/clang/lib/ExtractAPI/Serialization/SymbolGraphSerializer.cpp
@@ -31,14 +31,14 @@ namespace {
/// at position \p Key.
void serializeObject(Object &Paren, StringRef Key, Optional<Object> Obj) {
if (Obj)
- Paren[Key] = std::move(Obj.getValue());
+ Paren[Key] = std::move(Obj.value());
}
/// Helper function to inject a JSON array \p Array into object \p Paren at
/// position \p Key.
void serializeArray(Object &Paren, StringRef Key, Optional<Array> Array) {
if (Array)
- Paren[Key] = std::move(Array.getValue());
+ Paren[Key] = std::move(Array.value());
}
/// Serialize a \c VersionTuple \p V with the Symbol Graph semantic version
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index ba006b5d49f87..2cd7efd862eca 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -115,9 +115,9 @@ bool CompilerInstance::createTarget() {
auto TO = std::make_shared<TargetOptions>();
TO->Triple = llvm::Triple::normalize(getFrontendOpts().AuxTriple);
if (getFrontendOpts().AuxTargetCPU)
- TO->CPU = getFrontendOpts().AuxTargetCPU.getValue();
+ TO->CPU = getFrontendOpts().AuxTargetCPU.value();
if (getFrontendOpts().AuxTargetFeatures)
- TO->FeaturesAsWritten = getFrontendOpts().AuxTargetFeatures.getValue();
+ TO->FeaturesAsWritten = getFrontendOpts().AuxTargetFeatures.value();
TO->HostTriple = getTarget().getTriple().str();
setAuxTarget(TargetInfo::CreateTargetInfo(getDiagnostics(), TO));
}
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 50aaab608cd98..48cd6a3941074 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -1976,7 +1976,7 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
} else {
Opts.DiagnosticsHotnessThreshold = *ResultOrErr;
if ((!Opts.DiagnosticsHotnessThreshold ||
- Opts.DiagnosticsHotnessThreshold.getValue() > 0) &&
+ Opts.DiagnosticsHotnessThreshold.value() > 0) &&
!UsingProfile)
Diags.Report(diag::warn_drv_diagnostics_hotness_requires_pgo)
<< "-fdiagnostics-hotness-threshold=";
@@ -1993,7 +1993,7 @@ bool CompilerInvocation::ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args,
} else {
Opts.DiagnosticsMisExpectTolerance = *ResultOrErr;
if ((!Opts.DiagnosticsMisExpectTolerance ||
- Opts.DiagnosticsMisExpectTolerance.getValue() > 0) &&
+ Opts.DiagnosticsMisExpectTolerance.value() > 0) &&
!UsingProfile)
Diags.Report(diag::warn_drv_diagnostics_misexpect_requires_pgo)
<< "-fdiagnostics-misexpect-tolerance=";
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index fe3736c07c3ce..d0360696ff9cb 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -832,11 +832,11 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
unsigned minor = 0;
if (tuple.getMinor())
- minor = tuple.getMinor().getValue();
+ minor = tuple.getMinor().value();
unsigned subminor = 0;
if (tuple.getSubminor())
- subminor = tuple.getSubminor().getValue();
+ subminor = tuple.getSubminor().value();
Builder.defineMacro("__OBJFW_RUNTIME_ABI__",
Twine(tuple.getMajor() * 10000 + minor * 100 +
diff --git a/clang/lib/Lex/DependencyDirectivesScanner.cpp b/clang/lib/Lex/DependencyDirectivesScanner.cpp
index be7b7d6e17b2d..567ca81f6ac20 100644
--- a/clang/lib/Lex/DependencyDirectivesScanner.cpp
+++ b/clang/lib/Lex/DependencyDirectivesScanner.cpp
@@ -550,7 +550,7 @@ Scanner::tryLexIdentifierOrSkipLine(const char *&First, const char *const End) {
StringRef Scanner::lexIdentifier(const char *&First, const char *const End) {
Optional<StringRef> Id = tryLexIdentifierOrSkipLine(First, End);
assert(Id && "expected identifier token");
- return Id.getValue();
+ return Id.value();
}
bool Scanner::isNextIdentifierOrSkipLine(StringRef Id, const char *&First,
diff --git a/clang/lib/Lex/MacroInfo.cpp b/clang/lib/Lex/MacroInfo.cpp
index 310b95f36771d..eae12beb6244b 100644
--- a/clang/lib/Lex/MacroInfo.cpp
+++ b/clang/lib/Lex/MacroInfo.cpp
@@ -213,7 +213,7 @@ MacroDirective::DefInfo MacroDirective::getDefinition() {
isPublic = VisMD->isPublic();
}
- return DefInfo(nullptr, UndefLoc, !isPublic || isPublic.getValue());
+ return DefInfo(nullptr, UndefLoc, !isPublic || isPublic.value());
}
const MacroDirective::DefInfo
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index c791e3e4e5ca9..57e344622f25a 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -1219,8 +1219,8 @@ void ModuleMap::resolveHeaderDirectives(
Module *Mod, llvm::Optional<const FileEntry *> File) const {
bool NeedsFramework = false;
SmallVector<Module::UnresolvedHeaderDirective, 1> NewHeaders;
- const auto Size = File ? File.getValue()->getSize() : 0;
- const auto ModTime = File ? File.getValue()->getModificationTime() : 0;
+ const auto Size = File ? File.value()->getSize() : 0;
+ const auto ModTime = File ? File.value()->getModificationTime() : 0;
for (auto &Header : Mod->UnresolvedHeaders) {
if (File && ((Header.ModTime && Header.ModTime != ModTime) ||
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp
index bf46e5422bc8d..f3be2107f985f 100644
--- a/clang/lib/Lex/PPMacroExpansion.cpp
+++ b/clang/lib/Lex/PPMacroExpansion.cpp
@@ -1326,10 +1326,10 @@ static void EvaluateFeatureLikeBuiltinMacro(llvm::raw_svector_ostream& OS,
// The last ')' has been reached; return the value if one found or
// a diagnostic and a dummy value.
if (Result) {
- OS << Result.getValue();
+ OS << Result.value();
// For strict conformance to __has_cpp_attribute rules, use 'L'
// suffix for dated literals.
- if (Result.getValue() > 1)
+ if (Result.value() > 1)
OS << 'L';
} else {
OS << 0;
diff --git a/clang/lib/Lex/PreprocessingRecord.cpp b/clang/lib/Lex/PreprocessingRecord.cpp
index 673ef637e396a..2146a7c042179 100644
--- a/clang/lib/Lex/PreprocessingRecord.cpp
+++ b/clang/lib/Lex/PreprocessingRecord.cpp
@@ -115,7 +115,7 @@ bool PreprocessingRecord::isEntityInFileID(iterator PPEI, FileID FID) {
Optional<bool> IsInFile =
ExternalSource->isPreprocessedEntityInFileID(LoadedIndex, FID);
if (IsInFile)
- return IsInFile.getValue();
+ return IsInFile.value();
// The external source did not provide a definite answer, go and deserialize
// the entity to check it.
diff --git a/clang/lib/Parse/ParseOpenMP.cpp b/clang/lib/Parse/ParseOpenMP.cpp
index 08dccf9e43f76..5f53f9d684e7a 100644
--- a/clang/lib/Parse/ParseOpenMP.cpp
+++ b/clang/lib/Parse/ParseOpenMP.cpp
@@ -1884,11 +1884,11 @@ void Parser::ParseOMPDeclareTargetClauses(
if (DevTypeData) {
if (DeviceTypeLoc.isValid()) {
// We already saw another device_type clause, diagnose it.
- Diag(DevTypeData.getValue().Loc,
+ Diag(DevTypeData.value().Loc,
diag::warn_omp_more_one_device_type_clause);
break;
}
- switch (static_cast<OpenMPDeviceType>(DevTypeData.getValue().Type)) {
+ switch (static_cast<OpenMPDeviceType>(DevTypeData.value().Type)) {
case OMPC_DEVICE_TYPE_any:
DTCI.DT = OMPDeclareTargetDeclAttr::DT_Any;
break;
@@ -3634,20 +3634,20 @@ OMPClause *Parser::ParseOpenMPSimpleClause(OpenMPClauseKind Kind,
if (!Val || ParseOnly)
return nullptr;
if (getLangOpts().OpenMP < 51 && Kind == OMPC_default &&
- (static_cast<DefaultKind>(Val.getValue().Type) == OMP_DEFAULT_private ||
- static_cast<DefaultKind>(Val.getValue().Type) ==
+ (static_cast<DefaultKind>(Val.value().Type) == OMP_DEFAULT_private ||
+ static_cast<DefaultKind>(Val.value().Type) ==
OMP_DEFAULT_firstprivate)) {
- Diag(Val.getValue().LOpen, diag::err_omp_invalid_dsa)
- << getOpenMPClauseName(static_cast<DefaultKind>(Val.getValue().Type) ==
+ Diag(Val.value().LOpen, diag::err_omp_invalid_dsa)
+ << getOpenMPClauseName(static_cast<DefaultKind>(Val.value().Type) ==
OMP_DEFAULT_private
? OMPC_private
: OMPC_firstprivate)
<< getOpenMPClauseName(OMPC_default) << "5.1";
return nullptr;
}
- return Actions.ActOnOpenMPSimpleClause(
- Kind, Val.getValue().Type, Val.getValue().TypeLoc, Val.getValue().LOpen,
- Val.getValue().Loc, Val.getValue().RLoc);
+ return Actions.ActOnOpenMPSimpleClause(Kind, Val.value().Type,
+ Val.value().TypeLoc, Val.value().LOpen,
+ Val.value().Loc, Val.value().RLoc);
}
/// Parsing of OpenMP clauses like 'ordered'.
diff --git a/clang/lib/Sema/SemaCUDA.cpp b/clang/lib/Sema/SemaCUDA.cpp
index 8f8144d658d81..185ccebe2717c 100644
--- a/clang/lib/Sema/SemaCUDA.cpp
+++ b/clang/lib/Sema/SemaCUDA.cpp
@@ -381,13 +381,13 @@ bool Sema::inferCUDATargetForImplicitSpecialMember(CXXRecordDecl *ClassDecl,
InferredTarget = BaseMethodTarget;
} else {
bool ResolutionError = resolveCalleeCUDATargetConflict(
- InferredTarget.getValue(), BaseMethodTarget,
+ InferredTarget.value(), BaseMethodTarget,
InferredTarget.getPointer());
if (ResolutionError) {
if (Diagnose) {
Diag(ClassDecl->getLocation(),
diag::note_implicit_member_target_infer_collision)
- << (unsigned)CSM << InferredTarget.getValue() << BaseMethodTarget;
+ << (unsigned)CSM << InferredTarget.value() << BaseMethodTarget;
}
MemberDecl->addAttr(CUDAInvalidTargetAttr::CreateImplicit(Context));
return true;
@@ -425,14 +425,13 @@ bool Sema::inferCUDATargetForImplicitSpecialMember(CXXRecordDecl *ClassDecl,
InferredTarget = FieldMethodTarget;
} else {
bool ResolutionError = resolveCalleeCUDATargetConflict(
- InferredTarget.getValue(), FieldMethodTarget,
+ InferredTarget.value(), FieldMethodTarget,
InferredTarget.getPointer());
if (ResolutionError) {
if (Diagnose) {
Diag(ClassDecl->getLocation(),
diag::note_implicit_member_target_infer_collision)
- << (unsigned)CSM << InferredTarget.getValue()
- << FieldMethodTarget;
+ << (unsigned)CSM << InferredTarget.value() << FieldMethodTarget;
}
MemberDecl->addAttr(CUDAInvalidTargetAttr::CreateImplicit(Context));
return true;
@@ -445,9 +444,9 @@ bool Sema::inferCUDATargetForImplicitSpecialMember(CXXRecordDecl *ClassDecl,
// it's the least restrictive option that can be invoked from any target.
bool NeedsH = true, NeedsD = true;
if (InferredTarget) {
- if (InferredTarget.getValue() == CFT_Device)
+ if (InferredTarget.value() == CFT_Device)
NeedsH = false;
- else if (InferredTarget.getValue() == CFT_Host)
+ else if (InferredTarget.value() == CFT_Host)
NeedsD = false;
}
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index df602f168dbc6..aed1d9befe2bc 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -1880,7 +1880,7 @@ static ExprResult SemaBuiltinLaunder(Sema &S, CallExpr *TheCall) {
}();
if (DiagSelect) {
S.Diag(TheCall->getBeginLoc(), diag::err_builtin_launder_invalid_arg)
- << DiagSelect.getValue() << TheCall->getSourceRange();
+ << DiagSelect.value() << TheCall->getSourceRange();
return ExprError();
}
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index ec7ec5dcd0f50..5a546503ccedc 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -15514,7 +15514,7 @@ void Sema::AddKnownFunctionAttributesForReplaceableGlobalAllocationFunction(
// specified by the value of this argument.
if (AlignmentParam && !FD->hasAttr<AllocAlignAttr>()) {
FD->addAttr(AllocAlignAttr::CreateImplicit(
- Context, ParamIdx(AlignmentParam.getValue(), FD), FD->getLocation()));
+ Context, ParamIdx(AlignmentParam.value(), FD), FD->getLocation()));
}
// FIXME:
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp
index 66fe7e76546b7..838fd48357fb7 100644
--- a/clang/lib/Sema/SemaDeclAttr.cpp
+++ b/clang/lib/Sema/SemaDeclAttr.cpp
@@ -2673,7 +2673,7 @@ static void handleAvailabilityAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
if (IOSToWatchOSMapping) {
if (auto MappedVersion = IOSToWatchOSMapping->map(
Version, MinimumWatchOSVersion, None)) {
- return MappedVersion.getValue();
+ return MappedVersion.value();
}
}
@@ -2682,10 +2682,10 @@ static void handleAvailabilityAttr(Sema &S, Decl *D, const ParsedAttr &AL) {
if (NewMajor >= 2) {
if (Version.getMinor()) {
if (Version.getSubminor())
- return VersionTuple(NewMajor, Version.getMinor().getValue(),
- Version.getSubminor().getValue());
+ return VersionTuple(NewMajor, Version.getMinor().value(),
+ Version.getSubminor().value());
else
- return VersionTuple(NewMajor, Version.getMinor().getValue());
+ return VersionTuple(NewMajor, Version.getMinor().value());
}
return VersionTuple(NewMajor);
}
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 767ee097c0d7e..dc1470bf7a9d1 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -847,7 +847,7 @@ class DSAStackTy {
std::pair<const Expr *, OMPOrderedClause *> getOrderedRegionParam() const {
if (const SharingMapTy *Top = getTopOfStackOrNull())
if (Top->OrderedRegion)
- return Top->OrderedRegion.getValue();
+ return Top->OrderedRegion.value();
return std::make_pair(nullptr, nullptr);
}
/// Returns true, if parent region is ordered (has associated
@@ -862,7 +862,7 @@ class DSAStackTy {
getParentOrderedRegionParam() const {
if (const SharingMapTy *Parent = getSecondOnStackOrNull())
if (Parent->OrderedRegion)
- return Parent->OrderedRegion.getValue();
+ return Parent->OrderedRegion.value();
return std::make_pair(nullptr, nullptr);
}
/// Marks current region as nowait (it has a 'nowait' clause).
@@ -7942,18 +7942,18 @@ bool OpenMPIterationSpaceChecker::setStep(Expr *NewStep, bool Subtract) {
if (!TestIsLessOp)
TestIsLessOp = IsConstPos || (IsUnsigned && !Subtract);
if (UB &&
- (IsConstZero || (TestIsLessOp.getValue()
- ? (IsConstNeg || (IsUnsigned && Subtract))
- : (IsConstPos || (IsUnsigned && !Subtract))))) {
+ (IsConstZero ||
+ (TestIsLessOp.value() ? (IsConstNeg || (IsUnsigned && Subtract))
+ : (IsConstPos || (IsUnsigned && !Subtract))))) {
SemaRef.Diag(NewStep->getExprLoc(),
diag::err_omp_loop_incr_not_compatible)
- << LCDecl << TestIsLessOp.getValue() << NewStep->getSourceRange();
+ << LCDecl << TestIsLessOp.value() << NewStep->getSourceRange();
SemaRef.Diag(ConditionLoc,
diag::note_omp_loop_cond_requres_compatible_incr)
- << TestIsLessOp.getValue() << ConditionSrcRange;
+ << TestIsLessOp.value() << ConditionSrcRange;
return true;
}
- if (TestIsLessOp.getValue() == Subtract) {
+ if (TestIsLessOp.value() == Subtract) {
NewStep =
SemaRef.CreateBuiltinUnaryOp(NewStep->getExprLoc(), UO_Minus, NewStep)
.get();
@@ -8708,8 +8708,8 @@ Expr *OpenMPIterationSpaceChecker::buildNumIterations(
UBVal = MinUB.get();
}
}
- Expr *UBExpr = TestIsLessOp.getValue() ? UBVal : LBVal;
- Expr *LBExpr = TestIsLessOp.getValue() ? LBVal : UBVal;
+ Expr *UBExpr = TestIsLessOp.value() ? UBVal : LBVal;
+ Expr *LBExpr = TestIsLessOp.value() ? LBVal : UBVal;
Expr *Upper = tryBuildCapture(SemaRef, UBExpr, Captures).get();
Expr *Lower = tryBuildCapture(SemaRef, LBExpr, Captures).get();
if (!Upper || !Lower)
@@ -8772,12 +8772,12 @@ std::pair<Expr *, Expr *> OpenMPIterationSpaceChecker::buildMinMaxValues(
// init value.
Expr *MinExpr = nullptr;
Expr *MaxExpr = nullptr;
- Expr *LBExpr = TestIsLessOp.getValue() ? LB : UB;
- Expr *UBExpr = TestIsLessOp.getValue() ? UB : LB;
- bool LBNonRect = TestIsLessOp.getValue() ? InitDependOnLC.has_value()
- : CondDependOnLC.has_value();
- bool UBNonRect = TestIsLessOp.getValue() ? CondDependOnLC.has_value()
- : InitDependOnLC.has_value();
+ Expr *LBExpr = TestIsLessOp.value() ? LB : UB;
+ Expr *UBExpr = TestIsLessOp.value() ? UB : LB;
+ bool LBNonRect = TestIsLessOp.value() ? InitDependOnLC.has_value()
+ : CondDependOnLC.has_value();
+ bool UBNonRect = TestIsLessOp.value() ? CondDependOnLC.has_value()
+ : InitDependOnLC.has_value();
Expr *Lower =
LBNonRect ? LBExpr : tryBuildCapture(SemaRef, LBExpr, Captures).get();
Expr *Upper =
@@ -8901,8 +8901,8 @@ Expr *OpenMPIterationSpaceChecker::buildPreCond(
ExprResult CondExpr = SemaRef.BuildBinOp(
S, DefaultLoc,
- TestIsLessOp.getValue() ? (TestIsStrictOp ? BO_LT : BO_LE)
- : (TestIsStrictOp ? BO_GT : BO_GE),
+ TestIsLessOp.value() ? (TestIsStrictOp ? BO_LT : BO_LE)
+ : (TestIsStrictOp ? BO_GT : BO_GE),
NewLB.get(), NewUB.get());
if (CondExpr.isUsable()) {
if (!SemaRef.Context.hasSameUnqualifiedType(CondExpr.get()->getType(),
@@ -8978,12 +8978,10 @@ Expr *OpenMPIterationSpaceChecker::buildOrderedLoopData(
!SemaRef.getLangOpts().CPlusPlus)
return nullptr;
// Upper - Lower
- Expr *Upper = TestIsLessOp.getValue()
- ? Cnt
- : tryBuildCapture(SemaRef, LB, Captures).get();
- Expr *Lower = TestIsLessOp.getValue()
- ? tryBuildCapture(SemaRef, LB, Captures).get()
- : Cnt;
+ Expr *Upper =
+ TestIsLessOp.value() ? Cnt : tryBuildCapture(SemaRef, LB, Captures).get();
+ Expr *Lower =
+ TestIsLessOp.value() ? tryBuildCapture(SemaRef, LB, Captures).get() : Cnt;
if (!Upper || !Lower)
return nullptr;
@@ -22587,27 +22585,27 @@ void Sema::ActOnOpenMPDeclareTargetName(NamedDecl *ND, SourceLocation Loc,
auto *VD = cast<ValueDecl>(ND);
llvm::Optional<OMPDeclareTargetDeclAttr *> ActiveAttr =
OMPDeclareTargetDeclAttr::getActiveAttr(VD);
- if (ActiveAttr && ActiveAttr.getValue()->getDevType() != DTCI.DT &&
- ActiveAttr.getValue()->getLevel() == Level) {
+ if (ActiveAttr && ActiveAttr.value()->getDevType() != DTCI.DT &&
+ ActiveAttr.value()->getLevel() == Level) {
Diag(Loc, diag::err_omp_device_type_mismatch)
<< OMPDeclareTargetDeclAttr::ConvertDevTypeTyToStr(DTCI.DT)
<< OMPDeclareTargetDeclAttr::ConvertDevTypeTyToStr(
- ActiveAttr.getValue()->getDevType());
+ ActiveAttr.value()->getDevType());
return;
}
- if (ActiveAttr && ActiveAttr.getValue()->getMapType() != MT &&
- ActiveAttr.getValue()->getLevel() == Level) {
+ if (ActiveAttr && ActiveAttr.value()->getMapType() != MT &&
+ ActiveAttr.value()->getLevel() == Level) {
Diag(Loc, diag::err_omp_declare_target_to_and_link) << ND;
return;
}
- if (ActiveAttr && ActiveAttr.getValue()->getLevel() == Level)
+ if (ActiveAttr && ActiveAttr.value()->getLevel() == Level)
return;
Expr *IndirectE = nullptr;
bool IsIndirect = false;
if (DTCI.Indirect) {
- IndirectE = DTCI.Indirect.getValue();
+ IndirectE = DTCI.Indirect.value();
if (!IndirectE)
IsIndirect = true;
}
@@ -22701,13 +22699,13 @@ void Sema::checkDeclIsAllowedInOpenMPTarget(Expr *E, Decl *D,
llvm::Optional<OMPDeclareTargetDeclAttr *> ActiveAttr =
OMPDeclareTargetDeclAttr::getActiveAttr(VD);
unsigned Level = DeclareTargetNesting.size();
- if (ActiveAttr && ActiveAttr.getValue()->getLevel() >= Level)
+ if (ActiveAttr && ActiveAttr.value()->getLevel() >= Level)
return;
DeclareTargetContextInfo &DTCI = DeclareTargetNesting.back();
Expr *IndirectE = nullptr;
bool IsIndirect = false;
if (DTCI.Indirect) {
- IndirectE = DTCI.Indirect.getValue();
+ IndirectE = DTCI.Indirect.value();
if (!IndirectE)
IsIndirect = true;
}
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 10dc04b7e09a4..bd166ff6f5945 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -469,8 +469,8 @@ static void instantiateOMPDeclareVariantAttr(
if (!DeclVarData)
return;
- E = DeclVarData.getValue().second;
- FD = DeclVarData.getValue().first;
+ E = DeclVarData.value().second;
+ FD = DeclVarData.value().first;
if (auto *VariantDRE = dyn_cast<DeclRefExpr>(E->IgnoreParenImpCasts())) {
if (auto *VariantFD = dyn_cast<FunctionDecl>(VariantDRE->getDecl())) {
diff --git a/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp b/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
index 330ca90b7659e..ca76e2d83381e 100644
--- a/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp
@@ -769,7 +769,7 @@ void VariadicMethodTypeChecker::checkPreObjCMessage(const ObjCMethodCall &msg,
if (!errorNode)
errorNode = C.generateNonFatalErrorNode();
- if (!errorNode.getValue())
+ if (!errorNode.value())
continue;
SmallString<128> sbuf;
@@ -787,7 +787,7 @@ void VariadicMethodTypeChecker::checkPreObjCMessage(const ObjCMethodCall &msg,
os << "'";
auto R = std::make_unique<PathSensitiveBugReport>(*BT, os.str(),
- errorNode.getValue());
+ errorNode.value());
R->addRange(msg.getArgSourceRange(I));
C.emitReport(std::move(R));
}
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index 92d7cef78b13d..36464707d06a3 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
@@ -1189,9 +1189,10 @@ MallocChecker::performKernelMalloc(const CallEvent &Call, CheckerContext &C,
}
NonLoc Flags = V.castAs<NonLoc>();
- NonLoc ZeroFlag = C.getSValBuilder()
- .makeIntVal(KernelZeroFlagVal.getValue(), FlagsEx->getType())
- .castAs<NonLoc>();
+ NonLoc ZeroFlag =
+ C.getSValBuilder()
+ .makeIntVal(KernelZeroFlagVal.value(), FlagsEx->getType())
+ .castAs<NonLoc>();
SVal MaskedFlagsUC = C.getSValBuilder().evalBinOpNN(State, BO_And,
Flags, ZeroFlag,
FlagsEx->getType());
@@ -1239,7 +1240,7 @@ void MallocChecker::checkKernelMalloc(const CallEvent &Call,
llvm::Optional<ProgramStateRef> MaybeState =
performKernelMalloc(Call, C, State);
if (MaybeState)
- State = MaybeState.getValue();
+ State = MaybeState.value();
else
State = MallocMemAux(C, Call, Call.getArgExpr(0), UndefinedVal(), State,
AF_Malloc);
diff --git a/clang/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp
index 3481936e572bf..fb6afd0fdabcd 100644
--- a/clang/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/NonNullParamChecker.cpp
@@ -136,10 +136,10 @@ void NonNullParamChecker::checkPreCall(const CallEvent &Call,
if (!DV)
continue;
- assert(!HasRefTypeParam || isa<Loc>(DV.getValue()));
+ assert(!HasRefTypeParam || isa<Loc>(DV.value()));
// Process the case when the argument is not a location.
- if (ExpectedToBeNonNull && !isa<Loc>(DV.getValue())) {
+ if (ExpectedToBeNonNull && !isa<Loc>(DV.value())) {
// If the argument is a union type, we want to handle a potential
// transparent_union GCC extension.
if (!ArgE)
diff --git a/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
index 9da44d5c0d394..aa3f4524798a0 100644
--- a/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp
@@ -234,7 +234,8 @@ void UnixAPIMisuseChecker::CheckOpenVariant(CheckerContext &C,
}
NonLoc oflags = V.castAs<NonLoc>();
NonLoc ocreateFlag = C.getSValBuilder()
- .makeIntVal(Val_O_CREAT.getValue(), oflagsEx->getType()).castAs<NonLoc>();
+ .makeIntVal(Val_O_CREAT.value(), oflagsEx->getType())
+ .castAs<NonLoc>();
SVal maskedFlagsUC = C.getSValBuilder().evalBinOpNN(state, BO_And,
oflags, ocreateFlag,
oflagsEx->getType());
diff --git a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
index 79d19a3b99f26..009cbd4559b55 100644
--- a/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
+++ b/clang/lib/StaticAnalyzer/Core/AnalyzerOptions.cpp
@@ -78,7 +78,7 @@ AnalyzerOptions::getExplorationStrategy() const {
ExplorationStrategyKind::BFSBlockDFSContents)
.Default(None);
assert(K && "User mode is invalid.");
- return K.getValue();
+ return K.value();
}
CTUPhase1InliningKind AnalyzerOptions::getCTUPhase1Inlining() const {
@@ -89,7 +89,7 @@ CTUPhase1InliningKind AnalyzerOptions::getCTUPhase1Inlining() const {
.Case("all", CTUPhase1InliningKind::All)
.Default(None);
assert(K && "CTU inlining mode is invalid.");
- return K.getValue();
+ return K.value();
}
IPAKind AnalyzerOptions::getIPAMode() const {
@@ -102,7 +102,7 @@ IPAKind AnalyzerOptions::getIPAMode() const {
.Default(None);
assert(K && "IPA Mode is invalid.");
- return K.getValue();
+ return K.value();
}
bool
diff --git a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
index 5b72c91ccd748..2caa5bbc16df1 100644
--- a/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
+++ b/clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
@@ -2950,7 +2950,7 @@ PathDiagnosticPieceRef ConditionBRVisitor::VisitTrueTest(
PathDiagnosticLocation Loc(Cond, SM, LCtx);
auto event = std::make_shared<PathDiagnosticEventPiece>(Loc, Message);
if (shouldPrune)
- event->setPrunable(shouldPrune.getValue());
+ event->setPrunable(shouldPrune.value());
return event;
}
@@ -3084,9 +3084,9 @@ bool ConditionBRVisitor::printValue(const Expr *CondVarExpr, raw_ostream &Out,
Out << (TookTrue ? "not equal to 0" : "0");
} else {
if (Ty->isBooleanType())
- Out << (IntValue.getValue()->getBoolValue() ? "true" : "false");
+ Out << (IntValue.value()->getBoolValue() ? "true" : "false");
else
- Out << *IntValue.getValue();
+ Out << *IntValue.value();
}
return true;
@@ -3282,7 +3282,7 @@ void FalsePositiveRefutationBRVisitor::finalizeVisitor(
if (!IsSAT)
return;
- if (!IsSAT.getValue())
+ if (!IsSAT.value())
BR.markInvalid("Infeasible constraints", EndPathNode->getLocationContext());
}
diff --git a/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp b/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
index 5f8a84591b2a0..e1649f0b3df68 100644
--- a/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
+++ b/clang/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp
@@ -1016,7 +1016,7 @@ bool ExprEngine::shouldInlineCall(const CallEvent &Call, const Decl *D,
// Check if this function has been marked as non-inlinable.
Optional<bool> MayInline = Engine.FunctionSummaries->mayInline(D);
if (MayInline) {
- if (!MayInline.getValue())
+ if (!MayInline.value())
return false;
} else {
diff --git a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
index 93c19a688b9a8..d35646bfba910 100644
--- a/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
+++ b/clang/lib/StaticAnalyzer/Core/PlistDiagnostics.cpp
@@ -407,11 +407,11 @@ void PlistPrinter::ReportMacroExpansions(raw_ostream &o, unsigned indent) {
// Output the macro name.
Indent(o, indent) << "<key>name</key>";
- EmitString(o, MacroName.getValue()) << '\n';
+ EmitString(o, MacroName.value()) << '\n';
// Output what it expands into.
Indent(o, indent) << "<key>expansion</key>";
- EmitString(o, ExpansionText.getValue()) << '\n';
+ EmitString(o, ExpansionText.value()) << '\n';
// Finish up.
--indent;
diff --git a/clang/lib/Support/RISCVVIntrinsicUtils.cpp b/clang/lib/Support/RISCVVIntrinsicUtils.cpp
index d4d3f22c93279..19eb65b39b0a4 100644
--- a/clang/lib/Support/RISCVVIntrinsicUtils.cpp
+++ b/clang/lib/Support/RISCVVIntrinsicUtils.cpp
@@ -114,7 +114,7 @@ bool RVVType::verifyType() const {
return false;
if (isFloat() && ElementBitwidth == 8)
return false;
- unsigned V = Scale.getValue();
+ unsigned V = Scale.value();
switch (ElementBitwidth) {
case 1:
case 8:
@@ -798,7 +798,7 @@ RVVType::computeTypes(BasicType BT, int Log2LMUL, unsigned NF,
if (!T)
return llvm::None;
// Record legal type index
- Types.push_back(T.getValue());
+ Types.push_back(T.value());
}
return Types;
}
diff --git a/clang/tools/driver/driver.cpp b/clang/tools/driver/driver.cpp
index 0e21106535ec8..34335a599a008 100644
--- a/clang/tools/driver/driver.cpp
+++ b/clang/tools/driver/driver.cpp
@@ -408,7 +408,7 @@ int clang_main(int Argc, char **Argv) {
llvm::Optional<std::string> OptCL = llvm::sys::Process::GetEnv("CL");
if (OptCL) {
SmallVector<const char *, 8> PrependedOpts;
- getCLEnvVarOptions(OptCL.getValue(), Saver, PrependedOpts);
+ getCLEnvVarOptions(OptCL.value(), Saver, PrependedOpts);
// Insert right after the program name to prepend to the argument list.
Args.insert(Args.begin() + 1, PrependedOpts.begin(), PrependedOpts.end());
@@ -417,7 +417,7 @@ int clang_main(int Argc, char **Argv) {
llvm::Optional<std::string> Opt_CL_ = llvm::sys::Process::GetEnv("_CL_");
if (Opt_CL_) {
SmallVector<const char *, 8> AppendedOpts;
- getCLEnvVarOptions(Opt_CL_.getValue(), Saver, AppendedOpts);
+ getCLEnvVarOptions(Opt_CL_.value(), Saver, AppendedOpts);
// Insert at the end of the argument list to append.
Args.append(AppendedOpts.begin(), AppendedOpts.end());
diff --git a/clang/tools/libclang/CIndex.cpp b/clang/tools/libclang/CIndex.cpp
index 31747bb422ef2..420ee25d1df78 100644
--- a/clang/tools/libclang/CIndex.cpp
+++ b/clang/tools/libclang/CIndex.cpp
@@ -538,7 +538,7 @@ bool CursorVisitor::VisitChildren(CXCursor Cursor) {
const Optional<bool> V = handleDeclForVisitation(*TL);
if (!V)
continue;
- return V.getValue();
+ return V.value();
}
} else if (VisitDeclContext(
CXXUnit->getASTContext().getTranslationUnitDecl()))
@@ -643,7 +643,7 @@ bool CursorVisitor::VisitDeclContext(DeclContext *DC) {
const Optional<bool> V = handleDeclForVisitation(D);
if (!V)
continue;
- return V.getValue();
+ return V.value();
}
return false;
}
@@ -677,7 +677,7 @@ Optional<bool> CursorVisitor::handleDeclForVisitation(const Decl *D) {
const Optional<bool> V = shouldVisitCursor(Cursor);
if (!V)
return None;
- if (!V.getValue())
+ if (!V.value())
return false;
if (Visit(Cursor, true))
return true;
@@ -1076,7 +1076,7 @@ bool CursorVisitor::VisitObjCContainerDecl(ObjCContainerDecl *D) {
const Optional<bool> &V = shouldVisitCursor(Cursor);
if (!V)
continue;
- if (!V.getValue())
+ if (!V.value())
return false;
if (Visit(Cursor, true))
return true;
diff --git a/clang/unittests/Analysis/MacroExpansionContextTest.cpp b/clang/unittests/Analysis/MacroExpansionContextTest.cpp
index 2f28c596930f6..add3099a5be9a 100644
--- a/clang/unittests/Analysis/MacroExpansionContextTest.cpp
+++ b/clang/unittests/Analysis/MacroExpansionContextTest.cpp
@@ -181,14 +181,14 @@ EMPTY zz
// A b cd ef gh
// zz
- EXPECT_EQ("", Ctx->getExpandedText(at(3, 10)).getValue());
- EXPECT_EQ("EMPTY", Ctx->getOriginalText(at(3, 10)).getValue());
+ EXPECT_EQ("", Ctx->getExpandedText(at(3, 10)).value());
+ EXPECT_EQ("EMPTY", Ctx->getOriginalText(at(3, 10)).value());
- EXPECT_EQ("", Ctx->getExpandedText(at(3, 19)).getValue());
- EXPECT_EQ("EMPTY", Ctx->getOriginalText(at(3, 19)).getValue());
+ EXPECT_EQ("", Ctx->getExpandedText(at(3, 19)).value());
+ EXPECT_EQ("EMPTY", Ctx->getOriginalText(at(3, 19)).value());
- EXPECT_EQ("", Ctx->getExpandedText(at(4, 1)).getValue());
- EXPECT_EQ("EMPTY", Ctx->getOriginalText(at(4, 1)).getValue());
+ EXPECT_EQ("", Ctx->getExpandedText(at(4, 1)).value());
+ EXPECT_EQ("EMPTY", Ctx->getOriginalText(at(4, 1)).value());
}
TEST_F(MacroExpansionContextTest, TransitiveExpansions) {
@@ -200,10 +200,10 @@ TEST_F(MacroExpansionContextTest, TransitiveExpansions) {
// After preprocessing:
// A b cd ) 1 ef gh
- EXPECT_EQ("WOOF", Ctx->getOriginalText(at(4, 10)).getValue());
+ EXPECT_EQ("WOOF", Ctx->getOriginalText(at(4, 10)).value());
- EXPECT_EQ("", Ctx->getExpandedText(at(4, 18)).getValue());
- EXPECT_EQ("EMPTY", Ctx->getOriginalText(at(4, 18)).getValue());
+ EXPECT_EQ("", Ctx->getExpandedText(at(4, 18)).value());
+ EXPECT_EQ("EMPTY", Ctx->getOriginalText(at(4, 18)).value());
}
TEST_F(MacroExpansionContextTest, MacroFunctions) {
@@ -219,17 +219,17 @@ TEST_F(MacroExpansionContextTest, MacroFunctions) {
// WOOF( ) ) ) 1
// bar barr( ) ) ) 1( ) ) ) 1),,),')
- EXPECT_EQ("$$ ef ()))1", Ctx->getExpandedText(at(4, 10)).getValue());
- EXPECT_EQ("WOOF($$ ef)", Ctx->getOriginalText(at(4, 10)).getValue());
+ EXPECT_EQ("$$ ef ()))1", Ctx->getExpandedText(at(4, 10)).value());
+ EXPECT_EQ("WOOF($$ ef)", Ctx->getOriginalText(at(4, 10)).value());
- EXPECT_EQ("", Ctx->getExpandedText(at(4, 22)).getValue());
- EXPECT_EQ("EMPTY", Ctx->getOriginalText(at(4, 22)).getValue());
+ EXPECT_EQ("", Ctx->getExpandedText(at(4, 22)).value());
+ EXPECT_EQ("EMPTY", Ctx->getOriginalText(at(4, 22)).value());
- EXPECT_EQ("WOOF ()))1", Ctx->getExpandedText(at(5, 3)).getValue());
- EXPECT_EQ("WOOF(WOOF)", Ctx->getOriginalText(at(5, 3)).getValue());
+ EXPECT_EQ("WOOF ()))1", Ctx->getExpandedText(at(5, 3)).value());
+ EXPECT_EQ("WOOF(WOOF)", Ctx->getOriginalText(at(5, 3)).value());
- EXPECT_EQ("bar barr ()))1()))1", Ctx->getExpandedText(at(6, 3)).getValue());
- EXPECT_EQ("WOOF(WOOF(bar barr))", Ctx->getOriginalText(at(6, 3)).getValue());
+ EXPECT_EQ("bar barr ()))1()))1", Ctx->getExpandedText(at(6, 3)).value());
+ EXPECT_EQ("WOOF(WOOF(bar barr))", Ctx->getOriginalText(at(6, 3)).value());
}
TEST_F(MacroExpansionContextTest, VariadicMacros) {
@@ -251,24 +251,23 @@ TEST_F(MacroExpansionContextTest, VariadicMacros) {
// fprintf (stderr, "success!\n" );
EXPECT_EQ(R"(fprintf (stderr ,"success!\n",))",
- Ctx->getExpandedText(at(3, 3)).getValue());
+ Ctx->getExpandedText(at(3, 3)).value());
EXPECT_EQ(R"(eprintf("success!\n", ))",
- Ctx->getOriginalText(at(3, 3)).getValue());
+ Ctx->getOriginalText(at(3, 3)).value());
EXPECT_EQ(R"(fprintf (stderr ,"success!\n",))",
- Ctx->getExpandedText(at(4, 3)).getValue());
- EXPECT_EQ(R"(eprintf("success!\n"))",
- Ctx->getOriginalText(at(4, 3)).getValue());
+ Ctx->getExpandedText(at(4, 3)).value());
+ EXPECT_EQ(R"(eprintf("success!\n"))", Ctx->getOriginalText(at(4, 3)).value());
EXPECT_EQ(R"(fprintf (stderr ,"success!\n"))",
- Ctx->getExpandedText(at(8, 3)).getValue());
+ Ctx->getExpandedText(at(8, 3)).value());
EXPECT_EQ(R"(eprintf2("success!\n", ))",
- Ctx->getOriginalText(at(8, 3)).getValue());
+ Ctx->getOriginalText(at(8, 3)).value());
EXPECT_EQ(R"(fprintf (stderr ,"success!\n"))",
- Ctx->getExpandedText(at(9, 3)).getValue());
+ Ctx->getExpandedText(at(9, 3)).value());
EXPECT_EQ(R"(eprintf2("success!\n"))",
- Ctx->getOriginalText(at(9, 3)).getValue());
+ Ctx->getOriginalText(at(9, 3)).value());
}
TEST_F(MacroExpansionContextTest, ConcatenationMacros) {
@@ -286,12 +285,12 @@ TEST_F(MacroExpansionContextTest, ConcatenationMacros) {
// };
EXPECT_EQ(R"({"quit",quit_command })",
- Ctx->getExpandedText(at(4, 5)).getValue());
- EXPECT_EQ("COMMAND(quit)", Ctx->getOriginalText(at(4, 5)).getValue());
+ Ctx->getExpandedText(at(4, 5)).value());
+ EXPECT_EQ("COMMAND(quit)", Ctx->getOriginalText(at(4, 5)).value());
EXPECT_EQ(R"({"help",help_command })",
- Ctx->getExpandedText(at(5, 5)).getValue());
- EXPECT_EQ("COMMAND(help)", Ctx->getOriginalText(at(5, 5)).getValue());
+ Ctx->getExpandedText(at(5, 5)).value());
+ EXPECT_EQ("COMMAND(help)", Ctx->getOriginalText(at(5, 5)).value());
}
TEST_F(MacroExpansionContextTest, StringizingMacros) {
@@ -316,14 +315,14 @@ TEST_F(MacroExpansionContextTest, StringizingMacros) {
EXPECT_EQ(
R"(do {if (x ==0)fprintf (stderr ,"Warning: ""x == 0""\n");}while (0))",
- Ctx->getExpandedText(at(6, 3)).getValue());
- EXPECT_EQ("WARN_IF (x == 0)", Ctx->getOriginalText(at(6, 3)).getValue());
+ Ctx->getExpandedText(at(6, 3)).value());
+ EXPECT_EQ("WARN_IF (x == 0)", Ctx->getOriginalText(at(6, 3)).value());
- EXPECT_EQ(R"("foo")", Ctx->getExpandedText(at(11, 3)).getValue());
- EXPECT_EQ("str (foo)", Ctx->getOriginalText(at(11, 3)).getValue());
+ EXPECT_EQ(R"("foo")", Ctx->getExpandedText(at(11, 3)).value());
+ EXPECT_EQ("str (foo)", Ctx->getOriginalText(at(11, 3)).value());
- EXPECT_EQ(R"("4")", Ctx->getExpandedText(at(12, 3)).getValue());
- EXPECT_EQ("xstr (foo)", Ctx->getOriginalText(at(12, 3)).getValue());
+ EXPECT_EQ(R"("4")", Ctx->getExpandedText(at(12, 3)).value());
+ EXPECT_EQ("xstr (foo)", Ctx->getOriginalText(at(12, 3)).value());
}
TEST_F(MacroExpansionContextTest, StringizingVariadicMacros) {
@@ -352,18 +351,18 @@ TEST_F(MacroExpansionContextTest, StringizingVariadicMacros) {
EXPECT_EQ("zz !apple !x *apple !x !**y (apple )zz !apple !x *apple !x !**y "
"(appleapple ))))",
- Ctx->getExpandedText(at(11, 3)).getValue());
- EXPECT_EQ("q(g)", Ctx->getOriginalText(at(11, 3)).getValue());
+ Ctx->getExpandedText(at(11, 3)).value());
+ EXPECT_EQ("q(g)", Ctx->getOriginalText(at(11, 3)).value());
EXPECT_EQ(R"res("apple"(apple )"apple"(appleapple )))))res",
- Ctx->getExpandedText(at(12, 3)).getValue());
- EXPECT_EQ("q(xstr)", Ctx->getOriginalText(at(12, 3)).getValue());
+ Ctx->getExpandedText(at(12, 3)).value());
+ EXPECT_EQ("q(xstr)", Ctx->getOriginalText(at(12, 3)).value());
- EXPECT_EQ("zz !*)!x )!**y ", Ctx->getExpandedText(at(13, 3)).getValue());
- EXPECT_EQ("g(RParen2x)", Ctx->getOriginalText(at(13, 3)).getValue());
+ EXPECT_EQ("zz !*)!x )!**y ", Ctx->getExpandedText(at(13, 3)).value());
+ EXPECT_EQ("g(RParen2x)", Ctx->getOriginalText(at(13, 3)).value());
- EXPECT_EQ("!))*))", Ctx->getExpandedText(at(14, 3)).getValue());
- EXPECT_EQ("f( RParen2x )", Ctx->getOriginalText(at(14, 3)).getValue());
+ EXPECT_EQ("!))*))", Ctx->getExpandedText(at(14, 3)).value());
+ EXPECT_EQ("f( RParen2x )", Ctx->getOriginalText(at(14, 3)).value());
}
TEST_F(MacroExpansionContextTest, RedefUndef) {
@@ -381,11 +380,11 @@ TEST_F(MacroExpansionContextTest, RedefUndef) {
// Hi(Hi)
// FIXME: Extra space follows every identifier.
- EXPECT_EQ("Welcome Adam ", Ctx->getExpandedText(at(3, 3)).getValue());
- EXPECT_EQ("Hi(Adam)", Ctx->getOriginalText(at(3, 3)).getValue());
+ EXPECT_EQ("Welcome Adam ", Ctx->getExpandedText(at(3, 3)).value());
+ EXPECT_EQ("Hi(Adam)", Ctx->getOriginalText(at(3, 3)).value());
- EXPECT_EQ("Willkommen ", Ctx->getExpandedText(at(5, 3)).getValue());
- EXPECT_EQ("Hi", Ctx->getOriginalText(at(5, 3)).getValue());
+ EXPECT_EQ("Willkommen ", Ctx->getExpandedText(at(5, 3)).value());
+ EXPECT_EQ("Hi", Ctx->getOriginalText(at(5, 3)).value());
// There was no macro expansion at 7:3, we should expect None.
EXPECT_FALSE(Ctx->getExpandedText(at(7, 3)).has_value());
@@ -411,12 +410,11 @@ TEST_F(MacroExpansionContextTest, UnbalacedParenthesis) {
// fun();
// int x = ((1, fun(), 1, fun(), 1 ));
- EXPECT_EQ("fun ()", Ctx->getExpandedText(at(8, 3)).getValue());
- EXPECT_EQ("applyInt )", Ctx->getOriginalText(at(8, 3)).getValue());
+ EXPECT_EQ("fun ()", Ctx->getExpandedText(at(8, 3)).value());
+ EXPECT_EQ("applyInt )", Ctx->getOriginalText(at(8, 3)).value());
- EXPECT_EQ("((1,fun (),1,fun (),1",
- Ctx->getExpandedText(at(13, 12)).getValue());
- EXPECT_EQ("f(f(1))", Ctx->getOriginalText(at(13, 12)).getValue());
+ EXPECT_EQ("((1,fun (),1,fun (),1", Ctx->getExpandedText(at(13, 12)).value());
+ EXPECT_EQ("f(f(1))", Ctx->getOriginalText(at(13, 12)).value());
}
} // namespace
diff --git a/clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp b/clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp
index 13c9ed90d8dd3..3a73f39e73b3c 100644
--- a/clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp
+++ b/clang/unittests/DirectoryWatcher/DirectoryWatcherTest.cpp
@@ -262,7 +262,7 @@ void checkEventualResultWithTimeout(VerifyingConsumer &TestConsumer) {
if (TestConsumer.result()) {
EXPECT_TRUE(*TestConsumer.result());
}
- if ((TestConsumer.result() && !TestConsumer.result().getValue()) ||
+ if ((TestConsumer.result() && !TestConsumer.result().value()) ||
!TestConsumer.result())
TestConsumer.printUnmetExpectations(llvm::outs());
}
diff --git a/clang/unittests/Lex/HeaderSearchTest.cpp b/clang/unittests/Lex/HeaderSearchTest.cpp
index 93b4512809ab1..5024f0d3d6b00 100644
--- a/clang/unittests/Lex/HeaderSearchTest.cpp
+++ b/clang/unittests/Lex/HeaderSearchTest.cpp
@@ -202,7 +202,7 @@ TEST_F(HeaderSearchTest, HeaderFrameworkLookup) {
EXPECT_TRUE(FoundFile.has_value());
EXPECT_TRUE(IsFrameworkFound);
- auto &FE = FoundFile.getValue();
+ auto &FE = FoundFile.value();
auto FI = Search.getExistingFileInfo(FE);
EXPECT_TRUE(FI);
EXPECT_TRUE(FI->IsValid);
@@ -271,7 +271,7 @@ TEST_F(HeaderSearchTest, HeaderMapFrameworkLookup) {
EXPECT_TRUE(FoundFile.has_value());
EXPECT_TRUE(IsMapped);
- auto &FE = FoundFile.getValue();
+ auto &FE = FoundFile.value();
auto FI = Search.getExistingFileInfo(FE);
EXPECT_TRUE(FI);
EXPECT_TRUE(FI->IsValid);
diff --git a/clang/utils/TableGen/RISCVVEmitter.cpp b/clang/utils/TableGen/RISCVVEmitter.cpp
index 4737bfc2a0ea1..db4cd77d8c53f 100644
--- a/clang/utils/TableGen/RISCVVEmitter.cpp
+++ b/clang/utils/TableGen/RISCVVEmitter.cpp
@@ -228,7 +228,7 @@ void RVVEmitter::createHeader(raw_ostream &OS) {
auto T = RVVType::computeType(BasicType::Int8, Log2LMUL,
PrototypeDescriptor::Mask);
if (T)
- printType(T.getValue());
+ printType(T.value());
}
// Print RVV int/float types.
for (char I : StringRef("csil")) {
@@ -236,13 +236,13 @@ void RVVEmitter::createHeader(raw_ostream &OS) {
for (int Log2LMUL : Log2LMULs) {
auto T = RVVType::computeType(BT, Log2LMUL, PrototypeDescriptor::Vector);
if (T) {
- printType(T.getValue());
+ printType(T.value());
auto UT = RVVType::computeType(
BT, Log2LMUL,
PrototypeDescriptor(BaseTypeModifier::Vector,
VectorTypeModifier::NoModifier,
TypeModifier::UnsignedInteger));
- printType(UT.getValue());
+ printType(UT.value());
}
}
}
@@ -251,7 +251,7 @@ void RVVEmitter::createHeader(raw_ostream &OS) {
auto T = RVVType::computeType(BasicType::Float16, Log2LMUL,
PrototypeDescriptor::Vector);
if (T)
- printType(T.getValue());
+ printType(T.value());
}
OS << "#endif\n";
@@ -260,7 +260,7 @@ void RVVEmitter::createHeader(raw_ostream &OS) {
auto T = RVVType::computeType(BasicType::Float32, Log2LMUL,
PrototypeDescriptor::Vector);
if (T)
- printType(T.getValue());
+ printType(T.value());
}
OS << "#endif\n";
@@ -269,7 +269,7 @@ void RVVEmitter::createHeader(raw_ostream &OS) {
auto T = RVVType::computeType(BasicType::Float64, Log2LMUL,
PrototypeDescriptor::Vector);
if (T)
- printType(T.getValue());
+ printType(T.value());
}
OS << "#endif\n\n";
More information about the cfe-commits
mailing list