[cfe-commits] r68825 - /cfe/trunk/lib/Lex/PPMacroExpansion.cpp
Chris Lattner
sabre at nondot.org
Fri Apr 10 14:17:07 PDT 2009
Author: lattner
Date: Fri Apr 10 16:17:07 2009
New Revision: 68825
URL: http://llvm.org/viewvc/llvm-project?rev=68825&view=rev
Log:
simplify code.
Modified:
cfe/trunk/lib/Lex/PPMacroExpansion.cpp
Modified: cfe/trunk/lib/Lex/PPMacroExpansion.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPMacroExpansion.cpp?rev=68825&r1=68824&r2=68825&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPMacroExpansion.cpp (original)
+++ cfe/trunk/lib/Lex/PPMacroExpansion.cpp Fri Apr 10 16:17:07 2009
@@ -25,14 +25,12 @@
/// setMacroInfo - Specify a macro for this identifier.
///
void Preprocessor::setMacroInfo(IdentifierInfo *II, MacroInfo *MI) {
- if (MI == 0) {
- if (II->hasMacroDefinition()) {
- Macros.erase(II);
- II->setHasMacroDefinition(false);
- }
- } else {
+ if (MI) {
Macros[II] = MI;
II->setHasMacroDefinition(true);
+ } else if (II->hasMacroDefinition()) {
+ Macros.erase(II);
+ II->setHasMacroDefinition(false);
}
}
More information about the cfe-commits
mailing list