Subzero. Code organization.
This CL does more than any CL should.
First, it moves all target-specific classes (TargetLowering, Assembler,
and Instructions) to a target-specific namespace. For example, the
::Ice::TargetX8632 class now lives in ::Ice::X8632::TargetX8632. Same
goes for ARM32, X8664, and MIPS32. Now, we have a ton of redundant
prefixes (it should be pretty obvious that ::Ice::X8632::TargetLowering
is an X8632 target lowering), but this is definitively not something
for this CL.
Second, this CL gets rid of the excessive use of 'typename Foo::Bar'
in the X86 templates. These changes appear more intimidating than they
really are, and they were fairly mechanical.
Third, the x86?? Traitses (gollum!) classes are no longer template
instatiation. The previous X86 templates were parameterized with a
X86 TargetLowering, and they assumed that a MachineTraits<Target>
was defined for that TargetLowering. The X86 templates are now
parameterized with a TraitsType, and different backends may have
completely unrelated traits.
Fourth, the X86 templates are no longer members of
::Ice::X86Internal. Instead, each file #include'ing a Ice*X86Base.h
file need to #define X86NAMESPACE to the namespace where the backend
is being defined. With this change, the template instantiation for
X8632 live in ::Ice::X8632, and, for X8664, in ::Ice::X8664.
BUG=
R=stichnot@chromium.org
Review URL: https://codereview.chromium.org/1548363002 .
diff --git a/unittest/AssemblerX8632/TestUtil.h b/unittest/AssemblerX8632/TestUtil.h
index 6adf27b..a22c637 100644
--- a/unittest/AssemblerX8632/TestUtil.h
+++ b/unittest/AssemblerX8632/TestUtil.h
@@ -15,6 +15,7 @@
#define ASSEMBLERX8632_TESTUTIL_H_
#include "IceAssemblerX8632.h"
+#include "IceDefs.h"
#include "gtest/gtest.h"
@@ -31,14 +32,14 @@
using Cond = AssemblerX8632::Traits::Cond;
using GPRRegister = AssemblerX8632::Traits::GPRRegister;
using ByteRegister = AssemblerX8632::Traits::ByteRegister;
- using Label = ::Ice::X86Internal::Label;
+ using Label = ::Ice::X8632::Label;
using Traits = AssemblerX8632::Traits;
using XmmRegister = AssemblerX8632::Traits::XmmRegister;
using X87STRegister = AssemblerX8632::Traits::X87STRegister;
AssemblerX8632TestBase() { reset(); }
- void reset() { Assembler.reset(new AssemblerX8632()); }
+ void reset() { Assembler = makeUnique<AssemblerX8632>(); }
AssemblerX8632 *assembler() const { return Assembler.get(); }