Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Unified Diff: src/assembler.cpp

Issue 678533005: Subzero: Add basic ELFObjectWriter (text section, symtab, strtab, headers) (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: minor cleanup Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/assembler.h ('k') | src/assembler_ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.cpp
diff --git a/src/assembler.cpp b/src/assembler.cpp
index b0bd297f057db71e178e6307261781ab9750b0d3..a9516e869b05a0213e96557245d9ef270f513493 100644
--- a/src/assembler.cpp
+++ b/src/assembler.cpp
@@ -20,7 +20,6 @@
#include "assembler.h"
#include "IceGlobalContext.h"
-#include "IceMemoryRegion.h"
#include "IceOperand.h"
namespace Ice {
@@ -76,25 +75,6 @@ AssemblerBuffer::AssemblerBuffer(Assembler &assembler) : assembler_(assembler) {
AssemblerBuffer::~AssemblerBuffer() {}
-void AssemblerBuffer::ProcessFixups(const MemoryRegion &region) {
- for (SizeT I = 0; I < fixups_.size(); ++I) {
- AssemblerFixup *fixup = fixups_[I];
- fixup->Process(region, fixup->position());
- }
-}
-
-void AssemblerBuffer::FinalizeInstructions(const MemoryRegion &instructions) {
- // Copy the instructions from the buffer.
- MemoryRegion from(reinterpret_cast<void *>(contents()), Size());
- instructions.CopyFrom(0, from);
-
- // Process fixups in the instructions.
- ProcessFixups(instructions);
-#ifndef NDEBUG
- fixups_processed_ = true;
-#endif // !NDEBUG
-}
-
void AssemblerBuffer::ExtendCapacity() {
intptr_t old_size = Size();
intptr_t old_capacity = Capacity();
@@ -123,6 +103,11 @@ void AssemblerBuffer::ExtendCapacity() {
assert(Size() == old_size);
}
+llvm::StringRef Assembler::getBufferView() const {
+ return llvm::StringRef(reinterpret_cast<const char *>(buffer_.contents()),
+ buffer_.Size());
+}
+
void Assembler::emitIASBytes(GlobalContext *Ctx) const {
Ostream &Str = Ctx->getStrEmit();
intptr_t EndPosition = buffer_.Size();
« no previous file with comments | « src/assembler.h ('k') | src/assembler_ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698