diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-04-29 23:20:19 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-04-29 23:20:19 +0000 |
commit | 1f468121f536d0087a5e64aa9fa7b2d4800fb3f0 (patch) | |
tree | 68511be04fca093b48365f08d7bad8235fa67864 /lib/Sema/SemaFixItUtils.cpp | |
parent | f6dfb10742fe2954dc75d04a29bbf14150ab883a (diff) | |
download | clang-1f468121f536d0087a5e64aa9fa7b2d4800fb3f0.tar.gz |
[modules] Stop trying to fake up a linear MacroDirective history.
Modules builds fundamentally have a non-linear macro history. In the interest
of better source fidelity, represent the macro definition information
faithfully: we have a linear macro directive history within each module, and at
any point we have a unique "latest" local macro directive and a collection of
visible imported directives. This also removes the attendent complexity of
attempting to create a correct MacroDirective history (which we got wrong
in the general case).
No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236176 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaFixItUtils.cpp')
-rw-r--r-- | lib/Sema/SemaFixItUtils.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/Sema/SemaFixItUtils.cpp b/lib/Sema/SemaFixItUtils.cpp index 32b56bcddc..2e327ecf23 100644 --- a/lib/Sema/SemaFixItUtils.cpp +++ b/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( |