llvm.org GIT mirror llvm / 51ecde1
Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes. Differential revision: reviews.llvm.org/D16568 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@258831 91177308-0d34-0410-b5e6-96231b3b80d8 Eugene Zelenko 3 years ago
21 changed file(s) with 111 addition(s) and 128 deletion(s). Raw diff Collapse all Expand all
1515 #include
1616
1717 namespace llvm {
18
1918 /// ArrayRef - Represent a constant reference to an array (0 or more elements
2019 /// consecutively in memory), i.e. a start pointer and a length. It allows
2120 /// various APIs to take consecutive elements easily and conveniently.
9190 /// Construct an ArrayRef from ArrayRef. This uses SFINAE to
9291 /// ensure that only ArrayRefs of pointers can be converted.
9392 template
94 ArrayRef(const ArrayRef &A,
95 typename std::enable_if<
96 std::is_convertible::value>::type* = 0)
93 ArrayRef(
94 const ArrayRef &A,
95 typename std::enable_if<
96 std::is_convertible::value>::type * = nullptr)
9797 : Data(A.data()), Length(A.size()) {}
9898
9999 /// Construct an ArrayRef from a SmallVector. This is
100100 /// templated in order to avoid instantiating SmallVectorTemplateCommon
101101 /// whenever we copy-construct an ArrayRef.
102102 template
103 /*implicit*/ ArrayRef(const SmallVectorTemplateCommon &Vec,
104 typename std::enable_if<
105 std::is_convertible
106 T const *>::value>::type* = 0)
103 /*implicit*/ ArrayRef(
104 const SmallVectorTemplateCommon &Vec,
105 typename std::enable_if<
106 std::is_convertible::value>::type * = nullptr)
107107 : Data(Vec.data()), Length(Vec.size()) {
108108 }
109109
378378 template hash_code hash_value(ArrayRef S) {
379379 return hash_combine_range(S.begin(), S.end());
380380 }
381 }
382
383 #endif
381 } // end namespace llvm
382
383 #endif // LLVM_ADT_ARRAYREF_H
6565
6666 bool isPoisoned() const { return (reinterpret_cast(mi) & 0x1) == 0x1; }
6767 #endif // EXPENSIVE_CHECKS
68
6968 };
7069
7170 template <>
307306 SlotIndex getPrevIndex() const {
308307 return SlotIndex(&*--listEntry()->getIterator(), getSlot());
309308 }
310
311309 };
312310
313311 template <> struct isPodLike { static const bool value = true; };
381379 initializeSlotIndexesPass(*PassRegistry::getPassRegistry());
382380 }
383381
384 ~SlotIndexes() {
382 ~SlotIndexes() override {
385383 // The indexList's nodes are all allocated in the BumpPtrAllocator.
386384 indexList.clearAndLeakNodesUnsafely();
387385 }
708706 indexList.erase(entry);
709707 #endif
710708 }
711
712709 };
713
714710
715711 // Specialize IntervalMapInfo for half-open slot index intervals.
716712 template <>
717713 struct IntervalMapInfo : IntervalMapHalfOpenInfo {
718714 };
719715
720 }
716 } // end namespace llvm
721717
722718 #endif // LLVM_CODEGEN_SLOTINDEXES_H
5555 }
5656
5757 private:
58 virtual TypeIndex writeRecord(llvm::StringRef Data) override;
58 TypeIndex writeRecord(llvm::StringRef Data) override;
5959
6060 private:
6161 std::vector> Records;
6262 std::unordered_map HashedRecords;
6363 };
64 }
65 }
6664
67 #endif
65 } // end namespace codeview
66 } // end namespace llvm
67
68 #endif // LLVM_DEBUGINFO_CODEVIEW_MEMORYTYPETABLEBUILDER_H
5656 return *this;
5757 }
5858
59 ~RCMemoryManager() {
59 ~RCMemoryManager() override {
6060 Client.destroyRemoteAllocator(Id);
6161 DEBUG(dbgs() << "Destroyed remote allocator " << Id << "\n");
6262 }
354354 ResourceIdMgr::ResourceId Id)
355355 : Remote(Remote), Id(Id) {}
356356
357 ~RCIndirectStubsManager() { Remote.destroyIndirectStubsManager(Id); }
357 ~RCIndirectStubsManager() override {
358 Remote.destroyIndirectStubsManager(Id);
359 }
358360
359361 std::error_code createStub(StringRef StubName, TargetAddress StubAddr,
360362 JITSymbolFlags StubFlags) override {
478480 }
479481
480482 private:
481 void grow() {
483 void grow() override {
482484 TargetAddress BlockAddr = 0;
483485 uint32_t NumTrampolines = 0;
484486 auto EC = Remote.emitTrampolineBlock(BlockAddr, NumTrampolines);
796798
797799 #undef DEBUG_TYPE
798800
799 #endif
801 #endif // LLVM_EXECUTIONENGINE_ORC_ORCREMOTETARGETCLIENT_H
None //=-- InstrProf.h - Instrumented profiling format support ---------*- C++ -*-=//
0 //===-- InstrProf.h - Instrumented profiling format support -----*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
1212 //
1313 //===----------------------------------------------------------------------===//
1414
15 #ifndef LLVM_PROFILEDATA_INSTRPROF_H_
16 #define LLVM_PROFILEDATA_INSTRPROF_H_
15 #ifndef LLVM_PROFILEDATA_INSTRPROF_H
16 #define LLVM_PROFILEDATA_INSTRPROF_H
1717
1818 #include "llvm/ADT/STLExtras.h"
1919 #include "llvm/ADT/StringRef.h"
412412 /// Return the array of profiled values at \p Site.
413413 inline std::unique_ptr
414414 getValueForSite(uint32_t ValueKind, uint32_t Site,
415 uint64_t (*ValueMapper)(uint32_t, uint64_t) = 0) const;
415 uint64_t (*ValueMapper)(uint32_t, uint64_t) = nullptr) const;
416416 inline void
417417 getValueForSite(InstrProfValueData Dest[], uint32_t ValueKind, uint32_t Site,
418 uint64_t (*ValueMapper)(uint32_t, uint64_t) = 0) const;
418 uint64_t (*ValueMapper)(uint32_t, uint64_t) = nullptr) const;
419419 /// Reserve space for NumValueSites sites.
420420 inline void reserveSites(uint32_t ValueKind, uint32_t NumValueSites);
421421 /// Add ValueData for ValueKind at value Site.
736736 #include "llvm/ProfileData/InstrProfData.inc"
737737 };
738738
739 } // end namespace RawInstrProf
739 } // end namespace RawInstrProf
740740
741741 } // end namespace llvm
742742
745745 struct is_error_code_enum : std::true_type {};
746746 }
747747
748 #endif // LLVM_PROFILEDATA_INSTRPROF_H_
748 #endif // LLVM_PROFILEDATA_INSTRPROF_H
553553 for (I = 0; I <= IPVK_Last; I++) {
554554 uint16_t N = NumValueSites[I];
555555 if (!N) {
556 RuntimeRecord->SiteCountArray[I] = 0;
556 RuntimeRecord->SiteCountArray[I] = nullptr;
557557 continue;
558558 }
559559 NumValueKinds++;
560560 RuntimeRecord->SiteCountArray[I] = (uint8_t *)calloc(N, 1);
561561 if (!RuntimeRecord->SiteCountArray[I])
562562 return 1;
563 RuntimeRecord->NodesKind[I] = Nodes ? &Nodes[S] : NULL;
563 RuntimeRecord->NodesKind[I] = Nodes ? &Nodes[S] : nullptr;
564564 for (J = 0; J < N; J++) {
565565 /* Compute value count for each site. */
566566 uint32_t C = 0;
567 ValueProfNode *Site = Nodes ? RuntimeRecord->NodesKind[I][J] : NULL;
567 ValueProfNode *Site = Nodes ? RuntimeRecord->NodesKind[I][J] : nullptr;
568568 while (Site) {
569569 C++;
570570 Site = Site->Next;
605605 uint32_t getNumValueDataRT(const void *R, uint32_t VK) {
606606 unsigned I, S = 0;
607607 const ValueProfRuntimeRecord *Record = (const ValueProfRuntimeRecord *)R;
608 if (Record->SiteCountArray[VK] == 0)
608 if (Record->SiteCountArray[VK] == nullptr)
609609 return 0;
610610 for (I = 0; I < Record->NumValueSites[VK]; I++)
611611 S += Record->SiteCountArray[VK][I];
630630 return (ValueProfData *)calloc(TotalSizeInBytes, 1);
631631 }
632632
633 static ValueProfRecordClosure RTRecordClosure = {0,
633 static ValueProfRecordClosure RTRecordClosure = {nullptr,
634634 getNumValueKindsRT,
635635 getNumValueSitesRT,
636636 getNumValueDataRT,
637637 getNumValueDataForSiteRT,
638 0,
638 nullptr,
639639 getValueForSiteRT,
640640 allocValueProfDataRT};
641641
662662 return serializeValueProfDataFrom(&RTRecordClosure, DstData);
663663 }
664664
665
666665 #undef INSTR_PROF_COMMON_API_IMPL
667666 #endif /* INSTR_PROF_COMMON_API_IMPL */
668667
669668 /*============================================================================*/
670669
671
672670 #ifndef INSTR_PROF_DATA_DEFINED
673671
674 #ifndef INSTR_PROF_DATA_INC_
675 #define INSTR_PROF_DATA_INC_
672 #ifndef INSTR_PROF_DATA_INC
673 #define INSTR_PROF_DATA_INC
676674
677675 /* Helper macros. */
678676 #define INSTR_PROF_SIMPLE_QUOTE(x) #x
759757 struct ValueProfNode *Next;
760758 } ValueProfNode;
761759
762 #endif /* INSTR_PROF_DATA_INC_ */
760 #endif /* INSTR_PROF_DATA_INC */
763761
764762 #else
765763 #undef INSTR_PROF_DATA_DEFINED
3737 #endif
3838 T t;
3939 private:
40 AlignmentCalcImpl() {} // Never instantiate.
40 AlignmentCalcImpl() = delete;
4141 };
4242
4343 // Abstract base class helper, this will have the minimal alignment and size
5454 // of type T.
5555 template
5656 struct AlignmentCalcImpl : AlignmentCalcImplBase, T {
57 virtual ~AlignmentCalcImpl() = 0;
57 ~AlignmentCalcImpl() override = 0;
5858 };
5959
6060 } // End detail namespace.
222222 class AlignerImpl {
223223 T1 t1; T2 t2; T3 t3; T4 t4; T5 t5; T6 t6; T7 t7; T8 t8; T9 t9; T10 t10;
224224
225 AlignerImpl(); // Never defined or instantiated.
225 AlignerImpl() = delete;
226226 };
227227
228228 template
254254 T6, T7, T8, T9, T10>)> {
255255 };
256256 } // end namespace llvm
257 #endif
257
258 #endif // LLVM_SUPPORT_ALIGNOF_H
9797 ErrorOr(E ErrorCode,
9898 typename std::enable_if::value ||
9999 std::is_error_condition_enum::value,
100 void *>::type = 0)
100 void *>::type = nullptr)
101101 : HasError(true) {
102102 new (getErrorStorage()) std::error_code(make_error_code(ErrorCode));
103103 }
277277 return const_cast *>(this)->getErrorStorage();
278278 }
279279
280
281280 union {
282281 AlignedCharArrayUnion TStorage;
283282 AlignedCharArrayUnion ErrorStorage;
294293 }
295294 } // end namespace llvm
296295
297 #endif
296 #endif // LLVM_SUPPORT_ERROROR_H
3434 #include "llvm/Support/MemoryBuffer.h"
3535 #include "llvm/Support/raw_ostream.h"
3636 #include
37
3738 using namespace llvm;
3839
3940 namespace {
496497 std::error_code initStreamFromBuffer();
497498 std::error_code initLazyStream(std::unique_ptr Streamer);
498499 };
499 } // namespace
500 } // end anonymous namespace
500501
501502 BitcodeDiagnosticInfo::BitcodeDiagnosticInfo(std::error_code EC,
502503 DiagnosticSeverity Severity,
871872 /// Provide fast operand accessors
872873 DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
873874 };
874 }
875 } // end anonymous namespace
875876
876877 // FIXME: can we inherit this from ConstantExpr?
877878 template <>
879880 public FixedNumOperandTraits {
880881 };
881882 DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ConstantPlaceHolder, Value)
882 }
883 } // end namespace llvm
883884
884885 void BitcodeReaderValueList::assignValue(Value *V, unsigned Idx) {
885886 if (Idx == size()) {
907908 OldV->replaceAllUsesWith(V);
908909 delete PrevVal;
909910 }
910
911 return;
912 }
913
911 }
914912
915913 Constant *BitcodeReaderValueList::getConstantFwdRef(unsigned Idx,
916914 Type *Ty) {
11271125 IdentifiedStructTypes.push_back(Ret);
11281126 return Ret;
11291127 }
1130
11311128
11321129 //===----------------------------------------------------------------------===//
11331130 // Functions for parsing blocks from the bitcode file
21772174 getMDOrNull(Record[9]), getMDOrNull(Record[10]),
21782175 getMDOrNull(Record[11]), getMDOrNull(Record[12]),
21792176 getMDOrNull(Record[13]),
2180 Record.size() <= 15 ? 0 : getMDOrNull(Record[15]),
2177 Record.size() <= 15 ? nullptr : getMDOrNull(Record[15]),
21812178 Record.size() <= 14 ? 0 : Record[14]),
21822179 NextMetadataNo++);
21832180 break;
27002697 }
27012698 break;
27022699 }
2703
27042700 case bitc::CST_CODE_CE_BINOP: { // CE_BINOP: [opcode, opval, opval]
27052701 if (Record.size() < 3)
27062702 return error("Invalid record");
33743370 break;
33753371 }
33763372
3377
33783373 // Read a record.
33793374 auto BitCode = Stream.readRecord(Entry.ID, Record);
33803375 switch (BitCode) {
58155810 llvm_unreachable("Unknown error type!");
58165811 }
58175812 };
5818 }
5813 } // end anonymous namespace
58195814
58205815 static ManagedStatic ErrorCategory;
58215816
6464 llvm_unreachable("A value of instrprof_error has no message.");
6565 }
6666 };
67 }
67 } // end anonymous namespace
6868
6969 static ManagedStatic ErrorCategory;
7070
442442 }
443443
444444 static ValueProfRecordClosure InstrProfRecordClosure = {
445 0,
445 nullptr,
446446 getNumValueKindsInstrProf,
447447 getNumValueSitesInstrProf,
448448 getNumValueDataInstrProf,
449449 getNumValueDataForSiteInstrProf,
450 0,
450 nullptr,
451451 getValueForSiteInstrProf,
452452 allocValueProfDataInstrProf};
453453
637637 ProfileSummaryEntry PSE = {Cutoff, Count, BlocksSeen};
638638 DetailedSummary.push_back(PSE);
639639 }
640 return;
641 }
642
643 }
640 }
641
642 } // end namespace llvm
7272 return PROT_NONE;
7373 }
7474
75 } // namespace
75 } // anonymous namespace
7676
7777 namespace llvm {
7878 namespace sys {
264264 }
265265
266266 bool Memory::setExecutable (MemoryBlock &M, std::string *ErrMsg) {
267 if (M.Address == 0 || M.Size == 0) return false;
267 if (M.Address == nullptr || M.Size == 0) return false;
268268 Memory::InvalidateInstructionCache(M.Address, M.Size);
269269 #if defined(__APPLE__) && (defined(__arm__) || defined(__arm64__))
270270 kern_return_t kr = vm_protect(mach_task_self(), (vm_address_t)M.Address,
555555 // have memop! In fact, starting from ATOMADD64_DAG all opcodes will be
556556 // thought as target memory ops!
557557 };
558 }
558 } // end namespace X86ISD
559559
560560 /// Define some predicates that are used for node matching.
561561 namespace X86 {
607607 bool isOffsetSuitableForCodeModel(int64_t Offset, CodeModel::Model M,
608608 bool hasSymbolicDisplacement = true);
609609
610
611610 /// Determines whether the callee is required to pop its
612611 /// own arguments. Callee pop is necessary to support tail calls.
613612 bool isCalleePop(CallingConv::ID CallingConv,
614613 bool is64Bit, bool IsVarArg, bool GuaranteeTCO);
615614
616 }
615 } // end namespace X86
617616
618617 //===--------------------------------------------------------------------===//
619618 // X86 Implementation of the TargetLowering interface
684683 /// and types must exactly match those of the original return values of
685684 /// the node), or leaves Results empty, which indicates that the node is not
686685 /// to be custom lowered after all.
687 virtual void LowerOperationWrapper(SDNode *N,
688 SmallVectorImpl &Results,
689 SelectionDAG &DAG) const override;
686 void LowerOperationWrapper(SDNode *N,
687 SmallVectorImpl &Results,
688 SelectionDAG &DAG) const override;
690689
691690 /// Replace the results of node with an illegal result
692691 /// type with new values built out of custom code.
693692 ///
694693 void ReplaceNodeResults(SDNode *N, SmallVectorImpl&Results,
695694 SelectionDAG &DAG) const override;
696
697695
698696 SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const override;
699697
11791177 namespace X86 {
11801178 FastISel *createFastISel(FunctionLoweringInfo &funcInfo,
11811179 const TargetLibraryInfo *libInfo);
1182 }
1183 }
1184
1185 #endif // X86ISELLOWERING_H
1180 } // end namespace X86
1181 } // end namespace llvm
1182
1183 #endif // LLVM_LIB_TARGET_X86_X86ISELLOWERING_H
256256
257257 if (CreateGlobalVar)
258258 FuncNameVar = createPGOFuncNameVar(F, FuncName);
259 };
259 }
260260 };
261261
262262 // Compute Hash value for the CFG: the lower 32 bits are CRC32 of the index
689689 const PGOUseEdge *E = BBCountInfo.OutEdges[s];
690690 const BasicBlock *SrcBB = E->SrcBB;
691691 const BasicBlock *DestBB = E->DestBB;
692 if (DestBB == 0)
692 if (DestBB == nullptr)
693693 continue;
694694 unsigned SuccNum = GetSuccessorNumber(SrcBB, DestBB);
695695 uint64_t EdgeCount = E->CountValue;
7979
8080 bool runOnFunction(Function &F) override;
8181 };
82 }
82 } // end anonymous namespace
8383
8484 char AddDiscriminators::ID = 0;
8585 INITIALIZE_PASS_BEGIN(AddDiscriminators, "add-discriminators",
216216 // Sample base profile needs to distinguish different function calls within
217217 // a same source line for correct profile annotation.
218218 for (BasicBlock &B : F) {
219 const DILocation *FirstDIL = NULL;
219 const DILocation *FirstDIL = nullptr;
220220 for (auto &I : B.getInstList()) {
221221 CallInst *Current = dyn_cast(&I);
222222 if (!Current || isa(&I))
2626 EmptyModuleStatsTy = makeModuleStatsTy();
2727
2828 ModuleStatsGV = new GlobalVariable(*M, EmptyModuleStatsTy, false,
29 GlobalValue::InternalLinkage, 0);
29 GlobalValue::InternalLinkage, nullptr);
3030 }
3131
3232 ArrayType *SanitizerStatReport::makeModuleStatsArrayTy() {
5050 while (Begin != End && *Begin)
5151 ++Begin;
5252 if (Begin == End)
53 return 0;
53 return nullptr;
5454 StringRef Filename(FilenameBegin, Begin - FilenameBegin);
5555
5656 ++Begin;
5757 if (Begin == End)
58 return 0;
58 return nullptr;
5959
6060 symbolize::LLVMSymbolizer::Options SymbolizerOptions;
6161 SymbolizerOptions.Demangle = ClDemangle;
6969 Begin += SizeofPtr;
7070
7171 if (Begin > End)
72 return 0;
72 return nullptr;
7373 if (Addr == 0 && Data == 0)
7474 return Begin;
7575 if (Begin == End)
76 return 0;
76 return nullptr;
7777
7878 ErrorOr LineInfo = Symbolizer.symbolizeCode(Filename, Addr);
7979 if (LineInfo) {
128128 char SizeofPtr = *Begin++;
129129 while (Begin != End) {
130130 Begin = ReadModule(SizeofPtr, Begin, End);
131 if (Begin == 0) {
131 if (Begin == nullptr) {
132132 errs() << argv[0] << ": " << ClInputFile << ": short read\n";
133133 return 1;
134134 }
3636 return SectionMemoryManager::needsToReserveAllocationSpace();
3737 }
3838
39 bool finalizeMemory(std::string *ErrMsg = 0) override {
39 bool finalizeMemory(std::string *ErrMsg = nullptr) override {
4040 ++FinalizationCount;
4141 return SectionMemoryManager::finalizeMemory(ErrMsg);
4242 }
4343 };
4444
4545 TEST(ObjectLinkingLayerTest, TestSetProcessAllSections) {
46
4746 class SectionMemoryManagerWrapper : public SectionMemoryManager {
4847 public:
4948 SectionMemoryManagerWrapper(bool &DebugSeen) : DebugSeen(DebugSeen) {}
112111 }
113112 }
114113
115
116114 TEST_F(ObjectLinkingLayerExecutionTest, NoDuplicateFinalization) {
117
118115 if (!TM)
119116 return;
120117
186183 }
187184
188185 TEST_F(ObjectLinkingLayerExecutionTest, NoPrematureAllocation) {
189
190186 if (!TM)
191187 return;
192188
249245 "(multiple unrelated objects loaded prior to finalization)";
250246 }
251247
252 }
248 } // end anonymous namespace
None //===- llvm/unittest/IR/VerifierTest.cpp - Verifier unit tests ------------===//
0 //===- llvm/unittest/IR/VerifierTest.cpp - Verifier unit tests --*- C++ -*-===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
125125 Module M2("M2", C);
126126 GlobalVariable *newGV =
127127 new GlobalVariable(M1, Type::getInt8Ty(C), false,
128 GlobalVariable::ExternalLinkage, NULL, "Some Global");
128 GlobalVariable::ExternalLinkage, nullptr,
129 "Some Global");
129130
130131 DIBuilder dbuilder(M2);
131132 auto CU = dbuilder.createCompileUnit(dwarf::DW_LANG_Julia, "test.jl", ".",
142143 EXPECT_TRUE(StringRef(ErrorOS.str())
143144 .startswith("Referencing global in another module!"));
144145 }
145 }
146 }
146 } // end anonymous namespace
147 } // end namespace llvm
1313 #include "llvm/ProfileData/InstrProfWriter.h"
1414 #include "llvm/Support/Compression.h"
1515 #include "gtest/gtest.h"
16
1716 #include
1817
1918 using namespace llvm;
489488 {{uint64_t("callee2"), 1000}, &Site1Values[2]},
490489 {{uint64_t("callee3"), 500}, &Site1Values[3]},
491490 {{uint64_t("callee4"), 300}, &Site1Values[4]},
492 {{uint64_t("callee5"), 100}, 0}};
491 {{uint64_t("callee5"), 100}, nullptr}};
493492
494493 ValueProfNode Site2Values[4] = {{{uint64_t("callee5"), 800}, &Site2Values[1]},
495494 {{uint64_t("callee3"), 1000}, &Site2Values[2]},
496495 {{uint64_t("callee2"), 2500}, &Site2Values[3]},
497 {{uint64_t("callee1"), 1300}, 0}};
496 {{uint64_t("callee1"), 1300}, nullptr}};
498497
499498 ValueProfNode Site3Values[3] = {{{uint64_t("callee6"), 800}, &Site3Values[1]},
500499 {{uint64_t("callee3"), 1000}, &Site3Values[2]},
501 {{uint64_t("callee4"), 5500}, 0}};
500 {{uint64_t("callee4"), 5500}, nullptr}};
502501
503502 ValueProfNode Site4Values[2] = {{{uint64_t("callee2"), 1800}, &Site4Values[1]},
504 {{uint64_t("callee3"), 2000}, 0}};
503 {{uint64_t("callee3"), 2000}, nullptr}};
505504
506505 static ValueProfNode *ValueProfNodes[5] = {&Site1Values[0], &Site2Values[0],
507 &Site3Values[0], &Site4Values[0], 0};
506 &Site3Values[0], &Site4Values[0],
507 nullptr};
508
508509 static uint16_t NumValueSites[IPVK_Last + 1] = {5};
509510 TEST_F(InstrProfTest, runtime_value_prof_data_read_write) {
510511 ValueProfRuntimeRecord RTRecord;
515516
516517 InstrProfRecord Record("caller", 0x1234, {1ULL << 31, 2});
517518
518 VPData->deserializeTo(Record, 0);
519 VPData->deserializeTo(Record, nullptr);
519520
520521 // Now read data from Record and sanity check the data
521522 ASSERT_EQ(5U, Record.getNumValueSites(IPVK_IndirectCallTarget));
686687
687688 for (unsigned I = 0; I < sizeof(Funcs) / sizeof(*Funcs); I++) {
688689 Function *F = M->getFunction(Funcs[I]);
689 ASSERT_TRUE(F != NULL);
690 ASSERT_TRUE(F != nullptr);
690691 std::string PGOName = getPGOFuncName(*F);
691692 uint64_t Key = IndexedInstrProf::ComputeHash(PGOName);
692693 ASSERT_EQ(StringRef(PGOName),
None //=== - llvm/unittest/Support/AlignOfTest.cpp - Alignment utility tests ----===//
0 //=== - llvm/unittest/Support/AlignOfTest.cpp - Alignment utility tests ---===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
8989 V8::~V8() {}
9090
9191 struct Abstract1 {
92 virtual ~Abstract1() {}
92 virtual ~Abstract1() = default;
9393 virtual void method() = 0;
9494
9595 char c;
9696 };
9797
9898 struct Abstract2 : Abstract1 {
99 virtual ~Abstract2() {}
99 ~Abstract2() override = default;
100100 double d;
101101 };
102102
353353 EXPECT_EQ(2u, sizeof(AlignedCharArray<2, 2>));
354354 EXPECT_EQ(16u, sizeof(AlignedCharArray<2, 16>));
355355 }
356 }
356 } // end anonymous namespace
None //===- DFAPacketizerEmitter.cpp - Packetization DFA for a VLIW machine-----===//
0 //===- DFAPacketizerEmitter.cpp - Packetization DFA for a VLIW machine ----===//
11 //
22 // The LLVM Compiler Infrastructure
33 //
2727 #include
2828 #include
2929 #include
30
3031 using namespace llvm;
3132
3233 // --------------------------------------------------------------------
7273 InsnInput = addDFAFuncUnits(InsnInput, U);
7374 return InsnInput;
7475 }
75 }
76 } // end anonymous namespace
77
7678 // --------------------------------------------------------------------
7779
7880 #ifndef NDEBUG
148150
149151 void run(raw_ostream &OS);
150152 };
151 } // End anonymous namespace.
153 } // end anonymous namespace
152154
153155 //
154156 //
233235 //
234236 bool hasTransition(std::vector InsnClass) const;
235237 };
236 } // End anonymous namespace.
238 } // end anonymous namespace
237239
238240 //
239241 // class DFA: deterministic finite automaton for processor resource tracking.
261263 int numInsnClasses = 0,
262264 int maxResources = 0, int numCombos = 0, int maxStages = 0);
263265 };
264 } // End anonymous namespace.
266 } // end anonymous namespace
265267
266268 #ifndef NDEBUG
267269 // To enable debugging, run llvm-tblgen with: "-debug-only dfa-emitter".
304306 DEBUG(dbgs() << " ");
305307 }
306308 }
307 #endif
309 #endif // NDEBUG
308310
309311 //
310312 // Constructors and destructors for State and DFA
453455 }
454456 }
455457
456
457458 //
458459 // canMaybeAddInsnClass - Quickly verifies if an instruction of type InsnClass
459460 // may be a valid transition from this state i.e., can an instruction of type
504505 return false;
505506 }
506507
507
508508 const State &DFA::newState() {
509509 auto IterPair = states.insert(State());
510510 assert(IterPair.second && "State already exists");
516516 DFAPacketizerEmitter::DFAPacketizerEmitter(RecordKeeper &R):
517517 TargetName(CodeGenTarget(R).getName()),
518518 allInsnClasses(), Records(R) {}
519
520519
521520 //
522521 // writeTableAndAPI - Print out a table representing the DFA and the
625624 OS << "};\n";
626625 OS << "} // namespace\n";
627626
628
629627 //
630628 // Emit DFA Packetizer tables if the target is a VLIW machine.
631629 //
638636 << "DFAStateInputTable, " << TargetName << "DFAStateEntryTable);\n}\n\n";
639637 OS << "} // End llvm namespace \n";
640638 }
641
642639
643640 //
644641 // collectAllFuncUnits - Construct a map of function unit names to bits.
734731 return numCombos;
735732 }
736733
737
738734 //
739735 // collectOneInsnClass - Populate allInsnClasses with one instruction class
740736 //
939935 //
940936 if (!current->hasTransition(InsnClass) &&
941937 current->canMaybeAddInsnClass(InsnClass, ComboBitToBitsMap)) {
942 const State *NewState = NULL;
938 const State *NewState = nullptr;
943939 current->AddInsnClass(InsnClass, ComboBitToBitsMap, NewStateResources);
944940 if (NewStateResources.size() == 0) {
945941 DEBUG(dbgs() << " Skipped - no new states generated\n");
993989 DFAPacketizerEmitter(RK).run(OS);
994990 }
995991
996 } // End llvm namespace
992 } // end namespaec llvm