aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-01-31 02:04:38 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-01-31 02:04:38 +0000
commit95f97bf07a1811d020cbdcaa51d6e25752a4bd37 (patch)
treef8345e3b620c5b5912d5102f59c14ef6da7b689b /lib
parente8d411997899a87e1a9f63ad3f52b38e7931687c (diff)
Fix -Wcovered-switch-default and -Wunused-private-field warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174025 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/ASTDumper.cpp36
1 files changed, 17 insertions, 19 deletions
diff --git a/lib/AST/ASTDumper.cpp b/lib/AST/ASTDumper.cpp
index 5291c8bc42..4d891c987e 100644
--- a/lib/AST/ASTDumper.cpp
+++ b/lib/AST/ASTDumper.cpp
@@ -79,7 +79,6 @@ namespace {
raw_ostream &OS;
const CommandTraits *Traits;
const SourceManager *SM;
- unsigned IndentLevel;
bool IsFirstLine;
// Indicates whether more child are expected at the current tree depth
@@ -138,14 +137,14 @@ namespace {
public:
ASTDumper(raw_ostream &OS, const CommandTraits *Traits,
const SourceManager *SM)
- : OS(OS), Traits(Traits), SM(SM), IndentLevel(0), IsFirstLine(true),
- MoreChildren(false), LastLocFilename(""), LastLocLine(~0U), FC(0),
+ : OS(OS), Traits(Traits), SM(SM), IsFirstLine(true), MoreChildren(false),
+ LastLocFilename(""), LastLocLine(~0U), FC(0),
ShowColors(SM && SM->getDiagnostics().getShowColors()) { }
ASTDumper(raw_ostream &OS, const CommandTraits *Traits,
const SourceManager *SM, bool ShowColors)
- : OS(OS), Traits(Traits), SM(SM), IndentLevel(0), IsFirstLine(true),
- MoreChildren(false), LastLocFilename(""), LastLocLine(~0U),
+ : OS(OS), Traits(Traits), SM(SM), IsFirstLine(true), MoreChildren(false),
+ LastLocFilename(""), LastLocLine(~0U),
ShowColors(ShowColors) { }
~ASTDumper() {
@@ -334,21 +333,20 @@ void ASTDumper::indent() {
Indents.begin(), E = Indents.end();
I != E; ++I) {
switch (*I) {
- case IT_Child:
- if (I == E - 1)
- OS << "|-";
- else
- OS << "| ";
- break;
- case IT_LastChild:
- if (I == E - 1)
- OS << "`-";
- else
- OS << " ";
- break;
- default:
- llvm_unreachable("Invalid IndentType");
+ case IT_Child:
+ if (I == E - 1)
+ OS << "|-";
+ else
+ OS << "| ";
+ continue;
+ case IT_LastChild:
+ if (I == E - 1)
+ OS << "`-";
+ else
+ OS << " ";
+ continue;
}
+ llvm_unreachable("Invalid IndentType");
}
Indents.push_back(IT_Child);
}