summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [Sema] Do not match function type with const T in template argument deductionLei Liu2018-05-034-16/+49
| | | | | | | | | | | From http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1584, function type should not match cv-qualified type in template argument deduction. This also matches what GCC and EDG do in template argument deduction. Differential Revision: https://reviews.llvm.org/D45755 llvm-svn: 331424
* [ObjC] Supress the 'implementing unavailable method' warning whenAlex Lorenz2018-05-034-6/+48
| | | | | | | | | | | | | the method declaration is unavailable for an app extension platform Rationale: Classes are often shared between an app extension code and non-app extension code. There's no way to remove the implementation using preprocessor when building the app extension, so we should not warn here. rdar://38150617 llvm-svn: 331421
* [gcov] Make the CLang side coverage test work with the newChandler Carruth2018-05-021-7/+15
| | | | | | | | | instrumentation codegeneration strategy of using a data structure and a loop. Required some finesse to get the critical things being tested to surface in a nice way for FileCheck but I think this preserves the original intent of the test. llvm-svn: 331411
* [ObjC] The absence of ownership qualifiers on an ambiguous property leadsAlex Lorenz2018-05-022-4/+49
| | | | | | | | | to synthesis of a valid property even when the selected protocol property has ownership qualifiers rdar://39024725 llvm-svn: 331409
* [analyzer] Revert r331096 "CStringChecker: Add support for BSD strlcpy()...".Artem Dergachev2018-05-021-39/+2
| | | | | | | | | The return values of the newly supported functions were not handled correctly: strlcpy()/strlcat() return string sizes rather than pointers. Differential Revision: https://reviews.llvm.org/D45177 llvm-svn: 331401
* [X86] Mark all x86 specific builtins as nothrow.Craig Topper2018-05-022-1763/+1763
| | | | | | | | | | | | I believe all of the x86 builtins should be considered nothrow. I've left the incssp builtins alone because I think its current attributes are wrong and I'm following up with the contributor for that. I plan to start adding const as well, but that requires more careful auditing. Differential Revision: https://reviews.llvm.org/D46328 llvm-svn: 331399
* [OPENMP] Add support for reductions on simd directives in targetAlexey Bataev2018-05-022-19/+73
| | | | | | | | regions. Added codegen for `simd reduction()` constructs in target directives. llvm-svn: 331393
* Revert "Emit an error when mixing <stdatomic.h> and <atomic>"Volodymyr Sapsai2018-05-022-14/+0
| | | | | | | | | | | | | It reverts r331378 as it caused test failures ThreadSanitizer-x86_64 :: Darwin/gcd-groups-destructor.mm ThreadSanitizer-x86_64 :: Darwin/libcxx-shared-ptr-stress.mm ThreadSanitizer-x86_64 :: Darwin/xpc-race.mm Only clang part of the change is reverted, libc++ part remains as is because it emits error less aggressively. llvm-svn: 331392
* [Driver] Infer Android sysroot location.Dan Albert2018-05-021-0/+9
| | | | | | | | | | | | | | | | Summary: Android toolchains include their headers and libraries in a self-contained directory within the toolchain. Reviewers: srhines Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45291 llvm-svn: 331390
* [Driver] Obey computed sysroot when finding libc++ headers.Dan Albert2018-05-021-2/+3
| | | | | | | | | | | | | | | | Summary: A handful of targets will try some default paths if --sysroot is not provided. If that is the case, it should be used for the libc++ header paths. Reviewers: srhines, EricWF Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45292 llvm-svn: 331389
* [OPENMP] Analyze the type of the mapped entity instead of its base.Alexey Bataev2018-05-022-2/+17
| | | | | | | If the mapped entity is a data member, we erroneously checked the type of its base rather than the type of the mapped entity itself. llvm-svn: 331385
* Emit an error when mixing <stdatomic.h> and <atomic>Volodymyr Sapsai2018-05-022-0/+14
| | | | | | | | | | | | | | | | | | | | | Atomics in C and C++ are incompatible at the moment and mixing the headers can result in confusing error messages. Emit an error explicitly telling about the incompatibility. Introduce the macro `__ALLOW_STDC_ATOMICS_IN_CXX__` that allows to choose in C++ between C atomics and C++ atomics. rdar://problem/27435938 Reviewers: rsmith, EricWF, mclow.lists Reviewed By: mclow.lists Subscribers: jkorous-apple, christof, bumblebritches57, JonChesterfield, smeenai, cfe-commits Differential Revision: https://reviews.llvm.org/D45470 llvm-svn: 331378
* [OPENMP] Do not emit warning for implicitly declared target functions.Alexey Bataev2018-05-022-16/+18
| | | | | | | Since upcoming OpenMP 5.0 functions can be mapped implicitly as declare target and we should not emit warnings for such functions. llvm-svn: 331377
* [OPENMP] Enable c++ exceptions outside of the target constructs iff they areAlexey Bataev2018-05-025-2/+83
| | | | | | | | | | enabled for the host. If the compilation for the host enables C++ exceptions, but they are not supported by the device, we still need to allow the code with the exception handling constructs outside of the target regions. llvm-svn: 331372
* Add -foutline option to enable the MachineOutliner in AArch64Jessica Paquette2018-05-023-0/+11
| | | | | | | | | | | | | Since we've been working on productizing the MachineOutliner in AArch64, it makes sense to provide a more user-friendly way to enable it. This allows users of AArch64 to enable the outliner using -foutline instead of -mllvm -enable-machine-outliner. Other, less mature implementations (e.g, x86-64) can still enable the pass using the -mllvm option. Also add a test to make sure it works. llvm-svn: 331370
* [OPENMP] Support C++ member functions in the device constructs.Alexey Bataev2018-05-024-14/+18
| | | | | | | Added correct emission of the C++ member functions for the device function when they are used in the device constructs. llvm-svn: 331365
* [analyzer] Fix filename in cross-file HTML reportMalcolm Parsons2018-05-022-1/+5
| | | | | | | | | | | | | | | | | Summary: The filename is currently taken from the start of the path, while the line and column are taken from the end of the path. This didn't matter until cross-file path reporting was added. Reviewers: george.karpenkov, dcoughlin, vlad.tsyrklevich Reviewed By: george.karpenkov, vlad.tsyrklevich Subscribers: xazax.hun, szepet, a.sidorin, cfe-commits Differential Revision: https://reviews.llvm.org/D45611 llvm-svn: 331361
* [OPENMP] Emit names of the globals depending on target.Alexey Bataev2018-05-024-75/+141
| | | | | | | | Some symbols are not allowed to be used as names on some targets. Patch ries to unify the emission of the names of LLVM globals so they could be used on different targets. llvm-svn: 331358
* [analyzer] Add `TaintBugVisitor` to the ArrayBoundV2, DivideZero and VLASize.Henry Wong2018-05-024-26/+55
| | | | | | | | | | | | | | Summary: Add `TaintBugVisitor` to the ArrayBoundV2, DivideZero, VLASize to be able to indicate where the taint information originated from. Reviewers: NoQ, george.karpenkov, xazax.hun, a.sidorin Reviewed By: NoQ Subscribers: szepet, rnkovacs, cfe-commits, MTC Differential Revision: https://reviews.llvm.org/D46007 llvm-svn: 331345
* [ASTImporter] Fix isa cast assertPeter Szecsi2018-05-021-3/+7
| | | | | | | | | | | | | | | | | | | | | | | Do early return if we can't import the found decl for a member expr. This follows the pre-existing scheme, e.g with E->getMemberDecl(). E->getFoundDecl().getDecl() can be null when a member expression does not involve lookup. It may involve a lookup in case of a using directive which refers to a member function in a base class template. We faced this assert during the CTU analysis of google::protobuf v3.5.2. We tried hard to synthesize a minimal test example both by hand and by executing creduce on multiple files. Unfortunately, we were unable to reduce to such a minimal example, yet. Nevertheless, this fix solved the problem in protobuf. To reproduce the error one must execute the analyzer with -Xclang -analyzer-config -Xclang experimental-enable-naive-ctu-analysis=true -Xclang -analyzer-config -Xclang ctu-dir=/path/to/ctu_dir Patch by Gabor Marton! Differential Revision: https://reviews.llvm.org/D46019 llvm-svn: 331344
* [Modules] Allow @import to reach submodules in private module mapsBruno Cardoso Lopes2018-05-027-0/+38
| | | | | | | | | | | | | | | | | | | | A @import targeting a top level module from a private module map file (@import Foo_Private), would fail if there's any submodule declaration around (module Foo.SomeSub) in the same private module map. This happens because compileModuleImpl, when building Foo_Private, will start with the private module map and will not parse the public one, which leads to unsuccessful parsing of Foo.SomeSub, since top level Foo was never parsed. Declaring other submodules in the private module map is not common and should usually be avoided, but it shouldn't fail to build. Canonicalize compileModuleImpl to always look at the public module first, so that all necessary information is available when parsing the private one. rdar://problem/39822328 llvm-svn: 331322
* Track skipped files in dependency scanning.Volodymyr Sapsai2018-05-013-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | It's possible for a header to be a symlink to another header. In this case both will be represented by clang::FileEntry with the same UID and they'll use the same clang::HeaderFileInfo. If you include both headers and use some single-inclusion mechanism like a header guard or #import, one header will get a FileChanged callback, and another FileSkipped. So that we get an accurate dependency file, we therefore need to also implement the FileSkipped callback in dependency scanning. Patch by Pete Cooper. Reviewers: bruno, pete Reviewed By: bruno Subscribers: cfe-commits, jkorous, vsapsai Differential Revision: https://reviews.llvm.org/D30881 llvm-svn: 331319
* This test fails if there is no integrated assembler, so change the -c option ↵Douglas Yung2018-05-011-1/+1
| | | | | | to -S as it is not important to the test and allows it to pass when there is no integrated assembler. llvm-svn: 331318
* [libclang] Fix the type of 'int (Foo);'Shoaib Meenai2018-05-013-2/+22
| | | | | | | | | | | | | | | | libclang exposes the type of 'int (Foo);' (a global variable of type int called Foo) as CXType_Unexposed. This is because Clang represents Foo's type as ParenType{BuiltinType{Int}}, and libclang does not handle ParenType. Make libclang return CXType_Int as the type of 'int (Foo);' by unwrapping ParenType transparently. Patch by Matt Glazar. Differential Revision: https://reviews.llvm.org/D45713 llvm-svn: 331306
* [ARM] Remove redundant #if in test. NFCShoaib Meenai2018-05-011-4/+0
| | | | | | | | | | Both sides of this #if #include the same file. Drop the #if, leaving only the #include. Patch by Matt Glazar. Differential Revision: https://reviews.llvm.org/D45779 llvm-svn: 331305
* Fix bogus MSVC char8_t mangling.Richard Smith2018-05-012-2/+3
| | | | | | | This appears to have been caused by a bad automatic svn merge with r330225 attaching the 'case' label to the wrong block of code. :( llvm-svn: 331299
* Driver: fix an assertion with `-print-prog-name=`Saleem Abdulrasool2018-05-012-1/+12
| | | | | | | | | Fix an assertion when -print-prog-name= is invoked without parameter. Returns an empty string. Patch by Christian Bruel! llvm-svn: 331296
* Update existed CodeGen TBAA testsDanil Malyshev2018-05-016-47/+99
| | | | | | | | | | Reviewers: hfinkel, kosarev, rjmccall Reviewed By: rjmccall Differential Revision: https://reviews.llvm.org/D44616 llvm-svn: 331292
* Add Microsoft Mangling for OpenCL Half TypeErich Keane2018-05-012-2/+6
| | | | | | | | | | | | Half-type mangling is accomplished following the method introduced by Erich Keane for mangling _Float16. Updated the half.cl LIT test to cover this particular case. Patch By: vbridgers Differential Revision: https://reviews.llvm.org/D46131 llvm-svn: 331263
* [OPENMP] Emit template instatiation|specialization functions forAlexey Bataev2018-05-012-5/+18
| | | | | | | | | | devices. If the function is an instantiation|specialization of the template and is used in the device code, the definitions of such functions should be emitted for the device. llvm-svn: 331261
* [X86] directstore and movdir64b intrinsicsGabor Buella2018-05-0114-0/+141
| | | | | | | | | | Reviewers: spatel, craig.topper, RKSimon Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D45984 llvm-svn: 331249
* Fix up r331244 - the emitted definition is weak_odr linkage. Should getChandler Carruth2018-05-011-1/+1
| | | | | | | | the build bots to healthy again without a full revert. As the functionality added has nothing to do with linkage this seems unlikely to represent a deep or interesting bug in the patch. llvm-svn: 331245
* Implement P0482R2, support for char8_t type.Richard Smith2018-05-0148-19/+254
| | | | | | | | | | | | This is not yet part of any C++ working draft, and so is controlled by the flag -fchar8_t rather than a -std= flag. (The GCC implementation is controlled by a flag with the same name.) This implementation is experimental, and will be removed or revised substantially to match the proposal as it makes its way through the C++ committee. llvm-svn: 331244
* [ShadowCallStack] fix the docsKostya Serebryany2018-05-011-2/+2
| | | | llvm-svn: 331238
* [Modules] Fix testcases from r331232Bruno Cardoso Lopes2018-04-302-3/+2
| | | | llvm-svn: 331233
* [Modules] Handle ObjC/C ODR-like semantics for EnumConstantDeclBruno Cardoso Lopes2018-04-306-4/+44
| | | | | | | | | | | | | | Support for ObjC/C ODR-like semantics with structural equivalence checking was added back in r306918. There enums are handled and also checked for structural equivalence. However, at use time of EnumConstantDecl, support was missing for preventing ambiguous name lookup. Add the missing bits for properly merging EnumConstantDecl. rdar://problem/38374569 llvm-svn: 331232
* [CodeGen] Fix typo in comment form->from. NFCCraig Topper2018-04-301-1/+1
| | | | llvm-svn: 331231
* [docs] Fix docs/InternalsManual.rst heading.Fangrui Song2018-04-301-1/+1
| | | | llvm-svn: 331225
* [MC] Change AsmParser to leverage Assembler during evaluationNirav Dave2018-04-302-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | Teach AsmParser to check with Assembler for when evaluating constant expressions. This improves the handing of preprocessor expressions that must be resolved at parse time. This idiom can be found as assembling-time assertion checks in source-level assemblers. Note that this relies on the MCStreamer to keep sufficient tabs on Section / Fragment information which the MCAsmStreamer does not. As a result the textual output may fail where the equivalent object generation would pass. This can most easily be resolved by folding the MCAsmStreamer and MCObjectStreamer together which is planned for in a separate patch. Currently, this feature is only enabled for assembly input, keeping IR compilation consistent between assembly and object generation. Reviewers: echristo, rnk, probinson, espindola, peter.smith Reviewed By: peter.smith Subscribers: eraman, peter.smith, arichardson, jyknight, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D45164 llvm-svn: 331218
* AMDGPU: Add Vega12 and Vega20Matt Arsenault2018-04-308-2/+113
| | | | | | | | Changes by Matt Arsenault Konstantin Zhuravlyov llvm-svn: 331216
* clang-cl: Expose -fmerge-all-constantsHans Wennborg2018-04-302-1/+2
| | | | | | | Now that constant merging is off by default, we'd like a way to enable it on Windows. llvm-svn: 331214
* [OPENMP] Do not emit warning about non-declared target function params.Alexey Bataev2018-04-302-4/+4
| | | | | | | | We should not emit warning that the parameters are not marked as declare target, these declaration are local and cannot be marked as declare target. llvm-svn: 331211
* [Driver, CodeGen] rename options to disable an FP cast optimizationSanjay Patel2018-04-309-43/+49
| | | | | | | | | | | | | | As suggested in the post-commit thread for rL331056, we should match these clang options with the established vocabulary of the corresponding sanitizer option. Also, the use of 'strict' is well-known for these kinds of knobs, and we can improve the descriptive text in the docs. So this intends to match the logic of D46135 but only change the words. Matching LLVM commit to match this spelling of the attribute to follow shortly. Differential Revision: https://reviews.llvm.org/D46236 llvm-svn: 331209
* Regenerated AST Matchers doc.Alexander Kornienko2018-04-302-7/+9
| | | | | | Backported a minor fix to the comment in the header. llvm-svn: 331207
* [OPENMP] Do not crash on codegen for CXX member functions.Alexey Bataev2018-04-302-0/+9
| | | | | | | Non-static member functions should not be emitted as a standalone functions, this leads to compiler crash. llvm-svn: 331206
* [OPENMP] Do not crash on incorrect input data.Alexey Bataev2018-04-303-12/+63
| | | | | | | | Emit error messages instead of compiler crashing when the target region does not exist in the device code + fix crash when the location comes from macros. llvm-svn: 331195
* IWYU for llvm-config.h in clang. See r331124 for details.Nico Weber2018-04-3013-8/+5
| | | | llvm-svn: 331177
* Remove unnecessary indirection. No behavior change.Nico Weber2018-04-301-12/+6
| | | | llvm-svn: 331176
* [Targets] Implement getConstraintRegister for ARM and AArch64Mikhail Maltsev2018-04-305-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The getConstraintRegister method is used by semantic checking of inline assembly statements in order to diagnose conflicts between clobber list and input/output lists. Currently ARM and AArch64 don't override getConstraintRegister, so conflicts between registers assigned to variables in asm labels and clobber lists are not diagnosed. Such conflicts can cause assertion failures in the back end and even miscompilations. This patch implements getConstraintRegister for ARM and AArch64 targets. Since these targets don't have single-register constraints, the implementation is trivial and just returns the register specified in an asm label (if any). Reviewers: eli.friedman, javed.absar, thopre Reviewed By: thopre Subscribers: rengolin, eraman, rogfer01, myatsina, kristof.beyls, cfe-commits, chrib Differential Revision: https://reviews.llvm.org/D45965 llvm-svn: 331164
* PR37189 Fix incorrect end source location and spelling for a split '>>' token.Richard Smith2018-04-3035-216/+379
| | | | | | | | | | | | | | | | | | When a '>>' token is split into two '>' tokens (in C++11 onwards), or (as an extension) when we do the same for other tokens starting with a '>', we can't just use a location pointing to the first '>' as the location of the split token, because that would result in our miscomputing the length and spelling for the token. As a consequence, for example, a refactoring replacing 'A<X>' with something else would sometimes replace one character too many, and similarly diagnostics highlighting a template-id source range would highlight one character too many. Fix this by creating an expansion range covering the first character of the '>>' token, whose spelling is '>'. For this to work, we generalize the expansion range of a macro FileID to be either a token range (the common case) or a character range (used in this new case). llvm-svn: 331155
OpenPOWER on IntegriCloud