summaryrefslogtreecommitdiffstats
path: root/include/clang/Parse/Parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/clang/Parse/Parser.h')
-rw-r--r--include/clang/Parse/Parser.h39
1 files changed, 31 insertions, 8 deletions
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<PragmaHandler> OpenCLExtensionHandler;
OwningPtr<CommentHandler> CommentSemaHandler;
OwningPtr<PragmaHandler> OpenMPHandler;
+ OwningPtr<PragmaHandler> 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<Token> &LineToks,
+ unsigned &NumLineToksConsumed,
+ void *Info,
+ bool IsUnevaluated);
+
private:
ExprResult ParseExpressionWithLeadingAt(SourceLocation AtLoc);
OpenPOWER on IntegriCloud