summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* When instantiating a friend function template, don't forget to inherit ↵Richard Smith2017-05-101-0/+16
| | | | | | default template arguments from other declarations. llvm-svn: 302603
* [ubsan] Mark overflow checks with !nosanitizeVedant Kumar2017-05-091-5/+5
| | | | | | | | | Sanitizer instrumentation generally needs to be marked with !nosanitize, but we're not doing this properly for ubsan's overflow checks. r213291 has more information about why this is needed. llvm-svn: 302598
* Don't mark a member as a member specialization until we know we're keeping ↵Richard Smith2017-05-093-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | the specialization. This improves our behavior in a few ways: * We now guarantee that if a member is marked as being a member specialization, there will actually be a member specialization declaration somewhere on its redeclaration chain. This fixes a crash in modules builds where we would try to check that there was a visible declaration of the member specialization and be surprised to not find any declaration of it at all. * We don't set the source location of the in-class declaration of the member specialization to the out-of-line declaration's location until we have actually finished merging them. This fixes some very silly looking diagnostics, where we'd point a "previous declaration is here" note at the same declaration we're complaining about. Ideally we wouldn't mess with the prior declaration's location at all, but too much code assumes that the first declaration of an entity is a reasonable thing to use as an indication of where it was declared, and that's not really true for a member specialization unless we fake it like this. llvm-svn: 302596
* Fix clang_cl argument in fsanitize.c driver test.Evgeniy Stepanov2017-05-091-2/+2
| | | | llvm-svn: 302594
* [Sema] Implement Core 2094: Trivial copy/move constructor for class with ↵Eric Fiselier2017-05-093-5/+34
| | | | | | | | | | | | | | | | volatile member Summary: This patch implements http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2094 which reverts Core 496. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D32984 llvm-svn: 302593
* [asan] A clang flag to enable ELF globals-gc.Evgeniy Stepanov2017-05-092-2/+20
| | | | | | | | | | | | This feature is subtly broken when the linker is gold 2.26 or earlier. See the following bug for details: https://sourceware.org/bugzilla/show_bug.cgi?id=19002 Since the decision needs to be made at compilation time, we can not test the linker version. The flag is off by default on ELF targets, and on otherwise. llvm-svn: 302591
* Update testcase for upstream LLVM changes (r302469).Adrian Prantl2017-05-091-2/+4
| | | | llvm-svn: 302577
* [WebAssembly] Fix failing wasm-toolchain testSam Clegg2017-05-091-3/+3
| | | | | | | | This test was broken in r302558. Differential Revision: https://reviews.llvm.org/D33015 llvm-svn: 302569
* Revert r302547 ([mips] Impose a threshold for coercion of aggregates)Petar Jovanovic2017-05-091-38/+0
| | | | | | | | | | Reverting Modified MipsABIInfo::classifyArgumentType so that it now coerces aggregate structures only if the size of said aggregate is less than 16/64 bytes, depending on the ABI. as it broke clang-with-lto-ubuntu builder. llvm-svn: 302555
* [mips] Impose a threshold for coercion of aggregatesPetar Jovanovic2017-05-091-0/+38
| | | | | | | | | | | | Modified MipsABIInfo::classifyArgumentType so that it now coerces aggregate structures only if the size of said aggregate is less than 16/64 bytes, depending on the ABI. Patch by Stefan Maksimovic. Differential Revision: https://reviews.llvm.org/D32900 llvm-svn: 302547
* [CodeCompletion] Complete platform names in @available expressionsAlex Lorenz2017-05-091-0/+20
| | | | | | rdar://32074504 llvm-svn: 302545
* Revert r302476 "Update testcase for upstream LLVM changes."Hans Wennborg2017-05-091-4/+2
| | | | | | That test update was for r302469, which was reverted in r302533 due to PR32977. llvm-svn: 302542
* Add support for pretty platform names to `@available`/Alex Lorenz2017-05-094-24/+30
| | | | | | | | | | | | | `__builtin_available` This commit allows us to use the macOS/iOS/tvOS/watchOS platform names in `@available`/`__builtin_available`. rdar://32067795 Differential Revision: https://reviews.llvm.org/D33000 llvm-svn: 302540
* Reland "Warn about unused static file scope function template declarations."Vassil Vassilev2017-05-091-3/+15
| | | | | | | This patch reinstates r299930, reverted in r299956, as a separate diagnostic option (-Wunused-template). llvm-svn: 302518
* Fix PR32638 : Make sure we switch Sema's CurContext to the substituted ↵Faisal Vali2017-05-091-0/+7
| | | | | | | | | | | | | | | | | | | FunctionDecl when instantiating the exception specification. This fixes the bug: https://bugs.llvm.org/show_bug.cgi?id=32638 int main() { [](auto x) noexcept(noexcept(x)) { } (0); } In the above code, prior to this patch, when substituting into the noexcept expression, i.e. transforming the DeclRefExpr that represents 'x' - clang attempts to capture 'x' because Sema's CurContext is still pointing to the pattern FunctionDecl (i.e. the templated-decl set in FinishTemplateArgumentDeduction) which does not match the substituted 'x's DeclContext, which leads to an attempt to capture and an assertion failure. We fix this by adjusting Sema's CurContext to point to the substituted FunctionDecl under which the noexcept specifier's argument should be transformed, and so the ParmVarDecl that 'x' refers to has the same declcontext and no capture is attempted. I briefly investigated whether the SwitchContext should occur right after VisitMethodDecl creates the new substituted FunctionDecl, instead of only during instantiating the exception specification - but seeing no other code that seemed to rely on that, I decided to leave it just for the duration of the exception specification instantiation. llvm-svn: 302507
* [Sema] Make typeof(OverloadedFunctionName) not a pointer.George Burgess IV2017-05-092-0/+29
| | | | | | | | | | | | | | | | We were sometimes doing a function->pointer conversion in Sema::CheckPlaceholderExpr, which isn't the job of CheckPlaceholderExpr. So, when we saw typeof(OverloadedFunctionName), where OverloadedFunctionName referenced a name with only one function that could have its address taken, we'd give back a function pointer type instead of a function type. This is incorrect. I kept the logic for doing the function pointer conversion in resolveAndFixAddressOfOnlyViableOverloadCandidate because it was more consistent with existing ResolveAndFix* methods. llvm-svn: 302506
* [ODRHash] Loosen checks on typedefs.Richard Trieu2017-05-091-0/+33
| | | | | | | When a type in a class is from a typedef, only check the canonical type. Skip checking the intermediate underlying types. This is in response to PR 32965 llvm-svn: 302505
* [CodeGen][ObjC] Emit @objc_retain at -O0 for variables captured byAkira Hatanaka2017-05-092-2/+14
| | | | | | | | | | | blocks. r302270 made changes to avoid emitting clang.arc.use at -O0 and instead emit @objc_release. We also have to emit @objc_retain for the captured variable at -O0 to match the @objc_release instead of just storing the pointer to the capture field. llvm-svn: 302495
* [XRay] Add __xray_customeevent(...) as a clang-supported builtinDean Michael Berris2017-05-091-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We define the `__xray_customeevent` builtin that gets translated to IR calls to the correct intrinsic. The default implementation of this is a no-op function. The codegen side of this follows the following logic: - When `-fxray-instrument` is not provided in the driver, we elide all calls to `__xray_customevent`. - When `-fxray-instrument` is enabled and a function is marked as "never instrumented", we elide all calls to `__xray_customevent` in that function; if either marked as "always instrumented" or subject to threshold-based instrumentation, we emit a call to the `llvm.xray.customevent` intrinsic from LLVM for each `__xray_customevent` occurrence in the function. This change depends on D27503 (to land in LLVM first). Reviewers: echristo, rsmith Subscribers: mehdi_amini, pelikan, lrl, cfe-commits Differential Revision: https://reviews.llvm.org/D30018 llvm-svn: 302492
* [Modules] Allow umbrella frameworks to define private submodules for ↵Bruno Cardoso Lopes2017-05-0911-1/+46
| | | | | | | | | | | | subframeworks In r298391 we fixed the umbrella framework model to work when submodules named "Private" are used. This complements the work by allowing the umbrella framework model to work in general. rdar://problem/31790067 llvm-svn: 302491
* Update testcase for upstream LLVM changes.Adrian Prantl2017-05-081-2/+4
| | | | llvm-svn: 302476
* [Driver] Don't enable -fsanitize-use-after-scope when ASan is disabledVedant Kumar2017-05-081-1/+1
| | | | | | | | | | | | When enabling any sanitizer, -fsanitize-use-after-scope is enabled by default. This doesn't actually turn ASan on, because we've been getting lucky and there are extra checks in BackendUtil that stop this from happening. However, this has been causing a behavior change: extra lifetime markers are emitted in some cases where they aren't needed or expected. llvm-svn: 302468
* If we are building a module, and we read a second description of the sameRichard Smith2017-05-081-0/+5
| | | | | | | | module from a different module map, ignore it. This happens during builds of preprocessed modules (where it is harmless). llvm-svn: 302463
* [X86][LWP] Add __LWP__ macro testsSimon Pilgrim2017-05-082-0/+16
| | | | | | | | Missed in rL302418 Differential Revision: https://reviews.llvm.org/D32770 llvm-svn: 302445
* Fix grammar in comment. NFCJonathan Roelofs2017-05-081-2/+2
| | | | llvm-svn: 302443
* [Sema] Fix typos handling in an overloadable call.Anastasia Stulova2017-05-081-0/+7
| | | | | | | | | | | | | | | | In C typos in arguments in a call of an overloadable function lead to a failure of construction of CallExpr and following recovery does not handle created delayed typos. This causes an assertion fail in Sema::~Sema since Sema::DelayedTypos remains not empty. The patch fixes that behavior by handling a call with arguments having dependant types in the way that C++ does. Differential Revision: https://reviews.llvm.org/D31764 Patch by Dmitry Borisenkov! llvm-svn: 302435
* [X86][LWP] Add clang support for LWP instructions.Simon Pilgrim2017-05-081-0/+39
| | | | | | | | This patch adds support for the the LightWeight Profiling (LWP) instructions which are available on all AMD Bulldozer class CPUs (bdver1 to bdver4). Differential Revision: https://reviews.llvm.org/D32770 llvm-svn: 302418
* [OpenCL] Check that global samplers are constSven van Haastregt2017-05-081-1/+7
| | | | | | | | Patch by Simon Perretta. Differential Revision: https://reviews.llvm.org/D32856 llvm-svn: 302411
* [sanitizer-coverage] implement -fsanitize-coverage=no-prune,... instead of a ↵Kostya Serebryany2017-05-051-0/+4
| | | | | | hidden -mllvm flag. clang part. llvm-svn: 302320
* AArch64: fix weird edge case in ABI.Tim Northover2017-05-051-0/+67
| | | | | | | | | | | | | | | | | It turns out there are some sort-of-but-not-quite empty structs that break all the rules. For example: struct SuperEmpty { int arr[0]; }; struct SortOfEmpty { struct SuperEmpty e; }; Both of these have sizeof == 0, even in C++ mode, for GCC compatibility. The first one also doesn't occupy a register when passed by value in GNU C++ mode, unlike everything else. On Darwin, we want to ignore the lot (and especially don't want to try to use an i0 as we were). llvm-svn: 302313
* Permit keywords in module names in #pragma clang module *.Richard Smith2017-05-051-4/+5
| | | | | | | This is necessary to be able to build a libc++ module from preprocessed source (due to the submodule std.new). llvm-svn: 302312
* Add support for building modules from preprocessed source.Richard Smith2017-05-051-2/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support this, an optional marker "#pragma clang module contents" is recognized in module map files, and the rest of the module map file from that point onwards is treated as the source of the module. Preprocessing a module map produces the input module followed by the marker and then the preprocessed contents of the module. Ignoring line markers, a preprocessed module might look like this: module A { header "a.h" } #pragma clang module contents #pragma clang module begin A // ... a.h ... #pragma clang module end The preprocessed output generates line markers, which are not accepted by the module map parser, so -x c++-module-map-cpp-output should be used to compile such outputs. A couple of major parts do not work yet: 1) The files that are listed in the module map must exist on disk, in order to build the on-disk header -> module lookup table in the PCM file. To fix this, we need the preprocessed output to track the file size and other stat information we might use to build the lookup table. 2) Declaration ownership semantics don't work properly yet, since mapping from a source location to a module relies on mapping from FileIDs to modules, which we can't do if module transitions can occur in the middle of a file. llvm-svn: 302309
* [ARM] Limit the diagnose when an ISR calls a regular functionWeiming Zhao2017-05-051-4/+18
| | | | | | | | | | | | | | | | Summary: When the function is compiled with soft-float or on CPU with no FPU, we don't need to diagnose for a call from an ISR to a regular function. Reviewers: jroelofs, eli.friedman Reviewed By: jroelofs Subscribers: aemerson, rengolin, javed.absar, cfe-commits Differential Revision: https://reviews.llvm.org/D32918 llvm-svn: 302274
* CodeGen: avoid use of @clang.arc.use intrinsic at O0Saleem Abdulrasool2017-05-051-7/+25
| | | | | | | | | The clang.arc.use intrinsic is removed via the ARC Contract Pass. This pass is only executed in optimized builds (>= opt level 1). Prevent the optimization implemented in SVN r301667 from triggering at optimization level 0 like every other ARC use intrinsic usage. llvm-svn: 302270
* Warn that the [] spelling of uuid(...) is deprecated.Nico Weber2017-05-053-3/+3
| | | | | | https://reviews.llvm.org/D32879 llvm-svn: 302255
* Add a fix-it for -Wunguarded-availabilityAlex Lorenz2017-05-053-1/+122
| | | | | | | | | | | | | This patch adds a fix-it for the -Wunguarded-availability warning. This fix-it is similar to the Swift one: it suggests that you wrap the statement in an `if (@available)` check. The produced fixits are indented (just like the Swift ones) to make them look nice in Xcode's fix-it preview. rdar://31680358 Differential Revision: https://reviews.llvm.org/D32424 llvm-svn: 302253
* [ObjC] Don't disallow vector parameters/return values in methodsAlex Lorenz2017-05-051-9/+2
| | | | | | | | | | | whose introduced version is lower than the allowed version. We should just rely on the target version as this introduced version can lead to false positives (e.g. deprecated declarations). rdar://31964333 llvm-svn: 302250
* Introduce Wzero-as-null-pointer-constant.Nico Weber2017-05-051-0/+27
| | | | | | | | | Add an opt-in warning that fires when 0 is used as a null pointer. gcc has this warning, and there's some demand for it. https://reviews.llvm.org/D32914 llvm-svn: 302247
* [Driver] Add a "-mmacos_version_min" option that's an alias forAlex Lorenz2017-05-051-0/+4
| | | | | | | | | | | | | | "-mmacosx_version_min" The option -mmacosx_version_min will still be the canonical option for now, but in the future we will switch over to -mmacos_version_min and make -mmacosx_version_min an alias instead. rdar://27043820 Differential Revision: https://reviews.llvm.org/D32796 llvm-svn: 302240
* Document that Multilib flags must be actual flagsJonathan Roelofs2017-05-051-0/+14
| | | | | | | | This is because -print-multi-lib depends on them being flags for correctness. Fixes a case of this in the arm-android multilib selection logic. llvm-svn: 302207
* Fix whitespace before token-paste of an argument.James Y Knight2017-05-042-7/+25
| | | | | | | | | | | | | | | The whitespace should come from the argument name in the macro expansion, rather than from the token passed to the macro (same as it does when not pasting). Added a new test case for the change in behavior to stringize_space.c. FileCheck'ized macro_paste_commaext.c, tweaked the test case, and added a comment; no behavioral change to this test. Differential Revision: https://reviews.llvm.org/D30427 llvm-svn: 302195
* Fix bugs checking va_start in lambdas and erroneous contextsReid Kleckner2017-05-042-4/+59
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: First, getCurFunction looks through blocks and lambdas, which is wrong. Inside a lambda, va_start should refer to the lambda call operator prototype. This fixes PR32737. Second, we shouldn't use any of the getCur* methods, because they look through contexts that we don't want to look through (EnumDecl, CapturedStmtDecl). We can use CurContext directly as the calling context. Finally, this code assumed that CallExprs would never appear outside of code contexts (block, function, obj-c method), which is wrong. Struct member initializers are an easy way to create and parse exprs in a non-code context. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D32761 llvm-svn: 302188
* Driver: only inject libstdc++ paths when needed on CrossWindowsSaleem Abdulrasool2017-05-041-4/+9
| | | | | | | | When building with libc++ don't bother with injecting the libstdc++ search paths into the linker search path. This will make it easier to switch between ld and lld. llvm-svn: 302184
* [ms-inline-asm] Use the frontend size only for ambiguous instructionsReid Kleckner2017-05-046-89/+192
| | | | | | | | | | | | | | | | | | This avoids problems on code like this: char buf[16]; __asm { movups xmm0, [buf] mov [buf], eax } The frontend size in this case (1) is wrong, and the register makes the instruction matching unambiguous. There are also enough bytes available that we shouldn't complain to the user that they are potentially using an incorrectly sized instruction to access the variable. Supersedes D32636 and D26586 and fixes PR28266 llvm-svn: 302179
* Re-apply r302108, "IR: Use pointers instead of GUIDs to represent edges in ↵Peter Collingbourne2017-05-041-0/+4
| | | | | | | | the module summary. NFCI." with a fix for the clang backend. llvm-svn: 302176
* DiagnosticsEngine should clear DelayedDiagID before reporting theAlex Lorenz2017-05-041-0/+29
| | | | | | | | | | | | | | | | | | | | | delayed diagnostic This fix avoids an infinite recursion that was uncovered in one of our internal tests by r301992. The testcase is the most reduced version of that auto-generated test. This is an improved version of the reverted commit r302037. The previous fix actually managed to expose another subtle bug whereby `fatal_too_many_errors` error was reported twice, with the second report setting the `FatalErrorOccurred` flag. That prevented the notes that followed the diagnostic the caused `fatal_too_many_errors` to be emitted. This commit ensures that notes that follow `fatal_too_many_errors` but that belong to the diagnostic that caused `fatal_too_many_errors` won't be emitted by setting the `FatalErrorOccurred` when emitting `fatal_too_many_errors`. rdar://31962618 llvm-svn: 302151
* [Index] The relation between the declarations in templateAlex Lorenz2017-05-041-27/+26
| | | | | | | | | | specializations that 'override' declarations in the base template should use the 'specializationOf' relation instead of 'specializationOf | overrideOf'. The indexer relations are meant to be orthogonal, so 'specializationOf' is better than the combined relation. llvm-svn: 302136
* [ARM] ACLE Chapter 9 intrinsicsSam Parker2017-05-041-4/+389
| | | | | | | | | | Implemented the remaining integer data processing intrinsics from the ARM ACLE v2.1 spec, such as parallel arithemtic and DSP style multiplications. Differential Revision: https://reviews.llvm.org/D32282 llvm-svn: 302131
* [OpenCL] Add intel_reqd_sub_group_size attribute supportXiuli Pan2017-05-043-1/+10
| | | | | | | | | | | | | | | | Summary: Add intel_reqd_sub_group_size attribute support as intel extension cl_intel_required_subgroup_size from https://www.khronos.org/registry/OpenCL/extensions/intel/cl_intel_required_subgroup_size.txt Reviewers: Anastasia, bader, hfinkel, pxli168 Reviewed By: Anastasia, bader, pxli168 Subscribers: cfe-commits, yaxunl Differential Revision: https://reviews.llvm.org/D30805 llvm-svn: 302125
* Add #pragma clang module begin/end pragmas and generate them when ↵Richard Smith2017-05-044-12/+107
| | | | | | | | | | | | | | preprocessing a module. These pragmas are intended to simulate the effect of entering or leaving a file with an associated module. This is not completely implemented yet: declarations between the pragmas will not be attributed to the correct module, but macro visibility is already functional. Modules named by #pragma clang module begin must already be known to clang (in some module map that's either loaded or on the search path). llvm-svn: 302098
OpenPOWER on IntegriCloud