llvm-project/clang/unittests/ASTMatchers
Tom Roeder 521f004e99 [ASTImporter] Add support for importing ChooseExpr AST nodes.
Summary:
This allows ASTs to be merged when they contain ChooseExpr (the GNU
__builtin_choose_expr construction). This is needed, for example, for
cross-CTU analysis of C code that makes use of __builtin_choose_expr.

The node is already supported in the AST, but it didn't have a matcher
in ASTMatchers. So, this change adds the matcher and adds support to
ASTImporter.

This was originally reviewed and approved in
https://reviews.llvm.org/D58292 and submitted as r354832. It was
reverted in r354839 due to failures on the Windows CI builds.

This version fixes the test failures on Windows, which were caused by
differences in template expansion between versions of clang on different
OSes. The version of clang built with MSVC and running on Windows never
expands the template in the C++ test in ImportExpr.ImportChooseExpr in
clang/unittests/AST/ASTImporter.cpp, but the version on Linux does for
the empty arguments and -fms-compatibility.

So, this version of the patch drops the C++ test for
__builtin_choose_expr, since that version was written to catch
regressions of the logic for isConditionTrue() in the AST import code
for ChooseExpr, and those regressions are also caught by
ASTImporterOptionSpecificTestBase.ImportChooseExpr, which does work on
Windows.

Reviewers: shafik, a_sidorin, martong, aaron.ballman, rnk, a.sidorin

Subscribers: cfe-commits, jdoerfert, rnkovacs, aaron.ballman

Tags: #clang

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

llvm-svn: 354916
2019-02-26 19:26:41 +00:00
..
Dynamic Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ASTMatchersInternalTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ASTMatchersNarrowingTest.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ASTMatchersNodeTest.cpp [ASTImporter] Add support for importing ChooseExpr AST nodes. 2019-02-26 19:26:41 +00:00
ASTMatchersTest.h [CUDA] add support for the new kernel launch API in CUDA-9.2+. 2019-01-31 21:34:03 +00:00
ASTMatchersTraversalTest.cpp Move multiline raw string literal out of macro. NFC 2019-02-16 11:19:04 +00:00
CMakeLists.txt Add explicit dependency on clangSerialization for a bunch of components to fix -DBUILD_SHARED_LIBS=on build 2018-12-12 08:02:18 +00:00