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

Unified Diff: src/IceOperand.h

Issue 1129263005: Convert Constant->emit() definitions to allow multiple targets to define them. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: report fatal Created 5 years, 7 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 | « src/IceInstX8632.cpp ('k') | src/IceOperand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.h
diff --git a/src/IceOperand.h b/src/IceOperand.h
index 3bbd02cb60ba27836d7712522aec9c5dce3da0d5..430a565f418430efaec77976a0a5873d78c53f40 100644
--- a/src/IceOperand.h
+++ b/src/IceOperand.h
@@ -106,9 +106,8 @@ public:
void emitPoolLabel(Ostream &Str) const {
Str << ".L$" << getType() << "$" << PoolEntryID;
}
- void emit(const Cfg *Func) const override { emit(Func->getContext()); }
- virtual void emit(GlobalContext *Ctx) const = 0;
- virtual void emitWithoutDollar(GlobalContext *Ctx) const = 0;
+ void emit(const Cfg *Func) const override { emit(Func->getTarget()); }
+ virtual void emit(TargetLowering *Target) const = 0;
static bool classof(const Operand *Operand) {
OperandKind Kind = Operand->getKind();
@@ -147,10 +146,7 @@ public:
}
PrimType getValue() const { return Value; }
using Constant::emit;
- // The target needs to implement this for each ConstantPrimitive
- // specialization.
- void emit(GlobalContext *Ctx) const override;
- void emitWithoutDollar(GlobalContext *Ctx) const override;
+ void emit(TargetLowering *Target) const final;
using Constant::dump;
void dump(const Cfg *, Ostream &Str) const override {
if (ALLOW_DUMP)
@@ -234,9 +230,9 @@ public:
void setSuppressMangling(bool Value) { SuppressMangling = Value; }
bool getSuppressMangling() const { return SuppressMangling; }
using Constant::emit;
+ void emit(TargetLowering *Target) const final;
+ void emitWithoutPrefix(TargetLowering *Target) const;
using Constant::dump;
- void emit(GlobalContext *Ctx) const override;
- void emitWithoutDollar(GlobalContext *Ctx) const override;
void dump(const Cfg *Func, Ostream &Str) const override;
static bool classof(const Operand *Operand) {
@@ -272,10 +268,8 @@ public:
}
using Constant::emit;
+ void emit(TargetLowering *Target) const final;
using Constant::dump;
- // The target needs to implement this.
- void emit(GlobalContext *Ctx) const override;
- void emitWithoutDollar(GlobalContext *Ctx) const override;
void dump(const Cfg *, Ostream &Str) const override {
if (ALLOW_DUMP)
Str << "undef";
« no previous file with comments | « src/IceInstX8632.cpp ('k') | src/IceOperand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698