diff options
author | Daniel Jasper <djasper@google.com> | 2017-03-01 11:10:11 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2017-03-01 11:10:11 +0000 |
commit | 62703eb8a7235e49d5a39a2a37172961b51998cb (patch) | |
tree | 8081fdf2d7cdaf3eaed7953ccafdad236104aef7 /clang/lib/Format/UnwrappedLineParser.cpp | |
parent | 5d35b9e56c194af8ba53f9636d96881e3703bfef (diff) | |
download | bcm5719-llvm-62703eb8a7235e49d5a39a2a37172961b51998cb.tar.gz bcm5719-llvm-62703eb8a7235e49d5a39a2a37172961b51998cb.zip |
Fix r296605 so that stuff in #ifndef SWIG blocks is still formatted.
llvm-svn: 296608
Diffstat (limited to 'clang/lib/Format/UnwrappedLineParser.cpp')
-rw-r--r-- | clang/lib/Format/UnwrappedLineParser.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/UnwrappedLineParser.cpp b/clang/lib/Format/UnwrappedLineParser.cpp index bd049ef668b..9efb6812673 100644 --- a/clang/lib/Format/UnwrappedLineParser.cpp +++ b/clang/lib/Format/UnwrappedLineParser.cpp @@ -589,11 +589,12 @@ void UnwrappedLineParser::conditionalCompilationEnd() { } void UnwrappedLineParser::parsePPIf(bool IfDef) { + bool IfNDef = FormatTok->is(tok::pp_ifndef); nextToken(); bool Unreachable = false; if (!IfDef && (FormatTok->is(tok::kw_false) || FormatTok->TokenText == "0")) Unreachable = true; - if (IfDef && FormatTok->TokenText == "SWIG") + if (IfDef && !IfNDef && FormatTok->TokenText == "SWIG") Unreachable = true; conditionalCompilationStart(Unreachable); parsePPUnknown(); |