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

Unified Diff: src/IceOperand.cpp

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/IceOperand.h ('k') | src/IceTargetLowering.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceOperand.cpp
diff --git a/src/IceOperand.cpp b/src/IceOperand.cpp
index 9338bdc55fd962c3a4be99700db241eb8122b146..2d2c8cf2c3276fbf3ce89d28d116a74cdca3f54b 100644
--- a/src/IceOperand.cpp
+++ b/src/IceOperand.cpp
@@ -422,27 +422,28 @@ void Variable::dump(const Cfg *Func, Ostream &Str) const {
}
}
-void ConstantRelocatable::emitWithoutDollar(GlobalContext *Ctx) const {
- if (!ALLOW_DUMP)
- return;
- Ostream &Str = Ctx->getStrEmit();
- if (SuppressMangling)
- Str << Name;
- else
- Str << Ctx->mangleName(Name);
- if (Offset) {
- if (Offset > 0)
- Str << "+";
- Str << Offset;
- }
+template <> void ConstantInteger32::emit(TargetLowering *Target) const {
+ Target->emit(this);
}
-void ConstantRelocatable::emit(GlobalContext *Ctx) const {
- if (!ALLOW_DUMP)
- return;
- Ostream &Str = Ctx->getStrEmit();
- Str << "$";
- emitWithoutDollar(Ctx);
+template <> void ConstantInteger64::emit(TargetLowering *Target) const {
+ Target->emit(this);
+}
+
+template <> void ConstantFloat::emit(TargetLowering *Target) const {
+ Target->emit(this);
+}
+
+template <> void ConstantDouble::emit(TargetLowering *Target) const {
+ Target->emit(this);
+}
+
+void ConstantRelocatable::emit(TargetLowering *Target) const {
+ Target->emit(this);
+}
+
+void ConstantRelocatable::emitWithoutPrefix(TargetLowering *Target) const {
+ Target->emitWithoutPrefix(this);
}
void ConstantRelocatable::dump(const Cfg *Func, Ostream &Str) const {
@@ -458,6 +459,8 @@ void ConstantRelocatable::dump(const Cfg *Func, Ostream &Str) const {
Str << "+" << Offset;
}
+void ConstantUndef::emit(TargetLowering *Target) const { Target->emit(this); }
+
void LiveRange::dump(Ostream &Str) const {
if (!ALLOW_DUMP)
return;
« no previous file with comments | « src/IceOperand.h ('k') | src/IceTargetLowering.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698