]> granicus.if.org Git - clang/commitdiff
make Preprocessor::Diags be a pointer instead of a reference.
authorChris Lattner <sabre@nondot.org>
Fri, 13 Mar 2009 21:17:43 +0000 (21:17 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 13 Mar 2009 21:17:43 +0000 (21:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66955 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Lex/Preprocessor.h
lib/Lex/Preprocessor.cpp

index 4f5def5c5169f915d8f4536b6f654b6c65b7f19e..28aad1a7bb38d6a292b6b2d108a0ccbe3d0f24bb 100644 (file)
@@ -45,7 +45,7 @@ class DirectoryLookup;
 /// like the #include stack, token expansion, etc.
 ///
 class Preprocessor {
-  Diagnostic        &Diags;
+  Diagnostic        *Diags;
   const LangOptions &Features;
   TargetInfo        &Target;
   FileManager       &FileMgr;
@@ -196,7 +196,7 @@ public:
 
   ~Preprocessor();
 
-  Diagnostic &getDiagnostics() const { return Diags; }
+  Diagnostic &getDiagnostics() const { return *Diags; }
   const LangOptions &getLangOptions() const { return Features; }
   TargetInfo &getTargetInfo() const { return Target; }
   FileManager &getFileManager() const { return FileMgr; }
@@ -452,12 +452,12 @@ public:
   /// the specified Token's location, translating the token's start
   /// position in the current buffer into a SourcePosition object for rendering.
   DiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID) {
-    return Diags.Report(FullSourceLoc(Loc, getSourceManager()), DiagID);
+    return Diags->Report(FullSourceLoc(Loc, getSourceManager()), DiagID);
   }
   
   DiagnosticBuilder Diag(const Token &Tok, unsigned DiagID) {
-    return Diags.Report(FullSourceLoc(Tok.getLocation(), getSourceManager()),
-                        DiagID);
+    return Diags->Report(FullSourceLoc(Tok.getLocation(), getSourceManager()),
+                         DiagID);
   }
   
   /// getSpelling() - Return the 'spelling' of the Tok token.  The spelling of a
index de706440c845c52e4a7bb106af0468ea29c6c116..38a6919be37bc67549c446197a8b400078426df5 100644 (file)
@@ -49,7 +49,7 @@ Preprocessor::Preprocessor(Diagnostic &diags, const LangOptions &opts,
                            TargetInfo &target, SourceManager &SM, 
                            HeaderSearch &Headers,
                            IdentifierInfoLookup* IILookup)
-  : Diags(diags), Features(opts), Target(target), FileMgr(Headers.getFileMgr()),
+  : Diags(&diags), Features(opts), Target(target),FileMgr(Headers.getFileMgr()),
     SourceMgr(SM), HeaderInfo(Headers), Identifiers(opts, IILookup),
     CurPPLexer(0), CurDirLookup(0), Callbacks(0) {
   ScratchBuf = new ScratchBuffer(SourceMgr);