diff options
author | Arthur Eubanks <aeubanks@google.com> | 2023-09-14 14:10:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-14 14:10:14 -0700 |
commit | 0a1aa6cda2758b0926a95f87d39ffefb1cb90200 (patch) | |
tree | 766dc35b70235864f287a9f0a2cef45d487203ad /llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | |
parent | ae84b160d2fe61a7211817262ce717a17d27c0ae (diff) | |
download | llvm-0a1aa6cda2758b0926a95f87d39ffefb1cb90200.zip llvm-0a1aa6cda2758b0926a95f87d39ffefb1cb90200.tar.gz llvm-0a1aa6cda2758b0926a95f87d39ffefb1cb90200.tar.bz2 |
[NFC][CodeGen] Change CodeGenOpt::Level/CodeGenFileType into enum classes (#66295)
This will make it easy for callers to see issues with and fix up calls
to createTargetMachine after a future change to the params of
TargetMachine.
This matches other nearby enums.
For downstream users, this should be a fairly straightforward
replacement,
e.g. s/CodeGenOpt::Aggressive/CodeGenOptLevel::Aggressive
or s/CGFT_/CodeGenFileType::
Diffstat (limited to 'llvm/lib/CodeGen/TwoAddressInstructionPass.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TwoAddressInstructionPass.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp index 45f6126..79fe7f4 100644 --- a/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/llvm/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -95,7 +95,7 @@ class TwoAddressInstructionPass : public MachineFunctionPass { LiveVariables *LV = nullptr; LiveIntervals *LIS = nullptr; AliasAnalysis *AA = nullptr; - CodeGenOpt::Level OptLevel = CodeGenOpt::None; + CodeGenOptLevel OptLevel = CodeGenOptLevel::None; // The current basic block being processed. MachineBasicBlock *MBB = nullptr; @@ -551,7 +551,7 @@ bool TwoAddressInstructionPass::isProfitableToCommute(Register RegA, Register RegC, MachineInstr *MI, unsigned Dist) { - if (OptLevel == CodeGenOpt::None) + if (OptLevel == CodeGenOptLevel::None) return false; // Determine if it's profitable to commute this two address instruction. In @@ -1231,7 +1231,7 @@ tryInstructionTransform(MachineBasicBlock::iterator &mi, MachineBasicBlock::iterator &nmi, unsigned SrcIdx, unsigned DstIdx, unsigned &Dist, bool shouldOnlyCommute) { - if (OptLevel == CodeGenOpt::None) + if (OptLevel == CodeGenOptLevel::None) return false; MachineInstr &MI = *mi; @@ -1757,7 +1757,7 @@ bool TwoAddressInstructionPass::runOnMachineFunction(MachineFunction &Func) { // Disable optimizations if requested. We cannot skip the whole pass as some // fixups are necessary for correctness. if (skipFunction(Func.getFunction())) - OptLevel = CodeGenOpt::None; + OptLevel = CodeGenOptLevel::None; bool MadeChange = false; |