From 9298b6f4588322e510a2130310e1b69c6399edd6 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Sun, 1 Feb 2015 12:26:23 +0000 Subject: [PATCH] [multiversion] Update Clang for the API change in LLVM r227731. This moves all of the PassManager <-> Target communication to use the new pass manager's TargetIRAnalysis even with the old pass manager. See the LLVM commit for some of why things are moving in this direction, but the short version is that this will enable us to create per-function TargetTransformInfo objects that have correct subtarget information for that function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227732 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/BackendUtil.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/CodeGen/BackendUtil.cpp b/lib/CodeGen/BackendUtil.cpp index 6df34af86e..c4cea02252 100644 --- a/lib/CodeGen/BackendUtil.cpp +++ b/lib/CodeGen/BackendUtil.cpp @@ -61,18 +61,19 @@ class EmitAssemblyHelper { mutable FunctionPassManager *PerFunctionPasses; private: - TargetTransformInfo getTTI() const { + TargetIRAnalysis getTargetIRAnalysis() const { if (TM) - return TM->getTTI(); + return TM->getTargetIRAnalysis(); - return TargetTransformInfo(TheModule->getDataLayout()); + return TargetIRAnalysis(); } PassManager *getCodeGenPasses() const { if (!CodeGenPasses) { CodeGenPasses = new PassManager(); CodeGenPasses->add(new DataLayoutPass()); - CodeGenPasses->add(createTargetTransformInfoWrapperPass(getTTI())); + CodeGenPasses->add( + createTargetTransformInfoWrapperPass(getTargetIRAnalysis())); } return CodeGenPasses; } @@ -81,7 +82,8 @@ private: if (!PerModulePasses) { PerModulePasses = new PassManager(); PerModulePasses->add(new DataLayoutPass()); - PerModulePasses->add(createTargetTransformInfoWrapperPass(getTTI())); + PerModulePasses->add( + createTargetTransformInfoWrapperPass(getTargetIRAnalysis())); } return PerModulePasses; } @@ -90,7 +92,8 @@ private: if (!PerFunctionPasses) { PerFunctionPasses = new FunctionPassManager(TheModule); PerFunctionPasses->add(new DataLayoutPass()); - PerFunctionPasses->add(createTargetTransformInfoWrapperPass(getTTI())); + PerFunctionPasses->add( + createTargetTransformInfoWrapperPass(getTargetIRAnalysis())); } return PerFunctionPasses; } -- 2.40.0