mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 23:17:16 +00:00
[multiversion] Switch the TTI queries from TargetMachine to Subtarget
now that we have a correct and cached subtarget specific to the function. Also, finish providing a cached per-function subtarget in the core LLVMTargetMachine -- that layer hadn't switched over yet. The only use of the TargetMachine was to re-lookup a subtarget for a particular function to work around the fact that TTI was immutable. Now that it is per-function and we haved a cached subtarget, use it. This still leaves a few interfaces with real warts on them where we were passing Function objects through the TTI interface. I'll remove these and clean their usage up in subsequent commits now that this isn't necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227738 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -79,8 +79,9 @@ LLVMTargetMachine::LLVMTargetMachine(const Target &T, StringRef Triple,
|
||||
}
|
||||
|
||||
TargetIRAnalysis LLVMTargetMachine::getTargetIRAnalysis() {
|
||||
return TargetIRAnalysis(
|
||||
[this](Function &) { return TargetTransformInfo(BasicTTIImpl(this)); });
|
||||
return TargetIRAnalysis([this](Function &F) {
|
||||
return TargetTransformInfo(BasicTTIImpl(this, F));
|
||||
});
|
||||
}
|
||||
|
||||
/// addPassesToX helper drives creation and initialization of TargetPassConfig.
|
||||
|
||||
Reference in New Issue
Block a user