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

Unified Diff: src/IceTargetLoweringX8632.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/IceTargetLoweringX8632.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX8632.cpp
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
index dd75168d5c2aad780defa36d9b5941c5590c84df..5f83baef11a503f2fd756d404148c5c86ec62bbc 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -4650,58 +4650,33 @@ void TargetX8632::makeRandomRegisterPermutation(
}
}
-template <>
-void ConstantInteger32::emitWithoutDollar(GlobalContext *Ctx) const {
+void TargetX8632::emit(const ConstantInteger32 *C) const {
if (!ALLOW_DUMP)
return;
Ostream &Str = Ctx->getStrEmit();
- Str << (int32_t)getValue();
+ Str << getConstantPrefix() << C->getValue();
}
-template <> void ConstantInteger32::emit(GlobalContext *Ctx) const {
- if (!ALLOW_DUMP)
- return;
- Ostream &Str = Ctx->getStrEmit();
- Str << "$";
- emitWithoutDollar(Ctx);
-}
-
-template <> void ConstantInteger64::emitWithoutDollar(GlobalContext *) const {
- llvm_unreachable("Not expecting to emitWithoutDollar 64-bit integers");
-}
-
-template <> void ConstantInteger64::emit(GlobalContext *) const {
- llvm_unreachable("Not expecting to emit 64-bit integers");
+void TargetX8632::emit(const ConstantInteger64 *) const {
+ llvm::report_fatal_error("Not expecting to emit 64-bit integers");
}
-template <> void ConstantFloat::emitWithoutDollar(GlobalContext *) const {
- llvm_unreachable("Not expecting to emitWithoutDollar floats");
-}
-
-template <> void ConstantFloat::emit(GlobalContext *Ctx) const {
+void TargetX8632::emit(const ConstantFloat *C) const {
if (!ALLOW_DUMP)
return;
Ostream &Str = Ctx->getStrEmit();
- emitPoolLabel(Str);
-}
-
-template <> void ConstantDouble::emitWithoutDollar(GlobalContext *) const {
- llvm_unreachable("Not expecting to emitWithoutDollar doubles");
+ C->emitPoolLabel(Str);
}
-template <> void ConstantDouble::emit(GlobalContext *Ctx) const {
+void TargetX8632::emit(const ConstantDouble *C) const {
if (!ALLOW_DUMP)
return;
Ostream &Str = Ctx->getStrEmit();
- emitPoolLabel(Str);
-}
-
-void ConstantUndef::emitWithoutDollar(GlobalContext *) const {
- llvm_unreachable("Not expecting to emitWithoutDollar undef");
+ C->emitPoolLabel(Str);
}
-void ConstantUndef::emit(GlobalContext *) const {
- llvm_unreachable("undef value encountered by emitter.");
+void TargetX8632::emit(const ConstantUndef *) const {
+ llvm::report_fatal_error("undef value encountered by emitter.");
}
TargetDataX8632::TargetDataX8632(GlobalContext *Ctx)
« no previous file with comments | « src/IceTargetLoweringX8632.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698