change calls to getMacroInfo into hasMacroDefinition() where possible.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42726 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Lex/Preprocessor.cpp b/Lex/Preprocessor.cpp
index f43eae1..2d53fe7 100644
--- a/Lex/Preprocessor.cpp
+++ b/Lex/Preprocessor.cpp
@@ -533,7 +533,7 @@
// If the identifier is a macro, and if that macro is enabled, it may be
// expanded so it's not a trivial expansion.
- if (II->getMacroInfo() && II->getMacroInfo()->isEnabled() &&
+ if (II->hasMacroDefinition() && II->getMacroInfo()->isEnabled() &&
// Fast expanding "#define X X" is ok, because X would be disabled.
II != MacroIdent)
return false;
@@ -1116,7 +1116,7 @@
for (IdentifierTable::iterator I = Identifiers.begin(),
E = Identifiers.end(); I != E; ++I) {
const IdentifierInfo &II = I->getValue();
- if (II.getMacroInfo() && !II.getMacroInfo()->isUsed())
+ if (II.hasMacroDefinition() && !II.getMacroInfo()->isUsed())
Diag(II.getMacroInfo()->getDefinitionLoc(), diag::pp_macro_not_used);
}
}
@@ -1188,7 +1188,7 @@
} else if (isDefineUndef && II->getPPKeywordID() == tok::pp_defined) {
// Error if defining "defined": C99 6.10.8.4.
Diag(MacroNameTok, diag::err_defined_macro_name);
- } else if (isDefineUndef && II->getMacroInfo() &&
+ } else if (isDefineUndef && II->hasMacroDefinition() &&
II->getMacroInfo()->isBuiltinMacro()) {
// Error if defining "__LINE__" and other builtins: C99 6.10.8.4.
if (isDefineUndef == 1)