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

Unified Diff: src/IceAssembler.h

Issue 1211863004: Enables llvm dyn_cast for Assemblers. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses comments. Created 5 years, 6 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 | « no previous file | src/IceAssemblerARM32.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 b6ddf08003a4121cce3415282ca6f22117f2e3a3..c2a40d67ad733e1bb2be03b3c9673f998f6e5c56 100644
--- a/src/IceAssembler.h
+++ b/src/IceAssembler.h
@@ -144,11 +144,18 @@ private:
};
class Assembler {
+ Assembler() = delete;
Assembler(const Assembler &) = delete;
Assembler &operator=(const Assembler &) = delete;
public:
- Assembler() : Allocator(), Buffer(*this) {}
+ enum AssemblerKind {
+ Asm_ARM32,
+ Asm_MIPS32,
+ Asm_X8632,
+ Asm_X8664,
+ };
+
virtual ~Assembler() = default;
// Allocate a chunk of bytes using the per-Assembler allocator.
@@ -203,7 +210,15 @@ public:
void setPreliminary(bool Value) { Preliminary = Value; }
bool getPreliminary() const { return Preliminary; }
+ AssemblerKind getKind() const { return Kind; }
+
+protected:
+ explicit Assembler(AssemblerKind Kind)
+ : Kind(Kind), Allocator(), Buffer(*this) {}
+
private:
+ const AssemblerKind Kind;
+
ArenaAllocator<32 * 1024> Allocator;
// FunctionName and IsInternal are transferred from the original Cfg
// object, since the Cfg object may be deleted by the time the
« no previous file with comments | « no previous file | src/IceAssemblerARM32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698