diff options
| author | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2010-03-07 07:30:06 +0000 | 
|---|---|---|
| committer | Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> | 2010-03-07 07:30:06 +0000 | 
| commit | 752a124aeb6c009436158213fc680039172f15eb (patch) | |
| tree | 7c33580806a4bda7684fe3eb51890e947c34c57f /clang | |
| parent | c95d58d31a9c50437a77d42c8e8f408080a705f2 (diff) | |
| download | bcm5719-llvm-752a124aeb6c009436158213fc680039172f15eb.tar.gz bcm5719-llvm-752a124aeb6c009436158213fc680039172f15eb.zip  | |
Rename to addPPCallbacks since we're effectively adding a callback and maybe chaining it to an existing one
llvm-svn: 97913
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/include/clang/Lex/Preprocessor.h | 20 | ||||
| -rw-r--r-- | clang/lib/Frontend/DependencyFile.cpp | 2 | ||||
| -rw-r--r-- | clang/lib/Frontend/PrintPreprocessedOutput.cpp | 8 | 
3 files changed, 15 insertions, 15 deletions
diff --git a/clang/include/clang/Lex/Preprocessor.h b/clang/include/clang/Lex/Preprocessor.h index db9c884662a..532d8e4b46f 100644 --- a/clang/include/clang/Lex/Preprocessor.h +++ b/clang/include/clang/Lex/Preprocessor.h @@ -43,7 +43,7 @@ class ScratchBuffer;  class TargetInfo;  class PPCallbacks;  class DirectoryLookup; -   +  /// Preprocessor - This object engages in a tight little dance with the lexer to  /// efficiently preprocess tokens.  Lexers know only about tokens within a  /// single source file, and don't know anything about preprocessor-level issues @@ -60,7 +60,7 @@ class Preprocessor {    /// \brief External source of macros.    ExternalPreprocessorSource *ExternalSource; -   +    /// PTH - An optional PTHManager object used for getting tokens from    ///  a token cache rather than lexing the original source file.    llvm::OwningPtr<PTHManager> PTH; @@ -105,7 +105,7 @@ class Preprocessor {    /// \brief Whether we have already loaded macros from the external source.    mutable bool ReadMacrosFromExternalSource : 1; -   +    /// Identifiers - This is mapping/lookup information for all identifiers in    /// the program, including program keywords.    mutable IdentifierTable Identifiers; @@ -186,7 +186,7 @@ class Preprocessor {    /// allocation.    /// FIXME: why not use a singly linked list?    std::vector<MacroInfo*> MICache; -   +    /// MacroArgCache - This is a "freelist" of MacroArg objects that can be    /// reused for quick allocation.    MacroArgs *MacroArgCache; @@ -257,11 +257,11 @@ public:    void setExternalSource(ExternalPreprocessorSource *Source) {      ExternalSource = Source;    } -   +    ExternalPreprocessorSource *getExternalSource() const {      return ExternalSource;    } -   +    /// SetCommentRetentionState - Control whether or not the preprocessor retains    /// comments in output.    void SetCommentRetentionState(bool KeepComments, bool KeepMacroComments) { @@ -287,11 +287,11 @@ public:    /// expansions going on at the time.    PreprocessorLexer *getCurrentFileLexer() const; -  /// getPPCallbacks/setPPCallbacks - Accessors for preprocessor callbacks. +  /// getPPCallbacks/addPPCallbacks - Accessors for preprocessor callbacks.    /// Note that this class takes ownership of any PPCallbacks object given to    /// it.    PPCallbacks *getPPCallbacks() const { return Callbacks; } -  void setPPCallbacks(PPCallbacks *C) { +  void addPPCallbacks(PPCallbacks *C) {      if (Callbacks)        C = new PPChainedCallbacks(C, Callbacks);      Callbacks = C; @@ -313,7 +313,7 @@ public:                           MacroInfo*>::const_iterator macro_iterator;    macro_iterator macro_begin(bool IncludeExternalMacros = true) const;    macro_iterator macro_end(bool IncludeExternalMacros = true) const; -   +    const std::string &getPredefines() const { return Predefines; }    /// setPredefines - Set the predefines for this Preprocessor.  These    /// predefines are automatically injected when parsing the main file. @@ -523,7 +523,7 @@ public:    /// (1-based).    ///    /// \returns true if an error occurred, false otherwise. -  bool SetCodeCompletionPoint(const FileEntry *File,  +  bool SetCodeCompletionPoint(const FileEntry *File,                                unsigned Line, unsigned Column);    /// \brief Determine if this source location refers into the file diff --git a/clang/lib/Frontend/DependencyFile.cpp b/clang/lib/Frontend/DependencyFile.cpp index 9487b1a06d1..de2b056dc7c 100644 --- a/clang/lib/Frontend/DependencyFile.cpp +++ b/clang/lib/Frontend/DependencyFile.cpp @@ -74,7 +74,7 @@ void clang::AttachDependencyFileGen(Preprocessor &PP,      return;    } -  PP.setPPCallbacks(new DependencyFileCallback(&PP, OS, Opts)); +  PP.addPPCallbacks(new DependencyFileCallback(&PP, OS, Opts));  }  /// FileMatchesDepCriteria - Determine whether the given Filename should be diff --git a/clang/lib/Frontend/PrintPreprocessedOutput.cpp b/clang/lib/Frontend/PrintPreprocessedOutput.cpp index 774372c8693..be5bb0dade8 100644 --- a/clang/lib/Frontend/PrintPreprocessedOutput.cpp +++ b/clang/lib/Frontend/PrintPreprocessedOutput.cpp @@ -52,7 +52,7 @@ static void PrintMacroDefinition(const IdentifierInfo &II, const MacroInfo &MI,      if (MI.isGNUVarargs())        OS << "...";  // #define foo(x...) -     +      OS << ')';    } @@ -102,7 +102,7 @@ public:      EmittedMacroOnThisLine = false;      FileType = SrcMgr::C_User;      Initialized = false; -          +      // If we're in microsoft mode, use normal #line instead of line markers.      UseLineDirective = PP.getLangOptions().Microsoft;    } @@ -150,7 +150,7 @@ void PrintPPOutputPPCallbacks::WriteLineInfo(unsigned LineNo,      OS << '#' << ' ' << LineNo << ' ' << '"';      OS.write(&CurFilename[0], CurFilename.size());      OS << '"'; -     +      if (ExtraLen)        OS.write(Extra, ExtraLen); @@ -492,7 +492,7 @@ void clang::DoPrintPreprocessedInput(Preprocessor &PP, llvm::raw_ostream *OS,    PP.AddPragmaHandler("GCC", new UnknownPragmaHandler("#pragma GCC",                                                        Callbacks)); -  PP.setPPCallbacks(Callbacks); +  PP.addPPCallbacks(Callbacks);    // After we have configured the preprocessor, enter the main file.    PP.EnterMainSourceFile();  | 

