summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [XRay][clang] Only run driver test for Linux and FreeBSDDean Michael Berris2018-04-061-0/+2
| | | | | | | | | This is a follow-up to D45354, which we should have only been running on Linux and FreeBSD for specific targets. Differential Revision: https://reviews.llvm.org/D45354 llvm-svn: 329378
* [XRay][clang] Add a flag to enable/disable linking XRay deps explicitlyDean Michael Berris2018-04-061-0/+6
| | | | | | | | | | | | | | | | | | | | Summary: This change introduces `-fxray-link-deps` and `-fnoxray-link-deps`. The `-fnoxray-link-deps` allows for directly controlling which specific XRay runtime to link. The default is for clang to link the XRay runtime that is shipped with the compiler (if there are any), but users may want to explicitly add the XRay dependencies from other locations or other means. Reviewers: eizan, echristo, chandlerc Reviewed By: eizan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45354 llvm-svn: 329376
* Fix test added in r329301 to work properly with Windows paths.Douglas Yung2018-04-051-4/+4
| | | | llvm-svn: 329361
* Add a couple more tests for DR372.Richard Smith2018-04-051-0/+19
| | | | llvm-svn: 329352
* PR36992: do not store beyond the dsize of a class object unless we knowRichard Smith2018-04-051-0/+34
| | | | | | | | | | | | | | the tail padding is not reused. We track on the AggValueSlot (and through a couple of other initialization actions) whether we're dealing with an object that might share its tail padding with some other object, so that we can avoid emitting stores into the tail padding if that's the case. We still widen stores into tail padding when we can do so. Differential Revision: https://reviews.llvm.org/D45306 llvm-svn: 329342
* DR1672, DR1813, DR1881, DR2120: Implement recent fixes to "standardRichard Smith2018-04-057-2/+185
| | | | | | | | | | | | | | | | | layout" rules. The new rules say that a standard-layout struct has its first non-static data member and all base classes at offset 0, and consider a class to not be standard-layout if that would result in multiple subobjects of a single type having the same address. We track "is C++11 standard-layout class" separately from "is standard-layout class" so that the ABIs that need this information can still use it. Differential Revision: https://reviews.llvm.org/D45176 llvm-svn: 329332
* Remove the temporary availability checking workaround forAlex Lorenz2018-04-051-2/+2
| | | | | | | | the nested declarations in @interface. rdar://28825862 llvm-svn: 329324
* [ASTImporter] Fix for importing unnamed structsAleksei Sidorin2018-04-053-1/+133
| | | | | | | | Patch by Peter Szecsi! Differential Revision: https://reviews.llvm.org/D30876 llvm-svn: 329301
* Disable -fmerge-all-constants as default.Manoj Gupta2018-04-057-10/+21
| | | | | | | | | | | | | | | | | | | Summary: "-fmerge-all-constants" is a non-conforming optimization and should not be the default. It is also causing miscompiles when building Linux Kernel (https://lkml.org/lkml/2018/3/20/872). Fixes PR18538. Reviewers: rjmccall, rsmith, chandlerc Reviewed By: rsmith, chandlerc Subscribers: srhines, cfe-commits Differential Revision: https://reviews.llvm.org/D45289 llvm-svn: 329300
* [ObjC] Make C++ triviality type traits available to non-trivial CAkira Hatanaka2018-04-051-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | structs. r326307 and r327870 made changes that allowed using non-trivial C structs with fields qualified with __strong or __weak. This commit makes the following C++ triviality type traits available to non-trivial C structs: __has_trivial_assign __has_trivial_move_assign __has_trivial_copy __has_trivial_move_constructor __has_trivial_constructor __has_trivial_destructor This reapplies r328680. This commit fixes a bug where the copy/move __has_trivial_* traits would return false when a volatile type was being passed. Thanks to Richard Smith for pointing out the mistake. rdar://problem/33599681 Differential Revision: https://reviews.llvm.org/D44913 llvm-svn: 329289
* [PATCH] [RISCV] Extend getTargetDefines for RISCVTargetInfoShiva Chen2018-04-053-0/+94
| | | | | | | | | | | | | | Summary: This patch extend getTargetDefines and implement handleTargetFeatures and hasFeature. and define corresponding marco for those features. Reviewers: asb, apazos, eli.friedman Differential Revision: https://reviews.llvm.org/D44727 Patch by Kito Cheng. llvm-svn: 329278
* Revert r328680 ("[ObjC] Make C++ triviality type traits available to ↵Richard Smith2018-04-051-25/+0
| | | | | | | | | non-trivial C structs.") It unintentionally caused the values of the __has_* type traits to change in C++ for trivially-copyable classes with volatile members. llvm-svn: 329247
* [AST] Don't track lambda captures when checking a potential constant expression.Erik Pilkington2018-04-051-0/+33
| | | | | | | | Fixes PR36054. Differential revision: https://reviews.llvm.org/D45194 llvm-svn: 329244
* Enable msan unconditionally on Linux.Evgeniy Stepanov2018-04-041-3/+0
| | | | | | | | | | | | | | | | | | Memory sanitizer compatibility are already done in MemorySanitizer::doInitialization. It verifies whether the necessary offsets exist and bails out if not. For this reason it is no good to duplicate two checks in two projects. This patch removes clang check and postpones msan compatibility validation till MemorySanitizer::doInitialization. Another reason for this patch is to allow using msan with any CPU (given compatible runtime) and custom mapping provided via the arguments added by https://reviews.llvm.org/D44926. Patch by vit9696. Differential Revision: https://reviews.llvm.org/D44927 llvm-svn: 329241
* AArch64: Implement support for the shadowcallstack attribute.Peter Collingbourne2018-04-041-0/+13
| | | | | | | | | | | | The implementation of shadow call stack on aarch64 is quite different to the implementation on x86_64. Instead of reserving a segment register for the shadow call stack, we reserve the platform register, x18. Any function that spills lr to sp also spills it to the shadow call stack, a pointer to which is stored in x18. Differential Revision: https://reviews.llvm.org/D45239 llvm-svn: 329236
* [Driver] Include the Android multiarch includes.Dan Albert2018-04-0413-0/+25
| | | | | | | | | | | | | | | | Summary: Most Android headers live in a single directory, but a small handful live in multiarch directories. Reviewers: srhines Reviewed By: srhines Subscribers: javed.absar, cfe-commits Differential Revision: https://reviews.llvm.org/D44995 llvm-svn: 329234
* [CUDA] Add amdgpu sub archsYaxun Liu2018-04-041-0/+39
| | | | | | | | | Patch by Greg Rodgers. Revised and lit tests added by Yaxun Liu. Differential Revision: https://reviews.llvm.org/D45277 llvm-svn: 329232
* Revert "[CUDA] Check initializers of instantiated template variables."Artem Belevich2018-04-041-17/+0
| | | | | | | This (temporarily) reverts commit r329127 due to the problems it exposed in TensorFlow. llvm-svn: 329229
* [analyzer][test] Set C++14 as language standard for test depending on newJan Korous2018-04-041-1/+1
| | | | | | features llvm-svn: 329225
* Split test/Driver/darwin-sdkroot.c into two testsAlex Lorenz2018-04-042-56/+73
| | | | | | | | | | | The test additions in r329110 are Darwin-specific, as they rely on a code path that is reachabled when driver is invoked without -target. Instead of making the old test checks Darwin-specific too, let's simply split it into two files to ensure that the old checks are still platform-agnostic. Thanks Chandler for suggesting this! llvm-svn: 329141
* [ObjC] Use the name specified by objc_runtime_name instead of the classAkira Hatanaka2018-04-031-0/+24
| | | | | | | | | | | | | identifier. This patch fixes a few places in CGObjCMac.cpp where the class identifier was used instead of the name specified by objc_runtime_name. rdar://problem/37910822 Differential Revision: https://reviews.llvm.org/D45101 llvm-svn: 329128
* [CUDA] Check initializers of instantiated template variables.Artem Belevich2018-04-031-0/+17
| | | | | | | | | We were already performing checks on non-template variables, but the checks on templated ones were missing. Differential Revision: https://reviews.llvm.org/D45231 llvm-svn: 329127
* Add the -fsanitize=shadow-call-stack flagVlad Tsyrklevich2018-04-032-0/+31
| | | | | | | | | | | | | | | | | Summary: Add support for the -fsanitize=shadow-call-stack flag which causes clang to add ShadowCallStack attribute to functions compiled with that flag enabled. Reviewers: pcc, kcc Reviewed By: pcc, kcc Subscribers: cryptoad, cfe-commits, kcc Differential Revision: https://reviews.llvm.org/D44801 llvm-svn: 329122
* Add REQUIRES: darwin-system to test/Driver/darwin-sdkroot.cAlex Lorenz2018-04-031-0/+1
| | | | | | The test from r329110 is for Darwin only llvm-svn: 329113
* [driver][darwin] Do not infer -simulator environment for non-simulator SDKsAlex Lorenz2018-04-031-0/+55
| | | | | | rdar://36369832 llvm-svn: 329110
* [analyzer] Fix diagnostics in callees of interesting callees.Artem Dergachev2018-04-031-0/+302
| | | | | | | | | | | | | | | removeUnneededCalls() is responsible for removing path diagnostic pieces within functions that don't contain "interesting" events. It makes bug reports much tidier. When a stack frame is known to be interesting, the function doesn't descend into it to prune anything within it, even other callees that are totally boring. Fix the function to prune boring callees in interesting stack frames. Differential Revision: https://reviews.llvm.org/D45117 llvm-svn: 329102
* Revert "Set calling convention for CUDA kernel"Artem Belevich2018-04-031-29/+0
| | | | | | | This reverts r328795 which introduced an issue with referencing __global__ function templates. More details in the original review D44747. llvm-svn: 329099
* Restrict a test using named file descriptors to using the system shellDavid Blaikie2018-04-031-0/+1
| | | | llvm-svn: 329097
* [Hexagon] Remove -mhvx-double and the corresponding subtarget featureKrzysztof Parzyszek2018-04-031-21/+1
| | | | | | | Specifying the HVX vector length should be done via the -mhvx-length option. llvm-svn: 329077
* [Driver] Wire up the -f[no-]rtlib-add-rpath flag and testsPetr Hosek2018-04-021-14/+19
| | | | | | | | | | D30700 added the -f[no-]rtlib-add-rpath flag, but that flag was never wired up in the driver and tests were updated to check whether it actually does anything. This patch wires up the flag and updates test. Differential Revision: https://reviews.llvm.org/D45145 llvm-svn: 329032
* CodeGenCXX: support PreserveMostCC in MS ABISaleem Abdulrasool2018-04-021-4/+43
| | | | | | | | Microsoft has reserved 'U' for the PreserveMostCC which is used in the swift runtime. Add support for this. This allows the swift runtime to be built for Windows again. llvm-svn: 329025
* [MS] Emit vftable thunks for functions with incomplete prototypesReid Kleckner2018-04-022-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The following class hierarchy requires that we be able to emit a this-adjusting thunk for B::foo in C's vftable: struct Incomplete; struct A { virtual A* foo(Incomplete p) = 0; }; struct B : virtual A { void foo(Incomplete p) override; }; struct C : B { int c; }; This TU is valid, but lacks a definition of 'Incomplete', which makes it hard to build a thunk for the final overrider, B::foo. Before this change, Clang gives up attempting to emit the thunk, because it assumes that if the parameter types are incomplete, it must be emitting the thunk for optimization purposes. This is untrue for the MS ABI, where the implementation of B::foo has no idea what thunks C's vftable may require. Clang needs to emit the thunk without necessarily having access to the complete prototype of foo. This change makes Clang emit a musttail variadic call when it needs such a thunk. I call these "unprototyped" thunks, because they only prototype the "this" parameter, which must always come first in the MS C++ ABI. These thunks work, but they create ugly LLVM IR. If the call to the thunk is devirtualized, it will be a call to a bitcast of a function pointer. Today, LLVM cannot inline through such a call, but I want to address that soon, because we also use this pattern for virtual member pointer thunks. This change also implements an old FIXME in the code about reusing the thunk's computed CGFunctionInfo as much as possible. Now we don't end up computing the thunk's mangled name and arranging it's prototype up to around three times. Fixes PR25641 Reviewers: rjmccall, rsmith, hans Subscribers: Prazek, cfe-commits Differential Revision: https://reviews.llvm.org/D45112 llvm-svn: 329009
* Temporarily revert r328404:Eric Christopher2018-04-021-122/+0
| | | | | | | | | | | | | | commit 519b97132a4c960e8dedbfe4290d86970d92e995 Author: Richard Trieu <rtrieu@google.com> Date: Sat Mar 24 00:52:44 2018 +0000 [ODRHash] Support pointer and reference types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@328404 91177308-0d34-0410-b5e6-96231b3b80d8 As it's breaking some tests. I've communicated with Richard offline about testcases. llvm-svn: 329001
* [CUDA] Let device-side shared variables be initialized with undefYaxun Liu2018-04-022-36/+93
| | | | | | | | | | | CUDA shared variable should be initialized with undef. Patch by Greg Rodgers. Revised and lit test added by Yaxun Liu. Differential Revision: https://reviews.llvm.org/D44985 llvm-svn: 328994
* [coroutines] Add __builtin_coro_noop => llvm.coro.noopGor Nishanov2018-04-021-0/+3
| | | | | | | | | | | | | A recent addition to Coroutines TS (https://wg21.link/p0913) adds a pre-defined coroutine noop_coroutine that does nothing. To implement this feature, we implemented an llvm.coro.noop intrinsic that returns a coroutine handle to a coroutine that does nothing when resumed or destroyed. This patch adds a builtin __builtin_coro_noop() that maps to llvm.coro.noop intrinsic. Related llvm change: https://reviews.llvm.org/D45114 llvm-svn: 328993
* [Coroutines] Find custom allocators in class scopeBrian Gesiak2018-04-012-56/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: https://reviews.llvm.org/rL325291 implemented Coroutines TS N4723 section [dcl.fct.def.coroutine]/7, but it performed lookup of allocator functions within both the global and class scope, whereas the specified behavior is to perform lookup for custom allocators within just the class scope. To fix, add parameters to the `Sema::FindAllocationFunctions` function such that it can be used to lookup allocators in global scope, class scope, or both (instead of just being able to look up in just global scope or in both global and class scope). Then, use those parameters from within the coroutine Sema. This incorrect behavior had the unfortunate side-effect of causing the bug https://bugs.llvm.org/show_bug.cgi?id=36578 (or at least the reports of that bug in C++ programs). That bug would occur for any C++ user with a coroutine frame that took a single pointer argument, since it would then find the global placement form `operator new`, described in the C++ standard 18.6.1.3.1. This patch prevents Clang from generating code that triggers the LLVM assert described in that bug report. Test Plan: `check-clang` Reviewers: GorNishanov, eric_niebler, lewissbaker Reviewed By: GorNishanov Subscribers: EricWF, cfe-commits Differential Revision: https://reviews.llvm.org/D44552 llvm-svn: 328949
* Fix a major swiftcall ABI bug with trivial C++ class types.John McCall2018-04-011-0/+10
| | | | | | | | | | | | | | | | | | | | | | The problem with the previous logic was that there might not be any explicit copy/move constructor declarations, e.g. if the type is trivial and we've never type-checked a copy of it. Relying on Sema's computation seems much more reliable. Also, I believe Richard's recommendation is exactly the rule we use now on the Itanium ABI, modulo the trivial_abi attribute (which this change of course fixes our handling of in Swift). This does mean that we have a less portable rule for deciding indirectness for swiftcall. I would prefer it if we just applied the Itanium rule universally under swiftcall, but in the meantime, I need to fix this bug. This only arises when defining functions with class-type arguments in C++, as we do in the Swift runtime. It doesn't affect normal Swift operation because we don't import code as C++. llvm-svn: 328942
* [analyzer] Unroll the loop when it has a unsigned counter.Henry Wong2018-03-311-0/+23
| | | | | | | | | | | | | | | | | Summary: The original implementation in the `LoopUnrolling.cpp` didn't consider the case where the counter is unsigned. This case is only handled in `simpleCondition()`, but this is not enough, we also need to deal with the unsinged counter with the counter initialization. Since `IntegerLiteral` is `signed`, there is a `ImplicitCastExpr<IntegralCast>` in `unsigned counter = IntergerLiteral`. This patch add the `ignoringParenImpCasts()` in the `IntegerLiteral` matcher. Reviewers: szepet, a.sidorin, NoQ, george.karpenkov Reviewed By: szepet, george.karpenkov Subscribers: xazax.hun, rnkovacs, cfe-commits, MTC Differential Revision: https://reviews.llvm.org/D45086 llvm-svn: 328919
* [analyzer] Hopefully fix the ARM buildbot.George Karpenkov2018-03-312-10/+9
| | | | llvm-svn: 328913
* [analyzer] Fix assertion crash in CStringCheckerGeorge Karpenkov2018-03-311-0/+11
| | | | | | | | | | An offset might be unknown. rdar://39054939 Differential Revision: https://reviews.llvm.org/D45115 llvm-svn: 328912
* [analyzer] Fix liveness calculation for C++17 structured bindingsGeorge Karpenkov2018-03-311-0/+124
| | | | | | | | | | | | | C++ structured bindings for non-tuple-types are defined in a peculiar way, where the resulting declaration is not a VarDecl, but a BindingDecl. That means a lot of existing machinery stops working. rdar://36912381 Differential Revision: https://reviews.llvm.org/D44956 llvm-svn: 328910
* [analyzer] Fix test triple in missing-bind-temporary.cpp.Artem Dergachev2018-03-301-2/+2
| | | | | | | | | Otherwise the default triple for x86-windows-msvc2015 auto-inserts __attribute__((thiscall)) to some calls. Fixes the respective buildbot. llvm-svn: 328903
* [analyzer] Track null or undef values through pointer arithmetic.Artem Dergachev2018-03-302-3/+45
| | | | | | | | | | | | | | | | | | Pointer arithmetic on null or undefined pointers results in null or undefined pointers. This is obvious for undefined pointers; for null pointers it follows from our incorrect-but-somehow-working approach that declares that 0 (Loc) doesn't necessarily represent a pointer of numeric address value 0, but instead it represents any pointer that will cause a valid "null pointer dereference" issue when dereferenced. For now we've been seeing through pointer arithmetic at the original dereference expression, i.e. in bugreporter::getDerefExpr(), but not during further investigation of the value's origins in bugreporter::trackNullOrUndefValue(). The patch fixes it. Differential Revision: https://reviews.llvm.org/D45071 llvm-svn: 328896
* [CFG] [analyzer] Work around a disappearing CXXBindTemporaryExpr.Artem Dergachev2018-03-301-0/+130
| | | | | | | | | | | | | Sometimes template instantiation causes CXXBindTemporaryExpr to be missing in its usual spot. In CFG, temporary destructors work by relying on CXXBindTemporaryExprs, so they won't work in this case. Avoid the crash and notify the clients that we've encountered an unsupported AST by failing to provide the ill-formed construction context for the temporary. Differential Revision: https://reviews.llvm.org/D44955 llvm-svn: 328895
* [CFG] [analyzer] Avoid modeling C++17 constructors that aren't fully supported.Artem Dergachev2018-03-303-2/+66
| | | | | | | | | | | | | | Not enough work has been done so far to ensure correctness of construction contexts in the CFG when C++17 copy elision is in effect, so for now we should drop construction contexts in the CFG and in the analyzer when they seem different from what we support anyway. This includes initializations with conditional operators and return values across multiple stack frames. Differential Revision: https://reviews.llvm.org/D44854 llvm-svn: 328893
* Remove unused CHECK lines leftover from r306928.Eli Friedman2018-03-301-4/+0
| | | | | | | The RUN lines were removed, but the corresponding CHECK lines never went away. llvm-svn: 328891
* [OPENMP] Added emission of offloading data sections for declare targetAlexey Bataev2018-03-3033-375/+386
| | | | | | | | | | variables. Added emission of the offloading data sections for the variables within declare target regions + fixes emission of the declare target variables marked as declare target not within the declare target region. llvm-svn: 328888
* [Modules] Improve fixit for framework private module mapsBruno Cardoso Lopes2018-03-301-1/+1
| | | | | | | | | The wrong source range was being provided in some case, fix that to get a better fixit. rdar://problem/38520199 llvm-svn: 328857
* Adding UNSUPPORTED: system-windows at George's request until the problem can ↵Douglas Yung2018-03-301-0/+1
| | | | | | be debugged. llvm-svn: 328853
* [analyzer] Fix target triple for autorelease-write-checker testGeorge Karpenkov2018-03-291-1/+2
| | | | llvm-svn: 328837
OpenPOWER on IntegriCloud