Refactor the includes of Function.h now that the dependency on Operation has...
authorRiver Riddle <riverriddle@google.com>
Mon, 13 May 2019 16:00:22 +0000 (09:00 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Mon, 20 May 2019 20:38:32 +0000 (13:38 -0700)
--

PiperOrigin-RevId: 247944666

mlir/include/mlir/Analysis/NestedMatcher.h
mlir/include/mlir/IR/Function.h
mlir/lib/IR/Attributes.cpp
mlir/lib/IR/Function.cpp
mlir/lib/IR/MLIRContext.cpp

index a86cf94..3ab24f8 100644 (file)
@@ -19,6 +19,7 @@
 #define MLIR_ANALYSIS_MLFUNCTIONMATCHER_H_
 
 #include "mlir/IR/Function.h"
+#include "mlir/IR/Operation.h"
 #include "llvm/Support/Allocator.h"
 
 namespace mlir {
index d4b85b5..24cdb4a 100644 (file)
 #ifndef MLIR_IR_FUNCTION_H
 #define MLIR_IR_FUNCTION_H
 
-#include "mlir/IR/Operation.h"
+#include "mlir/IR/Attributes.h"
+#include "mlir/IR/Block.h"
+#include "mlir/IR/Identifier.h"
+#include "mlir/IR/Location.h"
 
 namespace mlir {
 class BlockAndValueMapping;
@@ -245,15 +248,18 @@ public:
 
   /// Emit an error about fatal conditions with this function, reporting up to
   /// any diagnostic handlers that may be listening.
-  InFlightDiagnostic emitError(const Twine &message = {});
+  InFlightDiagnostic emitError();
+  InFlightDiagnostic emitError(const Twine &message);
 
   /// Emit a warning about this function, reporting up to any diagnostic
   /// handlers that may be listening.
-  InFlightDiagnostic emitWarning(const Twine &message = {});
+  InFlightDiagnostic emitWarning();
+  InFlightDiagnostic emitWarning(const Twine &message);
 
   /// Emit a remark about this function, reporting up to any diagnostic
   /// handlers that may be listening.
-  InFlightDiagnostic emitRemark(const Twine &message = {});
+  InFlightDiagnostic emitRemark();
+  InFlightDiagnostic emitRemark(const Twine &message);
 
   /// Displays the CFG in a window. This is for use from the debugger and
   /// depends on Graphviz to generate the graph.
@@ -362,4 +368,4 @@ private:
 };
 } // end namespace llvm
 
-#endif  // MLIR_IR_FUNCTION_H
+#endif // MLIR_IR_FUNCTION_H
index bf1972c..401b995 100644 (file)
 #include "mlir/IR/Attributes.h"
 #include "AttributeDetail.h"
 #include "mlir/IR/AffineMap.h"
+#include "mlir/IR/Diagnostics.h"
 #include "mlir/IR/Dialect.h"
 #include "mlir/IR/Function.h"
 #include "mlir/IR/IntegerSet.h"
 #include "mlir/IR/Types.h"
+#include "llvm/ADT/Twine.h"
 
 using namespace mlir;
 using namespace mlir::detail;
index 1f9a1f5..0d44fa5 100644 (file)
 // =============================================================================
 
 #include "mlir/IR/Function.h"
-#include "mlir/IR/Attributes.h"
 #include "mlir/IR/BlockAndValueMapping.h"
 #include "mlir/IR/Diagnostics.h"
 #include "mlir/IR/MLIRContext.h"
 #include "mlir/IR/Module.h"
-#include "mlir/IR/Types.h"
 #include "llvm/ADT/MapVector.h"
 #include "llvm/ADT/SmallString.h"
-#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/Twine.h"
+
 using namespace mlir;
 
 Function::Function(Location location, StringRef name, FunctionType type,
@@ -118,18 +117,21 @@ void Function::erase() {
 /// any diagnostic handlers that may be listening.  This function always
 /// returns failure.  NOTE: This may terminate the containing application, only
 /// use when the IR is in an inconsistent state.
+InFlightDiagnostic Function::emitError() { return emitError({}); }
 InFlightDiagnostic Function::emitError(const Twine &message) {
   return getContext()->emitError(getLoc(), message);
 }
 
 /// Emit a warning about this function, reporting up to any diagnostic
 /// handlers that may be listening.
+InFlightDiagnostic Function::emitWarning() { return emitWarning({}); }
 InFlightDiagnostic Function::emitWarning(const Twine &message) {
   return getContext()->emitWarning(getLoc(), message);
 }
 
 /// Emit a remark about this function, reporting up to any diagnostic
 /// handlers that may be listening.
+InFlightDiagnostic Function::emitRemark() { return emitRemark({}); }
 InFlightDiagnostic Function::emitRemark(const Twine &message) {
   return getContext()->emitRemark(getLoc(), message);
 }
index a4cc076..3df3aea 100644 (file)
@@ -38,6 +38,7 @@
 #include "llvm/ADT/DenseSet.h"
 #include "llvm/ADT/SetVector.h"
 #include "llvm/ADT/StringMap.h"
+#include "llvm/ADT/Twine.h"
 #include "llvm/Support/Allocator.h"
 #include "llvm/Support/RWMutex.h"
 #include "llvm/Support/raw_ostream.h"