aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PrintPreprocessedOutput.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-07-13 09:07:17 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-07-13 09:07:17 +0000
commit9b36c3f0de0105e903130bbda3c4aea7d792c0af (patch)
tree66f0c582d3ebf63b52b90596156e3ddf75814a4f /lib/Frontend/PrintPreprocessedOutput.cpp
parentde80ec1fa947855d2e53722a8cd71367ff513481 (diff)
Modify the pragma handlers to accept and use StringRefs instead of IdentifierInfos.
When loading the PCH, IdentifierInfos that are associated with pragmas cause declarations that use these identifiers to be deserialized (e.g. the "clang" pragma causes the "clang" namespace to be loaded). We can avoid this if we just use StringRefs for the pragmas. As a bonus, since we don't have to create and pass IdentifierInfos, the pragma interfaces get a bit more simplified. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108237 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PrintPreprocessedOutput.cpp')
-rw-r--r--lib/Frontend/PrintPreprocessedOutput.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Frontend/PrintPreprocessedOutput.cpp b/lib/Frontend/PrintPreprocessedOutput.cpp
index 7385ca6cfd..73bca9a6ca 100644
--- a/lib/Frontend/PrintPreprocessedOutput.cpp
+++ b/lib/Frontend/PrintPreprocessedOutput.cpp
@@ -391,7 +391,7 @@ struct UnknownPragmaHandler : public PragmaHandler {
PrintPPOutputPPCallbacks *Callbacks;
UnknownPragmaHandler(const char *prefix, PrintPPOutputPPCallbacks *callbacks)
- : PragmaHandler(0), Prefix(prefix), Callbacks(callbacks) {}
+ : Prefix(prefix), Callbacks(callbacks) {}
virtual void HandlePragma(Preprocessor &PP, Token &PragmaTok) {
// Figure out what line we went to and insert the appropriate number of
// newline characters.
@@ -475,7 +475,7 @@ static int MacroIDCompare(const void* a, const void* b) {
static void DoPrintMacros(Preprocessor &PP, llvm::raw_ostream *OS) {
// Ignore unknown pragmas.
- PP.AddPragmaHandler(0, new EmptyPragmaHandler());
+ PP.AddPragmaHandler(new EmptyPragmaHandler());
// -dM mode just scans and ignores all tokens in the files, then dumps out
// the macro table at the end.
@@ -517,7 +517,7 @@ void clang::DoPrintPreprocessedInput(Preprocessor &PP, llvm::raw_ostream *OS,
PrintPPOutputPPCallbacks *Callbacks =
new PrintPPOutputPPCallbacks(PP, *OS, !Opts.ShowLineMarkers,
Opts.ShowMacros);
- PP.AddPragmaHandler(0, new UnknownPragmaHandler("#pragma", Callbacks));
+ PP.AddPragmaHandler(new UnknownPragmaHandler("#pragma", Callbacks));
PP.AddPragmaHandler("GCC", new UnknownPragmaHandler("#pragma GCC",
Callbacks));