llvm.org GIT mirror llvm / 14aae01
Apply clang-tidy's misc-move-constructor-init throughout LLVM. No functionality change intended, maybe a tiny performance improvement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@270997 91177308-0d34-0410-b5e6-96231b3b80d8 Benjamin Kramer 3 years ago
38 changed file(s) with 139 addition(s) and 99 deletion(s). Raw diff Collapse all Expand all
2323 #include "llvm/ADT/SmallSet.h"
2424 #include
2525 #include
26 #include
2627 #include
2728
2829 namespace llvm {
261262 set_type &set_;
262263
263264 public:
264 TestAndEraseFromSet(UnaryPredicate P, set_type &set_) : P(P), set_(set_) {}
265 TestAndEraseFromSet(UnaryPredicate P, set_type &set_)
266 : P(std::move(P)), set_(set_) {}
265267
266268 template
267269 bool operator()(const ArgumentT &Arg) {
3939 #include "llvm/IR/DebugLoc.h"
4040 #include "llvm/Pass.h"
4141 #include
42 #include
4243
4344 namespace llvm {
4445 class AsmPrinter;
5354 DebugLoc Loc;
5455
5556 GCPoint(GC::PointKind K, MCSymbol *L, DebugLoc DL)
56 : Kind(K), Label(L), Loc(DL) {}
57 : Kind(K), Label(L), Loc(std::move(DL)) {}
5758 };
5859
5960 /// GCRoot - Metadata for a pointer to an object managed by the garbage
1515 #define LLVM_CODEGEN_PBQP_GRAPH_H
1616
1717 #include "llvm/Support/Debug.h"
18 #include
1819 #include
1920
2021 namespace llvm {
6667 return std::numeric_limits::max();
6768 }
6869
69 NodeEntry(VectorPtr Costs) : Costs(Costs) {}
70 NodeEntry(VectorPtr Costs) : Costs(std::move(Costs)) {}
7071
7172 AdjEdgeIdx addAdjEdgeId(EdgeId EId) {
7273 AdjEdgeIdx Idx = AdjEdgeIds.size();
9798 class EdgeEntry {
9899 public:
99100 EdgeEntry(NodeId N1Id, NodeId N2Id, MatrixPtr Costs)
100 : Costs(Costs) {
101 : Costs(std::move(Costs)) {
101102 NIds[0] = N1Id;
102103 NIds[1] = N2Id;
103104 ThisEdgeAdjIdxs[0] = NodeEntry::getInvalidAdjEdgeIdx();
342343 Graph() : Solver(nullptr) {}
343344
344345 /// @brief Construct an empty PBQP graph with the given graph metadata.
345 Graph(GraphMetadata Metadata) : Metadata(Metadata), Solver(nullptr) {}
346 Graph(GraphMetadata Metadata)
347 : Metadata(std::move(Metadata)), Solver(nullptr) {}
346348
347349 /// @brief Get a reference to the graph metadata.
348350 GraphMetadata& getMetadata() { return Metadata; }
1717 #include "llvm/DebugInfo/CodeView/TypeIndex.h"
1818 #include "llvm/Support/ErrorOr.h"
1919 #include
20 #include
2021
2122 namespace llvm {
2223 namespace codeview {
745746 explicit VFTableShapeRecord(ArrayRef Slots)
746747 : TypeRecord(TypeRecordKind::VFTableShape), SlotsRef(Slots) {}
747748 explicit VFTableShapeRecord(std::vector Slots)
748 : TypeRecord(TypeRecordKind::VFTableShape), Slots(Slots) {}
749 : TypeRecord(TypeRecordKind::VFTableShape), Slots(std::move(Slots)) {}
749750
750751 /// Rewrite member type indices with IndexMap. Returns false if a type index
751752 /// is not in the map.
12551256 class EnumeratorRecord : public TypeRecord {
12561257 public:
12571258 EnumeratorRecord(MemberAccess Access, APSInt Value, StringRef Name)
1258 : TypeRecord(TypeRecordKind::Enumerator), Access(Access), Value(Value),
1259 Name(Name) {}
1259 : TypeRecord(TypeRecordKind::Enumerator), Access(Access),
1260 Value(std::move(Value)), Name(Name) {}
12601261
12611262 /// Rewrite member type indices with IndexMap. Returns false if a type index
12621263 /// is not in the map.
1818 #include
1919 #include
2020 #include
21 #include
2122
2223 namespace llvm {
2324 namespace symbolize {
3940 bool RelativeAddresses = false, std::string DefaultArch = "")
4041 : PrintFunctions(PrintFunctions), UseSymbolTable(UseSymbolTable),
4142 Demangle(Demangle), RelativeAddresses(RelativeAddresses),
42 DefaultArch(DefaultArch) {}
43 DefaultArch(std::move(DefaultArch)) {}
4344 };
4445
4546 LLVMSymbolizer(const Options &Opts = Options()) : Opts(Opts) {}
1818 #include "LambdaResolver.h"
1919 #include "LogicalDylib.h"
2020 #include "llvm/ADT/STLExtras.h"
21 #include "llvm/Support/Debug.h"
2122 #include "llvm/Transforms/Utils/Cloning.h"
2223 #include
2324 #include
2425 #include
25
26 #include "llvm/Support/Debug.h"
26 #include
2727
2828 namespace llvm {
2929 namespace orc {
172172 CompileCallbackMgrT &CallbackMgr,
173173 IndirectStubsManagerBuilderT CreateIndirectStubsManager,
174174 bool CloneStubsIntoPartitions = true)
175 : BaseLayer(BaseLayer), Partition(Partition),
175 : BaseLayer(BaseLayer), Partition(std::move(Partition)),
176176 CompileCallbackMgr(CallbackMgr),
177177 CreateIndirectStubsManager(std::move(CreateIndirectStubsManager)),
178178 CloneStubsIntoPartitions(CloneStubsIntoPartitions) {}
2020 #include "llvm/Support/Memory.h"
2121 #include
2222 #include
23 #include
2324
2425 namespace llvm {
2526
7778 typedef std::map ObjSectionToIDMap;
7879
7980 LoadedObjectInfo(RuntimeDyldImpl &RTDyld, ObjSectionToIDMap ObjSecToIDMap)
80 : RTDyld(RTDyld), ObjSecToIDMap(ObjSecToIDMap) { }
81 : RTDyld(RTDyld), ObjSecToIDMap(std::move(ObjSecToIDMap)) {}
8182
8283 virtual object::OwningBinary
8384 getObjectForDebug(const object::ObjectFile &Obj) const = 0;
1414 #define LLVM_SUPPORT_PROFILE_SUMMARY_H
1515
1616 #include
17 #include
1718 #include
1819
1920 #include "llvm/Support/Casting.h"
6162 uint64_t TotalCount, uint64_t MaxCount,
6263 uint64_t MaxInternalCount, uint64_t MaxFunctionCount,
6364 uint32_t NumCounts, uint32_t NumFunctions)
64 : PSK(K), DetailedSummary(DetailedSummary), TotalCount(TotalCount),
65 MaxCount(MaxCount), MaxInternalCount(MaxInternalCount),
66 MaxFunctionCount(MaxFunctionCount), NumCounts(NumCounts),
67 NumFunctions(NumFunctions) {}
65 : PSK(K), DetailedSummary(std::move(DetailedSummary)),
66 TotalCount(TotalCount), MaxCount(MaxCount),
67 MaxInternalCount(MaxInternalCount), MaxFunctionCount(MaxFunctionCount),
68 NumCounts(NumCounts), NumFunctions(NumFunctions) {}
6869 Kind getKind() const { return PSK; }
6970 /// \brief Return summary information as metadata.
7071 Metadata *getMD(LLVMContext &Context);
1414 #include
1515 #include
1616 #include
17 #include
1718 #include
1819
1920 namespace llvm {
136137
137138 template
138139 struct ListCompleterModel : ListCompleterConcept {
139 ListCompleterModel(T Value) : Value(Value) {}
140 ListCompleterModel(T Value) : Value(std::move(Value)) {}
140141 std::vector getCompletions(StringRef Buffer,
141142 size_t Pos) const override {
142143 return Value(Buffer, Pos);
1616 #include "llvm/Support/Compiler.h"
1717 #include "llvm/Support/DataTypes.h"
1818 #include "llvm/Support/SMLoc.h"
19 #include
1920
2021 namespace llvm {
2122
6566 public:
6667 AsmToken() {}
6768 AsmToken(TokenKind Kind, StringRef Str, APInt IntVal)
68 : Kind(Kind), Str(Str), IntVal(IntVal) {}
69 : Kind(Kind), Str(Str), IntVal(std::move(IntVal)) {}
6970 AsmToken(TokenKind Kind, StringRef Str, int64_t IntVal = 0)
7071 : Kind(Kind), Str(Str), IntVal(64, IntVal, true) {}
7172
1515
1616 #include "llvm/Object/Binary.h"
1717 #include "llvm/Support/Format.h"
18 #include
1819
1920 namespace llvm {
2021 namespace object {
5758 content_type Current;
5859
5960 public:
60 content_iterator(content_type symb) : Current(symb) {}
61 content_iterator(content_type symb) : Current(std::move(symb)) {}
6162
6263 const content_type *operator->() const { return &Current; }
6364
1717 #include
1818 #include
1919 #include
20 #include
2021 #include
2122
2223 #include "llvm/IR/ProfileSummary.h"
5152 protected:
5253 SummaryEntryVector DetailedSummary;
5354 ProfileSummaryBuilder(std::vector Cutoffs)
54 : DetailedSummaryCutoffs(Cutoffs), TotalCount(0), MaxCount(0),
55 : DetailedSummaryCutoffs(std::move(Cutoffs)), TotalCount(0), MaxCount(0),
5556 MaxFunctionCount(0), NumCounts(0), NumFunctions(0) {}
5657 inline void addCount(uint64_t Count);
5758 ~ProfileSummaryBuilder() = default;
1616 #include
1717 #include
1818 #include
19 #include
1920
2021 namespace llvm {
2122 class LLVMContext;
4445 FunctionImporter(
4546 const ModuleSummaryIndex &Index,
4647 std::function(StringRef Identifier)> ModuleLoader)
47 : Index(Index), ModuleLoader(ModuleLoader) {}
48 : Index(Index), ModuleLoader(std::move(ModuleLoader)) {}
4849
4950 /// Import functions in Module \p M based on the supplied import list.
5051 /// \p ForceImportReferencedDiscardableSymbols will set the ModuleLinker in
1616 #include "llvm/IR/Module.h"
1717 #include "llvm/IR/Operator.h"
1818 #include "llvm/Support/ErrorHandling.h"
19 #include
1920
2021 using namespace llvm;
2122
396397
397398 TargetIRAnalysis::TargetIRAnalysis(
398399 std::function TTICallback)
399 : TTICallback(TTICallback) {}
400 : TTICallback(std::move(TTICallback)) {}
400401
401402 TargetIRAnalysis::Result TargetIRAnalysis::run(const Function &F) {
402403 return TTICallback(F);
3636 #include "llvm/Support/MemoryBuffer.h"
3737 #include "llvm/Support/raw_ostream.h"
3838 #include
39 #include
3940
4041 using namespace llvm;
4142
57125713 ModuleSummaryIndexBitcodeReader::ModuleSummaryIndexBitcodeReader(
57135714 MemoryBuffer *Buffer, DiagnosticHandlerFunction DiagnosticHandler,
57145715 bool CheckGlobalValSummaryPresenceOnly)
5715 : DiagnosticHandler(DiagnosticHandler), Buffer(Buffer),
5716 : DiagnosticHandler(std::move(DiagnosticHandler)), Buffer(Buffer),
57165717 CheckGlobalValSummaryPresenceOnly(CheckGlobalValSummaryPresenceOnly) {}
57175718
57185719 ModuleSummaryIndexBitcodeReader::ModuleSummaryIndexBitcodeReader(
57195720 DiagnosticHandlerFunction DiagnosticHandler,
57205721 bool CheckGlobalValSummaryPresenceOnly)
5721 : DiagnosticHandler(DiagnosticHandler), Buffer(nullptr),
5722 : DiagnosticHandler(std::move(DiagnosticHandler)), Buffer(nullptr),
57225723 CheckGlobalValSummaryPresenceOnly(CheckGlobalValSummaryPresenceOnly) {}
57235724
57245725 void ModuleSummaryIndexBitcodeReader::freeState() { Buffer = nullptr; }
3333 #include "llvm/Target/TargetRegisterInfo.h"
3434 #include "llvm/Target/TargetSubtargetInfo.h"
3535 #include
36 #include
3637
3738 using namespace llvm;
3839
176177 public:
177178 static char ID;
178179 IfConverter(std::function Ftor = nullptr)
179 : MachineFunctionPass(ID), FnNum(-1), PredicateFtor(Ftor) {
180 : MachineFunctionPass(ID), FnNum(-1), PredicateFtor(std::move(Ftor)) {
180181 initializeIfConverterPass(*PassRegistry::getPassRegistry());
181182 }
182183
4141 #include "llvm/Target/TargetRegisterInfo.h"
4242 #include "llvm/Target/TargetSubtargetInfo.h"
4343 #include
44 #include
4445
4546 using namespace llvm;
4647
8384 SmallPtrSet LBlocks;
8485
8586 public:
86 UserValueScopes(DebugLoc D, LexicalScopes &L) : DL(D), LS(L) {}
87 UserValueScopes(DebugLoc D, LexicalScopes &L) : DL(std::move(D)), LS(L) {}
8788
8889 /// dominates - Return true if current scope dominates at least one machine
8990 /// instruction in a given machine basic block.
140141 /// UserValue - Create a new UserValue.
141142 UserValue(const MDNode *var, const MDNode *expr, unsigned o, bool i,
142143 DebugLoc L, LocMap::Allocator &alloc)
143 : Variable(var), Expression(expr), offset(o), IsIndirect(i), dl(L),
144 leader(this), next(nullptr), locInts(alloc) {}
144 : Variable(var), Expression(expr), offset(o), IsIndirect(i),
145 dl(std::move(L)), leader(this), next(nullptr), locInts(alloc) {}
145146
146147 /// getLeader - Get the leader of this value's equivalence class.
147148 UserValue *getLeader() {
1616 #include "llvm/Target/TargetMachine.h"
1717 #include "llvm/Target/TargetRegisterInfo.h"
1818 #include "llvm/Target/TargetSubtargetInfo.h"
19 #include
1920 using namespace llvm;
2021
2122 namespace {
2324 public:
2425 static char ID; // Pass identification
2526 UnpackMachineBundles(std::function Ftor = nullptr)
26 : MachineFunctionPass(ID), PredicateFtor(Ftor) {
27 : MachineFunctionPass(ID), PredicateFtor(std::move(Ftor)) {
2728 initializeUnpackMachineBundlesPass(*PassRegistry::getPassRegistry());
2829 }
2930
1515
1616 #include "llvm/IR/DebugLoc.h"
1717 #include "llvm/Support/DataTypes.h"
18 #include
1819
1920 namespace llvm {
2021
5455 // Constructor for non-constants.
5556 SDDbgValue(MDNode *Var, MDNode *Expr, SDNode *N, unsigned R, bool indir,
5657 uint64_t off, DebugLoc dl, unsigned O)
57 : Var(Var), Expr(Expr), Offset(off), DL(dl), Order(O), IsIndirect(indir) {
58 : Var(Var), Expr(Expr), Offset(off), DL(std::move(dl)), Order(O),
59 IsIndirect(indir) {
5860 kind = SDNODE;
5961 u.s.Node = N;
6062 u.s.ResNo = R;
6365 // Constructor for constants.
6466 SDDbgValue(MDNode *Var, MDNode *Expr, const Value *C, uint64_t off,
6567 DebugLoc dl, unsigned O)
66 : Var(Var), Expr(Expr), Offset(off), DL(dl), Order(O), IsIndirect(false) {
68 : Var(Var), Expr(Expr), Offset(off), DL(std::move(dl)), Order(O),
69 IsIndirect(false) {
6770 kind = CONST;
6871 u.Const = C;
6972 }
7174 // Constructor for frame indices.
7275 SDDbgValue(MDNode *Var, MDNode *Expr, unsigned FI, uint64_t off, DebugLoc dl,
7376 unsigned O)
74 : Var(Var), Expr(Expr), Offset(off), DL(dl), Order(O), IsIndirect(false) {
77 : Var(Var), Expr(Expr), Offset(off), DL(std::move(dl)), Order(O),
78 IsIndirect(false) {
7579 kind = FRAMEIX;
7680 u.FrameIx = FI;
7781 }
2121 #include "llvm/CodeGen/SelectionDAG.h"
2222 #include "llvm/CodeGen/SelectionDAGNodes.h"
2323 #include "llvm/IR/CallSite.h"
24 #include "llvm/IR/Constants.h"
2425 #include "llvm/IR/Statepoint.h"
25 #include "llvm/IR/Constants.h"
2626 #include "llvm/Support/ErrorHandling.h"
2727 #include "llvm/Target/TargetLowering.h"
28 #include
2829 #include
2930
3031 namespace llvm {
100101 unsigned SDNodeOrder;
101102 public:
102103 DanglingDebugInfo() : DI(nullptr), dl(DebugLoc()), SDNodeOrder(0) { }
103 DanglingDebugInfo(const DbgValueInst *di, DebugLoc DL, unsigned SDNO) :
104 DI(di), dl(DL), SDNodeOrder(SDNO) { }
104 DanglingDebugInfo(const DbgValueInst *di, DebugLoc DL, unsigned SDNO)
105 : DI(di), dl(std::move(DL)), SDNodeOrder(SDNO) {}
105106 const DbgValueInst* getDI() { return DI; }
106107 DebugLoc getdl() { return dl; }
107108 unsigned getSDNodeOrder() { return SDNodeOrder; }
259260 };
260261 struct JumpTableHeader {
261262 JumpTableHeader(APInt F, APInt L, const Value *SV, MachineBasicBlock *H,
262 bool E = false):
263 First(F), Last(L), SValue(SV), HeaderBB(H), Emitted(E) {}
263 bool E = false)
264 : First(std::move(F)), Last(std::move(L)), SValue(SV), HeaderBB(H),
265 Emitted(E) {}
264266 APInt First;
265267 APInt Last;
266268 const Value *SValue;
285287 BitTestBlock(APInt F, APInt R, const Value *SV, unsigned Rg, MVT RgVT,
286288 bool E, bool CR, MachineBasicBlock *P, MachineBasicBlock *D,
287289 BitTestInfo C, BranchProbability Pr)
288 : First(F), Range(R), SValue(SV), Reg(Rg), RegVT(RgVT), Emitted(E),
289 ContiguousRange(CR), Parent(P), Default(D), Cases(std::move(C)),
290 Prob(Pr) {}
290 : First(std::move(F)), Range(std::move(R)), SValue(SV), Reg(Rg),
291 RegVT(RgVT), Emitted(E), ContiguousRange(CR), Parent(P), Default(D),
292 Cases(std::move(C)), Prob(Pr) {}
291293 APInt First;
292294 APInt Range;
293295 const Value *SValue;
1919 #include "llvm/Support/Format.h"
2020 #include "llvm/Support/raw_ostream.h"
2121 #include
22 #include
2223 #include
2324
2425 using namespace llvm;
204205 SmallString<8> AugmentationData, uint32_t FDEPointerEncoding,
205206 uint32_t LSDAPointerEncoding)
206207 : FrameEntry(FK_CIE, Offset, Length), Version(Version),
207 Augmentation(std::move(Augmentation)),
208 AddressSize(AddressSize),
208 Augmentation(std::move(Augmentation)), AddressSize(AddressSize),
209209 SegmentDescriptorSize(SegmentDescriptorSize),
210210 CodeAlignmentFactor(CodeAlignmentFactor),
211211 DataAlignmentFactor(DataAlignmentFactor),
212212 ReturnAddressRegister(ReturnAddressRegister),
213 AugmentationData(AugmentationData),
213 AugmentationData(std::move(AugmentationData)),
214214 FDEPointerEncoding(FDEPointerEncoding),
215 LSDAPointerEncoding(LSDAPointerEncoding) { }
215 LSDAPointerEncoding(LSDAPointerEncoding) {}
216216
217217 ~CIE() override {}
218218
66 //
77 //===----------------------------------------------------------------------===//
88
9 #include "llvm/ADT/STLExtras.h"
9 #include "llvm/ExecutionEngine/RuntimeDyldChecker.h"
1010 #include "RuntimeDyldCheckerImpl.h"
1111 #include "RuntimeDyldImpl.h"
12 #include "llvm/ExecutionEngine/RuntimeDyldChecker.h"
12 #include "llvm/ADT/STLExtras.h"
1313 #include "llvm/MC/MCContext.h"
1414 #include "llvm/MC/MCDisassembler/MCDisassembler.h"
1515 #include "llvm/MC/MCInst.h"
1616 #include "llvm/Support/Path.h"
1717 #include
1818 #include
19 #include
1920
2021 #define DEBUG_TYPE "rtdyld"
2122
9697 public:
9798 EvalResult() : Value(0), ErrorMsg("") {}
9899 EvalResult(uint64_t Value) : Value(Value), ErrorMsg("") {}
99 EvalResult(std::string ErrorMsg) : Value(0), ErrorMsg(ErrorMsg) {}
100 EvalResult(std::string ErrorMsg)
101 : Value(0), ErrorMsg(std::move(ErrorMsg)) {}
100102 uint64_t getValue() const { return Value; }
101103 bool hasError() const { return ErrorMsg != ""; }
102104 const std::string &getErrorMsg() const { return ErrorMsg; }
1818 #include "llvm/IR/TypeFinder.h"
1919 #include "llvm/Support/Error.h"
2020 #include "llvm/Transforms/Utils/Cloning.h"
21 #include
2122 using namespace llvm;
2223
2324 //===----------------------------------------------------------------------===//
480481 IRMover::IdentifiedStructTypeSet &Set, std::unique_ptr SrcM,
481482 ArrayRef ValuesToLink,
482483 std::function AddLazyFor)
483 : DstM(DstM), SrcM(std::move(SrcM)), AddLazyFor(AddLazyFor), TypeMap(Set),
484 GValMaterializer(*this), LValMaterializer(*this), SharedMDs(SharedMDs),
484 : DstM(DstM), SrcM(std::move(SrcM)), AddLazyFor(std::move(AddLazyFor)),
485 TypeMap(Set), GValMaterializer(*this), LValMaterializer(*this),
486 SharedMDs(SharedMDs),
485487 Mapper(ValueMap, RF_MoveDistinctMDs | RF_IgnoreMissingLocals, &TypeMap,
486488 &GValMaterializer),
487489 AliasMCID(Mapper.registerAlternateMappingContext(AliasValueMap,
2727 #include "llvm/MC/MCSubtargetInfo.h"
2828 #include "llvm/Support/raw_ostream.h"
2929 #include
30 #include
3031
3132 namespace llvm {
3233 class Target;
8586 LLVMOpInfoCallback getOpInfo,
8687 LLVMSymbolLookupCallback symbolLookUp,
8788 const Target *theTarget, const MCAsmInfo *mAI,
88 const MCRegisterInfo *mRI,
89 const MCSubtargetInfo *mSI,
90 const MCInstrInfo *mII,
91 llvm::MCContext *ctx, const MCDisassembler *disAsm,
92 MCInstPrinter *iP) : TripleName(tripleName),
93 DisInfo(disInfo), TagType(tagType), GetOpInfo(getOpInfo),
94 SymbolLookUp(symbolLookUp), TheTarget(theTarget),
95 Options(0),
96 CommentStream(CommentsToEmit) {
89 const MCRegisterInfo *mRI, const MCSubtargetInfo *mSI,
90 const MCInstrInfo *mII, llvm::MCContext *ctx,
91 const MCDisassembler *disAsm, MCInstPrinter *iP)
92 : TripleName(std::move(tripleName)), DisInfo(disInfo), TagType(tagType),
93 GetOpInfo(getOpInfo), SymbolLookUp(symbolLookUp), TheTarget(theTarget),
94 Options(0), CommentStream(CommentsToEmit) {
9795 MAI.reset(mAI);
9896 MRI.reset(mRI);
9997 MSI.reset(mSI);
1717 #include "llvm/CodeGen/MachineFunctionPass.h"
1818 #include "llvm/CodeGen/MachineInstr.h"
1919 #include "llvm/CodeGen/MachineInstrBuilder.h"
20 #include "llvm/IR/Function.h" // To access Function attributes
20 #include "llvm/IR/Function.h" // To access Function attributes
2121 #include "llvm/Support/CommandLine.h"
2222 #include "llvm/Support/Debug.h"
2323 #include "llvm/Support/raw_ostream.h"
2424 #include "llvm/Target/TargetMachine.h"
25 #include
2526 using namespace llvm;
2627
2728 #define DEBUG_TYPE "t2-reduce-size"
212213 }
213214
214215 Thumb2SizeReduce::Thumb2SizeReduce(std::function Ftor)
215 : MachineFunctionPass(ID), PredicateFtor(Ftor) {
216 : MachineFunctionPass(ID), PredicateFtor(std::move(Ftor)) {
216217 OptimizeSize = MinimizeSize = false;
217218 for (unsigned i = 0, e = array_lengthof(ReduceTable); i != e; ++i) {
218219 unsigned FromOpc = ReduceTable[i].WideOpc;
1313
1414 #include "llvm/ADT/APFloat.h"
1515 #include "llvm/MC/MCExpr.h"
16 #include
1617
1718 namespace llvm {
1819
2930 const APFloat Flt;
3031
3132 explicit NVPTXFloatMCExpr(VariantKind Kind, APFloat Flt)
32 : Kind(Kind), Flt(Flt) {}
33 : Kind(Kind), Flt(std::move(Flt)) {}
3334
3435 public:
3536 /// @name Construction
149149
150150 // Provide the profile filename as the parameter.
151151 PGOInstrumentationUseLegacyPass(std::string Filename = "")
152 : ModulePass(ID), ProfileFileName(Filename) {
152 : ModulePass(ID), ProfileFileName(std::move(Filename)) {
153153 if (!PGOTestProfileFile.empty())
154154 ProfileFileName = PGOTestProfileFile;
155155 initializePGOInstrumentationUseLegacyPassPass(
918918 }
919919
920920 PGOInstrumentationUse::PGOInstrumentationUse(std::string Filename)
921 : ProfileFileName(Filename) {
921 : ProfileFileName(std::move(Filename)) {
922922 if (!PGOTestProfileFile.empty())
923923 ProfileFileName = PGOTestProfileFile;
924924 }
6262 #include "llvm/Transforms/Utils/LoopUtils.h"
6363 #include "llvm/Transforms/Utils/SSAUpdater.h"
6464 #include
65 #include
6566 using namespace llvm;
6667
6768 #define DEBUG_TYPE "licm"
810811 const AAMDNodes &AATags)
811812 : LoadAndStorePromoter(Insts, S), SomePtr(SP), PointerMustAliases(PMA),
812813 LoopExitBlocks(LEB), LoopInsertPts(LIP), PredCache(PIC), AST(ast),
813 LI(li), DL(dl), Alignment(alignment), AATags(AATags) {}
814 LI(li), DL(std::move(dl)), Alignment(alignment), AATags(AATags) {}
814815
815816 bool isInstInList(Instruction *I,
816817 const SmallVectorImpl &) const override {
3434 #include "llvm/Transforms/Utils/LoopUtils.h"
3535 #include "llvm/Transforms/Utils/UnrollLoop.h"
3636 #include
37 #include
3738
3839 using namespace llvm;
3940
938939 LoopUnroll(Optional Threshold = None,
939940 Optional Count = None,
940941 Optional AllowPartial = None, Optional Runtime = None)
941 : LoopPass(ID), ProvidedCount(Count), ProvidedThreshold(Threshold),
942 ProvidedAllowPartial(AllowPartial), ProvidedRuntime(Runtime) {
942 : LoopPass(ID), ProvidedCount(std::move(Count)),
943 ProvidedThreshold(Threshold), ProvidedAllowPartial(AllowPartial),
944 ProvidedRuntime(Runtime) {
943945 initializeLoopUnrollPass(*PassRegistry::getPassRegistry());
944946 }
945947
2020 //
2121 //===----------------------------------------------------------------------===//
2222
23 #include "llvm/Transforms/Scalar/SimplifyCFG.h"
2423 #include "llvm/ADT/SmallPtrSet.h"
2524 #include "llvm/ADT/SmallVector.h"
2625 #include "llvm/ADT/Statistic.h"
26 #include "llvm/Analysis/AssumptionCache.h"
27 #include "llvm/Analysis/CFG.h"
2728 #include "llvm/Analysis/GlobalsModRef.h"
28 #include "llvm/Analysis/AssumptionCache.h"
2929 #include "llvm/Analysis/TargetTransformInfo.h"
30 #include "llvm/Analysis/CFG.h"
3130 #include "llvm/IR/Attributes.h"
3231 #include "llvm/IR/CFG.h"
3332 #include "llvm/IR/Constants.h"
3736 #include "llvm/IR/Module.h"
3837 #include "llvm/Pass.h"
3938 #include "llvm/Support/CommandLine.h"
39 #include "llvm/Transforms/Scalar.h"
40 #include "llvm/Transforms/Scalar/SimplifyCFG.h"
4041 #include "llvm/Transforms/Utils/Local.h"
41 #include "llvm/Transforms/Scalar.h"
42 #include
4243 using namespace llvm;
4344
4445 #define DEBUG_TYPE "simplifycfg"
203204
204205 CFGSimplifyPass(int T = -1,
205206 std::function Ftor = nullptr)
206 : FunctionPass(ID), PredicateFtor(Ftor) {
207 : FunctionPass(ID), PredicateFtor(std::move(Ftor)) {
207208 BonusInstThreshold = (T == -1) ? UserBonusInstThreshold : unsigned(T);
208209 initializeCFGSimplifyPassPass(*PassRegistry::getPassRegistry());
209210 }
2020 #include "llvm/Support/raw_ostream.h"
2121 #include
2222 #include
23 #include
2324 using namespace llvm;
2425
2526 #define DEBUG_TYPE "toolrunner"
271272 std::string CompilerCommand;
272273 std::vector CompilerArgs;
273274 public:
274 CustomCompiler(
275 const std::string &CompilerCmd, std::vector CompArgs) :
276 CompilerCommand(CompilerCmd), CompilerArgs(CompArgs) {}
275 CustomCompiler(const std::string &CompilerCmd,
276 std::vector CompArgs)
277 : CompilerCommand(CompilerCmd), CompilerArgs(std::move(CompArgs)) {}
277278
278279 void compileProgram(const std::string &Bitcode,
279280 std::string *Error,
332333 std::string ExecutionCommand;
333334 std::vector ExecutorArgs;
334335 public:
335 CustomExecutor(
336 const std::string &ExecutionCmd, std::vector ExecArgs) :
337 ExecutionCommand(ExecutionCmd), ExecutorArgs(ExecArgs) {}
336 CustomExecutor(const std::string &ExecutionCmd,
337 std::vector ExecArgs)
338 : ExecutionCommand(ExecutionCmd), ExecutorArgs(std::move(ExecArgs)) {}
338339
339340 int ExecuteProgram(const std::string &Bitcode,
340341 const std::vector &Args,
5050 #include
5151 #include
5252 #include
53 #include
5354 #include
5455
5556 // FIXME: remove this declaration when we stop maintaining Ubuntu Quantal and
129130 public:
130131 ThinLTOTaskInfo(std::unique_ptr OS, std::string Filename,
131132 bool TempOutFile)
132 : OS(std::move(OS)), Filename(Filename), TempOutFile(TempOutFile) {}
133 : OS(std::move(OS)), Filename(std::move(Filename)),
134 TempOutFile(TempOutFile) {}
133135
134136 /// Performs task related cleanup activities that must be done
135137 /// single-threaded (i.e. call backs to gold).
903905 const ModuleSummaryIndex *CombinedIndex, std::string Filename,
904906 StringMap *ModuleMap)
905907 : M(std::move(M)), OS(OS), TaskID(TaskID), CombinedIndex(CombinedIndex),
906 SaveTempsFilename(Filename), ModuleMap(ModuleMap) {
908 SaveTempsFilename(std::move(Filename)), ModuleMap(ModuleMap) {
907909 assert(options::thinlto == !!CombinedIndex &&
908910 "Expected module summary index iff performing ThinLTO");
909911 initTargetMachine();
3535 #include "llvm/Transforms/Utils/FunctionImportUtils.h"
3636
3737 #include
38 #include
3839 using namespace llvm;
3940
4041 static cl::list
145146 ModuleLazyLoaderCache(std::function(
146147 const char *argv0, const std::string &FileName)>
147148 createLazyModule)
148 : createLazyModule(createLazyModule) {}
149 : createLazyModule(std::move(createLazyModule)) {}
149150
150151 /// Retrieve a Module from the cache or lazily load it on demand.
151152 Module &operator()(const char *argv0, const std::string &FileName);
5858 #include
5959 #include
6060 #include
61 #include
6162
6263 using namespace llvm;
6364 using namespace object;
196197 SectionFilterIterator(FilterPredicate P,
197198 llvm::object::section_iterator const &I,
198199 llvm::object::section_iterator const &E)
199 : Predicate(P), Iterator(I), End(E) {
200 : Predicate(std::move(P)), Iterator(I), End(E) {
200201 ScanPredicate();
201202 }
202203 const llvm::object::SectionRef &operator*() const { return *Iterator; }
223224 class SectionFilter {
224225 public:
225226 SectionFilter(FilterPredicate P, llvm::object::ObjectFile const &O)
226 : Predicate(P), Object(O) {}
227 : Predicate(std::move(P)), Object(O) {}
227228 SectionFilterIterator begin() {
228229 return SectionFilterIterator(Predicate, Object.section_begin(),
229230 Object.section_end());
2626 #include
2727 #include
2828 #include
29 #include
2930 #include
3031 using namespace llvm;
3132
604605 std::string Result;
605606 std::string AsmString;
606607 public:
607 IAPrinter(std::string R, std::string AS) : Result(R), AsmString(AS) {}
608 IAPrinter(std::string R, std::string AS)
609 : Result(std::move(R)), AsmString(std::move(AS)) {}
608610
609611 void addCond(const std::string &C) { Conds.push_back(C); }
610612
315315 K_Reg
316316 } Kind;
317317
318 ResultOperand(std::string N, Record *r) : Name(N), R(r), Kind(K_Record) {}
318 ResultOperand(std::string N, Record *r)
319 : Name(std::move(N)), R(r), Kind(K_Record) {}
319320 ResultOperand(int64_t I) : Imm(I), Kind(K_Imm) {}
320321 ResultOperand(Record *r) : R(r), Kind(K_Reg) {}
321322
2323 #include "llvm/TableGen/Error.h"
2424 #include "llvm/TableGen/Record.h"
2525 #include "llvm/TableGen/TableGenBackend.h"
26 #include
2627 using namespace llvm;
2728
2829
415416 return OpName;
416417 }
417418
418 FastISelMap::FastISelMap(std::string instns)
419 : InstNS(instns) {
420 }
419 FastISelMap::FastISelMap(std::string instns) : InstNS(std::move(instns)) {}
421420
422421 static std::string PhyRegForNode(TreePatternNode *Op,
423422 const CodeGenTarget &Target) {
2727 #include "llvm/TableGen/Record.h"
2828 #include
2929 #include
30 #include
3031 #include
3132
3233 using namespace llvm;
4647 bool HasCompleteDecoder;
4748
4849 OperandInfo(std::string D, bool HCD)
49 : Decoder(D), HasCompleteDecoder(HCD) { }
50 : Decoder(std::move(D)), HasCompleteDecoder(HCD) {}
5051
5152 void addField(unsigned Base, unsigned Width, unsigned Offset) {
5253 Fields.push_back(EncodingField(Base, Width, Offset));
8283
8384 // Defaults preserved here for documentation, even though they aren't
8485 // strictly necessary given the way that this is currently being called.
85 FixedLenDecoderEmitter(RecordKeeper &R,
86 std::string PredicateNamespace,
87 std::string GPrefix = "if (",
86 FixedLenDecoderEmitter(RecordKeeper &R, std::string PredicateNamespace,
87 std::string GPrefix = "if (",
8888 std::string GPostfix = " == MCDisassembler::Fail)",
89 std::string ROK = "MCDisassembler::Success",
90 std::string RFail = "MCDisassembler::Fail",
91 std::string L = "") :
92 Target(R),
93 PredicateNamespace(PredicateNamespace),
94 GuardPrefix(GPrefix), GuardPostfix(GPostfix),
95 ReturnOK(ROK), ReturnFail(RFail), Locals(L) {}
89 std::string ROK = "MCDisassembler::Success",
90 std::string RFail = "MCDisassembler::Fail",
91 std::string L = "")
92 : Target(R), PredicateNamespace(std::move(PredicateNamespace)),
93 GuardPrefix(std::move(GPrefix)), GuardPostfix(std::move(GPostfix)),
94 ReturnOK(std::move(ROK)), ReturnFail(std::move(RFail)),
95 Locals(std::move(L)) {}
9696
9797 // Emit the decoder state machine table.
9898 void emitTable(formatted_raw_ostream &o, DecoderTable &Table,