Lines Matching defs:IR
1 //===- unittests/IR/PassBuilderCallbacksTest.cpp - PB Callback Tests --===//
17 #include <llvm/IR/LLVMContext.h>
18 #include <llvm/IR/Module.h>
19 #include <llvm/IR/PassInstrumentation.h>
20 #include <llvm/IR/PassManager.h>
69 bool invalidate(IRUnitT &IR, const PreservedAnalyses &PA,
71 return Handle->invalidate(IR, PA, Inv);
75 Result run(IRUnitT &IR, AnalysisManagerT &AM, ExtraArgTs... ExtraArgs) {
76 return Handle->run(IR, AM, ExtraArgs...);
89 static bool invalidateCallback(IRUnitT &IR, const PreservedAnalyses &PA,
135 PreservedAnalyses run(IRUnitT &IR, AnalysisManagerT &AM,
137 return Handle->run(IR, AM, ExtraArgs...);
279 static std::unique_ptr<Module> parseIR(LLVMContext &C, const char *IR) {
281 return parseAssemblyString(IR, Err, C);
286 template <typename IRUnitT> std::string getName(const IRUnitT &IR) {
287 return std::string(IR.getName());
308 /// LLVM often has IR objects or analysis objects which expose a name
349 [this](StringRef P, llvm::Any IR) {
350 return this->runBeforePass(P, IR);
353 [this](StringRef P, llvm::Any IR) {
354 this->runBeforeSkippedPass(P, IR);
357 [this](StringRef P, llvm::Any IR) {
358 this->runBeforeNonSkippedPass(P, IR);
361 [this](StringRef P, llvm::Any IR, const PreservedAnalyses &PA) {
362 this->runAfterPass(P, IR, PA);
368 Callbacks.registerBeforeAnalysisCallback([this](StringRef P, llvm::Any IR) {
369 return this->runBeforeAnalysis(P, IR);
372 [this](StringRef P, llvm::Any IR) { this->runAfterAnalysis(P, IR); });
745 // Our mock pass does not invalidate IR.
861 // Our mock pass does not invalidate IR.
916 // Our mock pass invalidates IR, thus normal runAfterPass is never called.
982 // Our mock pass invalidates IR, thus normal runAfterPass is never called.
1108 // Our mock pass does not invalidate IR.
1163 // Our mock pass does invalidate IR, thus normal runAfterPass is never called.