diff options
author | James Dennett <jdennett@google.com> | 2013-08-09 23:08:25 +0000 |
---|---|---|
committer | James Dennett <jdennett@google.com> | 2013-08-09 23:08:25 +0000 |
commit | ddd36fff49443ab2b8d3078dbde4e607648a609c (patch) | |
tree | 40220c19778068cc7c7a645480a70964f18f8cdc /clang/lib/Serialization/ASTWriterStmt.cpp | |
parent | 98ca59ed3bb7ac8bbc6ea70b3f5d0bbae36313ed (diff) | |
download | bcm5719-llvm-ddd36fff49443ab2b8d3078dbde4e607648a609c.tar.gz bcm5719-llvm-ddd36fff49443ab2b8d3078dbde4e607648a609c.zip |
Expose LambdaIntroducer::DefaultLoc in the AST's LambdaExpr.
Summary:
Source-centric tools need access to the location of a C++11
lambda expression's capture-default ('&' or '=') when it's present.
It's possible for them to find it by re-lexing and re-implementing
rules that Clang's parser has already applied, but the cost of storing
the SourceLocation and making it available to them is 32 bits per
LambdaExpr (a small delta, proportionally), and the simplification in
client code is significant.
Reviewers: rsmith
Reviewed By: rsmith
CC: cfe-commits, klimek, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D1192
llvm-svn: 188121
Diffstat (limited to 'clang/lib/Serialization/ASTWriterStmt.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriterStmt.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Serialization/ASTWriterStmt.cpp b/clang/lib/Serialization/ASTWriterStmt.cpp index d8b852136c9..533496d5dc4 100644 --- a/clang/lib/Serialization/ASTWriterStmt.cpp +++ b/clang/lib/Serialization/ASTWriterStmt.cpp @@ -6,9 +6,10 @@ // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// -// -// This file implements serialization for Statements and Expressions. -// +/// +/// \file +/// \brief Implements serialization for Statements and Expressions. +/// //===----------------------------------------------------------------------===// #include "clang/Serialization/ASTWriter.h" @@ -1166,6 +1167,7 @@ void ASTStmtWriter::VisitLambdaExpr(LambdaExpr *E) { Record.push_back(NumArrayIndexVars); Writer.AddSourceRange(E->IntroducerRange, Record); Record.push_back(E->CaptureDefault); // FIXME: stable encoding + Writer.AddSourceLocation(E->CaptureDefaultLoc, Record); Record.push_back(E->ExplicitParams); Record.push_back(E->ExplicitResultType); Writer.AddSourceLocation(E->ClosingBrace, Record); |