This patch changes the ownership of TLOF from TargetLoweringBase to TargetMachine so that different subtargets could share the TLOF effectively

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221878 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Aditya Nandakumar
2014-11-13 09:26:31 +00:00
parent db1e51359d
commit 847729d19a
39 changed files with 142 additions and 65 deletions

View File

@@ -137,10 +137,10 @@ public:
llvm_unreachable("Invalid content kind");
}
/// NOTE: The constructor takes ownership of TLOF.
/// NOTE: The TargetMachine owns TLOF.
explicit TargetLoweringBase(const TargetMachine &TM,
const TargetLoweringObjectFile *TLOF);
virtual ~TargetLoweringBase();
virtual ~TargetLoweringBase() {}
protected:
/// \brief Initialize all of the actions to default values.

View File

@@ -44,6 +44,7 @@ class ScalarTargetTransformInfo;
class VectorTargetTransformInfo;
class formatted_raw_ostream;
class raw_ostream;
class TargetLoweringObjectFile;
// The old pass manager infrastructure is hidden in a legacy namespace now.
namespace legacy {
@@ -102,6 +103,9 @@ public:
virtual const TargetSubtargetInfo *getSubtargetImpl(const Function &) const {
return getSubtargetImpl();
}
virtual TargetLoweringObjectFile *getObjFileLowering() const {
return nullptr;
}
/// getSubtarget - This method returns a pointer to the specified type of
/// TargetSubtargetInfo. In debug builds, it verifies that the object being