summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [ASTImporter] Add support for importing ChooseExpr AST nodes.Tom Roeder2019-02-269-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [X86] Add 'znver2' and 'cascadelake' to the __builtin_cpu_is test.Craig Topper2019-02-261-0/+1
| | | | | | These are supported by at least libgcc trunk so we can include them now. llvm-svn: 354915
* [AMDGPU] Allow using integral non-type template parametersMichael Liao2019-02-267-47/+300
| | | | | | | | | | | | | | | | | | | Summary: - Allow using integral non-type template parameters in the following attributes __attribute__((amdgpu_flat_work_group_size(<min>, <max>))) __attribute__((amdgpu_waves_per_eu(<min>[, <max>]))) Reviewers: kzhuravl, yaxunl Subscribers: jvesely, wdng, nhaehnle, dstuttard, tpr, t-tye, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58623 llvm-svn: 354909
* [X86] AMD znver2 enablementGanesh Gopalasubramanian2019-02-267-2/+111
| | | | | | | | | | | | | | | | | This patch enables the following 1) AMD family 17h "znver2" tune flag (-march, -mcpu). 2) ISAs that are enabled for "znver2" architecture. 3) For the time being, it uses the znver1 scheduler model. 4) Tests are updated. 5) This patch is the clang counterpart to D58343 Reviewers: craig.topper Tags: #clang Differential Revision: https://reviews.llvm.org/D58344 llvm-svn: 354899
* [OpenCL] Fix assertion due to blocksYaxun Liu2019-02-262-0/+8
| | | | | | | | | | | | | | | | A recent change caused assertion in CodeGenFunction::EmitBlockCallExpr when a block is called. There is code Func = CGM.getOpenCLRuntime().getInvokeFunction(E->getCallee()); getCalleeDecl calls Expr::getReferencedDeclOfCallee, which does not handle BlockExpr and returns nullptr, which causes isa to assert. This patch fixes that. Differential Revision: https://reviews.llvm.org/D58658 llvm-svn: 354893
* [libclang] Avoid crashing when getting layout info of an undeduced type.Emilio Cobos Alvarez2019-02-264-13/+46
| | | | | | | | | | When the type is not deducible, return an error instead of crashing. This fixes https://bugs.llvm.org/show_bug.cgi?id=40813. Differential Revision: https://reviews.llvm.org/D58569 llvm-svn: 354885
* [clang-format] SpaceBeforeParens for lambda expressionsAndrew Ng2019-02-262-1/+5
| | | | | | | | | Add support for lambda expressions to the SpaceBeforeParens formatting option. Differential Revision: https://reviews.llvm.org/D58241 llvm-svn: 354880
* [clang][Index] Visit UsingDecls and generate USRs for themKadir Cetinkaya2019-02-265-3/+30
| | | | | | | | | | | | | | | | | Summary: Add indexing of UsingDecl itself. Also enable generation of USRs for UsingDecls, using the qualified name of the decl. Reviewers: ilya-biryukov, akyrtzi Subscribers: arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58340 llvm-svn: 354878
* revert r354873 as this breaks lldb builds.Pierre Gousseau2019-02-2611-325/+145
| | | | llvm-svn: 354875
* [Driver] Allow enum SanitizerOrdinal to represent more than 64 different ↵Pierre Gousseau2019-02-2611-145/+325
| | | | | | | | | | | | | sanitizer checks, NFC. enum SanitizerOrdinal has reached maximum capacity, this change extends the capacity to 128 sanitizer checks. This can eventually allow us to add gcc 8's options "-fsanitize=pointer-substract" and "-fsanitize=pointer-compare". Fixes: https://llvm.org/PR39425 Differential Revision: https://reviews.llvm.org/D57914 llvm-svn: 354873
* [CodeComplete] Propagate preferred type for function arguments in more casesIlya Biryukov2019-02-269-98/+153
| | | | | | | | | | | | | | | | | | | | | Summary: See the added test for some new cases. This change also removes special code completion calls inside the ParseExpressionList function now that we properly propagate expected type to the function responsible for parsing elements of the expression list (ParseAssignmentExpression). Reviewers: kadircet Reviewed By: kadircet Subscribers: xbolva00, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58541 llvm-svn: 354864
* CodeGen: Explicitly initialize structure padding in the ↵Alexander Potapenko2019-02-262-25/+232
| | | | | | | | | | | | | | | -ftrivial-auto-var-init mode When generating initializers for local structures in the -ftrivial-auto-var-init mode, explicitly wipe the padding bytes with either 0x00 or 0xAA. This will allow us to automatically handle the padding when splitting the initialization stores (see https://reviews.llvm.org/D57898). Reviewed at https://reviews.llvm.org/D58188 llvm-svn: 354861
* [CGDebugInfo] Set NonTrivial DIFlag to a c++ record if it's not trivialAaron Smith2019-02-261-0/+2
| | | | | | This goes with https://reviews.llvm.org/D44406 llvm-svn: 354843
* Revert r354832 "[ASTImporter] Add support for importing ChooseExpr AST nodes."Reid Kleckner2019-02-2684-2040/+0
| | | | | | Test does not pass on Windows llvm-svn: 354839
* [MS] Fix for Bug 8446, template instantiation without a 'typename' keywordReid Kleckner2019-02-262-0/+113
| | | | | | | | Patch by Zahira Ammarguellat! Differential Revision: https://reviews.llvm.org/D41950 llvm-svn: 354838
* [ASTImporter] Add support for importing ChooseExpr AST nodes.Tom Roeder2019-02-259-0/+99
| | | | | | | | | | | | | | | | | | | | | 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. Reviewers: shafik, a_sidorin, martong, aaron.ballman Subscribers: aaron.ballman, rnkovacs, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58292 llvm-svn: 354832
* [NFC] Reorder some mis-ordered testsJF Bastien2019-02-251-4/+4
| | | | | | I somehow had misaligned some of the tests when I originally wrote this. Re-order them properly. llvm-svn: 354831
* Reapply "Make static counters in ASTContext non-static." with fixes.Alexander Kornienko2019-02-253-37/+24
| | | | | | This reverts commit e50038e4dc53caee1acc811362ac0b15e00ef5eb. llvm-svn: 354827
* [CodeGenObjC] Fix a nullptr dyn_castErik Pilkington2019-02-252-2/+16
| | | | | | | | | | ObjCMessageExpr::getInstanceReceiver returns nullptr if the receiver is 'super'. Make this check more strict, since we don't care about messages to super here. rdar://48247290 llvm-svn: 354826
* [libclang] Expose warn_unused and warn_unused_result attributes.Emilio Cobos Alvarez2019-02-255-2/+22
| | | | | | | | | This is helpful to properly detect them, and fixing issues like https://github.com/rust-lang/rust-bindgen/issues/1518. Differential Revision: https://reviews.llvm.org/D58570 llvm-svn: 354824
* [libclang] Fix a trivial error introduced in D57946.Emilio Cobos Alvarez2019-02-251-1/+1
| | | | | | | | | | The value for CXCursor_ConvergentAttr is not 420. I'm not really sure how easy it is to test this, and I'm not familiar with the python bindings, just noticed the error while looking at D57946 to write D58570. Differential Revision: https://reviews.llvm.org/D58571 llvm-svn: 354823
* [OpenMP 5.0] Parsing/sema support for from clause with mapper modifier.Michael Kruse2019-02-2516-71/+203
| | | | | | | | | | | | | | | | | | | | This patch implements the parsing and sema support for the OpenMP 'from'-clause with potential user-defined mappers attached. User-defined mappers are a new feature in OpenMP 5.0. A 'from'-clause can have an explicit or implicit associated mapper, which instructs the compiler to generate and use customized mapping functions. An example is shown below: struct S { int len; int *d; }; #pragma omp declare mapper(id: struct S s) map(s, s.d[0:s.len]) struct S ss; #pragma omp target update from(mapper(id): ss) // use the mapper with name 'id' to map ss from device Contributed-by: Lingda Li <lildmh@gmail.com> Differential Revision: https://reviews.llvm.org/D58638 llvm-svn: 354817
* Revert "Make static counters in ASTContext non-static."Vlad Tsyrklevich2019-02-253-24/+37
| | | | | | | This reverts commit r354795, I suspect it is causing test failures on MSan sanitizer bots. llvm-svn: 354812
* [analyzer] Fix infinite recursion in printing macrosKristof Umann2019-02-251-1/+11
| | | | | | | | | | | | | | | | #define f(y) x #define x f(x) int main() { x; } This example results a compilation error since "x" in the first line was not defined earlier. However, the macro expression printer goes to an infinite recursion on this example. Patch by Tibor Brunner! Differential Revision: https://reviews.llvm.org/D57892 llvm-svn: 354806
* Make static counters in ASTContext non-static.Alexander Kornienko2019-02-253-37/+24
| | | | | | | | | | | | | | | | | | Summary: Fixes a data race and makes it possible to run clang-based tools in multithreaded environment with TSan. Reviewers: ilya-biryukov, riccibruno Reviewed By: riccibruno Subscribers: riccibruno, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58612 llvm-svn: 354795
* [AArch64] Add support for Cortex-A76 and Cortex-A76AELuke Cheeseman2019-02-254-0/+57
| | | | | | | | | | - Add LLVM backend support for Cortex-A76 and Cortex-A76AE - Documentation can be found at https://developer.arm.com/products/processors/cortex-a/cortex-a76 Differential Revision: https://reviews.llvm.org/D57764 llvm-svn: 354789
* Fixed typos in tests: s/CHEKC/CHECK/Dmitri Gribenko2019-02-252-2/+2
| | | | | | | | | | | | Reviewers: ilya-biryukov Subscribers: nemanjai, javed.absar, jsji, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D58611 llvm-svn: 354785
* [SYCL] Add clang front-end option to enable SYCL device compilation flow.Alexey Bader2019-02-255-1/+22
| | | | | | Patch by Mariya Podchishchaeva <mariya.podchishchaeva@intel.com> llvm-svn: 354773
* Fix accidentally used hard tabs. NFCKristina Brooks2019-02-241-1/+1
| | | | | | | Big sorry. This undoes the indentation mess I made in r354751. llvm-svn: 354752
* Wrap code for builtin_assume_aligned at 80 col.NFCKristina Brooks2019-02-241-1/+2
| | | | | | | Minor style fix to avoid going over 80 cols in handling of case for Builtin::BI__builtin_assume_aligned. NFC. llvm-svn: 354751
* Typo: s/CHCCK/CHECKMichael Liao2019-02-241-1/+1
| | | | llvm-svn: 354742
* [NFC] Minor coding style (indent) fix.Michael Liao2019-02-241-1/+1
| | | | llvm-svn: 354741
* Enable coroutines under -std=c++2a.Richard Smith2019-02-2311-16/+22
| | | | llvm-svn: 354736
* [cxx_status] Update to match Kona motions.Richard Smith2019-02-231-8/+59
| | | | llvm-svn: 354735
* [NFC] Fix Wdocumentation warning in OMPToClauseBruno Ricci2019-02-231-1/+0
| | | | llvm-svn: 354728
* [Sema][NFC] SequenceChecker: More tests in preparation for D57660Bruno Ricci2019-02-231-5/+148
| | | | llvm-svn: 354727
* Remove OpenBSD case for old system libstdc++ header path as OpenBSDBrad Smith2019-02-231-8/+0
| | | | | | has switched to libc++. llvm-svn: 354723
* Remove sanitizer context workaround no longer necessaryBrad Smith2019-02-231-3/+1
| | | | | | The base linker is now lld. llvm-svn: 354721
* [OpenMP 5.0] Parsing/sema support for to clause with mapper modifier.Michael Kruse2019-02-2218-118/+309
| | | | | | | | | | | | | | | | | | | This patch implements the parsing and sema support for OpenMP to clause with potential user-defined mappers attached. User defined mapper is a new feature in OpenMP 5.0. A to/from clause can have an explicit or implicit associated mapper, which instructs the compiler to generate and use customized mapping functions. An example is shown below: struct S { int len; int *d; }; #pragma omp declare mapper(id: struct S s) map(s, s.d[0:s.len]) struct S ss; #pragma omp target update to(mapper(id): ss) // use the mapper with name 'id' to map ss to device Contributed-by: <lildmh@gmail.com> Differential Revision: https://reviews.llvm.org/D58523 llvm-svn: 354698
* [clang] Only provide C11 features in <float.h> starting with C++17Louis Dionne2019-02-222-4/+4
| | | | | | | | | | | | | | Summary: In r353970, I enabled those features in C++11 and above. To be strictly conforming, those features should only be enabled in C++17 and above. Reviewers: jfb, eli.friedman Subscribers: jkorous, dexonsmith, libcxx-commits Differential Revision: https://reviews.llvm.org/D58289 llvm-svn: 354691
* [OPENMP] Delayed diagnostics for VLA support.Alexey Bataev2019-02-225-12/+32
| | | | | | Generalized processing of the deferred diagnostics for OpenMP/CUDA code. llvm-svn: 354690
* Fix "not all control paths return" warning. NFCI.Simon Pilgrim2019-02-221-0/+1
| | | | llvm-svn: 354681
* Revert "[OPENMP] Delayed diagnostics for VLA support."Alexey Bataev2019-02-223-20/+12
| | | | | | | This reverts commit r354679 to fix the problem with the Windows buildbots llvm-svn: 354680
* [OPENMP] Delayed diagnostics for VLA support.Alexey Bataev2019-02-223-12/+20
| | | | | | Generalized processing of the deferred diagnostics for OpenMP/CUDA code. llvm-svn: 354679
* CodeGen: use COMDAT for block copy/destroy helpersSaleem Abdulrasool2019-02-222-1/+14
| | | | | | | | | | | SVN r339438 added support to deduplicate the helpers by using a consistent naming scheme and using LinkOnceODR semantics. This works on ELF by means of weak linking semantics, and entirely does not work on PE/COFF where you end up with multiply defined strong symbols, which is a strong error on PE/COFF. Assign the functions a COMDAT group so that they can be uniqued by the linker. This fixes the use of blocks in CoreFoundation on Windows. llvm-svn: 354678
* [CUDA]Delayed diagnostics for the asm instructions.Alexey Bataev2019-02-226-20/+134
| | | | | | | | | Adapted targetDiag for the CUDA and used for the delayed diagnostics in asm constructs. Works for both host and device compilation sides. Differential Revision: https://reviews.llvm.org/D58463 llvm-svn: 354671
* revert r354615: [HIP] change kernel stub nameYaxun Liu2019-02-222-8/+1
| | | | | | | | It caused regressions. Differential Revision: https://reviews.llvm.org/D58518 llvm-svn: 354651
* [analyzer] MIGChecker: Enable by default as `osx.MIG'.Artem Dergachev2019-02-222-10/+6
| | | | | | | | | | With r354643, the checker is feature-rich and polished enough. rdar://problem/35380337 Differential Revision: https://reviews.llvm.org/D58397 llvm-svn: 354644
* [analyzer] MIGChecker: Add support for more APIs.Artem Dergachev2019-02-222-18/+166
| | | | | | | | | | | | | | | Add more "consuming" functions. For now only vm_deallocate() was supported. Add a non-zero value that isn't an error; this value is -305 ("MIG_NO_REPLY") and it's fine to deallocate data when you are returning this error. Make sure that the mig_server_routine annotation is inherited. rdar://problem/35380337 Differential Revision: https://reviews.llvm.org/D58397 llvm-svn: 354643
* [analyzer] MIGChecker: Fix an FN when the object is released in a destructor.Artem Dergachev2019-02-222-3/+43
| | | | | | | | | | | | | | | | | When a MIG server routine argument is released in an automatic destructor, the Static Analyzer thinks that this happens after the return statement, and so the violation of the MIG convention doesn't happen. Of course, it doesn't quite work that way, so this is a false negative. Add a hack that makes the checker double-check at the end of function that no argument was released when the routine fails with an error. rdar://problem/35380337 Differential Revision: https://reviews.llvm.org/D58392 llvm-svn: 354642
OpenPOWER on IntegriCloud