diff options
author | Pedro Artigas <partigas@apple.com> | 2012-12-14 18:52:11 +0000 |
---|---|---|
committer | Pedro Artigas <partigas@apple.com> | 2012-12-14 18:52:11 +0000 |
commit | 99cbdde6198623ff014c776743caec2cf48f4840 (patch) | |
tree | 37ba9f08c31167816c6ba44f76b8833601780ebf /include | |
parent | a5ed031fbcec67081d4857c9000f0180840fe2d5 (diff) |
Add more reset methods to make all objects that the backend may use for outputting code have a reset, some are not used but were declared for completeness
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170227 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/MC/MCAsmBackend.h | 3 | ||||
-rw-r--r-- | include/llvm/MC/MCCodeEmitter.h | 3 | ||||
-rw-r--r-- | include/llvm/MC/MCMachObjectWriter.h | 14 | ||||
-rw-r--r-- | include/llvm/MC/MCObjectWriter.h | 3 |
4 files changed, 23 insertions, 0 deletions
diff --git a/include/llvm/MC/MCAsmBackend.h b/include/llvm/MC/MCAsmBackend.h index 72ed1a317c..48bd9d0742 100644 --- a/include/llvm/MC/MCAsmBackend.h +++ b/include/llvm/MC/MCAsmBackend.h @@ -41,6 +41,9 @@ protected: // Can only create subclasses. public: virtual ~MCAsmBackend(); + /// lifetime management + virtual void reset() { } + /// createObjectWriter - Create a new MCObjectWriter instance for use by the /// assembler backend to emit the final object file. virtual MCObjectWriter *createObjectWriter(raw_ostream &OS) const = 0; diff --git a/include/llvm/MC/MCCodeEmitter.h b/include/llvm/MC/MCCodeEmitter.h index 0574890902..9bfa08eb5d 100644 --- a/include/llvm/MC/MCCodeEmitter.h +++ b/include/llvm/MC/MCCodeEmitter.h @@ -29,6 +29,9 @@ protected: // Can only create subclasses. public: virtual ~MCCodeEmitter(); + /// Lifetime management + virtual void reset() { } + /// EncodeInstruction - Encode the given \p Inst to bytes on the output /// stream \p OS. virtual void EncodeInstruction(const MCInst &Inst, raw_ostream &OS, diff --git a/include/llvm/MC/MCMachObjectWriter.h b/include/llvm/MC/MCMachObjectWriter.h index efaabfb9e8..2ddde0b68a 100644 --- a/include/llvm/MC/MCMachObjectWriter.h +++ b/include/llvm/MC/MCMachObjectWriter.h @@ -45,6 +45,13 @@ protected: public: virtual ~MCMachObjectTargetWriter(); + /// @name Lifetime Management + /// @{ + + virtual void reset() {}; + + /// @} + /// @name Accessors /// @{ @@ -111,6 +118,13 @@ public: : MCObjectWriter(_OS, _IsLittleEndian), TargetObjectWriter(MOTW) { } + /// @name Lifetime management Methods + /// @{ + + virtual void reset(); + + /// @} + /// @name Utility Methods /// @{ diff --git a/include/llvm/MC/MCObjectWriter.h b/include/llvm/MC/MCObjectWriter.h index f77b7d853d..9d5c1a785e 100644 --- a/include/llvm/MC/MCObjectWriter.h +++ b/include/llvm/MC/MCObjectWriter.h @@ -51,6 +51,9 @@ protected: // Can only create subclasses. public: virtual ~MCObjectWriter(); + /// lifetime management + virtual void reset() { } + bool isLittleEndian() const { return IsLittleEndian; } raw_ostream &getStream() { return OS; } |