aboutsummaryrefslogtreecommitdiff
path: root/clang/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
commit36745fda344d3f480fea0d327a276f421268a4ea (patch)
treeba074ddebfdfed4b3a6db642e1455803d1dd08c4 /clang/lib/Frontend/PrintPreprocessedOutput.cpp
parente82f0873780b72d49b294801d47e7f53bfca8645 (diff)
downloadllvm-36745fda344d3f480fea0d327a276f421268a4ea.zip
llvm-36745fda344d3f480fea0d327a276f421268a4ea.tar.gz
llvm-36745fda344d3f480fea0d327a276f421268a4ea.tar.bz2
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. llvm-svn: 108237
Diffstat (limited to 'clang/lib/Frontend/PrintPreprocessedOutput.cpp')
-rw-r--r--clang/lib/Frontend/PrintPreprocessedOutput.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp
index 7385ca6..73bca9a 100644
--- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp
+++ b/clang/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));