From ea266cad53e3d49771fa38103913d3ec7a166694 Mon Sep 17 00:00:00 2001 From: dim Date: Mon, 10 Jun 2013 20:45:12 +0000 Subject: Vendor import of clang tags/RELEASE_33/final r183502 (effectively, 3.3 release): http://llvm.org/svn/llvm-project/cfe/tags/RELEASE_33/final@183502 --- include/clang/Parse/Parser.h | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) (limited to 'include/clang/Parse/Parser.h') diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index 8cc60a2..1029a90 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -149,6 +149,7 @@ class Parser : public CodeCompletionHandler { OwningPtr OpenCLExtensionHandler; OwningPtr CommentSemaHandler; OwningPtr OpenMPHandler; + OwningPtr MSCommentHandler; /// Whether the '>' token acts as an operator or not. This will be /// true except when we are parsing an expression within a C++ @@ -172,6 +173,25 @@ class Parser : public CodeCompletionHandler { /// The "depth" of the template parameters currently being parsed. unsigned TemplateParameterDepth; + /// \brief RAII class that manages the template parameter depth. + class TemplateParameterDepthRAII { + unsigned &Depth; + unsigned AddedLevels; + public: + explicit TemplateParameterDepthRAII(unsigned &Depth) + : Depth(Depth), AddedLevels(0) {} + + ~TemplateParameterDepthRAII() { + Depth -= AddedLevels; + } + + void operator++() { + ++Depth; + ++AddedLevels; + } + unsigned getDepth() const { return Depth; } + }; + /// Factory object for creating AttributeList objects. AttributeFactory AttrFactory; @@ -422,6 +442,10 @@ private: /// #pragma OPENCL EXTENSION... void HandlePragmaOpenCLExtension(); + /// \brief Handle the annotation token produced for + /// #pragma clang __debug captured + StmtResult HandlePragmaCaptured(); + /// GetLookAheadToken - This peeks ahead N tokens and returns that token /// without consuming any tokens. LookAhead(0) returns 'Tok', LookAhead(1) /// returns the token after Tok, etc. @@ -454,19 +478,13 @@ private: /// \brief Read an already-translated primary expression out of an annotation /// token. static ExprResult getExprAnnotation(Token &Tok) { - if (Tok.getAnnotationValue()) - return ExprResult((Expr *)Tok.getAnnotationValue()); - - return ExprResult(true); + return ExprResult::getFromOpaquePointer(Tok.getAnnotationValue()); } /// \brief Set the primary expression corresponding to the given annotation /// token. static void setExprAnnotation(Token &Tok, ExprResult ER) { - if (ER.isInvalid()) - Tok.setAnnotationValue(0); - else - Tok.setAnnotationValue(ER.get()); + Tok.setAnnotationValue(ER.getAsOpaquePointer()); } public: @@ -1204,6 +1222,11 @@ public: // Expr that doesn't include commas. ExprResult ParseAssignmentExpression(TypeCastState isTypeCast = NotTypeCast); + ExprResult ParseMSAsmIdentifier(llvm::SmallVectorImpl &LineToks, + unsigned &NumLineToksConsumed, + void *Info, + bool IsUnevaluated); + private: ExprResult ParseExpressionWithLeadingAt(SourceLocation AtLoc); -- cgit v1.1