diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2015-11-25 12:01:00 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-11-25 12:01:00 +0000 |
| commit | f763027f0477163d855c51425e2a9199739220be (patch) | |
| tree | a77f1045da9a64ab548d54946a0e03c666b9eae8 /clang/lib/Serialization/ASTWriterStmt.cpp | |
| parent | 8ade8d2efd832cc10d2fe1bee54e372272d58617 (diff) | |
| download | bcm5719-llvm-f763027f0477163d855c51425e2a9199739220be.tar.gz bcm5719-llvm-f763027f0477163d855c51425e2a9199739220be.zip | |
[MSVC] 'property' with an empty array in array subscript expression.
MSVC supports 'property' attribute and allows to apply it to the declaration of an empty array in a class or structure definition.
For example:
```
__declspec(property(get=GetX, put=PutX)) int x[];
```
The above statement indicates that x[] can be used with one or more array indices. In this case, i=p->x[a][b] will be turned into i=p->GetX(a, b), and p->x[a][b] = i will be turned into p->PutX(a, b, i);
Differential Revision: http://reviews.llvm.org/D13336
llvm-svn: 254067
Diffstat (limited to 'clang/lib/Serialization/ASTWriterStmt.cpp')
| -rw-r--r-- | clang/lib/Serialization/ASTWriterStmt.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index 1f41db3cb71..e93fa810651 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -1689,6 +1689,14 @@ void ASTStmtWriter::VisitMSPropertyRefExpr(MSPropertyRefExpr *E) { Code = serialization::EXPR_CXX_PROPERTY_REF_EXPR; } +void ASTStmtWriter::VisitMSPropertySubscriptExpr(MSPropertySubscriptExpr *E) { + VisitExpr(E); + Writer.AddStmt(E->getBase()); + Writer.AddStmt(E->getIdx()); + Writer.AddSourceLocation(E->getRBracketLoc(), Record); + Code = serialization::EXPR_CXX_PROPERTY_SUBSCRIPT_EXPR; +} + void ASTStmtWriter::VisitCXXUuidofExpr(CXXUuidofExpr *E) { VisitExpr(E); Writer.AddSourceRange(E->getSourceRange(), Record); |

