summaryrefslogtreecommitdiffstats
path: root/llvm/unittests/MI/LiveIntervalTest.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2018-11-05 23:49:13 +0000
committerMatthias Braun <matze@braunis.de>2018-11-05 23:49:13 +0000
commit3d849f67cbae5807f18fb2d46dfccd3aeae3c39b (patch)
tree13aea93a9d4c1fc050701454d6be0ee2435fc369 /llvm/unittests/MI/LiveIntervalTest.cpp
parent54d23a8eb7eac3445450bacbe7a6336197ccdbf5 (diff)
downloadbcm5719-llvm-3d849f67cbae5807f18fb2d46dfccd3aeae3c39b.tar.gz
bcm5719-llvm-3d849f67cbae5807f18fb2d46dfccd3aeae3c39b.zip
MachineModuleInfo: Store more specific reference to LLVMTargetMachine; NFC
MachineModuleInfo can only be used in code using lib/CodeGen, hence we can keep a more specific reference to LLVMTargetMachine rather than just TargetMachine around. llvm-svn: 346182
Diffstat (limited to 'llvm/unittests/MI/LiveIntervalTest.cpp')
-rw-r--r--llvm/unittests/MI/LiveIntervalTest.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/unittests/MI/LiveIntervalTest.cpp b/llvm/unittests/MI/LiveIntervalTest.cpp
index a39fd7f73cf..5ee9d13dbd9 100644
--- a/llvm/unittests/MI/LiveIntervalTest.cpp
+++ b/llvm/unittests/MI/LiveIntervalTest.cpp
@@ -35,7 +35,7 @@ void initLLVM() {
/// Create a TargetMachine. As we lack a dedicated always available target for
/// unittests, we go for "AMDGPU" to be able to test normal and subregister
/// liveranges.
-std::unique_ptr<TargetMachine> createTargetMachine() {
+std::unique_ptr<LLVMTargetMachine> createTargetMachine() {
Triple TargetTriple("amdgcn--");
std::string Error;
const Target *T = TargetRegistry::lookupTarget("", TargetTriple, Error);
@@ -43,13 +43,14 @@ std::unique_ptr<TargetMachine> createTargetMachine() {
return nullptr;
TargetOptions Options;
- return std::unique_ptr<TargetMachine>(T->createTargetMachine(
- "AMDGPU", "", "", Options, None, None, CodeGenOpt::Aggressive));
+ return std::unique_ptr<LLVMTargetMachine>(static_cast<LLVMTargetMachine*>(
+ T->createTargetMachine("AMDGPU", "", "", Options, None, None,
+ CodeGenOpt::Aggressive)));
}
std::unique_ptr<Module> parseMIR(LLVMContext &Context,
legacy::PassManagerBase &PM, std::unique_ptr<MIRParser> &MIR,
- const TargetMachine &TM, StringRef MIRCode, const char *FuncName) {
+ const LLVMTargetMachine &TM, StringRef MIRCode, const char *FuncName) {
SMDiagnostic Diagnostic;
std::unique_ptr<MemoryBuffer> MBuffer = MemoryBuffer::getMemBuffer(MIRCode);
MIR = createMIRParser(std::move(MBuffer), Context);
@@ -128,7 +129,7 @@ static void testHandleMove(MachineFunction &MF, LiveIntervals &LIS,
static void liveIntervalTest(StringRef MIRFunc, LiveIntervalTest T) {
LLVMContext Context;
- std::unique_ptr<TargetMachine> TM = createTargetMachine();
+ std::unique_ptr<LLVMTargetMachine> TM = createTargetMachine();
// This test is designed for the X86 backend; stop if it is not available.
if (!TM)
return;
OpenPOWER on IntegriCloud