summaryrefslogtreecommitdiffstats
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
commit56d1215b05d621c4be1da113418b23e3d52bd47b (patch)
treef6fe66f933f1a558b301e1e8b0c6d58c79255984
parent20a2ae9df595fc29d748f021dcc7872edde3f517 (diff)
downloadbcm5719-llvm-56d1215b05d621c4be1da113418b23e3d52bd47b.tar.gz
bcm5719-llvm-56d1215b05d621c4be1da113418b23e3d52bd47b.zip
Fix -Wcovered-switch-default and -Wunused-private-field warnings.
llvm-svn: 174025
-rw-r--r--clang/lib/AST/ASTDumper.cpp36
1 files changed, 17 insertions, 19 deletions
diff --git a/clang/lib/AST/ASTDumper.cpp b/clang/lib/AST/ASTDumper.cpp
index 5291c8bc42d..4d891c987e5 100644
--- a/clang/lib/AST/ASTDumper.cpp
+++ b/clang/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);
}
OpenPOWER on IntegriCloud