#include "llvm/Target/TargetOptions.h"
+#include "llvm/CodeGen/TargetPassConfig.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/Support/TargetRegistry.h"
typedef std::function<void(bool)> TargetOptionsTest;
static void targetOptionsTest(bool EnableIPRA) {
- LLVMContext Context;
std::unique_ptr<TargetMachine> TM = createTargetMachine(EnableIPRA);
// This test is designed for the X86 backend; stop if it is not available.
if (!TM)
legacy::PassManager PM;
LLVMTargetMachine *LLVMTM = static_cast<LLVMTargetMachine *>(TM.get());
- TargetPassConfig &TPC = *LLVMTM->createPassConfig(PM);
+ TargetPassConfig *TPC = LLVMTM->createPassConfig(PM);
(void)TPC;
ASSERT_TRUE(TM->Options.EnableIPRA == EnableIPRA);
+
+ delete TPC;
}
} // End of anonymous namespace.