aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/X86/X86CodeEmitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/X86/X86CodeEmitter.cpp')
-rw-r--r--lib/Target/X86/X86CodeEmitter.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Target/X86/X86CodeEmitter.cpp b/lib/Target/X86/X86CodeEmitter.cpp
index dbb83c8..480c0cd 100644
--- a/lib/Target/X86/X86CodeEmitter.cpp
+++ b/lib/Target/X86/X86CodeEmitter.cpp
@@ -1117,8 +1117,11 @@ MCCodeEmitter *llvm::createHeinousX86MCCodeEmitter(const Target &T,
TargetMachine &TM) {
// FIXME: Remove the heinous one when the new one works.
- if (EnableNewEncoder)
- return createX86MCCodeEmitter(T, TM);
+ if (EnableNewEncoder) {
+ if (TM.getTargetData()->getPointerSize() == 4)
+ return createX86_32MCCodeEmitter(T, TM);
+ return createX86_64MCCodeEmitter(T, TM);
+ }
return new X86MCCodeEmitter(static_cast<X86TargetMachine&>(TM));
}