diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2015-12-30 02:51:00 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2015-12-30 02:51:00 +0000 |
commit | 813faed9200fd145f165baf4b620ceb356865786 (patch) | |
tree | 51ce52dc86178f80f621d06ea6396918599597be /clang/lib/AST/StmtIterator.cpp | |
parent | 1d75c5eccf2846122776a9faafaa72aa57be9b3c (diff) | |
download | bcm5719-llvm-813faed9200fd145f165baf4b620ceb356865786.tar.gz bcm5719-llvm-813faed9200fd145f165baf4b620ceb356865786.zip |
[ptr-traits] Stop using two bogus types as stand-ins for flags
indicating the nature of the default argument in a ParmVarDecl.
Instead, this adds a proper enum stored exclusively in the ParmVarDecl
bits (which we have plenty of) for this. This even allows us to track
a previously unrepresented state in Clang when we parse a function
declaration with a default argument on a parameter but we cannot even
form an invalid expression node (for example, it is an invalid token).
Now, we can model this state in the AST at least, and potentially
improve recovery in this area in the future.
I've also cleaned up the functions managing both variable initializer
expressions and parameter default argument expresssions as much as
possible. I've left some comments about further improvements based on
a discussion with Richard Smith. Lots of credit to him for walking me
through exactly which of the *many* tradeoffs here he felt was the best
fit.
Should be NFC for now. I've tried my best to preserve existing behavior.
This is part of a series of patches to allow LLVM to check for complete
pointee types when computing its pointer traits. This is absolutely
necessary to get correct (or reproducible) results for things like how
many low bits are guaranteed to be zero.
llvm-svn: 256609
Diffstat (limited to 'clang/lib/AST/StmtIterator.cpp')
-rw-r--r-- | clang/lib/AST/StmtIterator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/AST/StmtIterator.cpp b/clang/lib/AST/StmtIterator.cpp index 732756fbec9..861d0908209 100644 --- a/clang/lib/AST/StmtIterator.cpp +++ b/clang/lib/AST/StmtIterator.cpp @@ -42,7 +42,7 @@ void StmtIteratorBase::NextVA() { if (inDeclGroup()) { if (VarDecl* VD = dyn_cast<VarDecl>(*DGI)) - if (VD->Init) + if (VD->hasInit()) return; NextDecl(); |