for (const auto &CI : I.Description)
emitBlock(CI);
if (I.DefLoc)
- emitRecord(I.DefLoc.getValue(), ENUM_DEFLOCATION);
+ emitRecord(*I.DefLoc, ENUM_DEFLOCATION);
for (const auto &L : I.Loc)
emitRecord(L, ENUM_LOCATION);
emitRecord(I.Scoped, ENUM_SCOPED);
for (const auto &CI : I.Description)
emitBlock(CI);
if (I.DefLoc)
- emitRecord(I.DefLoc.getValue(), RECORD_DEFLOCATION);
+ emitRecord(*I.DefLoc, RECORD_DEFLOCATION);
for (const auto &L : I.Loc)
emitRecord(L, RECORD_LOCATION);
emitRecord(I.TagType, RECORD_TAG_TYPE);
emitRecord(I.Access, FUNCTION_ACCESS);
emitRecord(I.IsMethod, FUNCTION_IS_METHOD);
if (I.DefLoc)
- emitRecord(I.DefLoc.getValue(), FUNCTION_DEFLOCATION);
+ emitRecord(*I.DefLoc, FUNCTION_DEFLOCATION);
for (const auto &L : I.Loc)
emitRecord(L, FUNCTION_LOCATION);
emitBlock(I.Parent, FieldId::F_parent);
if (!JumpToSection)
return std::make_unique<TextNode>(Type.Name);
else
- return genLink(Type.Name, "#" + JumpToSection.getValue());
+ return genLink(Type.Name, "#" + *JumpToSection);
}
llvm::SmallString<64> Path = Type.getRelativeFilePath(CurrentDirectory);
llvm::sys::path::append(Path, Type.getFileBaseName() + ".html");
// Paths in HTML must be in posix-style
llvm::sys::path::native(Path, llvm::sys::path::Style::posix);
if (JumpToSection)
- Path += ("#" + JumpToSection.getValue()).str();
+ Path += ("#" + *JumpToSection).str();
return genLink(Type.Name, Path);
}
return std::make_unique<TagNode>(
HTMLTag::TAG_P, "Defined at line " + std::to_string(L.LineNumber) +
" of file " + L.Filename);
- SmallString<128> FileURL(RepositoryUrl.getValue());
+ SmallString<128> FileURL(*RepositoryUrl);
llvm::sys::path::append(FileURL, llvm::sys::path::Style::posix, L.Filename);
auto Node = std::make_unique<TagNode>(HTMLTag::TAG_P);
Node->Children.emplace_back(std::make_unique<TextNode>("Defined at line "));
SpanBody->Children.emplace_back(genReference(Index, InfoPath));
else
SpanBody->Children.emplace_back(
- genReference(Index, InfoPath, Index.JumpToSection.getValue().str()));
+ genReference(Index, InfoPath, Index.JumpToSection->str()));
}
if (Index.Children.empty())
return Out;
<< "*";
} else {
OS << "*Defined at [" << L.Filename << "#" << std::to_string(L.LineNumber)
- << "](" << StringRef{CDCtx.RepositoryUrl.getValue()}
+ << "](" << StringRef{*CDCtx.RepositoryUrl}
<< llvm::sys::path::relative_path(L.Filename) << "#"
<< std::to_string(L.LineNumber) << ")"
<< "*";
Members << "| " << N << " |\n";
writeLine(Members.str(), OS);
if (I.DefLoc)
- writeFileDefinition(CDCtx, I.DefLoc.getValue(), OS);
+ writeFileDefinition(CDCtx, *I.DefLoc, OS);
for (const auto &C : I.Description)
writeDescription(C, OS);
Stream.str() + ")"),
OS);
if (I.DefLoc)
- writeFileDefinition(CDCtx, I.DefLoc.getValue(), OS);
+ writeFileDefinition(CDCtx, *I.DefLoc, OS);
for (const auto &C : I.Description)
writeDescription(C, OS);
llvm::raw_ostream &OS) {
writeHeader(getTagType(I.TagType) + " " + I.Name, 1, OS);
if (I.DefLoc)
- writeFileDefinition(CDCtx, I.DefLoc.getValue(), OS);
+ writeFileDefinition(CDCtx, *I.DefLoc, OS);
if (!I.Description.empty()) {
for (const auto &C : I.Description)
if (AfterFirstStdConv) {
LLVM_DEBUG(llvm::dbgs() << "--- approximateImplicitConversion. Standard "
"Pre-Conversion found!\n");
- ImplicitSeq.AfterFirstStandard = AfterFirstStdConv.getValue();
+ ImplicitSeq.AfterFirstStandard = *AfterFirstStdConv;
WorkType = ImplicitSeq.AfterFirstStandard;
}
if (ConversionOperatorResult) {
LLVM_DEBUG(llvm::dbgs() << "--- approximateImplicitConversion. Found "
"conversion operator.\n");
- ImplicitSeq.update(ConversionOperatorResult.getValue());
+ ImplicitSeq.update(*ConversionOperatorResult);
WorkType = ImplicitSeq.getTypeAfterUserDefinedConversion();
FoundConversionOperator = true;
}
if (ConvCtorResult) {
LLVM_DEBUG(llvm::dbgs() << "--- approximateImplicitConversion. Found "
"converting constructor.\n");
- ImplicitSeq.update(ConvCtorResult.getValue());
+ ImplicitSeq.update(*ConvCtorResult);
WorkType = ImplicitSeq.getTypeAfterUserDefinedConversion();
FoundConvertingCtor = true;
}
/// Range ends with \c StartOfNextToken so that any whitespace after \c
/// virtual is included.
SourceLocation StartOfNextToken =
- Lexer::findNextToken(VirtualEndLoc, SM, LangOpts)
- .getValue()
- .getLocation();
+ Lexer::findNextToken(VirtualEndLoc, SM, LangOpts)->getLocation();
return CharSourceRange::getCharRange(VirtualBeginLoc, StartOfNextToken);
}
SmallString<32> Key = HeuristicToString[Idx];
Key.append(BK == BoundKind::DissimilarBelow ? "DissimilarBelow"
: "SimilarAbove");
- Options.store(Opts, Key, getBound(H, BK).getValue());
+ Options.store(Opts, Key, *getBound(H, BK));
};
for (std::size_t Idx = 0; Idx < HeuristicCount; ++Idx) {
BoundKind BK) const {
int8_t Threshold = -1;
if (Optional<int8_t> GotBound = getBound(H, BK))
- Threshold = GotBound.getValue();
+ Threshold = *GotBound;
switch (H) {
case Heuristic::Equality:
parse(External, N);
} else if (N.getType() == Node::NK_Scalar ||
N.getType() == Node::NK_BlockScalar) {
- parse(External, scalarValue(N, "External").getValue());
+ parse(External, *scalarValue(N, "External"));
} else {
error("External must be either a scalar or a mapping.", N);
return;
return false;
// Add a note that will point to real diagnostic.
- auto FE = SM.getFileEntryRefForID(SM.getFileID(DiagLoc)).getValue();
+ auto FE = *SM.getFileEntryRefForID(SM.getFileID(DiagLoc));
D.Notes.emplace(D.Notes.begin());
Note &N = D.Notes.front();
N.AbsFile = std::string(FE.getFileEntry().tryGetRealPathName());
std::string Storage;
std::vector<llvm::StringRef> SearchDirs;
if (Opts.CompileCommandsDir) // FIXME: unify this case with config.
- SearchDirs = {Opts.CompileCommandsDir.getValue()};
+ SearchDirs = {*Opts.CompileCommandsDir};
else {
WithContext WithProvidedContext(Opts.ContextProvider(Request.FileName));
const auto &Spec = Config::current().CompileFlags.CDBSearch;
case Config::CDBSearchSpec::NoCDBSearch:
return llvm::None;
case Config::CDBSearchSpec::FixedDir:
- Storage = Spec.FixedCDBPath.getValue();
+ Storage = *Spec.FixedCDBPath;
SearchDirs = {Storage};
break;
case Config::CDBSearchSpec::Ancestors:
std::vector<SearchPath> SearchPaths(AllFiles.size());
for (unsigned I = 0; I < AllFiles.size(); ++I) {
if (Parent.Opts.CompileCommandsDir) { // FIXME: unify with config
- SearchPaths[I].setPointer(
- &Dirs[Parent.Opts.CompileCommandsDir.getValue()]);
+ SearchPaths[I].setPointer(&Dirs[*Parent.Opts.CompileCommandsDir]);
continue;
}
if (ExitEarly()) // loading config may be slow
SearchPaths[I].setPointer(addParents(AllFiles[I]));
break;
case Config::CDBSearchSpec::FixedDir:
- SearchPaths[I].setPointer(&Dirs[Spec.FixedCDBPath.getValue()]);
+ SearchPaths[I].setPointer(&Dirs[*Spec.FixedCDBPath]);
break;
}
}
if (Variant.Relation)
Relations.insert(*Variant.Relation);
if (Variant.Source) {
- auto &IGN = Variant.Source.getValue();
+ auto &IGN = *Variant.Source;
auto Entry = Sources.try_emplace(IGN.URI).first;
Entry->getValue() = std::move(IGN);
// Fixup refs to refer to map keys which will live on
toHalfOpenFileRange(SM, LangOpts, FirstOriginalDecl->getSourceRange());
if (!DeclPos)
return error("Declaration is inside a macro");
- ExtractedFunc.ForwardDeclarationPoint = DeclPos.getValue().getBegin();
+ ExtractedFunc.ForwardDeclarationPoint = DeclPos->getBegin();
ExtractedFunc.ForwardDeclarationSyntacticDC = ExtractedFunc.SemanticDC;
}
std::string FunctionDecl = ExtractedFunc.renderDeclaration(
ForwardDeclaration, *ExtractedFunc.SemanticDC,
*ExtractedFunc.ForwardDeclarationSyntacticDC, SM);
- SourceLocation DeclPoint = ExtractedFunc.ForwardDeclarationPoint.getValue();
+ SourceLocation DeclPoint = *ExtractedFunc.ForwardDeclarationPoint;
return tooling::Replacement(SM, DeclPoint, 0, FunctionDecl);
}
// `nullable` form for the method parameter.
if (PropertyAttributes & ObjCPropertyAttribute::kind_nullability) {
if (auto Kind = AttributedType::stripOuterNullability(T)) {
- switch (Kind.getValue()) {
+ switch (*Kind) {
case NullabilityKind::Nullable:
Prefix = "nullable ";
break;
// Base case: selected a single ivar or property.
if (const auto *D = N->ASTNode.get<Decl>()) {
if (auto Param = MethodParameter::parameterFor(*D)) {
- Params.push_back(Param.getValue());
+ Params.push_back(*Param);
return Params;
}
}
continue;
if (auto P = MethodParameter::parameterFor(*D))
if (Names.insert(P->Name).second)
- Params.push_back(P.getValue());
+ Params.push_back(*P);
}
return Params;
}
loopCleanup = fn;
return;
}
- std::function<void(fir::FirOpBuilder &)> oldFn = loopCleanup.getValue();
+ std::function<void(fir::FirOpBuilder &)> oldFn = *loopCleanup;
loopCleanup = [=](fir::FirOpBuilder &builder) {
oldFn(builder);
fn(builder);
Fortran::lower::createArrayOfPointerAssignment(
*this, assign.lhs, assign.rhs, explicitIterSpace, implicitIterSpace,
- lbounds.getValue(), ubounds, localSymbols, stmtCtx);
+ *lbounds, ubounds, localSymbols, stmtCtx);
return;
}
Fortran::lower::ComponentPath::ExtendRefFunc
Fortran::lower::ComponentPath::getExtendCoorRef() const {
- return hasExtendCoorRef() ? extendCoorRef.getValue()
- : [](mlir::Value v) { return v; };
+ return hasExtendCoorRef() ? *extendCoorRef : [](mlir::Value v) { return v; };
}
std::size_t offset = explicitSpace->argPosition(oldInnerArg);
explicitSpace->setInnerArg(offset, fir::getBase(lexv));
fir::ExtendedValue exv = arrayModifyToExv(
- builder, loc, explicitSpace->getLhsLoad(0).getValue(),
- modifyOp.getResult(0));
+ builder, loc, *explicitSpace->getLhsLoad(0), modifyOp.getResult(0));
genScalarUserDefinedAssignmentCall(builder, loc, userAssignment, exv,
elementalExv);
} else {
mlir::Value origVal) {
mlir::Value val = builder.createConvert(loc, eleTy, origVal);
if (isBoundsSpec()) {
- auto lbs = lbounds.getValue();
+ auto lbs = *lbounds;
if (lbs.size() > 0) {
// Rebox the value with user-specified shift.
auto shiftTy = fir::ShiftType::get(eleTy.getContext(), lbs.size());
charLen = builder.createTemporary(loc, builder.getI64Type());
mlir::Value castLen =
builder.createConvert(loc, builder.getI64Type(), fir::getLen(exv));
- builder.create<fir::StoreOp>(loc, castLen, charLen.getValue());
+ builder.create<fir::StoreOp>(loc, castLen, *charLen);
}
}
stmtCtx.finalize(/*popScope=*/true);
// Convert to extended value.
if (fir::isa_char(seqTy.getEleTy())) {
- auto len = builder.create<fir::LoadOp>(loc, charLen.getValue());
+ auto len = builder.create<fir::LoadOp>(loc, *charLen);
return {fir::CharArrayBoxValue{mem, len, extents}, /*needCopy=*/false};
}
return {fir::ArrayBoxValue{mem, extents}, /*needCopy=*/false};
charLen = builder.createTemporary(loc, builder.getI64Type());
mlir::Value castLen =
builder.createConvert(loc, builder.getI64Type(), fir::getLen(exv));
- builder.create<fir::StoreOp>(loc, castLen, charLen.getValue());
+ builder.create<fir::StoreOp>(loc, castLen, *charLen);
}
}
mem = builder.createConvert(loc, fir::HeapType::get(resTy), mem);
const Fortran::lower::OperandPrepare &prepareOtherArgument,
Fortran::lower::AbstractConverter &converter) {
assert(retTy && "MIN and MAX must have a return type");
- mlir::Type resultType = retTy.getValue();
+ mlir::Type resultType = *retTy;
mlir::Location loc = converter.getCurrentLocation();
if (fir::isa_char(resultType))
TODO(loc,
assert(numOperands >= 2 && !isPresentCheck(0) && !isPresentCheck(1) &&
"min/max must have at least two non-optional args");
assert(retTy && "MIN and MAX must have a return type");
- mlir::Type resultType = retTy.getValue();
+ mlir::Type resultType = *retTy;
llvm::SmallVector<fir::ExtendedValue> args;
args.push_back(getOperand(0));
args.push_back(getOperand(1));
// Argument is dynamically optional.
extremum =
builder
- .genIfOp(loc, {resultType}, isPresentRuntimeCheck.getValue(),
+ .genIfOp(loc, {resultType}, *isPresentRuntimeCheck,
/*withElseRegion=*/true)
.genThen([&]() {
llvm::SmallVector<fir::ExtendedValue> args;
caseOp.getSuccessorOperands(adaptor.getOperands(), t);
llvm::Optional<mlir::ValueRange> cmpOps =
*caseOp.getCompareOperands(adaptor.getOperands(), t);
- mlir::Value caseArg = *(cmpOps.getValue().begin());
+ mlir::Value caseArg = *(cmpOps->begin());
mlir::Attribute attr = cases[t];
if (attr.isa<fir::PointIntervalAttr>()) {
auto cmp = rewriter.create<mlir::LLVM::ICmpOp>(
rewriter.setInsertionPointToEnd(thisBlock);
rewriter.create<mlir::LLVM::CondBrOp>(loc, cmp, newBlock1, newBlock2);
rewriter.setInsertionPointToEnd(newBlock1);
- mlir::Value caseArg0 = *(cmpOps.getValue().begin() + 1);
+ mlir::Value caseArg0 = *(cmpOps->begin() + 1);
auto cmp0 = rewriter.create<mlir::LLVM::ICmpOp>(
loc, mlir::LLVM::ICmpPredicate::sle, selector, caseArg0);
genCondBrOp(loc, cmp0, dest, destOps, rewriter, newBlock2);
auto maybeStore = lsf.findStoreToForward(
loadOp, getSpecificUsers<fir::StoreOp>(loadOp.getMemref()));
if (maybeStore) {
- auto storeOp = maybeStore.getValue();
+ auto storeOp = *maybeStore;
LLVM_DEBUG(llvm::dbgs() << "FlangMemDataFlowOpt: In " << f.getName()
<< " erasing load " << loadOp
<< " with value from " << storeOp << '\n');
if (!icfLevel)
icfLevel = doGC ? ICFLevel::All : ICFLevel::None;
config->doGC = doGC;
- config->doICF = icfLevel.getValue();
+ config->doICF = *icfLevel;
config->tailMerge =
(tailMerge == 1 && config->doICF != ICFLevel::None) || tailMerge == 2;
config->ltoDebugPassManager = ltoDebugPM;
// as a clash.
return;
- unsigned vfpArgs = attr.getValue();
+ unsigned vfpArgs = *attr;
ARMVFPArgKind arg;
switch (vfpArgs) {
case ARMBuildAttrs::BaseAAPCS:
result.AppendMessageWithFormat(", ");
else
print_comma = true;
- result.AppendMessageWithFormat("0x%" PRIx64,
- dirty_page_list.getValue()[i]);
+ result.AppendMessageWithFormat("0x%" PRIx64, (*dirty_page_list)[i]);
}
result.AppendMessageWithFormat(".\n");
}
}
if (got_line) {
- line = got_line.getValue();
+ line = *got_line;
if (m_data_recorder)
m_data_recorder->Record(line, true);
}
process_sp->GetLanguageRuntime(GetObjectRuntimeLanguage())) {
if (llvm::Optional<CompilerType> complete_type =
runtime->GetRuntimeType(compiler_type)) {
- m_override_type = complete_type.getValue();
+ m_override_type = *complete_type;
if (m_override_type.IsValid())
return m_override_type;
}
uint32_t partial_reg_size, lldb::Encoding encoding, lldb::Format format) {
for (auto it : llvm::enumerate(full_reg_indices)) {
llvm::Optional<uint32_t> full_reg_index = it.value();
- if (!full_reg_index ||
- regs[full_reg_index.getValue()].byte_size != full_reg_size)
+ if (!full_reg_index || regs[*full_reg_index].byte_size != full_reg_size)
return;
lldb_private::DynamicRegisterInfo::Register partial_reg{
LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM,
LLDB_INVALID_REGNUM,
- {full_reg_index.getValue()},
+ {*full_reg_index},
{}};
addSupplementaryRegister(regs, partial_reg);
}
uint32_t subreg_size, uint32_t subreg_offset = 0) {
for (const RegData *subreg : subregs) {
assert(subreg);
- uint32_t base_index = subreg->base_index.getValue();
+ uint32_t base_index = *subreg->base_index;
DynamicRegisterInfo::Register &full_reg = regs[base_index];
if (full_reg.byte_size != base_size)
continue;
}
return LLDB_INVALID_MODULE_VERSION;
} else
- return m_Foundation_major.getValue();
+ return *m_Foundation_major;
}
void AppleObjCRuntime::GetValuesForGlobalCFBooleans(lldb::addr_t &cf_true,
m_sdk_versions = llvm::VersionTuple();
}
- return m_sdk_versions.getValue();
+ return *m_sdk_versions;
}
bool ObjectFileMachO::GetIsDynamicLinkEditor() {
sdk_path.Printf("%s/Developer/Platforms/MacOSX.platform/Developer/"
"SDKs/MacOSX%u.%u.sdk",
fspec.GetPath().c_str(), version.getMajor(),
- version.getMinor().getValue());
+ *version.getMinor());
if (FileSystem::Instance().Exists(fspec))
return ConstString(sdk_path.GetString());
}
auto tgid_ret = getPIDForTID(child_pid);
if (tgid_ret != child_pid) {
// A new thread should have PGID matching our process' PID.
- assert(!tgid_ret || tgid_ret.getValue() == GetID());
+ assert(!tgid_ret || *tgid_ret == GetID());
NativeThreadLinux &child_thread = AddThread(child_pid, /*resume*/ true);
ThreadWasCreated(child_thread);
llvm::ELF::Elf32_Dyn>();
}
- return m_shared_library_info_addr.getValue();
+ return *m_shared_library_info_addr;
}
template <typename ELF_EHDR, typename ELF_PHDR, typename ELF_DYN>
if (!pid_tid)
break;
- ids.push_back(pid_tid.getValue());
+ ids.push_back(*pid_tid);
ch = response.GetChar(); // Skip the command separator
} while (ch == ','); // Make sure we got a comma separator
}
else if (name.equals("port")) {
// Make the Optional valid so we can use its value
port = 0;
- value.getAsInteger(0, port.getValue());
+ value.getAsInteger(0, *port);
}
}
GetTarget().GetDebugger().GetID());
pid = 1;
}
- SetID(pid.getValue());
+ SetID(*pid);
return error;
}
if (str.empty())
return false;
if (llvm::Optional<DIERef> die_ref = DIERef::Decode(data, offset_ptr))
- m_map.Append(ConstString(str), die_ref.getValue());
+ m_map.Append(ConstString(str), *die_ref);
else
return false;
}
auto option = GetOrCreateDeclForUid(uid);
if (!option)
return nullptr;
- clang::Decl *decl = FromCompilerDecl(option.getValue());
+ clang::Decl *decl = FromCompilerDecl(*option);
if (!decl)
return nullptr;
llvm::Optional<uint16_t> modi = m_index->GetModuleIndexForVa(file_addr);
if (!modi)
return 0;
- CompUnitSP cu_sp = GetCompileUnitAtIndex(modi.getValue());
+ CompUnitSP cu_sp = GetCompileUnitAtIndex(*modi);
if (!cu_sp)
return 0;
CompilerDecl SymbolFileNativePDB::GetDeclForUID(lldb::user_id_t uid) {
if (auto decl = m_ast->GetOrCreateDeclForUid(uid))
- return decl.getValue();
+ return *decl;
else
return CompilerDecl();
}
m_cursor_up->SetForwards(m_options.forwards);
if (m_options.skip) {
- uint64_t to_skip = m_options.skip.getValue();
+ uint64_t to_skip = *m_options.skip;
if (m_cursor_up->Seek((m_options.forwards ? 1 : -1) * to_skip,
TraceCursor::SeekType::Current) < to_skip) {
// This happens when the skip value was more than the number of
const URI &U) {
OS << U.scheme << "://[" << U.hostname << ']';
if (U.port)
- OS << ':' << U.port.getValue();
+ OS << ':' << *U.port;
return OS << U.path;
}
<< StatementIdx << ".\n";
return false;
}
- StringRef Accesses = JsonMemoryAccess->getString("relation").getValue();
+ StringRef Accesses = *JsonMemoryAccess->getString("relation");
isl_map *NewAccessMap =
isl_map_read_from_str(S.getIslCtx().get(), Accesses.str().c_str());
return false;
}
- if (SAI->getName() != Array.getString("name").getValue())
+ if (SAI->getName() != *Array.getString("name"))
return false;
if (SAI->getNumberOfDimensions() != Array.getArray("sizes")->size())
const json::Array &SizesArray = *Array.getArray("sizes");
std::vector<unsigned> DimSizes;
for (unsigned i = 0; i < SizesArray.size(); i++) {
- auto Size = std::stoi(SizesArray[i].getAsString().getValue().str());
+ auto Size = std::stoi(SizesArray[i].getAsString()->str());
// Check if the size if positive.
if (Size <= 0) {