]> granicus.if.org Git - clang/commit
[Syntax] Do not glue multiple empty PP expansions to a single mapping
authorIlya Biryukov <ibiryukov@google.com>
Mon, 24 Jun 2019 21:39:51 +0000 (21:39 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Mon, 24 Jun 2019 21:39:51 +0000 (21:39 +0000)
commite9cd88a09101a5d556655f65ce26172ed2772f4e
tree22bb4b0ea268a642a1955f278263c2718dbe7e7c
parentbf1bcc9ff6110f129f1e1d07b371046433a09935
[Syntax] Do not glue multiple empty PP expansions to a single mapping

Summary:
This change makes sure we have a single mapping for each macro expansion,
even if the result of expansion was empty.

To achieve that, we take information from PPCallbacks::MacroExpands into
account. Previously we relied only on source locations of expanded tokens.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D62953

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364236 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Tooling/Syntax/Tokens.h
lib/Tooling/Syntax/Tokens.cpp
unittests/Tooling/Syntax/TokensTest.cpp