summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriterStmt.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2019-06-11 17:50:32 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2019-06-11 17:50:32 +0000
commit715f7a1bd058c64a39cc4773114dfb46ae8cc8a3 (patch)
treed9f4369bedcbe50c9dc03ee5498544702d86616e /clang/lib/Serialization/ASTWriterStmt.cpp
parentef2d6d99c0d35e46dce7fff6b999a3a1fc08aecc (diff)
downloadbcm5719-llvm-715f7a1bd058c64a39cc4773114dfb46ae8cc8a3.tar.gz
bcm5719-llvm-715f7a1bd058c64a39cc4773114dfb46ae8cc8a3.zip
For DR712: store on a DeclRefExpr whether it constitutes an odr-use.
Begin restructuring to support the forms of non-odr-use reference permitted by DR712. llvm-svn: 363086
Diffstat (limited to 'clang/lib/Serialization/ASTWriterStmt.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriterStmt.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp
index d52a4a85b32..2b707520a8e 100644
--- a/clang/lib/Serialization/ASTWriterStmt.cpp
+++ b/clang/lib/Serialization/ASTWriterStmt.cpp
@@ -456,6 +456,7 @@ void ASTStmtWriter::VisitDeclRefExpr(DeclRefExpr *E) {
Record.push_back(E->hasTemplateKWAndArgsInfo());
Record.push_back(E->hadMultipleCandidates());
Record.push_back(E->refersToEnclosingVariableOrCapture());
+ Record.push_back(E->isNonOdrUse());
if (E->hasTemplateKWAndArgsInfo()) {
unsigned NumTemplateArgs = E->getNumTemplateArgs();
@@ -466,7 +467,8 @@ void ASTStmtWriter::VisitDeclRefExpr(DeclRefExpr *E) {
if ((!E->hasTemplateKWAndArgsInfo()) && (!E->hasQualifier()) &&
(E->getDecl() == E->getFoundDecl()) &&
- nk == DeclarationName::Identifier) {
+ nk == DeclarationName::Identifier &&
+ !E->refersToEnclosingVariableOrCapture() && !E->isNonOdrUse()) {
AbbrevToUse = Writer.getDeclRefExprAbbrev();
}
OpenPOWER on IntegriCloud