]> granicus.if.org Git - clang/commitdiff
[PM] Track an LLVM API update which separates the TargetLibraryInfo
authorChandler Carruth <chandlerc@gmail.com>
Thu, 15 Jan 2015 10:42:26 +0000 (10:42 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 15 Jan 2015 10:42:26 +0000 (10:42 +0000)
object from the pass that provides access to it.

We should probably refactor the createTLI code here in Clang in light of
the new structure, but I wanted this patch to be a minimal one that just
patches the behavior back together.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@226158 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/BackendUtil.cpp

index 7adbdddf296051ab63b9928df80aff52bc750434..ec93bc80af36b6d90adcd855b95345cf23c86f3e 100644 (file)
@@ -543,7 +543,8 @@ bool EmitAssemblyHelper::AddEmitPasses(BackendAction Action,
 
   // Add LibraryInfo.
   llvm::Triple TargetTriple(TheModule->getTargetTriple());
-  PM->add(createTLI(TargetTriple, CodeGenOpts));
+  std::unique_ptr<TargetLibraryInfo> TLI(createTLI(TargetTriple, CodeGenOpts));
+  PM->add(new TargetLibraryInfoWrapperPass(*TLI));
 
   // Add Target specific analysis passes.
   TM->addAnalysisPasses(*PM);