Index: src/assembler.h |
diff --git a/src/assembler.h b/src/assembler.h |
index dfd8cd123bfdc09418d095c80666b1be53c322f8..ecdda3781db41994e3ece9670a47e799a4cddcf3 100644 |
--- a/src/assembler.h |
+++ b/src/assembler.h |
@@ -115,6 +115,11 @@ public: |
const FixupRefList &fixups() const { return fixups_; } |
+ void setSize(intptr_t NewSize) { |
+ assert(NewSize < Size()); |
+ cursor_ = contents_ + NewSize; |
+ } |
+ |
private: |
// The limit is set to kMinimumGap bytes before the end of the data area. |
// This leaves enough space for the longest possible instruction and allows |
@@ -194,6 +199,11 @@ public: |
void setInternal(bool Internal) { IsInternal = Internal; } |
const IceString &getFunctionName() { return FunctionName; } |
void setFunctionName(const IceString &NewName) { FunctionName = NewName; } |
+ intptr_t getBufferSize() const { return buffer_.Size(); } |
+ // Roll back to a (smaller) size. |
+ void setBufferSize(intptr_t NewSize) { buffer_.setSize(NewSize); } |
+ // Add nop padding of a particular width. |
+ virtual void padWithNop(intptr_t Padding) = 0; |
private: |
ArenaAllocator<32 * 1024> Allocator; |