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

Unified Diff: src/IceAssembler.h

Issue 1559243002: Suzero. X8664. NaCl Sandboxing. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Fixes filetype=asm; addresses comments. Created 4 years, 11 months 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 | « pydir/targets.py ('k') | src/IceAssemblerX86Base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceAssembler.h
diff --git a/src/IceAssembler.h b/src/IceAssembler.h
index d2e9578ffe2d2a613fff1b76e907f282d15a2263..d3111adcbe5e19a6fca055c150a78a85726b1613 100644
--- a/src/IceAssembler.h
+++ b/src/IceAssembler.h
@@ -237,6 +237,9 @@ class Assembler {
Assembler &operator=(const Assembler &) = delete;
public:
+ using InternalRelocationList =
+ std::vector<std::pair<const IceString, const SizeT>>;
+
enum AssemblerKind {
Asm_ARM32,
Asm_MIPS32,
@@ -323,12 +326,23 @@ public:
AssemblerKind getKind() const { return Kind; }
+ void addRelocationAtCurrentPosition(const IceString &RelocName) {
+ if (!getPreliminary()) {
+ InternalRelocs.emplace_back(RelocName, getBufferSize());
+ }
+ }
+
+ const InternalRelocationList &getInternalRelocations() const {
+ return InternalRelocs;
+ }
+
protected:
explicit Assembler(AssemblerKind Kind)
: Kind(Kind), Allocator(), Buffer(*this) {}
private:
const AssemblerKind Kind;
+ InternalRelocationList InternalRelocs;
ArenaAllocator<32 * 1024> Allocator;
/// FunctionName and IsInternal are transferred from the original Cfg object,
« no previous file with comments | « pydir/targets.py ('k') | src/IceAssemblerX86Base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698