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

Unified Diff: src/IceTargetLowering.cpp

Issue 1114223002: Rename AssemblerX86 to AssemblerX8632 so it works with SZTargets.def. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 8 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/IceTargetLoweringX8632.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLowering.cpp
diff --git a/src/IceTargetLowering.cpp b/src/IceTargetLowering.cpp
index 93b48844f41f828673964af1e2164a8fd21a30f4..22f698acd6d8d0874c42241c415a9fad64b5a2d2 100644
--- a/src/IceTargetLowering.cpp
+++ b/src/IceTargetLowering.cpp
@@ -80,15 +80,10 @@ TargetLowering::TargetLowering(Cfg *Func)
std::unique_ptr<Assembler> TargetLowering::createAssembler(TargetArch Target,
Cfg *Func) {
- // These statements can be #ifdef'd to specialize the assembler
- // to a subset of the available targets. TODO: use CRTP.
- // TODO(jvoung): use SZTargets.def (rename AssemblerX86 -> AssemblerX8632),
- // and make the namespaces consistent.
- if (Target == Target_X8632)
- return std::unique_ptr<Assembler>(new x86::AssemblerX86());
-
- if (Target == Target_ARM32)
- return std::unique_ptr<Assembler>(new AssemblerARM32());
+#define SUBZERO_TARGET(X) \
+ if (Target == Target_##X) \
+ return std::unique_ptr<Assembler>(new X::Assembler##X());
+#include "llvm/Config/SZTargets.def"
Func->setError("Unsupported target assembler");
return nullptr;
« no previous file with comments | « src/IceInstX8632.cpp ('k') | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698