Don't warn about addresses of stack-allocated blocks escaping if the block
region was cast with CK_CopyAndAutoreleaseBlockObject. These casts, which
are introduced in the implicit conversion operator for lambda-to-block
conversions, cause the block to be copied to the heap -- so the warning is
spurious.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254639 91177308-0d34-0410-b5e6-96231b3b80d8
These additions were meant to go in as a part of r254554; while it's
certainly nice to have new functionality, it's nicer if we have tests to
go with it. :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254632 91177308-0d34-0410-b5e6-96231b3b80d8
After, properties from class extensions no longer show up in
ObjCInterfaceDecl::properties(). Make ObjCCommonMac::EmitPropertyList()
explicitly look for properties in class extensions before looking at
direct properties.
Also add a test that passes both with clang before r251874 and after this
patch (but fails with r251874 and without this patch).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254622 91177308-0d34-0410-b5e6-96231b3b80d8
r249143 added test/Driver/darwin-ld-lto.c which requires libLTO.dylib
to pass, but when running `ninja check-clang` in a fresh build directory
nothing caused libLTO.dylib to be built and the test would fail.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254612 91177308-0d34-0410-b5e6-96231b3b80d8
This reverts commit r254143 which introduces a crash on the following input:
f(char *);
g(char *);
#pragma weak f = g
int g(char *p) {}
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254605 91177308-0d34-0410-b5e6-96231b3b80d8
Run without flags if we cannot load a compilation database. This matches
the behavior of clang itself when simply called with a source file.
Based on a patch by Russell Wallace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254599 91177308-0d34-0410-b5e6-96231b3b80d8
This CL is for discussion how to better fix bit-filed layout compatibility issue with GCC (see PR25575 for test case and more details). Current clang behavior is compatible with GCC 4.1-4.3 series but it was fixed in 4.4+. Ignoring packed attribute looks very odd and because it was also fixed in GCC 4.4+, it makes sense also fix it in clang.
Differential Revision: http://reviews.llvm.org/D14872
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254596 91177308-0d34-0410-b5e6-96231b3b80d8
As discussed on the ml, backend tests need to be put in llvm/test/CodeGen/X86 as fast-isel tests using IR that is as close to what is generated here as possible.
The llvm tests will (re)added in a future commit
I will update PR24580 on this new plan
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254594 91177308-0d34-0410-b5e6-96231b3b80d8
side-effect, so that we don't allow speculative evaluation of such expressions
during code generation.
This caused a diagnostic quality regression, so fix constant expression
diagnostics to prefer either the first "can't be constant folded" diagnostic or
the first "not a constant expression" diagnostic depending on the kind of
evaluation we're doing. This was always the intent, but didn't quite work
correctly before.
This results in certain initializers that used to be constant initializers to
no longer be; in particular, things like:
float f = 1e100;
are no longer accepted in C. This seems appropriate, as such constructs would
lead to code being executed if sanitizers are enabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254574 91177308-0d34-0410-b5e6-96231b3b80d8
`pass_object_size` is our way of enabling `__builtin_object_size` to
produce high quality results without requiring inlining to happen
everywhere.
A link to the design doc for this attribute is available at the
Differential review link below.
Differential Revision: http://reviews.llvm.org/D13263
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254554 91177308-0d34-0410-b5e6-96231b3b80d8
This patch is a fix to r252901 which changed the behavior of
clang driver. In the presence of "-nostdlib" none of the standard
libraries should be passed to link line.
Differential Revision: http://reviews.llvm.org/D15130
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254535 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This patch implements the 4.5 specification for the implicit data maps. OpenMP 4.5 specification changes the default way data is captured into a target region. All the non-aggregate kinds are passed by value by default. This required activating the capturing by value during SEMA for the target region. All the non-aggregate values that can be encoded in the size of a pointer are properly casted and forwarded to the runtime library. On top of fixing the previous weird behavior for mapping pointers in nested data regions (an explicit map was always required), this also improves performance as the number of allocations/transactions to the device per non-aggregate map are reduced from two to only one - instead of passing a reference and the value, only the value passed.
Explicit maps will be added later on once firstprivate, private, and map clauses' SEMA and parsing are available.
Reviewers: hfinkel, rjmccall, ABataev
Subscribers: cfe-commits, carlo.bertolli
Differential Revision: http://reviews.llvm.org/D14940
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254521 91177308-0d34-0410-b5e6-96231b3b80d8
The host libstdc++ may be horribly broken and we want the fake one to be
picked up. This workaround is lame but I don't see a better way.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254446 91177308-0d34-0410-b5e6-96231b3b80d8
OpenMP 4.5 defines new clause 'priority' for 'task', 'taskloop' and 'taskloop simd' directives. Added parsing and sema analysis for 'priority' clause in 'task' and 'taskloop' directives.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254398 91177308-0d34-0410-b5e6-96231b3b80d8
Use undefined instead of setzero as the pass through input since its going to be fully overwritten. Use cmpeq of two zero vectors to produce the all 1s vector. Casting -1 to a double and vectorizing causes a constant load of a -1.0 floating point value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254389 91177308-0d34-0410-b5e6-96231b3b80d8
type changes when the initializer is attached). Don't hold onto the
GlobalVariable*; recompute it from the VarDecl* instead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254359 91177308-0d34-0410-b5e6-96231b3b80d8
Function types can be extracted from member pointer types.
However, the type is not appropriate without first adjusting the calling
convention.
This fixes PR25661.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254323 91177308-0d34-0410-b5e6-96231b3b80d8