diff options
author | Chris Lattner <sabre@nondot.org> | 2009-02-06 06:26:42 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-02-06 06:26:42 +0000 |
commit | 09b5c1d08a33ecf5d9c61b922fbe679867336684 (patch) | |
tree | 345a723381ba7e092695ded85b15fe8c388b46ad /include/clang/Lex/Preprocessor.h | |
parent | c76d807565beb8434a556dd34c574b640ceead7f (diff) |
add interface for walking macro table.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63925 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Lex/Preprocessor.h')
-rw-r--r-- | include/clang/Lex/Preprocessor.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/clang/Lex/Preprocessor.h b/include/clang/Lex/Preprocessor.h index 4e57069385..94a7ef45b3 100644 --- a/include/clang/Lex/Preprocessor.h +++ b/include/clang/Lex/Preprocessor.h @@ -247,6 +247,15 @@ public: /// void setMacroInfo(IdentifierInfo *II, MacroInfo *MI); + /// macro_iterator/macro_begin/macro_end - This allows you to walk the current + /// state of the macro table. This visits every currently-defined macro. + typedef llvm::DenseMap<IdentifierInfo*, + MacroInfo*>::const_iterator macro_iterator; + macro_iterator macro_begin() const { return Macros.begin(); } + macro_iterator macro_end() const { return Macros.end(); } + + + const std::string &getPredefines() const { return Predefines; } /// setPredefines - Set the predefines for this Preprocessor. These /// predefines are automatically injected when parsing the main file. |