From b629e20e7328615251a64fabb32f66f29d6ac6d3 Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sun, 4 Nov 2012 10:31:44 +0100 Subject: [PATCH] scop_extract_from_C_source: take TargetOptions object from CompilerInstance The memory management of TargetOptions has changed in recent clangs. Taking TargetOptions from the CompilerInstance seems to work in both older and newer versions of clang. Signed-off-by: Sven Verdoolaege --- pet.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pet.cc b/pet.cc index 727f802..5d2b8c6 100644 --- a/pet.cc +++ b/pet.cc @@ -629,7 +629,7 @@ static struct pet_scop *scop_extract_from_C_source(isl_ctx *ctx, Clang->setInvocation(invocation); Clang->createFileManager(); Clang->createSourceManager(Clang->getFileManager()); - TargetOptions TO; + TargetOptions &TO = Clang->getTargetOpts(); TO.Triple = llvm::sys::getDefaultTargetTriple(); TargetInfo *target = TargetInfo::CreateTargetInfo(Diags, TO); Clang->setTarget(target); -- 2.11.4.GIT