Continue sketching out basic infrastructure, including an input and output
filename, and printing of trivial stuff. There is no parser yet, so the
input file is ignored.
PiperOrigin-RevId: 201596916
diff --git a/lib/IR/Function.cpp b/lib/IR/Function.cpp
index d2f1fa9..6407e9c 100644
--- a/lib/IR/Function.cpp
+++ b/lib/IR/Function.cpp
@@ -14,14 +14,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// =============================================================================
-//
-// TODO
-//
-//===----------------------------------------------------------------------===//
#include "mlir/IR/Function.h"
+#include "llvm/Support/raw_ostream.h"
using namespace mlir;
-Function::Function() {
+Function::Function(StringRef name) : name(name.str()) {
}
+void Function::print(raw_ostream &os) {
+ os << "extfunc @" << name << "()\n";
+}
+
+void Function::dump() {
+ print(llvm::errs());
+}