Parser support for #pragma clang __debug captured
This patch implements parsing ‘#pragma clang __debug’ as a first step for
implementing captured statements. Captured statements are a mechanism for
doing outlining in the AST.
see http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-January/027540.html.
Currently returns StmtEmpty
Author: Andy Zhang <andy.zhang@intel.com>
Differential Revision: http://llvm-reviews.chandlerc.com/D369
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179614 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Frontend/PrintPreprocessedOutput.cpp b/lib/Frontend/PrintPreprocessedOutput.cpp
index 432428b..6734d77 100644
--- a/lib/Frontend/PrintPreprocessedOutput.cpp
+++ b/lib/Frontend/PrintPreprocessedOutput.cpp
@@ -140,6 +140,7 @@
virtual void PragmaComment(SourceLocation Loc, const IdentifierInfo *Kind,
const std::string &Str);
virtual void PragmaMessage(SourceLocation Loc, StringRef Str);
+ virtual void PragmaDebug(SourceLocation Loc, StringRef DebugType);
virtual void PragmaDiagnosticPush(SourceLocation Loc,
StringRef Namespace);
virtual void PragmaDiagnosticPop(SourceLocation Loc,
@@ -419,6 +420,17 @@
setEmittedDirectiveOnThisLine();
}
+void PrintPPOutputPPCallbacks::PragmaDebug(SourceLocation Loc,
+ StringRef DebugType) {
+ startNewLineIfNeeded();
+ MoveToLine(Loc);
+
+ OS << "#pragma clang __debug ";
+ OS << DebugType;
+
+ setEmittedDirectiveOnThisLine();
+}
+
void PrintPPOutputPPCallbacks::
PragmaDiagnosticPush(SourceLocation Loc, StringRef Namespace) {
startNewLineIfNeeded();