diff options
author | River Riddle <riverriddle@google.com> | 2019-07-01 10:29:09 -0700 |
---|---|---|
committer | jpienaar <jpienaar@google.com> | 2019-07-01 11:39:00 -0700 |
commit | 54cd6a7e97a226738e2c85b86559918dd9e3cd5d (patch) | |
tree | affa803347d6695be575137d1ad55a055a8021e3 /mlir/unittests/Pass/AnalysisManagerTest.cpp | |
parent | 84bd67fc4fd116e80f7a66bfadfe9a7fd6fd5e82 (diff) | |
download | bcm5719-llvm-54cd6a7e97a226738e2c85b86559918dd9e3cd5d.tar.gz bcm5719-llvm-54cd6a7e97a226738e2c85b86559918dd9e3cd5d.zip |
NFC: Refactor Function to be value typed.
Move the data members out of Function and into a new impl storage class 'FunctionStorage'. This allows for Function to become value typed, which will greatly simplify the transition of Function to FuncOp(given that FuncOp is also value typed).
PiperOrigin-RevId: 255983022
Diffstat (limited to 'mlir/unittests/Pass/AnalysisManagerTest.cpp')
-rw-r--r-- | mlir/unittests/Pass/AnalysisManagerTest.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/mlir/unittests/Pass/AnalysisManagerTest.cpp b/mlir/unittests/Pass/AnalysisManagerTest.cpp index 38a059b3ba5..d2a82374124 100644 --- a/mlir/unittests/Pass/AnalysisManagerTest.cpp +++ b/mlir/unittests/Pass/AnalysisManagerTest.cpp @@ -25,11 +25,11 @@ using namespace mlir::detail; namespace { /// Minimal class definitions for two analyses. struct MyAnalysis { - MyAnalysis(Function *) {} + MyAnalysis(Function) {} MyAnalysis(Module *) {} }; struct OtherAnalysis { - OtherAnalysis(Function *) {} + OtherAnalysis(Function) {} OtherAnalysis(Module *) {} }; @@ -59,10 +59,10 @@ TEST(AnalysisManagerTest, FineGrainFunctionAnalysisPreservation) { // Create a function and a module. std::unique_ptr<Module> module(new Module(&context)); - Function *func1 = - new Function(builder.getUnknownLoc(), "foo", - builder.getFunctionType(llvm::None, llvm::None)); - module->getFunctions().push_back(func1); + Function func1 = + Function::create(builder.getUnknownLoc(), "foo", + builder.getFunctionType(llvm::None, llvm::None)); + module->push_back(func1); // Test fine grain invalidation of the function analysis manager. ModuleAnalysisManager mam(&*module, /*passInstrumentor=*/nullptr); @@ -87,10 +87,10 @@ TEST(AnalysisManagerTest, FineGrainChildFunctionAnalysisPreservation) { // Create a function and a module. std::unique_ptr<Module> module(new Module(&context)); - Function *func1 = - new Function(builder.getUnknownLoc(), "foo", - builder.getFunctionType(llvm::None, llvm::None)); - module->getFunctions().push_back(func1); + Function func1 = + Function::create(builder.getUnknownLoc(), "foo", + builder.getFunctionType(llvm::None, llvm::None)); + module->push_back(func1); // Test fine grain invalidation of a function analysis from within a module // analysis manager. |