summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/utils/TableGen/DAGISelMatcher.cpp
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2018-04-06 14:26:03 +0000
committerpatrick <patrick@openbsd.org>2018-04-06 14:26:03 +0000
commitbdabc2f19ffb9e20600dad6e8a300842a7bda50e (patch)
treec50e7b2e5449b074651bb82a58517a8ebc4a8cf7 /gnu/llvm/utils/TableGen/DAGISelMatcher.cpp
parentPrint a 'p' flag for file descriptors that were opened after pledge(2). (diff)
downloadwireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.tar.xz
wireguard-openbsd-bdabc2f19ffb9e20600dad6e8a300842a7bda50e.zip
Import LLVM 6.0.1 release including clang, lld and lldb.
"where is the kaboom?" deraadt@
Diffstat (limited to 'gnu/llvm/utils/TableGen/DAGISelMatcher.cpp')
-rw-r--r--gnu/llvm/utils/TableGen/DAGISelMatcher.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/gnu/llvm/utils/TableGen/DAGISelMatcher.cpp b/gnu/llvm/utils/TableGen/DAGISelMatcher.cpp
index 6ac3958e0f4..4a918d15691 100644
--- a/gnu/llvm/utils/TableGen/DAGISelMatcher.cpp
+++ b/gnu/llvm/utils/TableGen/DAGISelMatcher.cpp
@@ -10,7 +10,6 @@
#include "DAGISelMatcher.h"
#include "CodeGenDAGPatterns.h"
#include "CodeGenTarget.h"
-#include "llvm/ADT/StringExtras.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TableGen/Record.h"
using namespace llvm;
@@ -80,18 +79,18 @@ bool Matcher::canMoveBeforeNode(const Matcher *Other) const {
ScopeMatcher::~ScopeMatcher() {
- for (unsigned i = 0, e = Children.size(); i != e; ++i)
- delete Children[i];
+ for (Matcher *C : Children)
+ delete C;
}
SwitchOpcodeMatcher::~SwitchOpcodeMatcher() {
- for (unsigned i = 0, e = Cases.size(); i != e; ++i)
- delete Cases[i].second;
+ for (auto &C : Cases)
+ delete C.second;
}
SwitchTypeMatcher::~SwitchTypeMatcher() {
- for (unsigned i = 0, e = Cases.size(); i != e; ++i)
- delete Cases[i].second;
+ for (auto &C : Cases)
+ delete C.second;
}
CheckPredicateMatcher::CheckPredicateMatcher(const TreePredicateFn &pred)
@@ -107,11 +106,11 @@ TreePredicateFn CheckPredicateMatcher::getPredicate() const {
void ScopeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
OS.indent(indent) << "Scope\n";
- for (unsigned i = 0, e = getNumChildren(); i != e; ++i) {
- if (!getChild(i))
+ for (const Matcher *C : Children) {
+ if (!C)
OS.indent(indent+1) << "NULL POINTER\n";
else
- getChild(i)->print(OS, indent+2);
+ C->print(OS, indent+2);
}
}
@@ -162,9 +161,9 @@ void CheckOpcodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
void SwitchOpcodeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
OS.indent(indent) << "SwitchOpcode: {\n";
- for (unsigned i = 0, e = Cases.size(); i != e; ++i) {
- OS.indent(indent) << "case " << Cases[i].first->getEnumName() << ":\n";
- Cases[i].second->print(OS, indent+2);
+ for (const auto &C : Cases) {
+ OS.indent(indent) << "case " << C.first->getEnumName() << ":\n";
+ C.second->print(OS, indent+2);
}
OS.indent(indent) << "}\n";
}
@@ -177,9 +176,9 @@ void CheckTypeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
void SwitchTypeMatcher::printImpl(raw_ostream &OS, unsigned indent) const {
OS.indent(indent) << "SwitchType: {\n";
- for (unsigned i = 0, e = Cases.size(); i != e; ++i) {
- OS.indent(indent) << "case " << getEnumName(Cases[i].first) << ":\n";
- Cases[i].second->print(OS, indent+2);
+ for (const auto &C : Cases) {
+ OS.indent(indent) << "case " << getEnumName(C.first) << ":\n";
+ C.second->print(OS, indent+2);
}
OS.indent(indent) << "}\n";
}