[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.

llvm-svn: 227732
This commit is contained in:
Chandler Carruth 2015-02-01 12:26:23 +00:00
parent 5ec2b1d11a
commit d294bdb5ad

View File

@ -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;
}