forked from OSchip/llvm-project
[llvm] Don't use Optional::hasValue (NFC)
This commit is contained in:
parent
e363c5963d
commit
e0e687a615
|
@ -1039,7 +1039,7 @@ public:
|
|||
// If we've already analyzed a Module or set of Modules, so we must clear
|
||||
// the SimilarityCandidates to make sure we do not have only old values
|
||||
// hanging around.
|
||||
if (SimilarityCandidates.hasValue())
|
||||
if (SimilarityCandidates)
|
||||
SimilarityCandidates->clear();
|
||||
else
|
||||
SimilarityCandidates = SimilarityGroupList();
|
||||
|
|
|
@ -59,7 +59,7 @@ inline bool isRetainOrClaimRV(ARCInstKind Kind) {
|
|||
/// or UnsafeClaimRV.
|
||||
inline ARCInstKind getAttachedARCFunctionKind(const CallBase *CB) {
|
||||
Optional<Function *> Fn = getAttachedARCFunction(CB);
|
||||
if (!Fn.hasValue())
|
||||
if (!Fn)
|
||||
return ARCInstKind::None;
|
||||
auto FnClass = GetFunctionClass(*Fn);
|
||||
assert(isRetainOrClaimRV(FnClass) && "unexpected ARC runtime function");
|
||||
|
|
|
@ -248,7 +248,7 @@ private:
|
|||
Optional<uint32_t> MaxLength;
|
||||
|
||||
Optional<uint32_t> bytesRemaining(uint32_t CurrentOffset) const {
|
||||
if (!MaxLength.hasValue())
|
||||
if (!MaxLength)
|
||||
return None;
|
||||
assert(CurrentOffset >= BeginOffset);
|
||||
|
||||
|
|
|
@ -249,7 +249,7 @@ private:
|
|||
}
|
||||
|
||||
bool ParseCurrentAnnotation() {
|
||||
if (Current.hasValue())
|
||||
if (Current)
|
||||
return true;
|
||||
|
||||
Next = Data;
|
||||
|
|
|
@ -88,7 +88,7 @@ private:
|
|||
for (auto &Callee : CandidateSet) {
|
||||
auto ImplSymbol = AliaseeImplTable.getImplFor(Callee);
|
||||
// try to distinguish already compiled & library symbols
|
||||
if (!ImplSymbol.hasValue())
|
||||
if (!ImplSymbol)
|
||||
continue;
|
||||
const auto &ImplSymbolName = ImplSymbol.getPointer()->first;
|
||||
JITDylib *ImplJD = ImplSymbol.getPointer()->second;
|
||||
|
|
|
@ -48,7 +48,7 @@ public:
|
|||
}
|
||||
|
||||
uint64_t getLength() const {
|
||||
if (Length.hasValue())
|
||||
if (Length)
|
||||
return *Length;
|
||||
|
||||
return BorrowedImpl ? (BorrowedImpl->getLength() - ViewOffset) : 0;
|
||||
|
@ -67,7 +67,7 @@ public:
|
|||
return Result;
|
||||
|
||||
Result.ViewOffset += N;
|
||||
if (Result.Length.hasValue())
|
||||
if (Result.Length)
|
||||
*Result.Length -= N;
|
||||
return Result;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
|
||||
// Since we're dropping non-zero bytes from the end, stop length-tracking
|
||||
// by setting the length of the resulting StreamRef to an explicit value.
|
||||
if (!Result.Length.hasValue())
|
||||
if (!Result.Length)
|
||||
Result.Length = getLength();
|
||||
|
||||
*Result.Length -= N;
|
||||
|
|
|
@ -313,7 +313,7 @@ struct format_provider<T,
|
|||
S = FloatStyle::Fixed;
|
||||
|
||||
Optional<size_t> Precision = parseNumericPrecision(Style);
|
||||
if (!Precision.hasValue())
|
||||
if (!Precision)
|
||||
Precision = getDefaultPrecision(S);
|
||||
|
||||
write_double(Stream, static_cast<double>(V), S, Precision);
|
||||
|
|
|
@ -403,7 +403,7 @@ template <typename CFLAA> class CFLGraphBuilder {
|
|||
auto &RetParamRelations = Summary->RetParamRelations;
|
||||
for (auto &Relation : RetParamRelations) {
|
||||
auto IRelation = instantiateExternalRelation(Relation, Call);
|
||||
if (IRelation.hasValue()) {
|
||||
if (IRelation) {
|
||||
Graph.addNode(IRelation->From);
|
||||
Graph.addNode(IRelation->To);
|
||||
Graph.addEdge(IRelation->From, IRelation->To);
|
||||
|
@ -413,7 +413,7 @@ template <typename CFLAA> class CFLGraphBuilder {
|
|||
auto &RetParamAttributes = Summary->RetParamAttributes;
|
||||
for (auto &Attribute : RetParamAttributes) {
|
||||
auto IAttr = instantiateExternalAttribute(Attribute, Call);
|
||||
if (IAttr.hasValue())
|
||||
if (IAttr)
|
||||
Graph.addNode(IAttr->IValue, IAttr->Attr);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -165,7 +165,7 @@ CFLSteensAAResult::FunctionInfo::FunctionInfo(
|
|||
assert(RetVal != nullptr);
|
||||
assert(RetVal->getType()->isPointerTy());
|
||||
auto RetInfo = Sets.find(InstantiatedValue{RetVal, 0});
|
||||
if (RetInfo.hasValue())
|
||||
if (RetInfo)
|
||||
AddToRetParamRelations(0, RetInfo->Index);
|
||||
}
|
||||
|
||||
|
@ -174,7 +174,7 @@ CFLSteensAAResult::FunctionInfo::FunctionInfo(
|
|||
for (auto &Param : Fn.args()) {
|
||||
if (Param.getType()->isPointerTy()) {
|
||||
auto ParamInfo = Sets.find(InstantiatedValue{&Param, 0});
|
||||
if (ParamInfo.hasValue())
|
||||
if (ParamInfo)
|
||||
AddToRetParamRelations(I + 1, ParamInfo->Index);
|
||||
}
|
||||
++I;
|
||||
|
|
|
@ -64,7 +64,7 @@ void IRInstructionData::initializeInstruction() {
|
|||
// Here we collect the operands and their types for determining whether
|
||||
// the structure of the operand use matches between two different candidates.
|
||||
for (Use &OI : Inst->operands()) {
|
||||
if (isa<CmpInst>(Inst) && RevisedPredicate.hasValue()) {
|
||||
if (isa<CmpInst>(Inst) && RevisedPredicate) {
|
||||
// If we have a CmpInst where the predicate is reversed, it means the
|
||||
// operands must be reversed as well.
|
||||
OperVals.insert(OperVals.begin(), OI.get());
|
||||
|
|
|
@ -573,7 +573,7 @@ std::string llvm::AnnotateInlinePassName(InlineContext IC) {
|
|||
}
|
||||
|
||||
const char *InlineAdvisor::getAnnotatedInlinePassName() {
|
||||
if (!IC.hasValue())
|
||||
if (!IC)
|
||||
return DEBUG_TYPE;
|
||||
|
||||
// IC is constant and initialized in constructor, so compute the annotated
|
||||
|
@ -598,7 +598,7 @@ InlineAdvisor::getMandatoryKind(CallBase &CB, FunctionAnalysisManager &FAM,
|
|||
auto TrivialDecision =
|
||||
llvm::getAttributeBasedInliningDecision(CB, &Callee, TIR, GetTLI);
|
||||
|
||||
if (TrivialDecision.hasValue()) {
|
||||
if (TrivialDecision) {
|
||||
if (TrivialDecision->isSuccess())
|
||||
return MandatoryInliningKind::Always;
|
||||
else
|
||||
|
|
|
@ -2915,7 +2915,7 @@ InlineCost llvm::getInlineCost(
|
|||
auto UserDecision =
|
||||
llvm::getAttributeBasedInliningDecision(Call, Callee, CalleeTTI, GetTLI);
|
||||
|
||||
if (UserDecision.hasValue()) {
|
||||
if (UserDecision) {
|
||||
if (UserDecision->isSuccess())
|
||||
return llvm::InlineCost::getAlways("always inline attribute");
|
||||
return llvm::InlineCost::getNever(UserDecision->getFailureReason());
|
||||
|
|
|
@ -942,7 +942,7 @@ Optional<ValueLatticeElement> LazyValueInfoImpl::solveBlockValueBinaryOpImpl(
|
|||
// @foo()), 32"
|
||||
Optional<ConstantRange> LHSRes = getRangeFor(I->getOperand(0), I, BB);
|
||||
Optional<ConstantRange> RHSRes = getRangeFor(I->getOperand(1), I, BB);
|
||||
if (!LHSRes.hasValue() || !RHSRes.hasValue())
|
||||
if (!LHSRes || !RHSRes)
|
||||
// More work to do before applying this transfer rule.
|
||||
return None;
|
||||
|
||||
|
|
|
@ -335,7 +335,7 @@ bool llvm::isAllocRemovable(const CallBase *CB, const TargetLibraryInfo *TLI) {
|
|||
Value *llvm::getAllocAlignment(const CallBase *V,
|
||||
const TargetLibraryInfo *TLI) {
|
||||
const Optional<AllocFnsTy> FnData = getAllocationData(V, AnyAlloc, TLI);
|
||||
if (FnData.hasValue() && FnData->AlignParam >= 0) {
|
||||
if (FnData && FnData->AlignParam >= 0) {
|
||||
return V->getOperand(FnData->AlignParam);
|
||||
}
|
||||
return V->getArgOperandWithAttribute(Attribute::AllocAlign);
|
||||
|
|
|
@ -6885,7 +6885,7 @@ ConstantRange ScalarEvolution::getRangeViaFactoring(const SCEV *Start,
|
|||
FalseValue = *FalseVal;
|
||||
|
||||
// Re-apply the cast we peeled off earlier
|
||||
if (CastOp.hasValue())
|
||||
if (CastOp)
|
||||
switch (*CastOp) {
|
||||
default:
|
||||
llvm_unreachable("Unknown SCEV cast type!");
|
||||
|
@ -9733,7 +9733,7 @@ static Optional<APInt> MinOptional(Optional<APInt> X, Optional<APInt> Y) {
|
|||
/// equation are BW+1 bits wide (to avoid truncation when converting from
|
||||
/// the addrec to the equation).
|
||||
static Optional<APInt> TruncIfPossible(Optional<APInt> X, unsigned BitWidth) {
|
||||
if (!X.hasValue())
|
||||
if (!X)
|
||||
return None;
|
||||
unsigned W = X->getBitWidth();
|
||||
if (BitWidth > 1 && BitWidth < W && X->isIntN(BitWidth))
|
||||
|
@ -9802,7 +9802,7 @@ SolveQuadraticAddRecRange(const SCEVAddRecExpr *AddRec,
|
|||
APInt A, B, C, M;
|
||||
unsigned BitWidth;
|
||||
auto T = GetQuadraticEquation(AddRec);
|
||||
if (!T.hasValue())
|
||||
if (!T)
|
||||
return None;
|
||||
|
||||
// Be careful about the return value: there can be two reasons for not
|
||||
|
@ -9847,7 +9847,7 @@ SolveQuadraticAddRecRange(const SCEVAddRecExpr *AddRec,
|
|||
// If SolveQuadraticEquationWrap returns None, it means that there can
|
||||
// be a solution, but the function failed to find it. We cannot treat it
|
||||
// as "no solution".
|
||||
if (!SO.hasValue() || !UO.hasValue())
|
||||
if (!SO || !UO)
|
||||
return { None, false };
|
||||
|
||||
// Check the smaller value first to see if it leaves the range.
|
||||
|
|
|
@ -560,7 +560,7 @@ private:
|
|||
|
||||
Optional<StratifiedIndex> indexOf(const T &Val) {
|
||||
auto MaybeVal = get(Val);
|
||||
if (!MaybeVal.hasValue())
|
||||
if (!MaybeVal)
|
||||
return None;
|
||||
auto *Info = *MaybeVal;
|
||||
auto &Link = linksAt(Info->Index);
|
||||
|
|
|
@ -1070,7 +1070,7 @@ static void computeKnownBitsFromShiftOperator(
|
|||
// bits. This check is sunk down as far as possible to avoid the expensive
|
||||
// call to isKnownNonZero if the cheaper checks above fail.
|
||||
if (ShiftAmt == 0) {
|
||||
if (!ShifterOperandIsNonZero.hasValue())
|
||||
if (!ShifterOperandIsNonZero)
|
||||
ShifterOperandIsNonZero =
|
||||
isKnownNonZero(I->getOperand(1), DemandedElts, Depth + 1, Q);
|
||||
if (*ShifterOperandIsNonZero)
|
||||
|
|
|
@ -221,7 +221,7 @@ assignSections(MachineFunction &MF,
|
|||
// set every basic block's section ID equal to its number (basic block
|
||||
// id). This further ensures that basic blocks are ordered canonically.
|
||||
MBB.setSectionID({static_cast<unsigned int>(MBB.getNumber())});
|
||||
} else if (FuncBBClusterInfo[MBB.getNumber()].hasValue())
|
||||
} else if (FuncBBClusterInfo[MBB.getNumber()])
|
||||
MBB.setSectionID(FuncBBClusterInfo[MBB.getNumber()]->ClusterID);
|
||||
else {
|
||||
// BB goes into the special cold section if it is not specified in the
|
||||
|
|
|
@ -3465,7 +3465,7 @@ bool CombinerHelper::matchLoadOrCombine(
|
|||
// BSWAP.
|
||||
bool IsBigEndianTarget = MF.getDataLayout().isBigEndian();
|
||||
Optional<bool> IsBigEndian = isBigEndian(MemOffset2Idx, LowestIdx);
|
||||
if (!IsBigEndian.hasValue())
|
||||
if (!IsBigEndian)
|
||||
return false;
|
||||
bool NeedsBSwap = IsBigEndianTarget != *IsBigEndian;
|
||||
if (NeedsBSwap && !isLegalOrBeforeLegalizer({TargetOpcode::G_BSWAP, {Ty}}))
|
||||
|
|
|
@ -972,7 +972,7 @@ void UserValue::extendDef(
|
|||
if (Segment->end < Stop) {
|
||||
Stop = Segment->end;
|
||||
Kills = {Stop, {LII.first}};
|
||||
} else if (Segment->end == Stop && Kills.hasValue()) {
|
||||
} else if (Segment->end == Stop && Kills) {
|
||||
// If multiple locations end at the same place, track all of them in
|
||||
// Kills.
|
||||
Kills->second.push_back(LII.first);
|
||||
|
|
|
@ -80,7 +80,7 @@ static bool isColdBlock(const MachineBasicBlock &MBB,
|
|||
const MachineBlockFrequencyInfo *MBFI,
|
||||
ProfileSummaryInfo *PSI) {
|
||||
Optional<uint64_t> Count = MBFI->getBlockProfileCount(&MBB);
|
||||
if (!Count.hasValue())
|
||||
if (!Count)
|
||||
return true;
|
||||
|
||||
if (PercentileCutoff > 0) {
|
||||
|
|
|
@ -850,7 +850,7 @@ void ModuloScheduleExpander::addBranches(MachineBasicBlock &PreheaderBB,
|
|||
Optional<bool> StaticallyGreater =
|
||||
LoopInfo->createTripCountGreaterCondition(j + 1, *Prolog, Cond);
|
||||
unsigned numAdded = 0;
|
||||
if (!StaticallyGreater.hasValue()) {
|
||||
if (!StaticallyGreater) {
|
||||
Prolog->addSuccessor(Epilog);
|
||||
numAdded = TII->insertBranch(*Prolog, Epilog, LastPro, Cond, DebugLoc());
|
||||
} else if (*StaticallyGreater == false) {
|
||||
|
@ -1421,7 +1421,7 @@ Register KernelRewriter::remapUse(Register Reg, MachineInstr &MI) {
|
|||
while (DefaultI != Defaults.rend())
|
||||
LoopReg = phi(LoopReg, *DefaultI++, MRI.getRegClass(Reg));
|
||||
|
||||
if (IllegalPhiDefault.hasValue()) {
|
||||
if (IllegalPhiDefault) {
|
||||
// The consumer optionally consumes LoopProducer in the same iteration
|
||||
// (because the producer is scheduled at an earlier cycle than the consumer)
|
||||
// or the initial value. To facilitate this we create an illegal block here
|
||||
|
@ -1463,7 +1463,7 @@ Register KernelRewriter::phi(Register LoopReg, Optional<Register> InitReg,
|
|||
auto I = UndefPhis.find(LoopReg);
|
||||
if (I != UndefPhis.end()) {
|
||||
Register R = I->second;
|
||||
if (!InitReg.hasValue())
|
||||
if (!InitReg)
|
||||
// Found a phi taking undef as input, and this input is undef so return
|
||||
// without any more changes.
|
||||
return R;
|
||||
|
@ -1943,7 +1943,7 @@ void PeelingModuloScheduleExpander::fixupBranches() {
|
|||
TII->removeBranch(*Prolog);
|
||||
Optional<bool> StaticallyGreater =
|
||||
LoopInfo->createTripCountGreaterCondition(TC, *Prolog, Cond);
|
||||
if (!StaticallyGreater.hasValue()) {
|
||||
if (!StaticallyGreater) {
|
||||
LLVM_DEBUG(dbgs() << "Dynamic: TC > " << TC << "\n");
|
||||
// Dynamically branch based on Cond.
|
||||
TII->insertBranch(*Prolog, Epilog, Fallthrough, Cond, DebugLoc());
|
||||
|
|
|
@ -862,7 +862,7 @@ bool SelectOptimize::computeLoopCosts(
|
|||
}
|
||||
}
|
||||
auto ILatency = computeInstCost(&I);
|
||||
if (!ILatency.hasValue()) {
|
||||
if (!ILatency) {
|
||||
OptimizationRemarkMissed ORmissL(DEBUG_TYPE, "SelectOpti", &I);
|
||||
ORmissL << "Invalid instruction cost preventing analysis and "
|
||||
"optimization of the inner-most loop containing this "
|
||||
|
|
|
@ -8116,7 +8116,7 @@ SDValue DAGCombiner::MatchLoadCombine(SDNode *N) {
|
|||
// little endian value load
|
||||
Optional<bool> IsBigEndian = isBigEndian(
|
||||
makeArrayRef(ByteOffsets).drop_back(ZeroExtendedBytes), FirstOffset);
|
||||
if (!IsBigEndian.hasValue())
|
||||
if (!IsBigEndian)
|
||||
return SDValue();
|
||||
|
||||
assert(FirstByteProvider && "must be set");
|
||||
|
|
|
@ -96,7 +96,7 @@ bool BaseIndexOffset::computeAliasing(const SDNode *Op0,
|
|||
if (!(BasePtr0.getBase().getNode() && BasePtr1.getBase().getNode()))
|
||||
return false;
|
||||
int64_t PtrDiff;
|
||||
if (NumBytes0.hasValue() && NumBytes1.hasValue() &&
|
||||
if (NumBytes0 && NumBytes1 &&
|
||||
BasePtr0.equalBaseIndex(BasePtr1, DAG, PtrDiff)) {
|
||||
// If the size of memory access is unknown, do not use it to analysis.
|
||||
// One example of unknown size memory access is to load/store scalable
|
||||
|
|
|
@ -269,7 +269,7 @@ static SDValue getCopyFromParts(SelectionDAG &DAG, const SDLoc &DL,
|
|||
// For a truncate, see if we have any information to
|
||||
// indicate whether the truncated bits will always be
|
||||
// zero or sign-extension.
|
||||
if (AssertOp.hasValue())
|
||||
if (AssertOp)
|
||||
Val = DAG.getNode(*AssertOp, DL, PartEVT, Val,
|
||||
DAG.getValueType(ValueVT));
|
||||
return DAG.getNode(ISD::TRUNCATE, DL, ValueVT, Val);
|
||||
|
@ -7375,7 +7375,7 @@ static unsigned getISDForVPIntrinsic(const VPIntrinsic &VPIntrin) {
|
|||
#include "llvm/IR/VPIntrinsics.def"
|
||||
}
|
||||
|
||||
if (!ResOPC.hasValue())
|
||||
if (!ResOPC)
|
||||
llvm_unreachable(
|
||||
"Inconsistency: no SDNode available for this VPIntrinsic!");
|
||||
|
||||
|
|
|
@ -280,7 +280,7 @@ static void reservePreviousStackSlotForValue(const Value *IncomingValue,
|
|||
const int LookUpDepth = 6;
|
||||
Optional<int> Index =
|
||||
findPreviousSpillSlot(IncomingValue, Builder, LookUpDepth);
|
||||
if (!Index.hasValue())
|
||||
if (!Index)
|
||||
return;
|
||||
|
||||
const auto &StatepointSlots = Builder.FuncInfo.StatepointStackSlots;
|
||||
|
|
|
@ -167,7 +167,7 @@ bool StackProtector::HasAddressTaken(const Instruction *AI,
|
|||
// If this instruction accesses memory make sure it doesn't access beyond
|
||||
// the bounds of the allocated object.
|
||||
Optional<MemoryLocation> MemLoc = MemoryLocation::getOrNone(I);
|
||||
if (MemLoc.hasValue() && MemLoc->Size.hasValue() &&
|
||||
if (MemLoc && MemLoc->Size.hasValue() &&
|
||||
!TypeSize::isKnownGE(AllocSize,
|
||||
TypeSize::getFixed(MemLoc->Size.getValue())))
|
||||
return true;
|
||||
|
|
|
@ -158,7 +158,7 @@ CVType ContinuationRecordBuilder::createSegmentRecord(
|
|||
RecordPrefix *Prefix = reinterpret_cast<RecordPrefix *>(Data.data());
|
||||
Prefix->RecordLen = Data.size() - sizeof(RecordPrefix::RecordLen);
|
||||
|
||||
if (RefersTo.hasValue()) {
|
||||
if (RefersTo) {
|
||||
auto Continuation = Data.take_back(ContinuationLength);
|
||||
ContinuationRecord *CR =
|
||||
reinterpret_cast<ContinuationRecord *>(Continuation.data());
|
||||
|
|
|
@ -487,7 +487,7 @@ Expected<bool> TypeStreamMerger::shouldRemapType(const CVType &Type) {
|
|||
if (auto EC = TypeDeserializer::deserializeAs(const_cast<CVType &>(Type),
|
||||
EP))
|
||||
return joinErrors(std::move(EC), errorCorruptRecord());
|
||||
if (PCHSignature.hasValue())
|
||||
if (PCHSignature)
|
||||
return errorCorruptRecord();
|
||||
PCHSignature.emplace(EP.getSignature());
|
||||
return false;
|
||||
|
|
|
@ -1145,7 +1145,7 @@ Error DWARFDebugFrame::parse(DWARFDataExtractor Data) {
|
|||
}
|
||||
}
|
||||
|
||||
if (AugmentationLength.hasValue()) {
|
||||
if (AugmentationLength) {
|
||||
if (Offset != EndAugmentationOffset)
|
||||
return createStringError(errc::invalid_argument,
|
||||
"parsing augmentation data at 0x%" PRIx64
|
||||
|
|
|
@ -108,7 +108,7 @@ llvm::Expected<uint64_t> FunctionInfo::encode(FileWriter &O) const {
|
|||
// Write the name of this function as a uint32_t string table offset.
|
||||
O.writeU32(Name);
|
||||
|
||||
if (OptLineTable.hasValue()) {
|
||||
if (OptLineTable) {
|
||||
O.writeU32(InfoType::LineTableInfo);
|
||||
// Write a uint32_t length as zero for now, we will fix this up after
|
||||
// writing the LineTable out with the number of bytes that were written.
|
||||
|
@ -126,7 +126,7 @@ llvm::Expected<uint64_t> FunctionInfo::encode(FileWriter &O) const {
|
|||
}
|
||||
|
||||
// Write out the inline function info if we have any and if it is valid.
|
||||
if (Inline.hasValue()) {
|
||||
if (Inline) {
|
||||
O.writeU32(InfoType::InlineInfo);
|
||||
// Write a uint32_t length as zero for now, we will fix this up after
|
||||
// writing the LineTable out with the number of bytes that were written.
|
||||
|
|
|
@ -71,7 +71,7 @@ void DbiStreamBuilder::setPublicsStreamIndex(uint32_t Index) {
|
|||
}
|
||||
|
||||
void DbiStreamBuilder::addNewFpoData(const codeview::FrameData &FD) {
|
||||
if (!NewFpoData.hasValue())
|
||||
if (!NewFpoData)
|
||||
NewFpoData.emplace(false);
|
||||
|
||||
NewFpoData->addFrameData(FD);
|
||||
|
@ -285,7 +285,7 @@ Error DbiStreamBuilder::finalize() {
|
|||
}
|
||||
|
||||
Error DbiStreamBuilder::finalizeMsfLayout() {
|
||||
if (NewFpoData.hasValue()) {
|
||||
if (NewFpoData) {
|
||||
DbgStreams[(int)DbgHeaderType::NewFPO].emplace();
|
||||
DbgStreams[(int)DbgHeaderType::NewFPO]->Size =
|
||||
NewFpoData->calculateSerializedSize();
|
||||
|
@ -306,7 +306,7 @@ Error DbiStreamBuilder::finalizeMsfLayout() {
|
|||
}
|
||||
|
||||
for (auto &S : DbgStreams) {
|
||||
if (!S.hasValue())
|
||||
if (!S)
|
||||
continue;
|
||||
auto ExpectedIndex = Msf.addStream(S->Size);
|
||||
if (!ExpectedIndex)
|
||||
|
|
|
@ -137,7 +137,7 @@ void NativeTypeEnum::dump(raw_ostream &OS, int Indent,
|
|||
dumpSymbolField(OS, "name", getName(), Indent);
|
||||
dumpSymbolIdField(OS, "typeId", getTypeId(), Indent, Session,
|
||||
PdbSymbolIdField::Type, ShowIdFields, RecurseIdFields);
|
||||
if (Modifiers.hasValue())
|
||||
if (Modifiers)
|
||||
dumpSymbolIdField(OS, "unmodifiedTypeId", getUnmodifiedTypeId(), Indent,
|
||||
Session, PdbSymbolIdField::UnmodifiedType, ShowIdFields,
|
||||
RecurseIdFields);
|
||||
|
|
|
@ -45,7 +45,7 @@ void NativeTypeUDT::dump(raw_ostream &OS, int Indent,
|
|||
dumpSymbolIdField(OS, "lexicalParentId", 0, Indent, Session,
|
||||
PdbSymbolIdField::LexicalParent, ShowIdFields,
|
||||
RecurseIdFields);
|
||||
if (Modifiers.hasValue())
|
||||
if (Modifiers)
|
||||
dumpSymbolIdField(OS, "unmodifiedTypeId", getUnmodifiedTypeId(), Indent,
|
||||
Session, PdbSymbolIdField::UnmodifiedType, ShowIdFields,
|
||||
RecurseIdFields);
|
||||
|
|
|
@ -85,7 +85,7 @@ void IRSpeculationLayer::emit(std::unique_ptr<MaterializationResponsibility> R,
|
|||
|
||||
auto IRNames = QueryAnalysis(Fn);
|
||||
// Instrument and register if Query has result
|
||||
if (IRNames.hasValue()) {
|
||||
if (IRNames) {
|
||||
|
||||
// Emit globals for each function.
|
||||
auto LoadValueTy = Type::getInt8Ty(MContext);
|
||||
|
|
|
@ -285,7 +285,7 @@ bool GlobalObject::canIncreaseAlignment() const {
|
|||
// alignment specified. (If it is assigned a section, the global
|
||||
// could be densely packed with other objects in the section, and
|
||||
// increasing the alignment could cause padding issues.)
|
||||
if (hasSection() && getAlign().hasValue())
|
||||
if (hasSection() && getAlign())
|
||||
return false;
|
||||
|
||||
// On ELF platforms, we're further restricted in that we can't
|
||||
|
|
|
@ -493,7 +493,7 @@ static Error populateDynamic(DynamicEntries &Dyn,
|
|||
return createError(
|
||||
"Couldn't locate dynamic symbol table (no DT_SYMTAB entry)");
|
||||
}
|
||||
if (Dyn.SONameOffset.hasValue() && *Dyn.SONameOffset >= Dyn.StrSize) {
|
||||
if (Dyn.SONameOffset && *Dyn.SONameOffset >= Dyn.StrSize) {
|
||||
return createStringError(object_error::parse_failed,
|
||||
"DT_SONAME string offset (0x%016" PRIx64
|
||||
") outside of dynamic string table",
|
||||
|
@ -608,7 +608,7 @@ buildStub(const ELFObjectFile<ELFT> &ElfObj) {
|
|||
DestStub->Target.ObjectFormat = "ELF";
|
||||
|
||||
// Populate SoName from .dynamic entries and dynamic string table.
|
||||
if (DynEnt.SONameOffset.hasValue()) {
|
||||
if (DynEnt.SONameOffset) {
|
||||
Expected<StringRef> NameOrErr =
|
||||
terminatedSubstr(DynStr, *DynEnt.SONameOffset);
|
||||
if (!NameOrErr) {
|
||||
|
|
|
@ -639,7 +639,7 @@ Error LTO::addModule(InputFile &Input, unsigned ModI,
|
|||
if (!LTOInfo)
|
||||
return LTOInfo.takeError();
|
||||
|
||||
if (EnableSplitLTOUnit.hasValue()) {
|
||||
if (EnableSplitLTOUnit) {
|
||||
// If only some modules were split, flag this in the index so that
|
||||
// we can skip or error on optimizations that need consistently split
|
||||
// modules (whole program devirt and lower type tests).
|
||||
|
|
|
@ -114,7 +114,7 @@ uint64_t DXContainerObjectWriter::writeObject(MCAssembler &Asm,
|
|||
const Triple &TT = Asm.getContext().getTargetTriple();
|
||||
VersionTuple Version = TT.getOSVersion();
|
||||
Header.MajorVersion = static_cast<uint8_t>(Version.getMajor());
|
||||
if (Version.getMinor().hasValue())
|
||||
if (Version.getMinor())
|
||||
Header.MinorVersion = static_cast<uint8_t>(*Version.getMinor());
|
||||
if (TT.hasEnvironment())
|
||||
Header.ShaderKind =
|
||||
|
|
|
@ -796,7 +796,7 @@ MCObjectStreamer::emitRelocDirective(const MCExpr &Offset, StringRef Name,
|
|||
const MCExpr *Expr, SMLoc Loc,
|
||||
const MCSubtargetInfo &STI) {
|
||||
Optional<MCFixupKind> MaybeKind = Assembler->getBackend().getFixupKind(Name);
|
||||
if (!MaybeKind.hasValue())
|
||||
if (!MaybeKind)
|
||||
return std::make_pair(true, std::string("unknown relocation name"));
|
||||
|
||||
MCFixupKind Kind = *MaybeKind;
|
||||
|
|
|
@ -1190,7 +1190,7 @@ bool MasmParser::expandMacros() {
|
|||
}
|
||||
}
|
||||
|
||||
if (!ExpandedValue.hasValue())
|
||||
if (!ExpandedValue)
|
||||
return true;
|
||||
std::unique_ptr<MemoryBuffer> Instantiation =
|
||||
MemoryBuffer::getMemBufferCopy(*ExpandedValue, "<instantiation>");
|
||||
|
@ -2902,7 +2902,7 @@ bool MasmParser::expandMacro(raw_svector_ostream &OS, StringRef Body,
|
|||
if (Body[Pos] == '&')
|
||||
break;
|
||||
if (isMacroParameterChar(Body[Pos])) {
|
||||
if (!CurrentQuote.hasValue())
|
||||
if (!CurrentQuote)
|
||||
break;
|
||||
if (IdentifierPos == End)
|
||||
IdentifierPos = Pos;
|
||||
|
@ -2911,7 +2911,7 @@ bool MasmParser::expandMacro(raw_svector_ostream &OS, StringRef Body,
|
|||
}
|
||||
|
||||
// Track quotation status
|
||||
if (!CurrentQuote.hasValue()) {
|
||||
if (!CurrentQuote) {
|
||||
if (Body[Pos] == '\'' || Body[Pos] == '"')
|
||||
CurrentQuote = Body[Pos];
|
||||
} else if (Body[Pos] == CurrentQuote) {
|
||||
|
@ -3330,7 +3330,7 @@ bool MasmParser::handleMacroInvocation(const MCAsmMacro *M, SMLoc NameLoc) {
|
|||
ParseStatementInfo Info(&AsmStrRewrites);
|
||||
bool Parsed = parseStatement(Info, nullptr);
|
||||
|
||||
if (!Parsed && Info.ExitValue.hasValue()) {
|
||||
if (!Parsed && Info.ExitValue) {
|
||||
ExitValue = std::move(*Info.ExitValue);
|
||||
break;
|
||||
}
|
||||
|
@ -3625,7 +3625,7 @@ bool MasmParser::parseTextItem(std::string &Data) {
|
|||
if (BuiltinIt != BuiltinSymbolMap.end()) {
|
||||
llvm::Optional<std::string> BuiltinText =
|
||||
evaluateBuiltinTextMacro(BuiltinIt->getValue(), StartLoc);
|
||||
if (!BuiltinText.hasValue()) {
|
||||
if (!BuiltinText) {
|
||||
// Not a text macro; break without substituting
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -303,7 +303,7 @@ SubtargetFeatures ELFObjectFileBase::getRISCVFeatures() const {
|
|||
}
|
||||
|
||||
Optional<StringRef> Attr = Attributes.getAttributeString(RISCVAttrs::ARCH);
|
||||
if (Attr.hasValue()) {
|
||||
if (Attr) {
|
||||
// The Arch pattern is [rv32|rv64][i|e]version(_[m|a|f|d|c]version)*
|
||||
// Version string pattern is (major)p(minor). Major and minor are optional.
|
||||
// For example, a version number could be 2p0, 2, or p92.
|
||||
|
|
|
@ -237,7 +237,7 @@ static bool layoutCOFF(COFFParser &CP) {
|
|||
if (S.SectionData.binary_size() == 0)
|
||||
S.SectionData = CodeViewYAML::toDebugT(S.DebugP, CP.Allocator, S.Name);
|
||||
} else if (S.Name == ".debug$H") {
|
||||
if (S.DebugH.hasValue() && S.SectionData.binary_size() == 0)
|
||||
if (S.DebugH && S.SectionData.binary_size() == 0)
|
||||
S.SectionData = CodeViewYAML::toDebugH(*S.DebugH, CP.Allocator);
|
||||
}
|
||||
|
||||
|
@ -457,7 +457,7 @@ static bool writeCOFF(COFFParser &CP, raw_ostream &OS) {
|
|||
CP.Obj.OptionalHeader->DataDirectories;
|
||||
uint32_t NumDataDir = sizeof(CP.Obj.OptionalHeader->DataDirectories) /
|
||||
sizeof(Optional<COFF::DataDirectory>);
|
||||
if (I >= NumDataDir || !DataDirectories[I].hasValue()) {
|
||||
if (I >= NumDataDir || !DataDirectories[I]) {
|
||||
OS << zeros(uint32_t(0));
|
||||
OS << zeros(uint32_t(0));
|
||||
} else {
|
||||
|
|
|
@ -130,7 +130,7 @@ formatv_object_base::splitLiteralAndReplacement(StringRef Fmt) {
|
|||
StringRef Right = Fmt.substr(BC + 1);
|
||||
|
||||
auto RI = parseReplacementItem(Spec);
|
||||
if (RI.hasValue())
|
||||
if (RI)
|
||||
return std::make_pair(*RI, Right);
|
||||
|
||||
// If there was an error parsing the replacement item, treat it as an
|
||||
|
|
|
@ -408,7 +408,7 @@ raw_ostream &raw_ostream::operator<<(const FormattedBytes &FB) {
|
|||
const size_t Size = Bytes.size();
|
||||
HexPrintStyle HPS = FB.Upper ? HexPrintStyle::Upper : HexPrintStyle::Lower;
|
||||
uint64_t OffsetWidth = 0;
|
||||
if (FB.FirstByteOffset.hasValue()) {
|
||||
if (FB.FirstByteOffset) {
|
||||
// Figure out how many nibbles are needed to print the largest offset
|
||||
// represented by this data set, so that we can align the offset field
|
||||
// to the right width.
|
||||
|
|
|
@ -33,7 +33,7 @@ void yaml::AArch64FunctionInfo::mappingImpl(yaml::IO &YamlIO) {
|
|||
|
||||
void AArch64FunctionInfo::initializeBaseYamlFields(
|
||||
const yaml::AArch64FunctionInfo &YamlMFI) {
|
||||
if (YamlMFI.HasRedZone.hasValue())
|
||||
if (YamlMFI.HasRedZone)
|
||||
HasRedZone = YamlMFI.HasRedZone;
|
||||
}
|
||||
|
||||
|
|
|
@ -274,7 +274,7 @@ static Reloc::Model getEffectiveRelocModel(const Triple &TT,
|
|||
// On ELF platforms the default static relocation model has a smart enough
|
||||
// linker to cope with referencing external symbols defined in a shared
|
||||
// library. Hence DynamicNoPIC doesn't need to be promoted to PIC.
|
||||
if (!RM.hasValue() || *RM == Reloc::DynamicNoPIC)
|
||||
if (!RM || *RM == Reloc::DynamicNoPIC)
|
||||
return Reloc::Static;
|
||||
return *RM;
|
||||
}
|
||||
|
|
|
@ -6525,7 +6525,7 @@ AArch64InstructionSelector::selectAddrModeIndexed(MachineOperand &Root,
|
|||
|
||||
// Before falling back to our general case, check if the unscaled
|
||||
// instructions can handle this. If so, that's preferable.
|
||||
if (selectAddrModeUnscaled(Root, Size).hasValue())
|
||||
if (selectAddrModeUnscaled(Root, Size))
|
||||
return None;
|
||||
|
||||
return {{
|
||||
|
|
|
@ -196,7 +196,7 @@ static std::string computeDataLayout(const Triple &TT, StringRef CPU,
|
|||
|
||||
static Reloc::Model getEffectiveRelocModel(const Triple &TT,
|
||||
Optional<Reloc::Model> RM) {
|
||||
if (!RM.hasValue())
|
||||
if (!RM)
|
||||
// Default relocation model on Darwin is PIC.
|
||||
return TT.isOSBinFormatMachO() ? Reloc::PIC_ : Reloc::Static;
|
||||
|
||||
|
|
|
@ -11381,7 +11381,7 @@ bool ARMAsmParser::parseDirectiveEabiAttr(SMLoc L) {
|
|||
StringRef Name = Parser.getTok().getIdentifier();
|
||||
Optional<unsigned> Ret = ELFAttrs::attrTypeFromString(
|
||||
Name, ARMBuildAttrs::getARMAttributeTags());
|
||||
if (!Ret.hasValue()) {
|
||||
if (!Ret) {
|
||||
Error(TagLoc, "attribute name not recognised: " + Name);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ static std::string computeDataLayout(const Triple &TT, StringRef CPU,
|
|||
|
||||
static Reloc::Model getEffectiveRelocModel(bool JIT,
|
||||
Optional<Reloc::Model> RM) {
|
||||
if (!RM.hasValue() || JIT)
|
||||
if (!RM || JIT)
|
||||
return Reloc::Static;
|
||||
return *RM;
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ void PPCELFStreamer::emitInstruction(const MCInst &Inst,
|
|||
// For example, the load that will get the relocation as follows:
|
||||
// .reloc .Lpcrel1-8,R_PPC64_PCREL_OPT,.-(.Lpcrel1-8)
|
||||
// lwa 3, 4(3)
|
||||
if (IsPartOfGOTToPCRelPair.hasValue() && !IsPartOfGOTToPCRelPair.getValue())
|
||||
if (IsPartOfGOTToPCRelPair && !*IsPartOfGOTToPCRelPair)
|
||||
emitGOTToPCRelReloc(Inst);
|
||||
|
||||
// Special handling is only for prefixed instructions.
|
||||
|
@ -113,7 +113,7 @@ void PPCELFStreamer::emitInstruction(const MCInst &Inst,
|
|||
// follows:
|
||||
// pld 3, vec@got@pcrel(0), 1
|
||||
// .Lpcrel1:
|
||||
if (IsPartOfGOTToPCRelPair.hasValue() && IsPartOfGOTToPCRelPair.getValue())
|
||||
if (IsPartOfGOTToPCRelPair && *IsPartOfGOTToPCRelPair)
|
||||
emitGOTToPCRelLabel(Inst);
|
||||
}
|
||||
|
||||
|
|
|
@ -2175,7 +2175,7 @@ bool RISCVAsmParser::parseDirectiveAttribute() {
|
|||
StringRef Name = Parser.getTok().getIdentifier();
|
||||
Optional<unsigned> Ret =
|
||||
ELFAttrs::attrTypeFromString(Name, RISCVAttrs::getRISCVAttributeTags());
|
||||
if (!Ret.hasValue()) {
|
||||
if (!Ret) {
|
||||
Error(TagLoc, "attribute name not recognised: " + Name);
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -9900,7 +9900,7 @@ static unsigned allocateRVVReg(MVT ValVT, unsigned ValNo,
|
|||
// Assign the first mask argument to V0.
|
||||
// This is an interim calling convention and it may be changed in the
|
||||
// future.
|
||||
if (FirstMaskArgument.hasValue() && ValNo == FirstMaskArgument.getValue())
|
||||
if (FirstMaskArgument && ValNo == *FirstMaskArgument)
|
||||
return State.AllocateReg(RISCV::V0);
|
||||
return State.AllocateReg(ArgVRs);
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
|
|||
static Reloc::Model getEffectiveRelocModel(Optional<Reloc::Model> RM) {
|
||||
// Static code is suitable for use in a dynamic executable; there is no
|
||||
// separate DynamicNoPIC model.
|
||||
if (!RM.hasValue() || *RM == Reloc::DynamicNoPIC)
|
||||
if (!RM || *RM == Reloc::DynamicNoPIC)
|
||||
return Reloc::Static;
|
||||
return *RM;
|
||||
}
|
||||
|
|
|
@ -211,7 +211,7 @@ MCSymbol *WebAssemblyAsmPrinter::getOrCreateWasmSymbol(StringRef Name) {
|
|||
auto *WasmSym = cast<MCSymbolWasm>(GetExternalSymbolSymbol(Name));
|
||||
|
||||
// May be called multiple times, so early out.
|
||||
if (WasmSym->getType().hasValue())
|
||||
if (WasmSym->getType())
|
||||
return WasmSym;
|
||||
|
||||
const WebAssemblySubtarget &Subtarget = getSubtarget();
|
||||
|
|
|
@ -87,7 +87,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeWebAssemblyTarget() {
|
|||
|
||||
static Reloc::Model getEffectiveRelocModel(Optional<Reloc::Model> RM,
|
||||
const Triple &TT) {
|
||||
if (!RM.hasValue()) {
|
||||
if (!RM) {
|
||||
// Default to static relocation model. This should always be more optimial
|
||||
// than PIC since the static linker can determine all global addresses and
|
||||
// assume direct function calls.
|
||||
|
|
|
@ -158,7 +158,7 @@ static Reloc::Model getEffectiveRelocModel(const Triple &TT,
|
|||
bool JIT,
|
||||
Optional<Reloc::Model> RM) {
|
||||
bool is64Bit = TT.getArch() == Triple::x86_64;
|
||||
if (!RM.hasValue()) {
|
||||
if (!RM) {
|
||||
// JIT codegen should use static relocations by default, since it's
|
||||
// typically executed in process and not relocatable.
|
||||
if (JIT)
|
||||
|
|
|
@ -77,7 +77,7 @@ static std::vector<StringRef> getSearchPaths(opt::InputArgList *Args,
|
|||
|
||||
// Add $LIB.
|
||||
Optional<std::string> EnvOpt = sys::Process::GetEnv("LIB");
|
||||
if (!EnvOpt.hasValue())
|
||||
if (!EnvOpt)
|
||||
return Ret;
|
||||
StringRef Env = Saver.save(*EnvOpt);
|
||||
while (!Env.empty()) {
|
||||
|
|
|
@ -1479,7 +1479,7 @@ private:
|
|||
auto Itr = AliasOffetMap.find(&I);
|
||||
if (Itr == AliasOffetMap.end()) {
|
||||
AliasOffetMap[&I] = Offset;
|
||||
} else if (Itr->second.hasValue() && Itr->second.getValue() != Offset) {
|
||||
} else if (Itr->second && *Itr->second != Offset) {
|
||||
// If we have seen two different possible values for this alias, we set
|
||||
// it to empty.
|
||||
AliasOffetMap[&I].reset();
|
||||
|
|
|
@ -709,7 +709,7 @@ Argument *IRPosition::getAssociatedArgument() const {
|
|||
|
||||
assert(ACS.getCalledFunction()->arg_size() > u &&
|
||||
"ACS mapped into var-args arguments!");
|
||||
if (CBCandidateArg.hasValue()) {
|
||||
if (CBCandidateArg) {
|
||||
CBCandidateArg = nullptr;
|
||||
break;
|
||||
}
|
||||
|
@ -1030,7 +1030,7 @@ Attributor::getAssumedConstant(const IRPosition &IRP,
|
|||
// assume it's simplified.
|
||||
for (auto &CB : SimplificationCallbacks.lookup(IRP)) {
|
||||
Optional<Value *> SimplifiedV = CB(IRP, &AA, UsedAssumedInformation);
|
||||
if (!SimplifiedV.hasValue())
|
||||
if (!SimplifiedV)
|
||||
return llvm::None;
|
||||
if (isa_and_nonnull<Constant>(*SimplifiedV))
|
||||
return cast<Constant>(*SimplifiedV);
|
||||
|
@ -1044,7 +1044,7 @@ Attributor::getAssumedConstant(const IRPosition &IRP,
|
|||
ValueSimplifyAA.getAssumedSimplifiedValue(*this);
|
||||
bool IsKnown = ValueSimplifyAA.isAtFixpoint();
|
||||
UsedAssumedInformation |= !IsKnown;
|
||||
if (!SimplifiedV.hasValue()) {
|
||||
if (!SimplifiedV) {
|
||||
recordDependence(ValueSimplifyAA, AA, DepClassTy::OPTIONAL);
|
||||
return llvm::None;
|
||||
}
|
||||
|
@ -1078,7 +1078,7 @@ Attributor::getAssumedSimplified(const IRPosition &IRP,
|
|||
ValueSimplifyAA.getAssumedSimplifiedValue(*this);
|
||||
bool IsKnown = ValueSimplifyAA.isAtFixpoint();
|
||||
UsedAssumedInformation |= !IsKnown;
|
||||
if (!SimplifiedV.hasValue()) {
|
||||
if (!SimplifiedV) {
|
||||
if (AA)
|
||||
recordDependence(ValueSimplifyAA, *AA, DepClassTy::OPTIONAL);
|
||||
return llvm::None;
|
||||
|
@ -1097,7 +1097,7 @@ Attributor::getAssumedSimplified(const IRPosition &IRP,
|
|||
Optional<Value *> Attributor::translateArgumentToCallSiteContent(
|
||||
Optional<Value *> V, CallBase &CB, const AbstractAttribute &AA,
|
||||
bool &UsedAssumedInformation) {
|
||||
if (!V.hasValue())
|
||||
if (!V)
|
||||
return V;
|
||||
if (*V == nullptr || isa<Constant>(*V))
|
||||
return V;
|
||||
|
@ -3159,7 +3159,7 @@ raw_ostream &llvm::operator<<(raw_ostream &OS,
|
|||
OS << " [" << Acc.getKind() << "] " << *Acc.getRemoteInst();
|
||||
if (Acc.getLocalInst() != Acc.getRemoteInst())
|
||||
OS << " via " << *Acc.getLocalInst();
|
||||
if (Acc.getContent().hasValue()) {
|
||||
if (Acc.getContent()) {
|
||||
if (*Acc.getContent())
|
||||
OS << " [" << **Acc.getContent() << "]";
|
||||
else
|
||||
|
|
|
@ -551,7 +551,7 @@ static void clampReturnedValueStates(
|
|||
LLVM_DEBUG(dbgs() << "[Attributor] RV: " << RV << " AA: " << AA.getAsStr()
|
||||
<< " @ " << RVPos << "\n");
|
||||
const StateType &AAS = AA.getState();
|
||||
if (!T.hasValue())
|
||||
if (!T)
|
||||
T = StateType::getBestState(AAS);
|
||||
*T &= AAS;
|
||||
LLVM_DEBUG(dbgs() << "[Attributor] AA State: " << AAS << " RV State: " << T
|
||||
|
@ -561,7 +561,7 @@ static void clampReturnedValueStates(
|
|||
|
||||
if (!A.checkForAllReturnedValues(CheckReturnValue, QueryingAA))
|
||||
S.indicatePessimisticFixpoint();
|
||||
else if (T.hasValue())
|
||||
else if (T)
|
||||
S ^= *T;
|
||||
}
|
||||
|
||||
|
@ -617,7 +617,7 @@ static void clampCallSiteArgumentStates(Attributor &A, const AAType &QueryingAA,
|
|||
LLVM_DEBUG(dbgs() << "[Attributor] ACS: " << *ACS.getInstruction()
|
||||
<< " AA: " << AA.getAsStr() << " @" << ACSArgPos << "\n");
|
||||
const StateType &AAS = AA.getState();
|
||||
if (!T.hasValue())
|
||||
if (!T)
|
||||
T = StateType::getBestState(AAS);
|
||||
*T &= AAS;
|
||||
LLVM_DEBUG(dbgs() << "[Attributor] AA State: " << AAS << " CSA State: " << T
|
||||
|
@ -629,7 +629,7 @@ static void clampCallSiteArgumentStates(Attributor &A, const AAType &QueryingAA,
|
|||
if (!A.checkForAllCallSites(CallSiteCheck, QueryingAA, true,
|
||||
UsedAssumedInformation))
|
||||
S.indicatePessimisticFixpoint();
|
||||
else if (T.hasValue())
|
||||
else if (T)
|
||||
S ^= *T;
|
||||
}
|
||||
|
||||
|
@ -2667,7 +2667,7 @@ struct AAUndefinedBehaviorImpl : public AAUndefinedBehavior {
|
|||
// or we got back a simplified value to continue.
|
||||
Optional<Value *> SimplifiedCond =
|
||||
stopOnUndefOrAssumed(A, BrInst->getCondition(), BrInst);
|
||||
if (!SimplifiedCond.hasValue() || !SimplifiedCond.getValue())
|
||||
if (!SimplifiedCond || !*SimplifiedCond)
|
||||
return true;
|
||||
AssumedNoUBInsts.insert(&I);
|
||||
return true;
|
||||
|
@ -2737,7 +2737,7 @@ struct AAUndefinedBehaviorImpl : public AAUndefinedBehavior {
|
|||
// or we got back a simplified return value to continue.
|
||||
Optional<Value *> SimplifiedRetValue =
|
||||
stopOnUndefOrAssumed(A, RI.getReturnValue(), &I);
|
||||
if (!SimplifiedRetValue.hasValue() || !SimplifiedRetValue.getValue())
|
||||
if (!SimplifiedRetValue || !*SimplifiedRetValue)
|
||||
return true;
|
||||
|
||||
// Check if a return instruction always cause UB or not
|
||||
|
@ -2886,7 +2886,7 @@ private:
|
|||
IRPosition::value(*V), *this, UsedAssumedInformation);
|
||||
if (!UsedAssumedInformation) {
|
||||
// Don't depend on assumed values.
|
||||
if (!SimplifiedV.hasValue()) {
|
||||
if (!SimplifiedV) {
|
||||
// If it is known (which we tested above) but it doesn't have a value,
|
||||
// then we can assume `undef` and hence the instruction is UB.
|
||||
KnownUBInsts.insert(I);
|
||||
|
@ -3529,7 +3529,7 @@ struct AAIsDeadValueImpl : public AAIsDead {
|
|||
bool UsedAssumedInformation = false;
|
||||
Optional<Constant *> C =
|
||||
A.getAssumedConstant(V, *this, UsedAssumedInformation);
|
||||
if (!C.hasValue() || *C)
|
||||
if (!C || *C)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -4036,7 +4036,7 @@ identifyAliveSuccessors(Attributor &A, const BranchInst &BI,
|
|||
} else {
|
||||
Optional<Constant *> C =
|
||||
A.getAssumedConstant(*BI.getCondition(), AA, UsedAssumedInformation);
|
||||
if (!C.hasValue() || isa_and_nonnull<UndefValue>(C.getValue())) {
|
||||
if (!C || isa_and_nonnull<UndefValue>(*C)) {
|
||||
// No value yet, assume both edges are dead.
|
||||
} else if (isa_and_nonnull<ConstantInt>(*C)) {
|
||||
const BasicBlock *SuccBB =
|
||||
|
@ -5374,7 +5374,7 @@ bool ValueSimplifyStateType::unionAssumed(Optional<Value *> Other) {
|
|||
return false;
|
||||
|
||||
LLVM_DEBUG({
|
||||
if (SimplifiedAssociatedValue.hasValue())
|
||||
if (SimplifiedAssociatedValue)
|
||||
dbgs() << "[ValueSimplify] is assumed to be "
|
||||
<< **SimplifiedAssociatedValue << "\n";
|
||||
else
|
||||
|
@ -5535,7 +5535,7 @@ struct AAValueSimplifyImpl : AAValueSimplify {
|
|||
|
||||
Optional<Constant *> COpt = AA.getAssumedConstant(A);
|
||||
|
||||
if (!COpt.hasValue()) {
|
||||
if (!COpt) {
|
||||
SimplifiedAssociatedValue = llvm::None;
|
||||
A.recordDependence(AA, *this, DepClassTy::OPTIONAL);
|
||||
return true;
|
||||
|
@ -6228,7 +6228,7 @@ struct AAHeapToStackFunction final : public AAHeapToStack {
|
|||
const DataLayout &DL = A.getInfoCache().getDL();
|
||||
Value *Size;
|
||||
Optional<APInt> SizeAPI = getSize(A, *this, AI);
|
||||
if (SizeAPI.hasValue()) {
|
||||
if (SizeAPI) {
|
||||
Size = ConstantInt::get(AI.CB->getContext(), *SizeAPI);
|
||||
} else {
|
||||
LLVMContext &Ctx = AI.CB->getContext();
|
||||
|
|
|
@ -1183,7 +1183,7 @@ static Optional<unsigned> getGVNForPHINode(OutlinableRegion &Region,
|
|||
// adding an extra input. We ignore this case for now, and so ignore the
|
||||
// region.
|
||||
Optional<unsigned> OGVN = Cand.getGVN(Incoming);
|
||||
if (!OGVN.hasValue() && Blocks.contains(IncomingBlock)) {
|
||||
if (!OGVN && Blocks.contains(IncomingBlock)) {
|
||||
Region.IgnoreRegion = true;
|
||||
return None;
|
||||
}
|
||||
|
@ -1206,7 +1206,7 @@ static Optional<unsigned> getGVNForPHINode(OutlinableRegion &Region,
|
|||
// If there is no number for the incoming block, it is becaause we have
|
||||
// split the candidate basic blocks. So we use the previous block that it
|
||||
// was split from to find the valid global value numbering for the PHINode.
|
||||
if (!OGVN.hasValue()) {
|
||||
if (!OGVN) {
|
||||
assert(Cand.getStartBB() == IncomingBlock &&
|
||||
"Unknown basic block used in exit path PHINode.");
|
||||
|
||||
|
@ -1367,7 +1367,7 @@ findExtractedOutputToOverallOutputMapping(OutlinableRegion &Region,
|
|||
// If two PHINodes have the same canonical values, but different aggregate
|
||||
// argument locations, then they will have distinct Canonical Values.
|
||||
GVN = getGVNForPHINode(Region, PN, BlocksInRegion, AggArgIdx);
|
||||
if (!GVN.hasValue())
|
||||
if (!GVN)
|
||||
return;
|
||||
} else {
|
||||
// If we do not have a PHINode we use the global value numbering for the
|
||||
|
@ -1883,7 +1883,7 @@ replaceArgumentUses(OutlinableRegion &Region,
|
|||
PHINode *PN = cast<PHINode>(SI->getValueOperand());
|
||||
// If it has a value, it was not split by the code extractor, which
|
||||
// is what we are looking for.
|
||||
if (Region.Candidate->getGVN(PN).hasValue())
|
||||
if (Region.Candidate->getGVN(PN))
|
||||
continue;
|
||||
|
||||
// We record the parent block for the PHINode in the Region so that
|
||||
|
@ -2678,7 +2678,7 @@ void IROutliner::updateOutputMapping(OutlinableRegion &Region,
|
|||
|
||||
// If we found an output register, place a mapping of the new value
|
||||
// to the original in the mapping.
|
||||
if (!OutputIdx.hasValue())
|
||||
if (!OutputIdx)
|
||||
return;
|
||||
|
||||
if (OutputMappings.find(Outputs[OutputIdx.getValue()]) ==
|
||||
|
|
|
@ -2545,7 +2545,7 @@ struct AAICVTrackerFunction : public AAICVTracker {
|
|||
}
|
||||
|
||||
// If we are in the same BB and we have a value, we are done.
|
||||
if (CurrBB == I->getParent() && ReplVal.hasValue())
|
||||
if (CurrBB == I->getParent() && ReplVal)
|
||||
return ReplVal;
|
||||
|
||||
// Go through all predecessors and add terminators for analysis.
|
||||
|
@ -2603,7 +2603,7 @@ struct AAICVTrackerFunctionReturned : AAICVTracker {
|
|||
ICVTrackingAA.getReplacementValue(ICV, &I, A);
|
||||
|
||||
// If we found a second ICV value there is no unique returned value.
|
||||
if (UniqueICVValue.hasValue() && UniqueICVValue != NewReplVal)
|
||||
if (UniqueICVValue && UniqueICVValue != NewReplVal)
|
||||
return false;
|
||||
|
||||
UniqueICVValue = NewReplVal;
|
||||
|
@ -2654,7 +2654,7 @@ struct AAICVTrackerCallSite : AAICVTracker {
|
|||
}
|
||||
|
||||
ChangeStatus manifest(Attributor &A) override {
|
||||
if (!ReplVal.hasValue() || !ReplVal.getValue())
|
||||
if (!ReplVal || !*ReplVal)
|
||||
return ChangeStatus::UNCHANGED;
|
||||
|
||||
A.changeAfterManifest(IRPosition::inst(*getCtxI()), **ReplVal);
|
||||
|
@ -4494,7 +4494,7 @@ struct AAFoldRuntimeCallCallSiteReturned : AAFoldRuntimeCall {
|
|||
ChangeStatus manifest(Attributor &A) override {
|
||||
ChangeStatus Changed = ChangeStatus::UNCHANGED;
|
||||
|
||||
if (SimplifiedValue.hasValue() && SimplifiedValue.getValue()) {
|
||||
if (SimplifiedValue && *SimplifiedValue) {
|
||||
Instruction &I = *getCtxI();
|
||||
A.changeAfterManifest(IRPosition::inst(I), **SimplifiedValue);
|
||||
A.deleteAfterManifest(I);
|
||||
|
|
|
@ -2180,7 +2180,7 @@ bool SampleProfileLoader::runOnFunction(Function &F, ModuleAnalysisManager *AM)
|
|||
|
||||
// Initialize entry count when the function has no existing entry
|
||||
// count value.
|
||||
if (!F.getEntryCount().hasValue())
|
||||
if (!F.getEntryCount())
|
||||
F.setEntryCount(ProfileCount(initialEntryCount, Function::PCT_Real));
|
||||
std::unique_ptr<OptimizationRemarkEmitter> OwnedORE;
|
||||
if (AM) {
|
||||
|
|
|
@ -3142,7 +3142,7 @@ Instruction *InstCombinerImpl::visitCallBase(CallBase &Call) {
|
|||
Optional<OperandBundleUse> Bundle =
|
||||
GCSP.getOperandBundle(LLVMContext::OB_gc_live);
|
||||
unsigned NumOfGCLives = LiveGcValues.size();
|
||||
if (!Bundle.hasValue() || NumOfGCLives == Bundle->Inputs.size())
|
||||
if (!Bundle || NumOfGCLives == Bundle->Inputs.size())
|
||||
break;
|
||||
// We can reduce the size of gc live bundle.
|
||||
DenseMap<Value *, unsigned> Val2Idx;
|
||||
|
|
|
@ -1409,7 +1409,7 @@ bool LoopConstrainer::run() {
|
|||
|
||||
bool IsSignedPredicate = MainLoopStructure.IsSignedPredicate;
|
||||
Optional<SubRanges> MaybeSR = calculateSubRanges(IsSignedPredicate);
|
||||
if (!MaybeSR.hasValue()) {
|
||||
if (!MaybeSR) {
|
||||
LLVM_DEBUG(dbgs() << "irce: could not compute subranges\n");
|
||||
return false;
|
||||
}
|
||||
|
@ -1856,7 +1856,7 @@ InductiveRangeCheckElimination::isProfitableToTransform(const Loop &L,
|
|||
LoopStructure &LS) {
|
||||
if (SkipProfitabilityChecks)
|
||||
return true;
|
||||
if (GetBFI.hasValue()) {
|
||||
if (GetBFI) {
|
||||
BlockFrequencyInfo &BFI = (*GetBFI)();
|
||||
uint64_t hFreq = BFI.getBlockFreq(LS.Header).getFrequency();
|
||||
uint64_t phFreq = BFI.getBlockFreq(L.getLoopPreheader()).getFrequency();
|
||||
|
@ -1922,7 +1922,7 @@ bool InductiveRangeCheckElimination::run(
|
|||
const char *FailureReason = nullptr;
|
||||
Optional<LoopStructure> MaybeLoopStructure =
|
||||
LoopStructure::parseLoopStructure(SE, *L, FailureReason);
|
||||
if (!MaybeLoopStructure.hasValue()) {
|
||||
if (!MaybeLoopStructure) {
|
||||
LLVM_DEBUG(dbgs() << "irce: could not parse loop structure: "
|
||||
<< FailureReason << "\n";);
|
||||
return false;
|
||||
|
|
|
@ -298,7 +298,7 @@ static ArrayRef<Use> GetDeoptBundleOperands(const CallBase *Call) {
|
|||
Optional<OperandBundleUse> DeoptBundle =
|
||||
Call->getOperandBundle(LLVMContext::OB_deopt);
|
||||
|
||||
if (!DeoptBundle.hasValue()) {
|
||||
if (!DeoptBundle) {
|
||||
assert(AllowStatepointWithNoDeoptInfo &&
|
||||
"Found non-leaf call without deopt info!");
|
||||
return None;
|
||||
|
|
|
@ -1609,7 +1609,7 @@ void llvm::updateProfileCallee(
|
|||
Function *Callee, int64_t EntryDelta,
|
||||
const ValueMap<const Value *, WeakTrackingVH> *VMap) {
|
||||
auto CalleeCount = Callee->getEntryCount();
|
||||
if (!CalleeCount.hasValue())
|
||||
if (!CalleeCount)
|
||||
return;
|
||||
|
||||
const uint64_t PriorEntryCount = CalleeCount->getCount();
|
||||
|
|
|
@ -254,7 +254,7 @@ llvm::getOptionalElementCountLoopAttribute(const Loop *TheLoop) {
|
|||
Optional<int> Width =
|
||||
getOptionalIntLoopAttribute(TheLoop, "llvm.loop.vectorize.width");
|
||||
|
||||
if (Width.hasValue()) {
|
||||
if (Width) {
|
||||
Optional<int> IsScalable = getOptionalIntLoopAttribute(
|
||||
TheLoop, "llvm.loop.vectorize.scalable.enable");
|
||||
return ElementCount::get(*Width, IsScalable.value_or(false));
|
||||
|
|
|
@ -5861,7 +5861,7 @@ InstructionCost BoUpSLP::getEntryCost(const TreeEntry *E,
|
|||
SmallVector<const TreeEntry *> Entries;
|
||||
Optional<TargetTransformInfo::ShuffleKind> Shuffle =
|
||||
isGatherShuffledEntry(E, Mask, Entries);
|
||||
if (Shuffle.hasValue()) {
|
||||
if (Shuffle) {
|
||||
InstructionCost GatherCost = 0;
|
||||
if (ShuffleVectorInst::isIdentityMask(Mask)) {
|
||||
// Perfect match in the graph, will reuse the previously vectorized
|
||||
|
@ -5897,7 +5897,7 @@ InstructionCost BoUpSLP::getEntryCost(const TreeEntry *E,
|
|||
SmallVector<int> Mask;
|
||||
Optional<TargetTransformInfo::ShuffleKind> ShuffleKind =
|
||||
isFixedVectorShuffle(VL, Mask);
|
||||
if (ShuffleKind.hasValue()) {
|
||||
if (ShuffleKind) {
|
||||
// Found the bunch of extractelement instructions that must be gathered
|
||||
// into a vector and can be represented as a permutation elements in a
|
||||
// single input vector or of 2 input vectors.
|
||||
|
@ -7768,7 +7768,7 @@ Value *BoUpSLP::vectorizeTree(TreeEntry *E) {
|
|||
SmallVector<const TreeEntry *> Entries;
|
||||
Optional<TargetTransformInfo::ShuffleKind> Shuffle =
|
||||
isGatherShuffledEntry(E, Mask, Entries);
|
||||
if (Shuffle.hasValue()) {
|
||||
if (Shuffle) {
|
||||
assert((Entries.size() == 1 || Entries.size() == 2) &&
|
||||
"Expected shuffle of 1 or 2 entries.");
|
||||
Vec = Builder.CreateShuffleVector(Entries.front()->VectorizedValue,
|
||||
|
|
|
@ -546,7 +546,7 @@ static int compileModule(char **argv, LLVMContext &Context) {
|
|||
|
||||
// On AIX, setting the relocation model to anything other than PIC is
|
||||
// considered a user error.
|
||||
if (TheTriple.isOSAIX() && RM.hasValue() && *RM != Reloc::PIC_)
|
||||
if (TheTriple.isOSAIX() && RM && *RM != Reloc::PIC_)
|
||||
reportError("invalid relocation model, AIX only supports PIC",
|
||||
InputFilename);
|
||||
|
||||
|
@ -589,7 +589,7 @@ static int compileModule(char **argv, LLVMContext &Context) {
|
|||
|
||||
// On AIX, setting the relocation model to anything other than PIC is
|
||||
// considered a user error.
|
||||
if (TheTriple.isOSAIX() && RM.hasValue() && *RM != Reloc::PIC_) {
|
||||
if (TheTriple.isOSAIX() && RM && *RM != Reloc::PIC_) {
|
||||
WithColor::error(errs(), argv[0])
|
||||
<< "invalid relocation model, AIX only supports PIC.\n";
|
||||
return 1;
|
||||
|
|
|
@ -2283,7 +2283,7 @@ static void printFaultMaps(const ObjectFile *Obj) {
|
|||
|
||||
outs() << "FaultMap table:\n";
|
||||
|
||||
if (!FaultMapSection.hasValue()) {
|
||||
if (!FaultMapSection) {
|
||||
outs() << "<not found>\n";
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ BytesOutputStyle::BytesOutputStyle(PDBFile &File)
|
|||
|
||||
Error BytesOutputStyle::dump() {
|
||||
|
||||
if (opts::bytes::DumpBlockRange.hasValue()) {
|
||||
if (opts::bytes::DumpBlockRange) {
|
||||
auto &R = *opts::bytes::DumpBlockRange;
|
||||
uint32_t Max = R.Max.value_or(R.Min);
|
||||
|
||||
|
@ -104,7 +104,7 @@ Error BytesOutputStyle::dump() {
|
|||
P.NewLine();
|
||||
}
|
||||
|
||||
if (opts::bytes::DumpByteRange.hasValue()) {
|
||||
if (opts::bytes::DumpByteRange) {
|
||||
auto &R = *opts::bytes::DumpByteRange;
|
||||
uint32_t Max = R.Max.value_or(File.getFileSize());
|
||||
|
||||
|
|
|
@ -791,7 +791,7 @@ static void yamlToPdb(StringRef Path) {
|
|||
PDBFileBuilder Builder(Allocator);
|
||||
|
||||
uint32_t BlockSize = 4096;
|
||||
if (YamlObj.Headers.hasValue())
|
||||
if (YamlObj.Headers)
|
||||
BlockSize = YamlObj.Headers->SuperBlock.BlockSize;
|
||||
ExitOnErr(Builder.initialize(BlockSize));
|
||||
// Add each of the reserved streams. We ignore stream metadata in the
|
||||
|
@ -806,7 +806,7 @@ static void yamlToPdb(StringRef Path) {
|
|||
StringsAndChecksums Strings;
|
||||
Strings.setStrings(std::make_shared<DebugStringTableSubsection>());
|
||||
|
||||
if (YamlObj.StringTable.hasValue()) {
|
||||
if (YamlObj.StringTable) {
|
||||
for (auto S : *YamlObj.StringTable)
|
||||
Strings.strings()->insert(S);
|
||||
}
|
||||
|
@ -841,7 +841,7 @@ static void yamlToPdb(StringRef Path) {
|
|||
|
||||
for (auto S : MI.SourceFiles)
|
||||
ExitOnErr(DbiBuilder.addModuleSourceFile(ModiBuilder, S));
|
||||
if (MI.Modi.hasValue()) {
|
||||
if (MI.Modi) {
|
||||
const auto &ModiStream = *MI.Modi;
|
||||
for (auto Symbol : ModiStream.Symbols) {
|
||||
ModiBuilder.addSymbol(
|
||||
|
|
|
@ -824,7 +824,7 @@ void CSProfileGenerator::populateBodySamplesForFunction(
|
|||
do {
|
||||
uint64_t Offset = Binary->virtualAddrToOffset(IP.Address);
|
||||
auto LeafLoc = Binary->getInlineLeafFrameLoc(Offset);
|
||||
if (LeafLoc.hasValue()) {
|
||||
if (LeafLoc) {
|
||||
// Recording body sample for this specific context
|
||||
updateBodySamplesforFunctionProfile(FunctionProfile, *LeafLoc, Count);
|
||||
FunctionProfile.addTotalSamples(Count);
|
||||
|
@ -853,7 +853,7 @@ void CSProfileGenerator::populateBoundarySamplesForFunction(
|
|||
"CallerProfile is null only if ContextId is empty");
|
||||
// Record called target sample and its count
|
||||
auto LeafLoc = Binary->getInlineLeafFrameLoc(SourceOffset);
|
||||
if (LeafLoc.hasValue()) {
|
||||
if (LeafLoc) {
|
||||
CallerProfile->addCalledTargetSamples(
|
||||
LeafLoc->Location.LineOffset,
|
||||
getBaseDiscriminator(LeafLoc->Location.Discriminator), CalleeName,
|
||||
|
|
|
@ -5934,7 +5934,7 @@ template <class ELFT>
|
|||
SmallVector<uint32_t> ELFDumper<ELFT>::getSymbolIndexesForFunctionAddress(
|
||||
uint64_t SymValue, Optional<const Elf_Shdr *> FunctionSec) {
|
||||
SmallVector<uint32_t> SymbolIndexes;
|
||||
if (!this->AddressToIndexMap.hasValue()) {
|
||||
if (!this->AddressToIndexMap) {
|
||||
// Populate the address to index map upon the first invocation of this
|
||||
// function.
|
||||
this->AddressToIndexMap.emplace();
|
||||
|
|
|
@ -933,7 +933,7 @@ void GICombinerEmitter::run(raw_ostream &OS) {
|
|||
"getRuleIdxForIdentifier(RangePair.first);\n"
|
||||
<< " const auto Last = "
|
||||
"getRuleIdxForIdentifier(RangePair.second);\n"
|
||||
<< " if (!First.hasValue() || !Last.hasValue())\n"
|
||||
<< " if (!First || !Last)\n"
|
||||
<< " return None;\n"
|
||||
<< " if (First >= Last)\n"
|
||||
<< " report_fatal_error(\"Beginning of range should be before "
|
||||
|
@ -944,7 +944,7 @@ void GICombinerEmitter::run(raw_ostream &OS) {
|
|||
<< " return {{0, " << Rules.size() << "}};\n"
|
||||
<< " }\n"
|
||||
<< " const auto I = getRuleIdxForIdentifier(RangePair.first);\n"
|
||||
<< " if (!I.hasValue())\n"
|
||||
<< " if (!I)\n"
|
||||
<< " return None;\n"
|
||||
<< " return {{*I, *I + 1}};\n"
|
||||
<< "}\n\n";
|
||||
|
@ -953,7 +953,7 @@ void GICombinerEmitter::run(raw_ostream &OS) {
|
|||
OS << "bool " << getClassName() << "RuleConfig::setRule"
|
||||
<< (Enabled ? "Enabled" : "Disabled") << "(StringRef RuleIdentifier) {\n"
|
||||
<< " auto MaybeRange = getRuleRangeForIdentifier(RuleIdentifier);\n"
|
||||
<< " if (!MaybeRange.hasValue())\n"
|
||||
<< " if (!MaybeRange)\n"
|
||||
<< " return false;\n"
|
||||
<< " for (auto I = MaybeRange->first; I < MaybeRange->second; ++I)\n"
|
||||
<< " DisabledRules." << (Enabled ? "reset" : "set") << "(I);\n"
|
||||
|
|
|
@ -4273,7 +4273,7 @@ Error GlobalISelEmitter::importChildMatcher(
|
|||
|
||||
auto MaybeInsnOperand = OM.addPredicate<InstructionOperandMatcher>(
|
||||
InsnMatcher.getRuleMatcher(), SrcChild->getName());
|
||||
if (!MaybeInsnOperand.hasValue()) {
|
||||
if (!MaybeInsnOperand) {
|
||||
// This isn't strictly true. If the user were to provide exactly the same
|
||||
// matchers as the original operand then we could allow it. However, it's
|
||||
// simpler to not permit the redundant specification.
|
||||
|
@ -4404,7 +4404,7 @@ Expected<action_iterator> GlobalISelEmitter::importExplicitUseRenderer(
|
|||
TreePatternNode *DstChild) {
|
||||
|
||||
const auto &SubOperand = Rule.getComplexSubOperand(DstChild->getName());
|
||||
if (SubOperand.hasValue()) {
|
||||
if (SubOperand) {
|
||||
DstMIBuilder.addRenderer<RenderComplexPatternOperand>(
|
||||
*std::get<0>(*SubOperand), DstChild->getName(),
|
||||
std::get<1>(*SubOperand), std::get<2>(*SubOperand));
|
||||
|
@ -4806,7 +4806,7 @@ Expected<action_iterator> GlobalISelEmitter::importExplicitUseRenderers(
|
|||
|
||||
const auto SrcRCDstRCPair =
|
||||
RC->getMatchingSubClassWithSubRegs(CGRegs, SubIdx);
|
||||
if (SrcRCDstRCPair.hasValue()) {
|
||||
if (SrcRCDstRCPair) {
|
||||
assert(SrcRCDstRCPair->second && "Couldn't find a matching subclass");
|
||||
if (SrcRCDstRCPair->first != RC)
|
||||
return failedImport("EXTRACT_SUBREG requires an additional COPY");
|
||||
|
|
Loading…
Reference in New Issue