summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [OpenMP][Clang] Support for target math functionsGheorghe-Teodor Bercea2019-05-0818-433/+693
| | | | | | | | | | | | | | | | | | | | | | | Summary: In this patch we propose a temporary solution to resolving math functions for the NVPTX toolchain, temporary until OpenMP variant is supported by Clang. We intercept the inclusion of math.h and cmath headers and if we are in the OpenMP-NVPTX case, we re-use CUDA's math function resolution mechanism. Authors: @gtbercea @jdoerfert Reviewers: hfinkel, caomhin, ABataev, tra Reviewed By: hfinkel, ABataev, tra Subscribers: JDevlieghere, mgorny, guansong, cfe-commits, jdoerfert Tags: #clang Differential Revision: https://reviews.llvm.org/D61399 llvm-svn: 360265
* [ASTImporter] Fix inequivalence of unresolved exception specGabor Marton2019-05-082-17/+36
| | | | | | | | | | | | | | | | | | Summary: Structural equivalence of methods can falsely report false when the exception specifier is unresolved (i.e unevaluated or not instantiated). (This caused one assertion during bitcoin ctu-analysis.) Reviewers: a_sidorin, shafik, a.sidorin Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61424 llvm-svn: 360261
* [Sema][OpenCL] Make address space conversions a bit stricter.Anastasia Stulova2019-05-089-30/+179
| | | | | | | | | | | | | | | | | | | | | | | | The semantics for converting nested pointers between address spaces are not very well defined. Some conversions which do not really carry any meaning only produce warnings, and in some cases warnings hide invalid conversions, such as 'global int*' to 'local float*'! This patch changes the logic in checkPointerTypesForAssignment and checkAddressSpaceCast to fail properly on implicit conversions that should definitely not be permitted. We also dig deeper into the pointer types and warn on explicit conversions where the address space in a nested pointer changes, regardless of whether the address space is compatible with the corresponding pointer nesting level on the destination type. Fixes PR39674! Patch by ebevhan (Bevin Hansson)! Differential Revision: https://reviews.llvm.org/D58236 llvm-svn: 360258
* [clang-format] Fix the crash when formatting unsupported encodingsOwen Pan2019-05-081-0/+30
| | | | | | | | Fixes PR33946 Differential Revision: https://reviews.llvm.org/D61559 llvm-svn: 360257
* [clang] Fix a bug that reports UTF32 (LE) files as UTF16 (LE) onesOwen Pan2019-05-081-3/+3
| | | | | | | | Also fix a typo for the SCSU byte order mark. Differential Revision: https://reviews.llvm.org/D61628 llvm-svn: 360256
* Allow test to pass after 2030.Aaron Ballman2019-05-081-2/+2
| | | | | | Patch by Bernhard M. Wiedemann. llvm-svn: 360254
* Allow 'static' storage specifier on an out-of-line class member template ↵Aaron Ballman2019-05-082-2/+16
| | | | | | | | declaration in MSVCCompat mode. Patch by Soumi Manna. llvm-svn: 360250
* [libclang] PR41649: Remove pointless duplicate flag. NFC.Nikolai Kosjar2019-05-081-3/+2
| | | | llvm-svn: 360249
* Fix for the greendragon bots.Leonard Chan2019-05-082-2/+4
| | | | | | Adds extra checks for ObjC GC and Ownership. llvm-svn: 360225
* [Sema] Correct typos in return statements so the return types of 'auto' ↵Sam McCall2019-05-082-2/+19
| | | | | | | | | | | | | | | | | | | | | functions are always deduced. Summary: e.g. auto foo() { return no_such_thing; // Return value is a TypoExpr } using T = decltype(foo()); // Uh-oh, undeduced auto. Reviewers: rsmith Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61649 llvm-svn: 360224
* Fix buildbot break after r360195Nemanja Ivanovic2019-05-081-0/+2
| | | | llvm-svn: 360220
* Split ActOnCallExpr into an ActOnCallExpr to be called by the parser,Richard Smith2019-05-0810-23/+32
| | | | | | | and a BuildCallExpr to be called internally within Sema to build / rebuild calls. llvm-svn: 360217
* [hip] Fix ambiguity from `>>>` of CUDA.Michael Liao2019-05-082-1/+14
| | | | | | | | | | | | | | | | | Summary: - For template arguments ending with `>>>`, we should cease lookahead and treat it as type-id firstly, so that deduction could work properly. Reviewers: tra, yaxunl Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61396 llvm-svn: 360214
* [COFF] Use COFF stubs for extern_weak functionsReid Kleckner2019-05-072-1/+8
| | | | | | | | | | | | | | | | | | | | | | | Summary: A COFF stub indirects the reference to a symbol through memory. A .refptr.$sym global variable pointer is created to refer to $sym. Typically mingw uses these for external global variable declarations, but we can use them for weak function declarations as well. Updates the dso_local classification to add a special case for extern_weak symbols on COFF in both clang and LLVM. Fixes PR37598 Reviewers: smeenai, mstorsjo Subscribers: hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D61615 llvm-svn: 360207
* [analyzer] Fix a crash when doing RVO from within blocks.Artem Dergachev2019-05-072-0/+24
| | | | | | | | | | When looking for the location context of the call site, unwrap block invocation contexts because they are attached to the current AnalysisDeclContext while what we need is the previous AnalysisDeclContext. Differential Revision: https://reviews.llvm.org/D61545 llvm-svn: 360202
* -frewrite-imports: Add support for wildcard rules in umbrella modules withDavid Blaikie2019-05-074-4/+55
| | | | | | | | | | This trips over a few other limitations, but in the interests of incremental development I'm starting here & I'll look at the issues with -verify and filesystem checks (the fact that the behavior depends on the existence of a 'foo' directory even though it shouldn't need it), etc. Reviewers: rsmith Differential Revision: https://reviews.llvm.org/D61656 llvm-svn: 360195
* Revert "[OpenMP][Clang] Support for target math functions"Jonas Devlieghere2019-05-0717-675/+431
| | | | | | | | | | | | | | This commit appears to be breaking stage-2 builds on GreenDragon. The OpenMP wrappers for cmath and math.h are copied into the root of the resource directory and cause a cyclic dependency in module 'Darwin': Darwin -> std -> Darwin. This blows up when CMake is testing for modules support and breaks all stage 2 module builds, including the ThinLTO bot and all LLDB bots. CMake Error at cmake/modules/HandleLLVMOptions.cmake:497 (message): LLVM_ENABLE_MODULES is not supported by this compiler llvm-svn: 360192
* [ASTImporter] Corrected type of integer constant in a test.Balazs Keri2019-05-071-2/+2
| | | | llvm-svn: 360156
* Add an explicit triple to this test to hopefully appease the build bots.Aaron Ballman2019-05-071-1/+1
| | | | llvm-svn: 360155
* [Tooling] Add -x flags when inferring compile commands for files with ↵Sam McCall2019-05-072-6/+12
| | | | | | | | | | | | | | | | no/invalid extension. Summary: We treat them as headers, as the motivating case is C++ standard library. Reviewers: kadircet Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61633 llvm-svn: 360153
* [OpenCL] Prevent mangling kernel functions.Anastasia Stulova2019-05-076-19/+56
| | | | | | | | | | | | Kernel function names have to be preserved as in the original source to be able to access them from the host API side. This commit also adds restriction to kernels that prevents them from being used in overloading, templates, etc. Differential Revision: https://reviews.llvm.org/D60454 llvm-svn: 360152
* Allow field offset lookups in types with incomplete arrays within libclang.Aaron Ballman2019-05-072-2/+41
| | | | | | Patch thanks to Jorn Vernee llvm-svn: 360147
* [ASTImporter] Import TemplateParameterLists in function templates.Balazs Keri2019-05-072-0/+39
| | | | | | | | | | | | | | | | Summary: Correct missing import of TemplateParameterList in function decl. Reviewers: martong, a.sidorin, shafik Reviewed By: martong Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60461 llvm-svn: 360132
* [Tooling] Don't mmap the JSONCompilationDatabase, it's not correct for ↵Sam McCall2019-05-071-1/+4
| | | | | | | | | | | | | | long-lived processes. Reviewers: ilya-biryukov Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61631 llvm-svn: 360122
* [Sema] Add missing VisitMacroQualifiedTypeLoc to TypeSpecLocFillerLeonard Chan2019-05-071-0/+5
| | | | | | To hopefully fix greenbot failures llvm-svn: 360120
* Improve function / variable disambiguation.Richard Smith2019-05-075-33/+46
| | | | | | | | Keep looking for decl-specifiers after an unknown identifier. Don't issue diagnostics about an error type specifier conflicting with later type specifiers. llvm-svn: 360117
* Recommit r359859 "[Attribute/Diagnostics] Print macro if definition is an ↵Leonard Chan2019-05-0733-20/+430
| | | | | | | | attribute declaration" Updated with fix for read of uninitialized memory. llvm-svn: 360109
* Fix typo in risc-v register aliases.Eric Christopher2019-05-071-1/+1
| | | | | | | | Patch by John. Differential Revision: https://reviews.llvm.org/D61464 llvm-svn: 360104
* [Clang][NewPM] Don't bail out if the target machine is emptyPetr Hosek2019-05-063-6/+11
| | | | | | | | | | | This matches the behavior of the old pass manager. There are some targets that don't have target machine at all (e.g. le32, spir) which whose tests would never run with new pass manager. Similarly, we would need to disable tests for targets that are disabled. Differential Revision: https://reviews.llvm.org/D58374 llvm-svn: 360100
* [Sema] Fix for P41774 where `ExpectNoDerefChunk` is assigned twiceLeonard Chan2019-05-061-5/+2
| | | | llvm-svn: 360089
* Revert "Re-commit r357452: SimplifyCFG SinkCommonCodeFromPredecessors: Also ↵Jordan Rupprecht2019-05-063-2/+3
| | | | | | | | | | sink function calls without used results (PR41259)" This reverts r357452 (git commit 21eb771dcb5c11d7500fa6ad551c97a921997f05). This was causing strange optimization-related test failures on an internal test. Will followup with more details offline. llvm-svn: 360086
* PR41183: Don't emit strict-prototypes warning for an implicit functionJames Y Knight2019-05-062-2/+11
| | | | | | | | | | | declaration. It should emit _only_ an implicit-function-declaration warning, not both of them. Differential Revision: https://reviews.llvm.org/D59711 llvm-svn: 360084
* [AArch64] Add __builtin_sponentry, for calling setjmp in MinGWMartin Storsjo2019-05-063-0/+16
| | | | | | | | | | | | In MinGW, setjmp isn't expanded as a builtin in the compiler (like it is for MSVC), but manually hooked up as calls to the right underlying functions in headers. Using the actual CRT's real setjmp/longjmp functions requires this intrinsic. (Currently this is worked around by using MinGW specific reimplementations of setjmp/longjmp on aarch64.) Differential Revision: https://reviews.llvm.org/D61592 llvm-svn: 360082
* [MinGW] Use SEH by default on AArch64Martin Storsjo2019-05-062-4/+5
| | | | | | | | The implementation of SEH is pretty mature at this point. Differential Revision: https://reviews.llvm.org/D61591 llvm-svn: 360081
* [OPENMP]Fix PR41767: diagnose DSA for variables in clauses withAlexey Bataev2019-05-068-15/+112
| | | | | | | | | | | default(none). If the combined directive has default(none) clause and has clauses for inner directive that reference some variables, for which data-sharing attributes are not specified, the error messages should be emitted for such variables. llvm-svn: 360073
* [OpenMP][Clang] Support for target math functionsGheorghe-Teodor Bercea2019-05-0617-431/+675
| | | | | | | | | | | | | | | | | | | | | | | Summary: In this patch we propose a temporary solution to resolving math functions for the NVPTX toolchain, temporary until OpenMP variant is supported by Clang. We intercept the inclusion of math.h and cmath headers and if we are in the OpenMP-NVPTX case, we re-use CUDA's math function resolution mechanism. Authors: @gtbercea @jdoerfert Reviewers: hfinkel, caomhin, ABataev, tra Reviewed By: hfinkel, ABataev, tra Subscribers: mgorny, guansong, cfe-commits, jdoerfert Tags: #clang Differential Revision: https://reviews.llvm.org/D61399 llvm-svn: 360063
* [OPENMP]Fix PR41768: check DSA for globals with `default(none)` clauses.Alexey Bataev2019-05-0639-66/+78
| | | | | | | | If the `default(none)` was specified for the construct, we might miss diagnostic for the globals without explicitly specified data-sharing attributes. Patch fixes this problem. llvm-svn: 360061
* [CodeComplete] Update python tests after r360042Ilya Biryukov2019-05-061-2/+2
| | | | llvm-svn: 360048
* [CodeComplete] Add a trailing semicolons to some pattern completionsIlya Biryukov2019-05-064-19/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Where semicolon is required in any case. Here's a list of completions that now have a semicolon: - namespace <name> = <target>; - using namespace <name>; - using <qualifier>::<name>; - continue; - break; - goto <label>; - return; - return <expression>; Reviewers: gribozavr Reviewed By: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61589 llvm-svn: 360042
* Revert r359949 "[clang] adding explicit(bool) from c++2a"Hans Wennborg2019-05-0645-1643/+360
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This caused Clang to start erroring on the following: struct S {   template <typename = int> explicit S(); }; struct T : S {}; struct U : T {   U(); }; U::U() {} $ clang -c /tmp/x.cc /tmp/x.cc:10:4: error: call to implicitly-deleted default constructor of 'T' U::U() {}    ^ /tmp/x.cc:5:12: note: default constructor of 'T' is implicitly deleted because base class 'S' has no default constructor struct T : S {};            ^ 1 error generated. See discussion on the cfe-commits email thread. This also reverts the follow-ups r359966 and r359968. > this patch adds support for the explicit bool specifier. > > Changes: > - The parsing for the explicit(bool) specifier was added in ParseDecl.cpp. > - The storage of the explicit specifier was changed. the explicit specifier was stored as a boolean value in the FunctionDeclBitfields and in the DeclSpec class. now it is stored as a PointerIntPair<Expr*, 2> with a flag and a potential expression in CXXConstructorDecl, CXXDeductionGuideDecl, CXXConversionDecl and in the DeclSpec class. > - Following the AST change, Serialization, ASTMatchers, ASTComparator and ASTPrinter were adapted. > - Template instantiation was adapted to instantiate the potential expressions of the explicit(bool) specifier When instantiating their associated declaration. > - The Add*Candidate functions were adapted, they now take a Boolean indicating if the context allowing explicit constructor or conversion function and this boolean is used to remove invalid overloads that required template instantiation to be detected. > - Test for Semantic and Serialization were added. > > This patch is not yet complete. I still need to check that interaction with CTAD and deduction guides is correct. and add more tests for AST operations. But I wanted first feedback. > Perhaps this patch should be spited in smaller patches, but making each patch testable as a standalone may be tricky. > > Patch by Tyker > > Differential Revision: https://reviews.llvm.org/D60934 llvm-svn: 360024
* [X86] Move files to correct directories after D60552Fangrui Song2019-05-064-0/+855
| | | | llvm-svn: 360022
* Enable intrinsics of AVX512_BF16, which are supported for BFLOAT16 in Cooper ↵Luo, Yuanke2019-05-0612-2/+80
| | | | | | | | | | | | | | | | | | | | | | | Lake Summary: 1. Enable infrastructure of AVX512_BF16, which is supported for BFLOAT16 in Cooper Lake; 2. Enable intrinsics for VCVTNE2PS2BF16, VCVTNEPS2BF16 and DPBF16PS instructions, which are Vector Neural Network Instructions supporting BFLOAT16 inputs and conversion instructions from IEEE single precision. For more details about BF16 intrinsic, please refer to the latest ISE document: https://software.intel.com/en-us/download/intel-architecture-instruction-set-extensions-programming-reference Patch by LiuTianle Reviewers: craig.topper, smaslov, LuoYuanke, wxiao3, annita.zhang, spatel, RKSimon Reviewed By: craig.topper Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60552 llvm-svn: 360018
* P1286R2: Remove restriction that the exception specification of aRichard Smith2019-05-0613-125/+105
| | | | | | defaulted special member matches the implicit exception specification. llvm-svn: 360011
* Use DiagRuntimeBehavior for -Wunsequenced to weed out false positivesRichard Smith2019-05-067-23/+43
| | | | | | | | | where either the modification or the other access is unreachable. This reverts r359984 (which reverted r359962). The bug in clang-tidy's test suite exposed by the original commit was fixed in r360009. llvm-svn: 360010
* [c++20] Implement P1009R2: allow omitting the array bound in an arrayRichard Smith2019-05-0619-80/+170
| | | | | | | | | | new expression. This was voted into C++20 as a defect report resolution, so we retroactively apply it to all prior language modes (though it can never actually be used before C++11 mode). llvm-svn: 360006
* The 'CodeGenObjC/illegal-UTF8.m' get failed with Clang built with 32-bit ↵Galina Kistanova2019-05-061-1/+1
| | | | | | | | | | | | | | targets only (as example ARM-only) with the following error: error: unable to create target: 'No available targets are compatible with triple "< ... any 64-bit target triple ... >"' I didn't find any 64-bit dependencies for the test and I think removing '-m64' option should fix the problem and allow this test for any target specified by LLVM_DEFAULT_TARGET_TRIPLE. Patch by Vlad Vereschaka. Differential Revision: https://reviews.llvm.org/D61345 llvm-svn: 360005
* [analyzer][UninitializedObjectChecker] PR41741: Regard all scalar types as ↵Kristof Umann2019-05-052-8/+36
| | | | | | | | | | | | | | | | | | | | primitive. https://bugs.llvm.org/show_bug.cgi?id=41741 Pretty much the same as D61246 and D61106, this time for __complex__ types. Upon further investigation, I realized that we should regard all types Type::isScalarType returns true for as primitive, so I merged isMemberPointerType(), isBlockPointerType() and isAnyComplexType()` into that instead. I also stumbled across yet another bug, https://bugs.llvm.org/show_bug.cgi?id=41753, but it seems to be unrelated to this checker. Differential Revision: https://reviews.llvm.org/D61569 llvm-svn: 359998
* Revert rL359962 : Use DiagRuntimeBehavior for -Wunsequenced to weed out ↵Simon Pilgrim2019-05-057-43/+23
| | | | | | | | | | false positives where either the modification or the other access is unreachable. ........ Try to fix buildbots llvm-svn: 359984
* [clang] fixing -ast-print for variadic parameter pack in lambda captureNicolas Lesser2019-05-052-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: currently for: ``` template<typename ... T> void f(T... t) { auto l = [t...]{}; } ``` `clang -ast-print file.cpp` outputs: ``` template <typename ...T> void f(T ...t) { auto l = [t] { } ; } ``` notice that there is not `...` in the capture list of the lambda. this patch fixes this issue. and add test for it. Patch by Tyker Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61556 llvm-svn: 359980
* [C++] Interpret unknown identifier in parameter clause as unknown typeNicolas Lesser2019-05-053-4/+5
| | | | | | instead of as parameter name without a type. llvm-svn: 359979
OpenPOWER on IntegriCloud