From 4b770c20778ccb5d2f304fa73e0522a7ab8c4623 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 27 Aug 2009 07:57:12 +0000 Subject: [PATCH] Add {MCInst,MCOperand}::{print,dump} git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80231 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/MC/MCInst.h | 7 ++++++ lib/MC/CMakeLists.txt | 1 + lib/MC/MCInst.cpp | 52 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 lib/MC/MCInst.cpp diff --git a/include/llvm/MC/MCInst.h b/include/llvm/MC/MCInst.h index 36011b9b65f..857d29411e6 100644 --- a/include/llvm/MC/MCInst.h +++ b/include/llvm/MC/MCInst.h @@ -22,6 +22,7 @@ #include "llvm/Support/DebugLoc.h" namespace llvm { +class raw_ostream; /// MCOperand - Instances of this class represent operands of the MCInst class. /// This is a simple discriminated union. @@ -119,6 +120,9 @@ public: Op.MCValueVal = Val; return Op; } + + void print(raw_ostream &OS) const; + void dump() const; }; @@ -142,6 +146,9 @@ public: void addOperand(const MCOperand &Op) { Operands.push_back(Op); } + + void print(raw_ostream &OS) const; + void dump() const; }; diff --git a/lib/MC/CMakeLists.txt b/lib/MC/CMakeLists.txt index ecb84405751..672d9b76a96 100644 --- a/lib/MC/CMakeLists.txt +++ b/lib/MC/CMakeLists.txt @@ -8,6 +8,7 @@ add_llvm_library(LLVMMC MCAssembler.cpp MCCodeEmitter.cpp MCContext.cpp + MCInst.cpp MCMachOStreamer.cpp MCNullStreamer.cpp MCSection.cpp diff --git a/lib/MC/MCInst.cpp b/lib/MC/MCInst.cpp new file mode 100644 index 00000000000..469dc7975e5 --- /dev/null +++ b/lib/MC/MCInst.cpp @@ -0,0 +1,52 @@ +//===- lib/MC/MCInst.cpp - MCInst implementation --------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include "llvm/MC/MCInst.h" +#include "llvm/Support/raw_ostream.h" + +using namespace llvm; + +void MCOperand::print(raw_ostream &OS) const { + OS << ""; +} + +void MCOperand::dump() const { + print(errs()); + errs() << "\n"; +} + +void MCInst::print(raw_ostream &OS) const { + OS << ""; +} + +void MCInst::dump() const { + print(errs()); + errs() << "\n"; +} -- 2.34.1