X86Subtarget.h - remove unnecessary TargetMachine.h include. NFC.

By moving X86Subtarget::isPositionIndependent() into X86Subtarget.cpp we can remove the header dependency and move the few uses into source files.
This commit is contained in:
Simon Pilgrim 2020-05-24 12:30:22 +01:00
parent 478f2ce5d3
commit d0f2a8a049
5 changed files with 9 additions and 2 deletions

View File

@ -40,6 +40,7 @@
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h" #include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
using namespace llvm; using namespace llvm;

View File

@ -44,6 +44,7 @@
#include "llvm/MC/MCSymbol.h" #include "llvm/MC/MCSymbol.h"
#include "llvm/MC/MCSymbolELF.h" #include "llvm/MC/MCSymbolELF.h"
#include "llvm/Target/TargetLoweringObjectFile.h" #include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetMachine.h"
using namespace llvm; using namespace llvm;

View File

@ -53,6 +53,7 @@
#include "llvm/Support/CommandLine.h" #include "llvm/Support/CommandLine.h"
#include "llvm/Support/Debug.h" #include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h" #include "llvm/Support/raw_ostream.h"
#include "llvm/Target/TargetMachine.h"
#include <algorithm> #include <algorithm>
#include <cassert> #include <cassert>
#include <iterator> #include <iterator>

View File

@ -378,3 +378,7 @@ void X86Subtarget::getPostRAMutations(
std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const { std::vector<std::unique_ptr<ScheduleDAGMutation>> &Mutations) const {
Mutations.push_back(createX86MacroFusionDAGMutation()); Mutations.push_back(createX86MacroFusionDAGMutation());
} }
bool X86Subtarget::isPositionIndependent() const {
return TM.isPositionIndependent();
}

View File

@ -20,7 +20,6 @@
#include "llvm/ADT/Triple.h" #include "llvm/ADT/Triple.h"
#include "llvm/CodeGen/TargetSubtargetInfo.h" #include "llvm/CodeGen/TargetSubtargetInfo.h"
#include "llvm/IR/CallingConv.h" #include "llvm/IR/CallingConv.h"
#include "llvm/Target/TargetMachine.h"
#include <climits> #include <climits>
#include <memory> #include <memory>
@ -35,6 +34,7 @@ class InstructionSelector;
class LegalizerInfo; class LegalizerInfo;
class RegisterBankInfo; class RegisterBankInfo;
class StringRef; class StringRef;
class TargetMachine;
/// The X86 backend supports a number of different styles of PIC. /// The X86 backend supports a number of different styles of PIC.
/// ///
@ -841,7 +841,7 @@ public:
return PICStyle == PICStyles::Style::StubPIC; return PICStyle == PICStyles::Style::StubPIC;
} }
bool isPositionIndependent() const { return TM.isPositionIndependent(); } bool isPositionIndependent() const;
bool isCallingConvWin64(CallingConv::ID CC) const { bool isCallingConvWin64(CallingConv::ID CC) const {
switch (CC) { switch (CC) {