52 changes: 26 additions & 26 deletions clang/lib/Sema/SemaOpenMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ class DSAStackTy {
void addCriticalWithHint(const OMPCriticalDirective *D, llvm::APSInt Hint) {
Criticals.try_emplace(D->getDirectiveName().getAsString(), D, Hint);
}
const std::pair<const OMPCriticalDirective *, llvm::APSInt>
std::pair<const OMPCriticalDirective *, llvm::APSInt>
getCriticalWithHint(const DeclarationNameInfo &Name) const {
auto I = Criticals.find(Name.getAsString());
if (I != Criticals.end())
Expand All @@ -519,18 +519,18 @@ class DSAStackTy {
/// current region.
/// \return The index of the loop control variable in the list of associated
/// for-loops (from outer to inner).
const LCDeclInfo isLoopControlVariable(const ValueDecl *D) const;
LCDeclInfo isLoopControlVariable(const ValueDecl *D) const;
/// Check if the specified variable is a loop control variable for
/// parent region.
/// \return The index of the loop control variable in the list of associated
/// for-loops (from outer to inner).
const LCDeclInfo isParentLoopControlVariable(const ValueDecl *D) const;
LCDeclInfo isParentLoopControlVariable(const ValueDecl *D) const;
/// Check if the specified variable is a loop control variable for
/// current region.
/// \return The index of the loop control variable in the list of associated
/// for-loops (from outer to inner).
const LCDeclInfo isLoopControlVariable(const ValueDecl *D,
unsigned Level) const;
LCDeclInfo isLoopControlVariable(const ValueDecl *D,
unsigned Level) const;
/// Get the loop control variable for the I-th loop (or nullptr) in
/// parent directive.
const ValueDecl *getParentLoopControlVariable(unsigned I) const;
Expand Down Expand Up @@ -563,13 +563,13 @@ class DSAStackTy {
const Expr *ReductionRef);
/// Returns the location and reduction operation from the innermost parent
/// region for the given \p D.
const DSAVarData
DSAVarData
getTopMostTaskgroupReductionData(const ValueDecl *D, SourceRange &SR,
BinaryOperatorKind &BOK,
Expr *&TaskgroupDescriptor) const;
/// Returns the location and reduction operation from the innermost parent
/// region for the given \p D.
const DSAVarData
DSAVarData
getTopMostTaskgroupReductionData(const ValueDecl *D, SourceRange &SR,
const Expr *&ReductionRef,
Expr *&TaskgroupDescriptor) const;
Expand All @@ -594,15 +594,15 @@ class DSAStackTy {

/// Returns data sharing attributes from top of the stack for the
/// specified declaration.
const DSAVarData getTopDSA(ValueDecl *D, bool FromParent);
DSAVarData getTopDSA(ValueDecl *D, bool FromParent);
/// Returns data-sharing attributes for the specified declaration.
const DSAVarData getImplicitDSA(ValueDecl *D, bool FromParent) const;
DSAVarData getImplicitDSA(ValueDecl *D, bool FromParent) const;
/// Returns data-sharing attributes for the specified declaration.
const DSAVarData getImplicitDSA(ValueDecl *D, unsigned Level) const;
DSAVarData getImplicitDSA(ValueDecl *D, unsigned Level) const;
/// Checks if the specified variables has data-sharing attributes which
/// match specified \a CPred predicate in any directive which matches \a DPred
/// predicate.
const DSAVarData
DSAVarData
hasDSA(ValueDecl *D,
const llvm::function_ref<bool(OpenMPClauseKind, bool,
DefaultDataSharingAttributes)>
Expand All @@ -612,7 +612,7 @@ class DSAStackTy {
/// Checks if the specified variables has data-sharing attributes which
/// match specified \a CPred predicate in any innermost directive which
/// matches \a DPred predicate.
const DSAVarData
DSAVarData
hasInnermostDSA(ValueDecl *D,
const llvm::function_ref<bool(OpenMPClauseKind, bool)> CPred,
const llvm::function_ref<bool(OpenMPDirectiveKind)> DPred,
Expand Down Expand Up @@ -1436,7 +1436,7 @@ void DSAStackTy::addLoopControlVariable(const ValueDecl *D, VarDecl *Capture) {
D, LCDeclInfo(StackElem.LCVMap.size() + 1, Capture));
}

const DSAStackTy::LCDeclInfo
DSAStackTy::LCDeclInfo
DSAStackTy::isLoopControlVariable(const ValueDecl *D) const {
assert(!isStackEmpty() && "Data-sharing attributes stack is empty");
D = getCanonicalDecl(D);
Expand All @@ -1447,7 +1447,7 @@ DSAStackTy::isLoopControlVariable(const ValueDecl *D) const {
return {0, nullptr};
}

const DSAStackTy::LCDeclInfo
DSAStackTy::LCDeclInfo
DSAStackTy::isLoopControlVariable(const ValueDecl *D, unsigned Level) const {
assert(!isStackEmpty() && "Data-sharing attributes stack is empty");
D = getCanonicalDecl(D);
Expand All @@ -1460,7 +1460,7 @@ DSAStackTy::isLoopControlVariable(const ValueDecl *D, unsigned Level) const {
return {0, nullptr};
}

const DSAStackTy::LCDeclInfo
DSAStackTy::LCDeclInfo
DSAStackTy::isParentLoopControlVariable(const ValueDecl *D) const {
const SharingMapTy *Parent = getSecondOnStackOrNull();
assert(Parent && "Data-sharing attributes stack is empty");
Expand Down Expand Up @@ -1602,7 +1602,7 @@ void DSAStackTy::addTaskgroupReductionData(const ValueDecl *D, SourceRange SR,
}
}

const DSAStackTy::DSAVarData DSAStackTy::getTopMostTaskgroupReductionData(
DSAStackTy::DSAVarData DSAStackTy::getTopMostTaskgroupReductionData(
const ValueDecl *D, SourceRange &SR, BinaryOperatorKind &BOK,
Expr *&TaskgroupDescriptor) const {
D = getCanonicalDecl(D);
Expand All @@ -1629,7 +1629,7 @@ const DSAStackTy::DSAVarData DSAStackTy::getTopMostTaskgroupReductionData(
return DSAVarData();
}

const DSAStackTy::DSAVarData DSAStackTy::getTopMostTaskgroupReductionData(
DSAStackTy::DSAVarData DSAStackTy::getTopMostTaskgroupReductionData(
const ValueDecl *D, SourceRange &SR, const Expr *&ReductionRef,
Expr *&TaskgroupDescriptor) const {
D = getCanonicalDecl(D);
Expand Down Expand Up @@ -1721,8 +1721,8 @@ static bool rejectConstNotMutableType(Sema &SemaRef, const ValueDecl *D,
return false;
}

const DSAStackTy::DSAVarData DSAStackTy::getTopDSA(ValueDecl *D,
bool FromParent) {
DSAStackTy::DSAVarData DSAStackTy::getTopDSA(ValueDecl *D,
bool FromParent) {
D = getCanonicalDecl(D);
DSAVarData DVar;

Expand Down Expand Up @@ -1881,8 +1881,8 @@ const DSAStackTy::DSAVarData DSAStackTy::getTopDSA(ValueDecl *D,
return DVar;
}

const DSAStackTy::DSAVarData DSAStackTy::getImplicitDSA(ValueDecl *D,
bool FromParent) const {
DSAStackTy::DSAVarData DSAStackTy::getImplicitDSA(ValueDecl *D,
bool FromParent) const {
if (isStackEmpty()) {
const_iterator I;
return getDSA(I, D);
Expand All @@ -1895,16 +1895,16 @@ const DSAStackTy::DSAVarData DSAStackTy::getImplicitDSA(ValueDecl *D,
return getDSA(StartI, D);
}

const DSAStackTy::DSAVarData DSAStackTy::getImplicitDSA(ValueDecl *D,
unsigned Level) const {
DSAStackTy::DSAVarData DSAStackTy::getImplicitDSA(ValueDecl *D,
unsigned Level) const {
if (getStackSize() <= Level)
return DSAVarData();
D = getCanonicalDecl(D);
const_iterator StartI = std::next(begin(), getStackSize() - 1 - Level);
return getDSA(StartI, D);
}

const DSAStackTy::DSAVarData
DSAStackTy::DSAVarData
DSAStackTy::hasDSA(ValueDecl *D,
const llvm::function_ref<bool(OpenMPClauseKind, bool,
DefaultDataSharingAttributes)>
Expand All @@ -1930,7 +1930,7 @@ DSAStackTy::hasDSA(ValueDecl *D,
return {};
}

const DSAStackTy::DSAVarData DSAStackTy::hasInnermostDSA(
DSAStackTy::DSAVarData DSAStackTy::hasInnermostDSA(
ValueDecl *D, const llvm::function_ref<bool(OpenMPClauseKind, bool)> CPred,
const llvm::function_ref<bool(OpenMPDirectiveKind)> DPred,
bool FromParent) const {
Expand Down Expand Up @@ -22487,7 +22487,7 @@ bool SemaOpenMP::ActOnStartOpenMPDeclareTargetContext(
return true;
}

const SemaOpenMP::DeclareTargetContextInfo
SemaOpenMP::DeclareTargetContextInfo
SemaOpenMP::ActOnOpenMPEndDeclareTargetDirective() {
assert(!DeclareTargetNesting.empty() &&
"check isInOpenMPDeclareTargetContext() first!");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ class StdLibraryFunctionsChecker
/// a later bug report created by ErrnoChecker.
/// Empty return value means that 'errno' related bug may not happen from
/// the current analyzed function.
virtual const std::string describe(CheckerContext &C) const { return ""; }
virtual std::string describe(CheckerContext &C) const { return ""; }

virtual ~ErrnoConstraintBase() {}

Expand Down Expand Up @@ -606,7 +606,7 @@ class StdLibraryFunctionsChecker
return errno_modeling::setErrnoForStdSuccess(State, C);
}

const std::string describe(CheckerContext &C) const override {
std::string describe(CheckerContext &C) const override {
return "'errno' becomes undefined after the call";
}
};
Expand All @@ -624,7 +624,7 @@ class StdLibraryFunctionsChecker
Call.getOriginExpr());
}

const std::string describe(CheckerContext &C) const override {
std::string describe(CheckerContext &C) const override {
return "reading 'errno' is required to find out if the call has failed";
}
};
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/StaticAnalyzer/Core/BugReporterVisitors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ static bool potentiallyWritesIntoIvar(const Decl *Parent,
/// Note that \p Vec is passed by value, leading to quadratic copying cost,
/// but it's OK in practice since its length is limited to DEREFERENCE_LIMIT.
/// \return A chain fields leading to the region of interest or std::nullopt.
const std::optional<NoStoreFuncVisitor::RegionVector>
std::optional<NoStoreFuncVisitor::RegionVector>
NoStoreFuncVisitor::findRegionOfInterestInRecord(
const RecordDecl *RD, ProgramStateRef State, const MemRegion *R,
const NoStoreFuncVisitor::RegionVector &Vec /* = {} */,
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/StaticAnalyzer/Core/CallEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ const ConstructionContext *CallEvent::getConstructionContext() const {
return nullptr;
}

const CallEventRef<> CallEvent::getCaller() const {
CallEventRef<> CallEvent::getCaller() const {
const auto *CallLocationContext = this->getLocationContext();
if (!CallLocationContext || CallLocationContext->inTopFrame())
return nullptr;
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/ADT/APInt.h
Original file line number Diff line number Diff line change
Expand Up @@ -2227,12 +2227,12 @@ inline const APInt &umax(const APInt &A, const APInt &B) {
}

/// Determine the absolute difference of two APInts considered to be signed.
inline const APInt abds(const APInt &A, const APInt &B) {
inline APInt abds(const APInt &A, const APInt &B) {
return A.sge(B) ? (A - B) : (B - A);
}

/// Determine the absolute difference of two APInts considered to be unsigned.
inline const APInt abdu(const APInt &A, const APInt &B) {
inline APInt abdu(const APInt &A, const APInt &B) {
return A.uge(B) ? (A - B) : (B - A);
}

Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/ADT/DenseMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -465,13 +465,13 @@ class DenseMapBase : public DebugEpochBase {
return KeyInfoT::getHashValue(Val);
}

static const KeyT getEmptyKey() {
static KeyT getEmptyKey() {
static_assert(std::is_base_of_v<DenseMapBase, DerivedT>,
"Must pass the derived type to this template!");
return KeyInfoT::getEmptyKey();
}

static const KeyT getTombstoneKey() { return KeyInfoT::getTombstoneKey(); }
static KeyT getTombstoneKey() { return KeyInfoT::getTombstoneKey(); }

private:
iterator makeIterator(BucketT *P, BucketT *E, DebugEpochBase &Epoch,
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/ADT/SmallPtrSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class LLVM_DEBUGEPOCHBASE_HANDLEBASE_EMPTYBASE SmallPtrSetIterator

// Most methods are provided by the base class.

const PtrTy operator*() const {
PtrTy operator*() const {
assert(isHandleInSync() && "invalid iterator access!");
if (shouldReverseIterate()) {
assert(Bucket > End);
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/Analysis/CtxProfAnalysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class PGOContextualProfile {
void update(Visitor, const Function &F);
void visit(ConstVisitor, const Function *F = nullptr) const;

const CtxProfFlatProfile flatten() const;
CtxProfFlatProfile flatten() const;

bool invalidate(Module &, const PreservedAnalyses &PA,
ModuleAnalysisManager::Invalidator &) {
Expand Down
10 changes: 5 additions & 5 deletions llvm/include/llvm/Analysis/InstructionSimplify.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ bool replaceAndRecursivelySimplify(
// These helper functions return a SimplifyQuery structure that contains as
// many of the optional analysis we use as are currently valid. This is the
// strongly preferred way of constructing SimplifyQuery in passes.
const SimplifyQuery getBestSimplifyQuery(Pass &, Function &);
SimplifyQuery getBestSimplifyQuery(Pass &, Function &);
template <class T, class... TArgs>
const SimplifyQuery getBestSimplifyQuery(AnalysisManager<T, TArgs...> &,
Function &);
const SimplifyQuery getBestSimplifyQuery(LoopStandardAnalysisResults &,
const DataLayout &);
SimplifyQuery getBestSimplifyQuery(AnalysisManager<T, TArgs...> &,
Function &);
SimplifyQuery getBestSimplifyQuery(LoopStandardAnalysisResults &,
const DataLayout &);
} // end namespace llvm

#endif
2 changes: 1 addition & 1 deletion llvm/include/llvm/CodeGen/AccelTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ template <typename DataT> class AccelTable : public AccelTableBase {
void addName(DwarfStringPoolEntryRef Name, Types &&... Args);
void clear() { Entries.clear(); }
void addEntries(AccelTable<DataT> &Table);
const StringEntries getEntries() const { return Entries; }
StringEntries getEntries() const { return Entries; }
};

template <typename AccelTableDataT>
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class DWARFDebugLine {
std::vector<DWARFFormValue> IncludeDirectories;
std::vector<FileNameEntry> FileNames;

const dwarf::FormParams getFormParams() const { return FormParams; }
dwarf::FormParams getFormParams() const { return FormParams; }
uint16_t getVersion() const { return FormParams.Version; }
uint8_t getAddressSize() const { return FormParams.AddrSize; }
bool isDWARF64() const { return FormParams.Format == dwarf::DWARF64; }
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/DebugInfo/PDB/Native/ModuleDebugStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ModuleDebugStreamRef {
symbols(bool *HadError) const;

const codeview::CVSymbolArray &getSymbolArray() const { return SymbolArray; }
const codeview::CVSymbolArray
codeview::CVSymbolArray
getSymbolArrayForScope(uint32_t ScopeBegin) const;

BinarySubstreamRef getSymbolsSubstream() const;
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/MC/MCParser/MCAsmLexer.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class MCAsmLexer {
}

/// Look ahead at the next token to be lexed.
const AsmToken peekTok(bool ShouldSkipSpace = true) {
AsmToken peekTok(bool ShouldSkipSpace = true) {
AsmToken Tok;

MutableArrayRef<AsmToken> Buf(Tok);
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/MC/MCPseudoProbe.h
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ class MCPseudoProbeDecoder {
return iterator_range(It->second);
}

const ArrayRef<MCDecodedPseudoProbeInlineTree> getInlineTreeVec() const {
ArrayRef<MCDecodedPseudoProbeInlineTree> getInlineTreeVec() const {
return InlineTreeVec;
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/Option/OptTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class OptTable {
/// if necessary.
///
/// \return The option, or null for the INVALID option id.
const Option getOption(OptSpecifier Opt) const;
Option getOption(OptSpecifier Opt) const;

/// Lookup the name of the given option.
StringRef getOptionName(OptSpecifier id) const {
Expand Down
6 changes: 3 additions & 3 deletions llvm/include/llvm/Option/Option.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,13 @@ class Option {
return Info->getName();
}

const Option getGroup() const {
Option getGroup() const {
assert(Info && "Must have a valid info!");
assert(Owner && "Must have a valid owner!");
return Owner->getOption(Info->GroupID);
}

const Option getAlias() const {
Option getAlias() const {
assert(Info && "Must have a valid info!");
assert(Owner && "Must have a valid owner!");
return Owner->getOption(Info->AliasID);
Expand Down Expand Up @@ -193,7 +193,7 @@ class Option {

/// getUnaliasedOption - Return the final option this option
/// aliases (itself, if the option has no alias).
const Option getUnaliasedOption() const {
Option getUnaliasedOption() const {
const Option Alias = getAlias();
if (Alias.isValid()) return Alias.getUnaliasedOption();
return *this;
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/ProfileData/MemProf.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ struct AllocationInfo {
AllocationInfo() = default;
AllocationInfo(
const IndexedAllocationInfo &IndexedAI,
llvm::function_ref<const Frame(const FrameId)> IdToFrameCallback) {
llvm::function_ref<Frame(FrameId)> IdToFrameCallback) {
for (const FrameId &Id : IndexedAI.CallStack) {
CallStack.push_back(IdToFrameCallback(Id));
}
Expand Down Expand Up @@ -475,7 +475,7 @@ struct MemProfRecord {
MemProfRecord() = default;
MemProfRecord(
const IndexedMemProfRecord &Record,
llvm::function_ref<const Frame(const FrameId Id)> IdToFrameCallback) {
llvm::function_ref<Frame(FrameId)> IdToFrameCallback) {
for (const IndexedAllocationInfo &IndexedAI : Record.AllocSites) {
AllocSites.emplace_back(IndexedAI, IdToFrameCallback);
}
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/ProfileData/MemProfReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class MemProfReader {

virtual Error
readNextRecord(GuidMemProfRecordPair &GuidRecord,
std::function<const Frame(const FrameId)> Callback = nullptr) {
std::function<Frame(FrameId)> Callback = nullptr) {
if (FunctionProfileData.empty())
return make_error<InstrProfError>(instrprof_error::empty_raw_profile);

Expand Down Expand Up @@ -163,7 +163,7 @@ class RawMemProfReader final : public MemProfReader {

Error
readNextRecord(GuidMemProfRecordPair &GuidRecord,
std::function<const Frame(const FrameId)> Callback) override;
std::function<Frame(FrameId)> Callback) override;

// Constructor for unittests only.
RawMemProfReader(std::unique_ptr<llvm::symbolize::SymbolizableModule> Sym,
Expand Down
8 changes: 4 additions & 4 deletions llvm/include/llvm/ProfileData/SampleProf.h
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ class SampleRecord {

uint64_t getSamples() const { return NumSamples; }
const CallTargetMap &getCallTargets() const { return CallTargets; }
const SortedCallTargetSet getSortedCallTargets() const {
SortedCallTargetSet getSortedCallTargets() const {
return sortCallTargets(CallTargets);
}

Expand All @@ -403,7 +403,7 @@ class SampleRecord {
}

/// Sort call targets in descending order of call frequency.
static const SortedCallTargetSet
static SortedCallTargetSet
sortCallTargets(const CallTargetMap &Targets) {
SortedCallTargetSet SortedTargets;
for (const auto &[Target, Frequency] : Targets) {
Expand All @@ -413,8 +413,8 @@ class SampleRecord {
}

/// Prorate call targets by a distribution factor.
static const CallTargetMap adjustCallTargets(const CallTargetMap &Targets,
float DistributionFactor) {
static CallTargetMap adjustCallTargets(const CallTargetMap &Targets,
float DistributionFactor) {
CallTargetMap AdjustedTargets;
for (const auto &[Target, Frequency] : Targets) {
AdjustedTargets[Target] = Frequency * DistributionFactor;
Expand Down
4 changes: 2 additions & 2 deletions llvm/include/llvm/Support/PointerLikeTypeTraits.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ template <> struct PointerLikeTypeTraits<void *> {
template <typename T> struct PointerLikeTypeTraits<const T> {
typedef PointerLikeTypeTraits<T> NonConst;

static inline const void *getAsVoidPointer(const T P) {
static inline const void *getAsVoidPointer(T P) {
return NonConst::getAsVoidPointer(P);
}
static inline const T getFromVoidPointer(const void *P) {
static inline T getFromVoidPointer(const void *P) {
return NonConst::getFromVoidPointer(const_cast<void *>(P));
}
static constexpr int NumLowBitsAvailable = NonConst::NumLowBitsAvailable;
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/TableGen/Record.h
Original file line number Diff line number Diff line change
Expand Up @@ -1978,7 +1978,7 @@ class RecordKeeper {
detail::RecordKeeperImpl &getImpl() { return *Impl; }

/// Get the main TableGen input file's name.
const std::string getInputFilename() const { return InputFilename; }
std::string getInputFilename() const { return InputFilename; }

/// Get the map of classes.
const RecordMap &getClasses() const { return Classes; }
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/Target/TargetMachine.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ class TargetMachine {
}

/// Create a DataLayout.
const DataLayout createDataLayout() const { return DL; }
DataLayout createDataLayout() const { return DL; }

/// Test if a DataLayout if compatible with the CodeGen for this target.
///
Expand Down
2 changes: 1 addition & 1 deletion llvm/include/llvm/TargetParser/Host.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace sys {
/// which features may appear in this map, except that they are all valid LLVM
/// feature names. The map can be empty, for example if feature detection
/// fails.
const StringMap<bool, MallocAllocator> getHostCPUFeatures();
StringMap<bool, MallocAllocator> getHostCPUFeatures();

/// This is a function compatible with cl::AddExtraVersionPrinter, which adds
/// info about the current target triple and detected CPU.
Expand Down
118 changes: 59 additions & 59 deletions llvm/include/llvm/Transforms/IPO/Attributor.h

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion llvm/include/llvm/Transforms/Utils/SCCPSolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class SCCPSolver {

/// getMRVFunctionsTracked - Get the set of functions which return multiple
/// values tracked by the pass.
const SmallPtrSet<Function *, 16> getMRVFunctionsTracked();
SmallPtrSet<Function *, 16> getMRVFunctionsTracked();

/// markOverdefined - Mark the specified value overdefined. This
/// works with both scalars and structs.
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Analysis/CtxProfAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ void PGOContextualProfile::visit(ConstVisitor V, const Function *F) const {
V(*reinterpret_cast<const PGOCtxProfContext *>(Node));
}

const CtxProfFlatProfile PGOContextualProfile::flatten() const {
CtxProfFlatProfile PGOContextualProfile::flatten() const {
assert(Profiles.has_value());
CtxProfFlatProfile Flat;
preorderVisit<const PGOCtxProfContext::CallTargetMapTy,
Expand Down
14 changes: 7 additions & 7 deletions llvm/lib/Analysis/InstructionSimplify.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7302,7 +7302,7 @@ bool llvm::replaceAndRecursivelySimplify(
}

namespace llvm {
const SimplifyQuery getBestSimplifyQuery(Pass &P, Function &F) {
SimplifyQuery getBestSimplifyQuery(Pass &P, Function &F) {
auto *DTWP = P.getAnalysisIfAvailable<DominatorTreeWrapperPass>();
auto *DT = DTWP ? &DTWP->getDomTree() : nullptr;
auto *TLIWP = P.getAnalysisIfAvailable<TargetLibraryInfoWrapperPass>();
Expand All @@ -7312,21 +7312,21 @@ const SimplifyQuery getBestSimplifyQuery(Pass &P, Function &F) {
return {F.getDataLayout(), TLI, DT, AC};
}

const SimplifyQuery getBestSimplifyQuery(LoopStandardAnalysisResults &AR,
const DataLayout &DL) {
SimplifyQuery getBestSimplifyQuery(LoopStandardAnalysisResults &AR,
const DataLayout &DL) {
return {DL, &AR.TLI, &AR.DT, &AR.AC};
}

template <class T, class... TArgs>
const SimplifyQuery getBestSimplifyQuery(AnalysisManager<T, TArgs...> &AM,
Function &F) {
SimplifyQuery getBestSimplifyQuery(AnalysisManager<T, TArgs...> &AM,
Function &F) {
auto *DT = AM.template getCachedResult<DominatorTreeAnalysis>(F);
auto *TLI = AM.template getCachedResult<TargetLibraryAnalysis>(F);
auto *AC = AM.template getCachedResult<AssumptionAnalysis>(F);
return {F.getDataLayout(), TLI, DT, AC};
}
template const SimplifyQuery getBestSimplifyQuery(AnalysisManager<Function> &,
Function &);
template SimplifyQuery getBestSimplifyQuery(AnalysisManager<Function> &,
Function &);

bool SimplifyQuery::isUndefValue(Value *V) const {
if (!CanUseUndef)
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/DebugInfo/PDB/Native/ModuleDebugStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Error ModuleDebugStreamRef::reloadSerialize(BinaryStreamReader &Reader) {
return Error::success();
}

const codeview::CVSymbolArray
codeview::CVSymbolArray
ModuleDebugStreamRef::getSymbolArrayForScope(uint32_t ScopeBegin) const {
return limitSymbolArrayToScope(SymbolArray, ScopeBegin);
}
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/MC/MCParser/MasmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ class MasmParser : public MCAsmParser {

private:
bool expandMacros();
const AsmToken peekTok(bool ShouldSkipSpace = true);
AsmToken peekTok(bool ShouldSkipSpace = true);

bool parseStatement(ParseStatementInfo &Info,
MCAsmParserSemaCallback *SI);
Expand Down Expand Up @@ -1287,7 +1287,7 @@ const AsmToken &MasmParser::Lex(ExpandKind ExpandNextToken) {
return *tok;
}

const AsmToken MasmParser::peekTok(bool ShouldSkipSpace) {
AsmToken MasmParser::peekTok(bool ShouldSkipSpace) {
AsmToken Tok;

MutableArrayRef<AsmToken> Buf(Tok);
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Option/OptTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ void OptTable::buildPrefixChars() {

OptTable::~OptTable() = default;

const Option OptTable::getOption(OptSpecifier Opt) const {
Option OptTable::getOption(OptSpecifier Opt) const {
unsigned id = Opt.getID();
if (id == 0)
return Option(nullptr, nullptr);
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/ProfileData/MemProfReader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ RawMemProfReader::getModuleOffset(const uint64_t VirtualAddress) {

Error RawMemProfReader::readNextRecord(
GuidMemProfRecordPair &GuidRecord,
std::function<const Frame(const FrameId)> Callback) {
std::function<Frame(FrameId)> Callback) {
// Create a new callback for the RawMemProfRecord iterator so that we can
// provide the symbol name if the reader was initialized with KeepSymbolName =
// true. This is useful for debugging and testing.
Expand Down
12 changes: 6 additions & 6 deletions llvm/lib/TargetParser/Host.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1676,7 +1676,7 @@ VendorSignatures getVendorSignature(unsigned *MaxLeaf) {

#if defined(__i386__) || defined(_M_IX86) || \
defined(__x86_64__) || defined(_M_X64)
const StringMap<bool> sys::getHostCPUFeatures() {
StringMap<bool> sys::getHostCPUFeatures() {
unsigned EAX = 0, EBX = 0, ECX = 0, EDX = 0;
unsigned MaxLevel;
StringMap<bool> Features;
Expand Down Expand Up @@ -1880,7 +1880,7 @@ const StringMap<bool> sys::getHostCPUFeatures() {
return Features;
}
#elif defined(__linux__) && (defined(__arm__) || defined(__aarch64__))
const StringMap<bool> sys::getHostCPUFeatures() {
StringMap<bool> sys::getHostCPUFeatures() {
StringMap<bool> Features;
std::unique_ptr<llvm::MemoryBuffer> P = getProcCpuinfoContent();
if (!P)
Expand Down Expand Up @@ -1955,7 +1955,7 @@ const StringMap<bool> sys::getHostCPUFeatures() {
return Features;
}
#elif defined(_WIN32) && (defined(__aarch64__) || defined(_M_ARM64))
const StringMap<bool> sys::getHostCPUFeatures() {
StringMap<bool> sys::getHostCPUFeatures() {
StringMap<bool> Features;

// If we're asking the OS at runtime, believe what the OS says
Expand All @@ -1974,7 +1974,7 @@ const StringMap<bool> sys::getHostCPUFeatures() {
}
#elif defined(__linux__) && defined(__loongarch__)
#include <sys/auxv.h>
const StringMap<bool> sys::getHostCPUFeatures() {
StringMap<bool> sys::getHostCPUFeatures() {
unsigned long hwcap = getauxval(AT_HWCAP);
bool HasFPU = hwcap & (1UL << 3); // HWCAP_LOONGARCH_FPU
uint32_t cpucfg2 = 0x2;
Expand All @@ -1997,7 +1997,7 @@ struct RISCVHwProbe {
int64_t Key;
uint64_t Value;
};
const StringMap<bool> sys::getHostCPUFeatures() {
StringMap<bool> sys::getHostCPUFeatures() {
RISCVHwProbe Query[]{{/*RISCV_HWPROBE_KEY_BASE_BEHAVIOR=*/3, 0},
{/*RISCV_HWPROBE_KEY_IMA_EXT_0=*/4, 0},
{/*RISCV_HWPROBE_KEY_MISALIGNED_SCALAR_PERF=*/9, 0}};
Expand Down Expand Up @@ -2080,7 +2080,7 @@ const StringMap<bool> sys::getHostCPUFeatures() {
return Features;
}
#else
const StringMap<bool> sys::getHostCPUFeatures() { return {}; }
StringMap<bool> sys::getHostCPUFeatures() { return {}; }
#endif

#if __APPLE__
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/IPO/Attributor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3288,7 +3288,7 @@ InformationCache::FunctionInfo::~FunctionInfo() {
It.getSecond()->~InstructionVectorTy();
}

const ArrayRef<Function *>
ArrayRef<Function *>
InformationCache::getIndirectlyCallableFunctions(Attributor &A) const {
assert(A.isClosedWorldModule() && "Cannot see all indirect callees!");
return IndirectlyCallableFunctions;
Expand Down
78 changes: 39 additions & 39 deletions llvm/lib/Transforms/IPO/AttributorAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ struct AAPointerInfoImpl
AAPointerInfoImpl(const IRPosition &IRP, Attributor &A) : BaseTy(IRP) {}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return std::string("PointerInfo ") +
(isValidState() ? (std::string("#") +
std::to_string(OffsetBins.size()) + " bins")
Expand Down Expand Up @@ -2099,7 +2099,7 @@ struct AANoUnwindImpl : AANoUnwind {
(void)IsKnown;
}

const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "nounwind" : "may-unwind";
}

Expand Down Expand Up @@ -2224,7 +2224,7 @@ struct AANoSyncImpl : AANoSync {
(void)IsKnown;
}

const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "nosync" : "may-sync";
}

Expand Down Expand Up @@ -2314,7 +2314,7 @@ struct AANoFreeImpl : public AANoFree {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "nofree" : "may-free";
}
};
Expand Down Expand Up @@ -2620,7 +2620,7 @@ struct AANonNullImpl : AANonNull {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "nonnull" : "may-null";
}
};
Expand Down Expand Up @@ -2698,7 +2698,7 @@ struct AANonNullReturned final
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "nonnull" : "may-null";
}

Expand Down Expand Up @@ -2750,7 +2750,7 @@ struct AAMustProgressImpl : public AAMustProgress {
}

/// See AbstractAttribute::getAsStr()
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "mustprogress" : "may-not-progress";
}
};
Expand Down Expand Up @@ -2833,7 +2833,7 @@ struct AANoRecurseImpl : public AANoRecurse {
}

/// See AbstractAttribute::getAsStr()
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "norecurse" : "may-recurse";
}
};
Expand Down Expand Up @@ -2898,7 +2898,7 @@ struct AANonConvergentImpl : public AANonConvergent {
: AANonConvergent(IRP, A) {}

/// See AbstractAttribute::getAsStr()
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "non-convergent" : "may-be-convergent";
}
};
Expand Down Expand Up @@ -3198,7 +3198,7 @@ struct AAUndefinedBehaviorImpl : public AAUndefinedBehavior {
}

/// See AbstractAttribute::getAsStr()
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "undefined-behavior" : "no-ub";
}

Expand Down Expand Up @@ -3367,7 +3367,7 @@ struct AAWillReturnImpl : public AAWillReturn {
}

/// See AbstractAttribute::getAsStr()
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "willreturn" : "may-noreturn";
}
};
Expand Down Expand Up @@ -3569,7 +3569,7 @@ struct CachedReachabilityAA : public BaseTy {
return Result == RQITy::Reachable::Yes;
}

const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
// TODO: Return the number of reachable queries.
return "#queries(" + std::to_string(QueryVector.size()) + ")";
}
Expand Down Expand Up @@ -3800,7 +3800,7 @@ struct AANoAliasImpl : AANoAlias {
"Noalias is a pointer attribute");
}

const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "noalias" : "may-alias";
}
};
Expand Down Expand Up @@ -4132,7 +4132,7 @@ struct AAIsDeadValueImpl : public AAIsDead {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return isAssumedDead() ? "assumed-dead" : "assumed-live";
}

Expand Down Expand Up @@ -4264,7 +4264,7 @@ struct AAIsDeadFloating : public AAIsDeadValueImpl {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
Instruction *I = dyn_cast<Instruction>(&getAssociatedValue());
if (isa_and_nonnull<StoreInst>(I))
if (isValidState())
Expand Down Expand Up @@ -4448,7 +4448,7 @@ struct AAIsDeadCallSiteReturned : public AAIsDeadFloating {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return isAssumedDead()
? "assumed-dead"
: (getAssumed() ? "assumed-dead-users" : "assumed-live");
Expand Down Expand Up @@ -4525,7 +4525,7 @@ struct AAIsDeadFunction : public AAIsDead {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return "Live[#BB " + std::to_string(AssumedLiveBlocks.size()) + "/" +
std::to_string(getAnchorScope()->size()) + "][#TBEP " +
std::to_string(ToBeExploredFrom.size()) + "][#KDE " +
Expand Down Expand Up @@ -5038,7 +5038,7 @@ struct AADereferenceableImpl : AADereferenceable {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
if (!getAssumedDereferenceableBytes())
return "unknown-dereferenceable";
bool IsKnownNonNull;
Expand Down Expand Up @@ -5343,7 +5343,7 @@ struct AAAlignImpl : AAAlign {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return "align<" + std::to_string(getKnownAlign().value()) + "-" +
std::to_string(getAssumedAlign().value()) + ">";
}
Expand Down Expand Up @@ -5511,7 +5511,7 @@ struct AANoReturnImpl : public AANoReturn {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "noreturn" : "may-return";
}

Expand Down Expand Up @@ -5658,7 +5658,7 @@ struct AAInstanceInfoImpl : public AAInstanceInfo {
}

/// See AbstractState::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return isAssumedUniqueForAnalysis() ? "<unique [fAa]>" : "<unknown>";
}

Expand Down Expand Up @@ -5851,7 +5851,7 @@ struct AANoCaptureImpl : public AANoCapture {
}

/// See AbstractState::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
if (isKnownNoCapture())
return "known not-captured";
if (isAssumedNoCapture())
Expand Down Expand Up @@ -6159,7 +6159,7 @@ struct AAValueSimplifyImpl : AAValueSimplify {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
LLVM_DEBUG({
dbgs() << "SAV: " << (bool)SimplifiedAssociatedValue << " ";
if (SimplifiedAssociatedValue && *SimplifiedAssociatedValue)
Expand Down Expand Up @@ -6696,7 +6696,7 @@ struct AAHeapToStackFunction final : public AAHeapToStack {
SCB);
}

const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
unsigned NumH2SMallocs = 0, NumInvalidMallocs = 0;
for (const auto &It : AllocationInfos) {
if (It.second->Status == AllocationInfo::INVALID)
Expand Down Expand Up @@ -7225,7 +7225,7 @@ struct AAPrivatizablePtrImpl : public AAPrivatizablePtr {
return PrivatizableType;
}

const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return isAssumedPrivatizablePtr() ? "[priv]" : "[no-priv]";
}

Expand Down Expand Up @@ -7876,7 +7876,7 @@ struct AAMemoryBehaviorImpl : public AAMemoryBehavior {
}

/// See AbstractState::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
if (isAssumedReadNone())
return "readnone";
if (isAssumedReadOnly())
Expand Down Expand Up @@ -8897,7 +8897,7 @@ struct AADenormalFPMathImpl : public AADenormalFPMath {
AADenormalFPMathImpl(const IRPosition &IRP, Attributor &A)
: AADenormalFPMath(IRP, A) {}

const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
std::string Str("AADenormalFPMath[");
raw_string_ostream OS(Str);

Expand Down Expand Up @@ -9015,7 +9015,7 @@ struct AAValueConstantRangeImpl : AAValueConstantRange {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
std::string Str;
llvm::raw_string_ostream OS(Str);
OS << "range(" << getBitWidth() << ")<";
Expand Down Expand Up @@ -9696,7 +9696,7 @@ struct AAPotentialConstantValuesImpl : AAPotentialConstantValues {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
std::string Str;
llvm::raw_string_ostream OS(Str);
OS << getState();
Expand Down Expand Up @@ -10239,7 +10239,7 @@ struct AANoUndefImpl : AANoUndef {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return getAssumed() ? "noundef" : "may-undef-or-poison";
}

Expand Down Expand Up @@ -10399,7 +10399,7 @@ struct AANoFPClassImpl : AANoFPClass {
return false;
}

const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
std::string Result = "nofpclass";
raw_string_ostream OS(Result);
OS << getKnownNoFPClass() << '/' << getAssumedNoFPClass();
Expand Down Expand Up @@ -10510,7 +10510,7 @@ struct AACallEdgesImpl : public AACallEdges {
return HasUnknownCalleeNonAsm;
}

const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return "CallEdges[" + std::to_string(HasUnknownCallee) + "," +
std::to_string(CalledFunctions.size()) + "]";
}
Expand Down Expand Up @@ -10818,7 +10818,7 @@ struct AAPotentialValuesImpl : AAPotentialValues {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
std::string Str;
llvm::raw_string_ostream OS(Str);
OS << getState();
Expand Down Expand Up @@ -11775,7 +11775,7 @@ struct AAAssumptionInfoImpl : public AAAssumptionInfo {
}

/// See AbstractAttribute::getAsStr()
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
const SetContents &Known = getKnown();
const SetContents &Assumed = getAssumed();

Expand Down Expand Up @@ -11895,7 +11895,7 @@ struct AAUnderlyingObjectsImpl
AAUnderlyingObjectsImpl(const IRPosition &IRP, Attributor &A) : BaseTy(IRP) {}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
if (!isValidState())
return "<invalid>";
std::string Str;
Expand Down Expand Up @@ -12186,7 +12186,7 @@ struct AAGlobalValueInfoFloating : public AAGlobalValueInfo {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return "[" + std::to_string(Uses.size()) + " uses]";
}

Expand Down Expand Up @@ -12486,7 +12486,7 @@ struct AAIndirectCallInfoCallSite : public AAIndirectCallInfo {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
return std::string(AllCalleesKnown ? "eliminate" : "specialize") +
" indirect call site with " + std::to_string(AssumedCallees.size()) +
" functions";
Expand Down Expand Up @@ -12650,7 +12650,7 @@ struct AAAddressSpaceImpl : public AAAddressSpace {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
if (!isValidState())
return "addrspace(<invalid>)";
return "addrspace(" +
Expand Down Expand Up @@ -12875,7 +12875,7 @@ struct AAAllocationInfoImpl : public AAAllocationInfo {
}

/// See AbstractAttribute::getAsStr().
const std::string getAsStr(Attributor *A) const override {
std::string getAsStr(Attributor *A) const override {
if (!isValidState())
return "allocationinfo(<invalid>)";
return "allocationinfo(" +
Expand Down
24 changes: 12 additions & 12 deletions llvm/lib/Transforms/IPO/OpenMPOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2286,7 +2286,7 @@ struct AAICVTracker : public StateWrapper<BooleanState, AbstractAttribute> {
InternalControlVar TrackableICVs[1] = {ICV_nthreads};

/// See AbstractAttribute::getName()
const std::string getName() const override { return "AAICVTracker"; }
std::string getName() const override { return "AAICVTracker"; }

/// See AbstractAttribute::getIdAddr()
const char *getIdAddr() const override { return &ID; }
Expand All @@ -2304,7 +2304,7 @@ struct AAICVTrackerFunction : public AAICVTracker {
: AAICVTracker(IRP, A) {}

// FIXME: come up with better string.
const std::string getAsStr(Attributor *) const override {
std::string getAsStr(Attributor *) const override {
return "ICVTrackerFunction";
}

Expand Down Expand Up @@ -2498,7 +2498,7 @@ struct AAICVTrackerFunctionReturned : AAICVTracker {
: AAICVTracker(IRP, A) {}

// FIXME: come up with better string.
const std::string getAsStr(Attributor *) const override {
std::string getAsStr(Attributor *) const override {
return "ICVTrackerFunctionReturned";
}

Expand Down Expand Up @@ -2597,7 +2597,7 @@ struct AAICVTrackerCallSite : AAICVTracker {
}

// FIXME: come up with better string.
const std::string getAsStr(Attributor *) const override {
std::string getAsStr(Attributor *) const override {
return "ICVTrackerCallSite";
}

Expand Down Expand Up @@ -2638,7 +2638,7 @@ struct AAICVTrackerCallSiteReturned : AAICVTracker {
: AAICVTracker(IRP, A) {}

// FIXME: come up with better string.
const std::string getAsStr(Attributor *) const override {
std::string getAsStr(Attributor *) const override {
return "ICVTrackerCallSiteReturned";
}

Expand Down Expand Up @@ -2710,7 +2710,7 @@ struct AAExecutionDomainFunction : public AAExecutionDomain {
RPOT = new ReversePostOrderTraversal<Function *>(F);
}

const std::string getAsStr(Attributor *) const override {
std::string getAsStr(Attributor *) const override {
unsigned TotalBlocks = 0, InitialThreadBlocks = 0, AlignedBlocks = 0;
for (auto &It : BEDMap) {
if (!It.getFirst())
Expand Down Expand Up @@ -3399,7 +3399,7 @@ struct AAHeapToShared : public StateWrapper<BooleanState, AbstractAttribute> {
virtual bool isAssumedHeapToSharedRemovedFree(CallBase &CB) const = 0;

/// See AbstractAttribute::getName().
const std::string getName() const override { return "AAHeapToShared"; }
std::string getName() const override { return "AAHeapToShared"; }

/// See AbstractAttribute::getIdAddr().
const char *getIdAddr() const override { return &ID; }
Expand All @@ -3418,7 +3418,7 @@ struct AAHeapToSharedFunction : public AAHeapToShared {
AAHeapToSharedFunction(const IRPosition &IRP, Attributor &A)
: AAHeapToShared(IRP, A) {}

const std::string getAsStr(Attributor *) const override {
std::string getAsStr(Attributor *) const override {
return "[AAHeapToShared] " + std::to_string(MallocCalls.size()) +
" malloc calls eligible.";
}
Expand Down Expand Up @@ -3622,7 +3622,7 @@ struct AAKernelInfo : public StateWrapper<KernelInfoState, AbstractAttribute> {
void trackStatistics() const override {}

/// See AbstractAttribute::getAsStr()
const std::string getAsStr(Attributor *) const override {
std::string getAsStr(Attributor *) const override {
if (!isValidState())
return "<invalid>";
return std::string(SPMDCompatibilityTracker.isAssumed() ? "SPMD"
Expand Down Expand Up @@ -3652,7 +3652,7 @@ struct AAKernelInfo : public StateWrapper<KernelInfoState, AbstractAttribute> {
static AAKernelInfo &createForPosition(const IRPosition &IRP, Attributor &A);

/// See AbstractAttribute::getName()
const std::string getName() const override { return "AAKernelInfo"; }
std::string getName() const override { return "AAKernelInfo"; }

/// See AbstractAttribute::getIdAddr()
const char *getIdAddr() const override { return &ID; }
Expand Down Expand Up @@ -5186,7 +5186,7 @@ struct AAFoldRuntimeCall
Attributor &A);

/// See AbstractAttribute::getName()
const std::string getName() const override { return "AAFoldRuntimeCall"; }
std::string getName() const override { return "AAFoldRuntimeCall"; }

/// See AbstractAttribute::getIdAddr()
const char *getIdAddr() const override { return &ID; }
Expand All @@ -5205,7 +5205,7 @@ struct AAFoldRuntimeCallCallSiteReturned : AAFoldRuntimeCall {
: AAFoldRuntimeCall(IRP, A) {}

/// See AbstractAttribute::getAsStr()
const std::string getAsStr(Attributor *) const override {
std::string getAsStr(Attributor *) const override {
if (!isValidState())
return "<invalid>";

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ struct MainSwitch {
virtual ~MainSwitch() = default;

SwitchInst *getInstr() const { return Instr; }
const SmallVector<SelectInstToUnfold, 4> getSelectInsts() {
SmallVector<SelectInstToUnfold, 4> getSelectInsts() {
return SelectInsts;
}

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Utils/CodeMoverUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ControlConditions {
/// \p BB from \p Dominator. If \p MaxLookup is non-zero, it limits the
/// number of conditions to collect. Return std::nullopt if not all conditions
/// are collected successfully, or we hit the limit.
static const std::optional<ControlConditions>
static std::optional<ControlConditions>
collectControlConditions(const BasicBlock &BB, const BasicBlock &Dominator,
const DominatorTree &DT,
const PostDominatorTree &PDT,
Expand Down Expand Up @@ -104,7 +104,7 @@ static bool domTreeLevelBefore(DominatorTree *DT, const Instruction *InstA,
return DA->getLevel() < DB->getLevel();
}

const std::optional<ControlConditions>
std::optional<ControlConditions>
ControlConditions::collectControlConditions(const BasicBlock &BB,
const BasicBlock &Dominator,
const DominatorTree &DT,
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Utils/InlineFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2152,7 +2152,7 @@ inlineRetainOrClaimRVCalls(CallBase &CB, objcarc::ARCInstKind RVCallKind,
// profile. Note: we only update the "name" and "index" operands in the
// instrumentation intrinsics, we leave the hash and total nr of indices as-is,
// it's not worth updating those.
static const std::pair<std::vector<int64_t>, std::vector<int64_t>>
static std::pair<std::vector<int64_t>, std::vector<int64_t>>
remapIndices(Function &Caller, BasicBlock *StartBB,
PGOContextualProfile &CtxProf, uint32_t CalleeCounters,
uint32_t CalleeCallsites) {
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Transforms/Utils/SCCPSolver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@ class SCCPInstVisitor : public InstVisitor<SCCPInstVisitor> {
return TrackedGlobals;
}

const SmallPtrSet<Function *, 16> getMRVFunctionsTracked() {
SmallPtrSet<Function *, 16> getMRVFunctionsTracked() {
return MRVFunctionsTracked;
}

Expand Down Expand Up @@ -2217,7 +2217,7 @@ SCCPSolver::getTrackedGlobals() {
return Visitor->getTrackedGlobals();
}

const SmallPtrSet<Function *, 16> SCCPSolver::getMRVFunctionsTracked() {
SmallPtrSet<Function *, 16> SCCPSolver::getMRVFunctionsTracked() {
return Visitor->getMRVFunctionsTracked();
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6093,7 +6093,7 @@ void BoUpSLP::reorderBottomToTop(bool IgnoreReorder) {
continue;
if (!OpTE->ReuseShuffleIndices.empty() && !GathersToOrders.count(OpTE))
continue;
const auto Order = [&]() -> const OrdersType {
const auto Order = [&]() -> OrdersType {
if (OpTE->isGather() || !OpTE->ReuseShuffleIndices.empty())
return getReorderingData(*OpTE, /*TopToBottom=*/false)
.value_or(OrdersType(1));
Expand Down
2 changes: 1 addition & 1 deletion llvm/utils/TableGen/Common/CodeGenTarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class ComplexPattern {
const Record *getValueType() const { return Ty; }
unsigned getNumOperands() const { return NumOperands; }
const std::string &getSelectFunc() const { return SelectFunc; }
const ArrayRef<const Record *> getRootNodes() const { return RootNodes; }
ArrayRef<const Record *> getRootNodes() const { return RootNodes; }
bool hasProperty(enum SDNP Prop) const { return Properties & (1 << Prop); }
unsigned getComplexity() const { return Complexity; }
};
Expand Down