Skip to content

Commit 7fe8882

Browse files
committed
Replace the use of TargetMachine with a tiny bool variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210386 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent df2f80d commit 7fe8882

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

lib/Target/X86/X86JITInfo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,16 +432,16 @@ X86JITInfo::getLazyResolverFunction(JITCompilerFn F) {
432432
// SSE Callback should be called for SSE-enabled LLVM.
433433
return X86CompilationCallback_SSE;
434434
#else
435-
if (Subtarget->hasSSE1())
435+
if (useSSE)
436436
return X86CompilationCallback_SSE;
437437
#endif
438438
#endif
439439

440440
return X86CompilationCallback;
441441
}
442442

443-
X86JITInfo::X86JITInfo(X86TargetMachine &tm) : TM(tm) {
444-
Subtarget = &TM.getSubtarget<X86Subtarget>();
443+
X86JITInfo::X86JITInfo(bool UseSSE) {
444+
useSSE = UseSSE;
445445
useGOT = 0;
446446
TLSOffset = nullptr;
447447
}

lib/Target/X86/X86JITInfo.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,14 @@
1919
#include "llvm/Target/TargetJITInfo.h"
2020

2121
namespace llvm {
22-
class X86TargetMachine;
2322
class X86Subtarget;
2423

2524
class X86JITInfo : public TargetJITInfo {
26-
X86TargetMachine &TM;
27-
const X86Subtarget *Subtarget;
2825
uintptr_t PICBase;
2926
char* TLSOffset;
27+
bool useSSE;
3028
public:
31-
explicit X86JITInfo(X86TargetMachine &tm);
29+
explicit X86JITInfo(bool UseSSE);
3230

3331
/// replaceMachineCodeForFunction - Make it so that calling the function
3432
/// whose machine code is at OLD turns into a call to NEW, perhaps by

lib/Target/X86/X86TargetMachine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ X86TargetMachine::X86TargetMachine(const Target &T, StringRef TT, StringRef CPU,
8080
Subtarget.getStackAlignment(),
8181
Subtarget.is64Bit() ? -8 : -4),
8282
DL(computeDataLayout(*getSubtargetImpl())), InstrInfo(*this),
83-
TLInfo(*this), TSInfo(DL), JITInfo(*this) {
83+
TLInfo(*this), TSInfo(DL), JITInfo(Subtarget.hasSSE1()) {
8484
// Determine the PICStyle based on the target selected.
8585
if (getRelocationModel() == Reloc::Static) {
8686
// Unless we're in PIC or DynamicNoPIC mode, set the PIC style to None.

0 commit comments

Comments
 (0)