diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-04-22 02:09:43 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-04-22 02:09:43 +0000 |
commit | 5dbef929323a180a8e56c34c473238835c500c79 (patch) | |
tree | 863f3443d2766c4ef24140adcaedd20195636158 /clang/lib/Lex/PPMacroExpansion.cpp | |
parent | f8344c60a69bfd9388bf0a5bdd13f504c6b7b53e (diff) | |
download | bcm5719-llvm-5dbef929323a180a8e56c34c473238835c500c79.tar.gz bcm5719-llvm-5dbef929323a180a8e56c34c473238835c500c79.zip |
[modules] Cope with partial module macro information, fix memory leak found by buildbot.
llvm-svn: 235464
Diffstat (limited to 'clang/lib/Lex/PPMacroExpansion.cpp')
-rw-r--r-- | clang/lib/Lex/PPMacroExpansion.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPMacroExpansion.cpp b/clang/lib/Lex/PPMacroExpansion.cpp index 4c6aa4e45ac..6753bf3fff1 100644 --- a/clang/lib/Lex/PPMacroExpansion.cpp +++ b/clang/lib/Lex/PPMacroExpansion.cpp @@ -112,6 +112,15 @@ ModuleMacro *Preprocessor::addModuleMacro(unsigned ModuleID, IdentifierInfo *II, return MM; } +ModuleMacro *Preprocessor::getModuleMacro(unsigned ModuleID, + IdentifierInfo *II) { + llvm::FoldingSetNodeID ID; + ModuleMacro::Profile(ID, ModuleID, II); + + void *InsertPos; + return ModuleMacros.FindNodeOrInsertPos(ID, InsertPos); +} + /// RegisterBuiltinMacro - Register the specified identifier in the identifier /// table and mark it as a builtin macro to be expanded. static IdentifierInfo *RegisterBuiltinMacro(Preprocessor &PP, const char *Name){ |