mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-03 19:32:35 +00:00
[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:
parent
5ec2b1d11a
commit
d294bdb5ad
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user