[PATCH] D57507: [clang] Add getCommentHandler to PreambleCallbacks
Kadir Cetinkaya via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 4 01:42:28 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rL353030: [clang] Add getCommentHandler to PreambleCallbacks (authored by kadircet, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D57507/new/
https://reviews.llvm.org/D57507
Files:
cfe/trunk/include/clang/Frontend/PrecompiledPreamble.h
cfe/trunk/lib/Frontend/PrecompiledPreamble.cpp
Index: cfe/trunk/include/clang/Frontend/PrecompiledPreamble.h
===================================================================
--- cfe/trunk/include/clang/Frontend/PrecompiledPreamble.h
+++ cfe/trunk/include/clang/Frontend/PrecompiledPreamble.h
@@ -283,6 +283,8 @@
/// Creates wrapper class for PPCallbacks so we can also process information
/// about includes that are inside of a preamble
virtual std::unique_ptr<PPCallbacks> createPPCallbacks();
+ /// The returned CommentHandler will be added to the preprocessor if not null.
+ virtual CommentHandler *getCommentHandler();
};
enum class BuildPreambleError {
Index: cfe/trunk/lib/Frontend/PrecompiledPreamble.cpp
===================================================================
--- cfe/trunk/lib/Frontend/PrecompiledPreamble.cpp
+++ cfe/trunk/lib/Frontend/PrecompiledPreamble.cpp
@@ -18,6 +18,7 @@
#include "clang/Frontend/FrontendActions.h"
#include "clang/Frontend/FrontendOptions.h"
#include "clang/Lex/Lexer.h"
+#include "clang/Lex/Preprocessor.h"
#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Serialization/ASTWriter.h"
#include "llvm/ADT/StringExtras.h"
@@ -346,6 +347,8 @@
Callbacks.createPPCallbacks();
if (DelegatedPPCallbacks)
Clang->getPreprocessor().addPPCallbacks(std::move(DelegatedPPCallbacks));
+ if (auto CommentHandler = Callbacks.getCommentHandler())
+ Clang->getPreprocessor().addCommentHandler(CommentHandler);
Act->Execute();
@@ -742,6 +745,7 @@
std::unique_ptr<PPCallbacks> PreambleCallbacks::createPPCallbacks() {
return nullptr;
}
+CommentHandler *PreambleCallbacks::getCommentHandler() { return nullptr; }
static llvm::ManagedStatic<BuildPreambleErrorCategory> BuildPreambleErrCategory;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57507.185007.patch
Type: text/x-patch
Size: 1742 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190204/2431534f/attachment-0001.bin>
More information about the cfe-commits
mailing list