aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp')
-rw-r--r--llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
index 59148a9..ed3ec92 100644
--- a/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
+++ b/llvm/utils/TableGen/Common/CodeGenDAGPatterns.cpp
@@ -4139,23 +4139,19 @@ void CodeGenDAGPatterns::InferInstructionFlags() {
// If requested by the target, guess any undefined properties.
if (Target.guessInstructionProperties()) {
- for (unsigned i = 0, e = Instructions.size(); i != e; ++i) {
- CodeGenInstruction *InstInfo =
- const_cast<CodeGenInstruction *>(Instructions[i]);
+ for (const CodeGenInstruction *InstInfo : Instructions) {
if (InstInfo->InferredFrom)
continue;
// The mayLoad and mayStore flags default to false.
// Conservatively assume hasSideEffects if it wasn't explicit.
if (InstInfo->hasSideEffects_Unset)
- InstInfo->hasSideEffects = true;
+ const_cast<CodeGenInstruction *>(InstInfo)->hasSideEffects = true;
}
return;
}
// Complain about any flags that are still undefined.
- for (unsigned i = 0, e = Instructions.size(); i != e; ++i) {
- CodeGenInstruction *InstInfo =
- const_cast<CodeGenInstruction *>(Instructions[i]);
+ for (const CodeGenInstruction *InstInfo : Instructions) {
if (InstInfo->InferredFrom)
continue;
if (InstInfo->hasSideEffects_Unset)