summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaFixItUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaFixItUtils.cpp')
-rw-r--r--clang/lib/Sema/SemaFixItUtils.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/Sema/SemaFixItUtils.cpp b/clang/lib/Sema/SemaFixItUtils.cpp
index 32b56bcddc6..2e327ecf231 100644
--- a/clang/lib/Sema/SemaFixItUtils.cpp
+++ b/clang/lib/Sema/SemaFixItUtils.cpp
@@ -161,11 +161,8 @@ bool ConversionFixItGenerator::tryToFixConversion(const Expr *FullExpr,
}
static bool isMacroDefined(const Sema &S, SourceLocation Loc, StringRef Name) {
- const IdentifierInfo *II = &S.getASTContext().Idents.get(Name);
- if (!II->hadMacroDefinition()) return false;
-
- MacroDirective *Macro = S.PP.getMacroDirectiveHistory(II);
- return Macro && Macro->findDirectiveAtLoc(Loc, S.getSourceManager());
+ return (bool)S.PP.getMacroDefinitionAtLoc(&S.getASTContext().Idents.get(Name),
+ Loc);
}
static std::string getScalarZeroExpressionForType(
OpenPOWER on IntegriCloud