]> granicus.if.org Git - clang/log
clang
9 years agoclang-format: Format Objective-C try blocks like all the other try blocks.
Nico Weber [Sat, 7 Feb 2015 01:57:32 +0000 (01:57 +0000)]
clang-format: Format Objective-C try blocks like all the other try blocks.

Before:

  @try {
    // ...
  }
  @finally {
    // ...
  }

Now:

  @try {
    // ...
  } @finally {
    // ...
  }

This is consistent with how we format C++ try blocks and SEH try blocks.
clang-format not doing this before was an implementation oversight.

This is dependent on BraceBreakingStyle.  The snippet above is with the
Attach style.  Style Stroustrip for example still results in the "Before:"
snippet, which makes sense since other blocks (try, else) break after '}' too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228483 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake the byte-shift SSE intrinsics emit vector shuffles which we know the backend...
Filipe Cabecinhas [Sat, 7 Feb 2015 01:37:09 +0000 (01:37 +0000)]
Make the byte-shift SSE intrinsics emit vector shuffles which we know the backend can handle.

Also removed unused builtins.

Original patch by Andrea Di Biagio!

Reviewers: craig.topper, nadav

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7199

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228481 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] Don't accidentally trigger deserialization from DeclContext::noload_lookup.
Richard Smith [Sat, 7 Feb 2015 00:45:52 +0000 (00:45 +0000)]
[modules] Don't accidentally trigger deserialization from DeclContext::noload_lookup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228475 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPR22405: don't lose implicit-deleted-ness across AST write / read.
Richard Smith [Fri, 6 Feb 2015 23:20:21 +0000 (23:20 +0000)]
PR22405: don't lose implicit-deleted-ness across AST write / read.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228464 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake this test a little less specific by removing the argument that
Eric Christopher [Fri, 6 Feb 2015 20:53:40 +0000 (20:53 +0000)]
Make this test a little less specific by removing the argument that
could change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228438 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoASTUnit: Fix a name clash in GCC builds.
Benjamin Kramer [Fri, 6 Feb 2015 18:58:04 +0000 (18:58 +0000)]
ASTUnit: Fix a name clash in GCC builds.

Should fix the build. Looks like GCC 4.9 is using different scoping rules for
range-based for loops.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228424 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoInline asm IR input register constraints don't have early clobber
Eric Christopher [Fri, 6 Feb 2015 18:44:18 +0000 (18:44 +0000)]
Inline asm IR input register constraints don't have early clobber
modifiers on them. If we have a matching output constraint with
an early clobber make sure we don't propagate that to the input
constraint.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228422 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoASTUnit: Use range-based for loops.
Benjamin Kramer [Fri, 6 Feb 2015 18:36:04 +0000 (18:36 +0000)]
ASTUnit: Use range-based for loops.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228420 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago-iframework option should be forwarded to linker
Steven Wu [Fri, 6 Feb 2015 18:08:29 +0000 (18:08 +0000)]
-iframework option should be forwarded to linker

Summary:
-iframework option is used to specified System framework path so the
path specified should be passed to linker as -F option
rdar://problem/18234544

Reviewers: bob.wilson

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7106

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228413 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake FileEntry::closeFile public
Ben Langmuir [Fri, 6 Feb 2015 17:34:28 +0000 (17:34 +0000)]
Make FileEntry::closeFile public

If you request that the file manager not close your file immediately
after reading, it's useful to be able to close it later to prevent a
file descriptor leak.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228407 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "OpenCL: handle shift operator with vector operands"
Tom Stellard [Fri, 6 Feb 2015 17:30:04 +0000 (17:30 +0000)]
Revert "OpenCL: handle shift operator with vector operands"

This reverts commit r228382.

This breaks the following case:  Reported by Jeroen Ketema:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20150202/122961.html

typedef __attribute__((ext_vector_type(3))) char char3;

void foo() {
 char3 v = {1,1,1};
 char3 w = {1,2,3};

 w <<= v;
}

If I compile with:

 clang -x cl file.c

Then an error is produced:

file.c:10:5: error: expression is not assignable
 w <<= v;
 ~ ^
1 error generated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228406 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate APIs that return a pair of iterators to return an iterator_range instead.
Benjamin Kramer [Fri, 6 Feb 2015 17:25:10 +0000 (17:25 +0000)]
Update APIs that return a pair of iterators to return an iterator_range instead.

Convert uses of those APIs into ranged for loops. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228404 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Re-disable linker optimizations for now
Bill Schmidt [Fri, 6 Feb 2015 15:31:03 +0000 (15:31 +0000)]
[PowerPC] Re-disable linker optimizations for now

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228402 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdded a test to check that exception flags are not passed by default on PS4.
Andrea Di Biagio [Fri, 6 Feb 2015 13:02:39 +0000 (13:02 +0000)]
Added a test to check that exception flags are not passed by default on PS4.

This patch adds an extra test case to clang-exception-flags.cpp.
No functional change intended.

Patch by Wolfgang Pieb!

Reviewers: filcab, alexr

Differential Revision: http://reviews.llvm.org/D7298

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228394 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoOpenCL: handle shift operator with vector operands
Sameer Sahasrabuddhe [Fri, 6 Feb 2015 05:44:55 +0000 (05:44 +0000)]
OpenCL: handle shift operator with vector operands

Introduce a number of checks:
1. If LHS is a scalar, then RHS cannot be a vector.
2. Operands must be of integer type.
3. If both are vectors, then the number of elements must match.

Relax the requirement for "usual arithmetic conversions":
When LHS is a vector, a scalar RHS can simply be expanded into a
vector; OpenCL does not require that its rank be lower than the LHS.
For example, the following code is not an error even if the implicit
type of the constant literal is "int".

  char2 foo(char2 v) { return v << 1; }

Consolidate existing tests under CodeGenOpenCL, and add more tests
under SemaOpenCL.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228382 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] If a module declares an entity and then imports another declaration
Richard Smith [Fri, 6 Feb 2015 02:42:59 +0000 (02:42 +0000)]
[modules] If a module declares an entity and then imports another declaration
of that entity, ensure that the redeclaration chain is reordered properly on
reload. Otherwise, the result of name lookup for that entity may point to an
entity that is too old; if that's an injected friend name or the like, that
can result in the name not being found at all.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228371 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPreprocessor: support __BIGGEST_ALIGNMENT__ macro
Tim Northover [Fri, 6 Feb 2015 01:25:07 +0000 (01:25 +0000)]
Preprocessor: support __BIGGEST_ALIGNMENT__ macro

For compatibility with GCC (and because it's generally helpful information
otherwise inaccessible to the preprocessor). This appears to be canonically the
alignment of max_align_t (e.g. on i386, __BIGGEST_ALIGNMENT__ is 4 even though
vector types will be given greater alignment).

Patch mostly by Mats Petersson

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228367 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix \param in r228276. [-Wdocumentation]
NAKAMURA Takumi [Thu, 5 Feb 2015 23:12:13 +0000 (23:12 +0000)]
Fix \param in r228276. [-Wdocumentation]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228355 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] Refactor: unify the code that picks which declaration goes into a
Richard Smith [Thu, 5 Feb 2015 23:08:52 +0000 (23:08 +0000)]
[modules] Refactor: unify the code that picks which declaration goes into a
name lookup table.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228354 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoForce an unknown target for the default case to make it work.
Filipe Cabecinhas [Thu, 5 Feb 2015 19:48:48 +0000 (19:48 +0000)]
Force an unknown target for the default case to make it work.

Summary:
This test was failing if LLVM_DEFAULT_TARGET_TRIPLE=x86_64-scei-ps4 due to
its behavior for exceptions.
Force an --unknown triple for the default case.

Reviewers: echristo, chandlerc

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7422

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228337 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRe-land r228258 and make clang-cl's /EHs- disable -fexceptions again
Reid Kleckner [Thu, 5 Feb 2015 18:56:03 +0000 (18:56 +0000)]
Re-land r228258 and make clang-cl's /EHs- disable -fexceptions again

After r228258, Clang started emitting C++ EH IR that LLVM wasn't ready
to deal with, even when exceptions were disabled with /EHs-. This time,
make /EHs- turn off -fexceptions while still emitting exceptional
constructs in functions using __try.  Since Sema rejects C++ exception
handling constructs before CodeGen, landingpads should only appear in
such functions as the result of a __try.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228329 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Fix assert triggering on carriage returns.
Daniel Jasper [Thu, 5 Feb 2015 11:05:31 +0000 (11:05 +0000)]
clang-format: Fix assert triggering on carriage returns.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228288 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPR22465: when performing list-initialization for a class type C, if we see an
Richard Smith [Thu, 5 Feb 2015 07:02:11 +0000 (07:02 +0000)]
PR22465: when performing list-initialization for a class type C, if we see an
initializer of the form {x}, where x is of type C or a type derived from C,
perform *non-list* initialization of the entity from x, but create a
CXXConstructExpr that knows that we used list-initialization syntax.

Plus some fixes to ensure we mangle correctly in this and related cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228276 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Initial codegen for 'single' directive.
Alexey Bataev [Thu, 5 Feb 2015 06:35:41 +0000 (06:35 +0000)]
[OPENMP] Initial codegen for 'single' directive.
This patch emits the following code for the single directive:

#pragma omp single
<body>
<---->

if(__kmpc_single(...)) {
    <body>
      __kmpc_end_single(...);
}
Differential Revision: http://reviews.llvm.org/D7045

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228275 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoVarious fixes to mangling of list-initialization.
Richard Smith [Thu, 5 Feb 2015 06:15:50 +0000 (06:15 +0000)]
Various fixes to mangling of list-initialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228274 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[OPENMP] Codegen for 'taskyield' directive
Alexey Bataev [Thu, 5 Feb 2015 05:57:51 +0000 (05:57 +0000)]
[OPENMP] Codegen for 'taskyield' directive
For 'taskyield' directive emit call to kmp_int32 __kmpc_omp_taskyield(ident_t *,
kmp_int32 global_tid, int end_part); runtime function call with end_part arg set
to 0 (it is ignored).
Differential Revision: http://reviews.llvm.org/D7047

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228272 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert r228258.
Nico Weber [Thu, 5 Feb 2015 02:08:50 +0000 (02:08 +0000)]
Revert r228258.

It caused a chromium base unittest that tests throwing and catching SEH
exceptions to fail (http://crbug.com/455488) and I suspect it might also
be the cause of the chromium clang win 64-bit shared release builder timing
out during compiles.  So revert to see if that's true.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228262 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSilence a warning.
Sean Silva [Thu, 5 Feb 2015 01:20:26 +0000 (01:20 +0000)]
Silence a warning.

/Users/Sean/pg/llvm/tools/clang/lib/CodeGen/CGException.cpp:1871:23: warning: unused variable 'Finally' [-Wunused-variable]
  if (SEHFinallyStmt *Finally = S.getFinallyHandler()) {
                      ^
1 warning generated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228255 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[PowerPC] Revert workaround for TLS linker bug
Bill Schmidt [Thu, 5 Feb 2015 01:12:24 +0000 (01:12 +0000)]
[PowerPC] Revert workaround for TLS linker bug

In r227480, Ulrich Weigand introduced a workaround for a linker
optimization bug that can create mis-optimized code for accesses to
general-dynamic or local-dynamic TLS variables.  The linker
optimization bug only occurred for Clang/LLVM because of some
inefficient code being generated for these TLS accesses.  I have
recently corrected LLVM to produce the efficient code sequence
expected by the linkers, so this workaround is no longer needed.
Therefore this patch reverts r227480.

I've tested that the previous bootstrap failure no longer occurs with
the workaround reverted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228253 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Relax an assertion in VisitLvalArraySubscriptExpr
Anna Zaks [Thu, 5 Feb 2015 01:02:59 +0000 (01:02 +0000)]
[analyzer] Relax an assertion in VisitLvalArraySubscriptExpr

The analyzer thinks that ArraySubscriptExpr cannot be an r-value (ever).
However, it can be in some corner cases. Specifically, C forbids expressions
of unqualified void type from being l-values.

Note, the analyzer will keep modeling the subscript expr as an l-value. The
analyzer should be treating void* as a char array
(https://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Pointer-Arith.html).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228249 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Do not crash in the KeychainAPI checker on user defined 'free()'.
Anna Zaks [Thu, 5 Feb 2015 01:02:56 +0000 (01:02 +0000)]
[analyzer] Do not crash in the KeychainAPI checker on user defined 'free()'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228248 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Look for allocation site in the parent frames as well as the current one.
Anna Zaks [Thu, 5 Feb 2015 01:02:53 +0000 (01:02 +0000)]
[analyzer] Look for allocation site in the parent frames as well as the current one.

Instead of handling edge cases (mostly involving blocks), where we have difficulty finding
an allocation statement, allow the allocation site to be in a parent node.

Previously we assumed that the allocation site can always be found in the same frame
as allocation, but there are scenarios in which an element is leaked in a child
frame but is allocated in the parent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228247 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] Don't skip analyzing the functions in preprocessed files.
Anna Zaks [Thu, 5 Feb 2015 01:02:47 +0000 (01:02 +0000)]
[analyzer] Don't skip analyzing the functions in preprocessed files.

The change in main file detection ended up disabling the path-sensitive
analysis of functions within preprocessed files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228246 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTweak clang/test/CodeGenCXX/debug-info-line.cpp for -Asserts.
NAKAMURA Takumi [Thu, 5 Feb 2015 01:02:34 +0000 (01:02 +0000)]
Tweak clang/test/CodeGenCXX/debug-info-line.cpp for -Asserts.

  CHECK: call {{.*}}src

matched

  %call = invoke dereferenceable(4) i32* @_Z3srcv()

I don't think it was intentional.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228245 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix crash on finally blocks that don't fall through
Reid Kleckner [Thu, 5 Feb 2015 00:58:46 +0000 (00:58 +0000)]
Fix crash on finally blocks that don't fall through

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228243 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix build break, these builtins don't exist
Reid Kleckner [Thu, 5 Feb 2015 00:24:57 +0000 (00:24 +0000)]
Fix build break, these builtins don't exist

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228241 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDo the same IRgen for __builtin_pow* as for pow*
Reid Kleckner [Thu, 5 Feb 2015 00:18:01 +0000 (00:18 +0000)]
Do the same IRgen for __builtin_pow* as for pow*

There's no reason for these to be different.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228240 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDriver: Stop forcing frame pointer usage on Windows
Reid Kleckner [Wed, 4 Feb 2015 23:45:07 +0000 (23:45 +0000)]
Driver: Stop forcing frame pointer usage on Windows

Previously, we would use a frame pointer by default on non-Linux OSs. On
Linux, any optimization flags imply -fomit-frame-pointer. XCore always
defaulted to -fomit-frame-pointer.

Now x86 Windows matches our behavior on Linux. All other ISAs supported
by Windows (ARM, x64) use xdata information, and frame pointers aren't
useful. Frame pointers are now off by default for such targets, but can
be forced via -fno-omit-frame-pointer and code using alloca().

In fact, on Win64 our frame-pointer prologue is not describable with
UNWIND_INFO. This change is a workaround to avoid using the broken FP
using prologue for most functions. This is PR22467.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228236 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] When using -E, we may try to merge decls despite having no Sema
Richard Smith [Wed, 4 Feb 2015 23:37:59 +0000 (23:37 +0000)]
[modules] When using -E, we may try to merge decls despite having no Sema
object. In such a case, use the TU's DC for merging global decls rather than
giving up when we find there is no TU scope.

Ultimately, we should probably avoid all loading of decls when preprocessing,
but there are other reasonable use cases for loading an AST file with no Sema
object for which this is the right thing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228234 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoImplement IRGen for SEH __finally and AbnormalTermination
Reid Kleckner [Wed, 4 Feb 2015 22:37:07 +0000 (22:37 +0000)]
Implement IRGen for SEH __finally and AbnormalTermination

Previously we would simply double-emit the body of the __finally block,
but that doesn't work when it contains any kind of Decl, which we can't
double emit.

This fixes that by emitting the block once and branching into a shared
code region and then branching back out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228222 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCatch more cases when diagnosing integer-constant-expression overflows.
Josh Magee [Wed, 4 Feb 2015 21:50:20 +0000 (21:50 +0000)]
Catch more cases when diagnosing integer-constant-expression overflows.

When visiting AssignmentOps, keep evaluating after a failure (when possible) in
order to identify overflow in subexpressions.

Differential Revision: http://reviews.llvm.org/D1238

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228202 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThread Safety Analysis: support adopting of locks, as implemented in
DeLesley Hutchins [Wed, 4 Feb 2015 21:16:17 +0000 (21:16 +0000)]
Thread Safety Analysis: support adopting of locks, as implemented in
std::lock_guard.  If EXCLUSIVE_LOCKS_REQUIRED is placed on the constructor of
a SCOPED_LOCKABLE class, then that constructor is assumed to adopt the lock;
e.g. the lock must be held on construction, and will be released on destruction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228194 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate inaccurate comment about inalloca
Reid Kleckner [Wed, 4 Feb 2015 20:50:29 +0000 (20:50 +0000)]
Update inaccurate comment about inalloca

I meant to say it was like indirect+byval and not direct. It is not at
all like direct.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228191 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Attribute cleanup code to the end of the scope, not the end of the function.
David Blaikie [Wed, 4 Feb 2015 19:47:54 +0000 (19:47 +0000)]
DebugInfo: Attribute cleanup code to the end of the scope, not the end of the function.

Now if you break on a dtor and go 'up' in your debugger (or you get an
asan failure in a dtor) during an exception unwind, you'll have more
context. Instead of all dtors appearing to be called from the '}' of the
function, they'll be attributed to the end of the scope of the variable,
the same as the non-exceptional dtor call.

This doesn't /quite/ remove all uses of CurEHLocation (which might be
nice to remove, for a few reasons) - it's still used to choose the
location for some other work in the landing pad. It'd be nice to
attribute that code to the same location as the exception calls within
the block and to remove CurEHLocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228181 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThread Safety Analysis: remove minor piece of unused code. No change in
DeLesley Hutchins [Wed, 4 Feb 2015 19:28:17 +0000 (19:28 +0000)]
Thread Safety Analysis: remove minor piece of unused code.  No change in
functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228176 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[analyzer] RetainCountChecker: be forgiving when ivars are accessed directly.
Jordan Rose [Wed, 4 Feb 2015 19:24:52 +0000 (19:24 +0000)]
[analyzer] RetainCountChecker: be forgiving when ivars are accessed directly.

A refinement of r204730, itself a refinement of r198953, to better handle
cases where an object is accessed both through a property getter and
through direct ivar access. An object accessed through a property should
always be treated as +0, i.e. not owned by the caller. However, an object
accessed through an ivar may be at +0 or at +1, depending on whether the
ivar is a strong reference. Outside of ARC, we don't always have that
information.

The previous attempt would clear out the +0 provided by a getter, but only
if that +0 hadn't already participated in other retain counting operations.
(That is, "self.foo" is okay, but "[[self.foo retain] autorelease]" is
problematic.) This turned out to not be good enough when our synthesized
getters get involved.

This commit drops the notion of "overridable" reference counting and instead
just tracks whether a value ever came from a (strong) ivar. If it has, we
allow one more release than we otherwise would. This has the added benefit
of being able to catch /some/ overreleases of instance variables, though
it's not likely to come up in practice.

We do still get some false negatives because we currently throw away
refcount state upon assigning a value into an ivar. We should probably
improve on that in the future, especially once we synthesize setters as
well as getters.

rdar://problem/18075108

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228174 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPort test/Driver/mg.c to use FileCheck instead of fgrep
Ben Langmuir [Wed, 4 Feb 2015 18:34:26 +0000 (18:34 +0000)]
Port test/Driver/mg.c to use FileCheck instead of fgrep

Patch by İsmail Dönmez

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228164 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoReplace isalnum with isAlphanumeric per review
Ben Langmuir [Wed, 4 Feb 2015 18:34:23 +0000 (18:34 +0000)]
Replace isalnum with isAlphanumeric per review

Thanks Dmitri!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228163 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUpdate darwin-version tests
Steven Wu [Wed, 4 Feb 2015 18:10:38 +0000 (18:10 +0000)]
Update darwin-version tests

Summary:
Now that the darwin-version tests in Driver and Frontend are
testing different parts of the version encoding instead of doing
duplicated work

Reviewers: rnk

Reviewed By: rnk

Subscribers: rnk, cfe-commits

Differential Revision: http://reviews.llvm.org/D7134

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228159 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAllow to specify multiple -fsanitize-blacklist= arguments.
Alexey Samsonov [Wed, 4 Feb 2015 17:40:08 +0000 (17:40 +0000)]
Allow to specify multiple -fsanitize-blacklist= arguments.

Summary:
Allow user to provide multiple blacklists by passing several
-fsanitize-blacklist= options. These options now don't override
default blacklist from Clang resource directory, which is always
applied (which fixes PR22431).

-fno-sanitize-blacklist option now disables all blacklists that
were specified earlier in the command line (including the default
one).

This change depends on http://reviews.llvm.org/D7367.

Test Plan: regression test suite

Reviewers: timurrrr

Subscribers: cfe-commits, kcc, pcc

Differential Revision: http://reviews.llvm.org/D7368

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228156 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang-format: Add support for SEH __try / __except / __finally blocks.
Nico Weber [Wed, 4 Feb 2015 15:26:27 +0000 (15:26 +0000)]
clang-format: Add support for SEH __try / __except / __finally blocks.

This lets clang-format format

    __try {
    } __except(0) {
    }

and

    __try {
    } __finally {
    }

correctly. __try and __finally are keywords if `LangOpts.MicrosoftExt` is set,
so this turns this on.  This also enables a few other keywords, but it
shouldn't overly perturb regular clang-format operation.  __except is a
context-sensitive keyword, so `AdditionalKeywords` needs to be passed around to
a few more places.

Fixes PR22321.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228148 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTweak clang/test/CodeGenCXX/copy-constructor-elim.cpp to satisfy i686-linux.
NAKAMURA Takumi [Wed, 4 Feb 2015 14:51:30 +0000 (14:51 +0000)]
Tweak clang/test/CodeGenCXX/copy-constructor-elim.cpp to satisfy i686-linux.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228146 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRewrite r228138 to be somewhat saner.
Daniel Jasper [Wed, 4 Feb 2015 14:29:47 +0000 (14:29 +0000)]
Rewrite r228138 to be somewhat saner.

While probably technically correct, the solution r228138 was quite hard
to read/understand. This should be simpler.

Also added a test to ensure that we are still visiting the syntactic form
as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228144 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPreserve early clobber flag when using named registers in inline assembly.
Daniel Sanders [Wed, 4 Feb 2015 14:25:47 +0000 (14:25 +0000)]
Preserve early clobber flag when using named registers in inline assembly.

Summary:
Named registers with the constraint "=&r" currently lose the early clobber flag
and turn into "=r" when converted to LLVM-IR. This patch correctly passes it on.

Reviewers: atanasyan

Reviewed By: atanasyan

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D7346

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228143 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoTeaches the Clang driver to accept Cortex-A72
Renato Golin [Wed, 4 Feb 2015 13:31:56 +0000 (13:31 +0000)]
Teaches the Clang driver to accept Cortex-A72

A previous commit added Cortex-A72 to LLVM, this teaches Clang to
accept it as well.

Patch by Ranjeet Singh.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228141 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoLet RecursiveASTVisitor walk both syntactic and semantic form of InitListExprs.
Daniel Jasper [Wed, 4 Feb 2015 13:11:42 +0000 (13:11 +0000)]
Let RecursiveASTVisitor walk both syntactic and semantic form of InitListExprs.

Otherwise, this can lead to unexpected results when AST matching as
some nodes are only present in the semantic form.

For example, only looking at the syntactic form does not find the
DeclRefExpr to f() in:

  struct S { S(void (*a)()); };
  void f();
  S s[1] = {&f};

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228138 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoParse: Handle __declspec in a lambda definition
David Majnemer [Wed, 4 Feb 2015 08:22:46 +0000 (08:22 +0000)]
Parse: Handle __declspec in a lambda definition

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228121 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSema: Add support for __declspec(restrict)
David Majnemer [Wed, 4 Feb 2015 07:23:21 +0000 (07:23 +0000)]
Sema: Add support for __declspec(restrict)

__declspec(restrict) and __attribute(malloc) are both handled
identically by clang: they are allowed to the noalias LLVM attribute.

Seeing as how noalias models the C99 notion of 'restrict', rename the
internal clang attribute to Restrict from Malloc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228120 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRegister parameters have local storage.
Anna Zaks [Wed, 4 Feb 2015 07:15:12 +0000 (07:15 +0000)]
Register parameters have local storage.

Fixes a regression introduced in r209149.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228119 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoOpenCL: handle ternary operator when the condition is a vector
Sameer Sahasrabuddhe [Wed, 4 Feb 2015 06:38:18 +0000 (06:38 +0000)]
OpenCL: handle ternary operator when the condition is a vector

When the condition is a vector, OpenCL specifies additional
requirements on the operand types, and also the operations
required to determine the result type of the operator. This is a
combination of OpenCL v1.1 s6.3.i and s6.11.6, and the semantics
remain unchanged in later versions of OpenCL.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228118 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[MSVC2012] Allow 'mutable' references
Alexey Bataev [Wed, 4 Feb 2015 04:45:32 +0000 (04:45 +0000)]
[MSVC2012] Allow 'mutable' references
Some standard header files from MSVC2012 use 'mutable' on references, though it is directly prohibited by the standard.
Fix for http://llvm.org/PR22444
Differential Revision: http://reviews.llvm.org/D7370

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228113 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake this test stricter. NFC.
Rafael Espindola [Wed, 4 Feb 2015 04:23:48 +0000 (04:23 +0000)]
Make this test stricter. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228112 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix ARM buildbot
David Majnemer [Wed, 4 Feb 2015 03:30:00 +0000 (03:30 +0000)]
Fix ARM buildbot

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228111 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix typo in test case.
Larisse Voufo [Wed, 4 Feb 2015 03:16:46 +0000 (03:16 +0000)]
Fix typo in test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228110 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix typo in test case.
Larisse Voufo [Wed, 4 Feb 2015 02:46:33 +0000 (02:46 +0000)]
Fix typo in test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228108 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoGeneralize r228066 to give all implicit global allocation functions default visibility.
Larisse Voufo [Wed, 4 Feb 2015 02:34:32 +0000 (02:34 +0000)]
Generalize r228066 to give all implicit global allocation functions default visibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228107 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd missing file from r228104.
Richard Smith [Wed, 4 Feb 2015 01:51:12 +0000 (01:51 +0000)]
Add missing file from r228104.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228105 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[modules] If we already have a fake definition for one declaration of a class,
Richard Smith [Wed, 4 Feb 2015 01:23:46 +0000 (01:23 +0000)]
[modules] If we already have a fake definition for one declaration of a class,
don't think we're providing a new one in an update record adding a definition
to another declaration of the same class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228104 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang/test/CodeGenCXX/cxx14-implicit-sized-delete.cpp: Unbreak build to add explicit...
NAKAMURA Takumi [Wed, 4 Feb 2015 01:00:12 +0000 (01:00 +0000)]
clang/test/CodeGenCXX/cxx14-implicit-sized-delete.cpp: Unbreak build to add explicit triple x86_64-unknown.

It seems incompatible to i686.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228100 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoclang/test/CodeGenCXX/cxx14-implicit-sized-delete.cpp: Fix for -Asserts.
NAKAMURA Takumi [Wed, 4 Feb 2015 01:00:04 +0000 (01:00 +0000)]
clang/test/CodeGenCXX/cxx14-implicit-sized-delete.cpp: Fix for -Asserts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228099 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd LF to EOF.
NAKAMURA Takumi [Wed, 4 Feb 2015 00:59:59 +0000 (00:59 +0000)]
Add LF to EOF.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228098 91177308-0d34-0410-b5e6-96231b3b80d8

9 years ago[inlineasm] Fix an incorrect warning about register constraint and modifier.
Akira Hatanaka [Wed, 4 Feb 2015 00:27:13 +0000 (00:27 +0000)]
[inlineasm] Fix an incorrect warning about register constraint and modifier.

Previously, when the following piece of code was compiled, clang would
incorrectly warn that the size of "wide_two" does not match register size
specified by the constraint and modifier":

long wide_two = two;
asm ("%w0 %1" : "+r" (one), "+r"(wide_two));

This was caused by a miscalculation of ConstraintIdx in Sema::ActOnGCCAsmStmt.

This commit fixes PR21270 and rdar://problem/18668354.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228089 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUnbreak the MIPS buildbot
David Majnemer [Wed, 4 Feb 2015 00:26:13 +0000 (00:26 +0000)]
Unbreak the MIPS buildbot

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228088 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoHeaders: Don't use attribute keywords which aren't reserved
David Majnemer [Wed, 4 Feb 2015 00:26:10 +0000 (00:26 +0000)]
Headers: Don't use attribute keywords which aren't reserved

Instead of using 'unavailable', use '__unavailable__'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228087 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoInstrProf: Update for LLVM API change
Justin Bogner [Tue, 3 Feb 2015 23:59:48 +0000 (23:59 +0000)]
InstrProf: Update for LLVM API change

Update for the API change in r228075

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228076 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoPR22419: Give implicit sized deallocation functions default visibility
Larisse Voufo [Tue, 3 Feb 2015 23:31:50 +0000 (23:31 +0000)]
PR22419: Give implicit sized deallocation functions default visibility

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228066 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUnbreak hexagon bot
David Majnemer [Tue, 3 Feb 2015 23:21:21 +0000 (23:21 +0000)]
Unbreak hexagon bot

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228065 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoWrap to 80 columns. No behavior change.
Nico Weber [Tue, 3 Feb 2015 23:10:18 +0000 (23:10 +0000)]
Wrap to 80 columns. No behavior change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228063 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCodeGen: Copy-ctorm must obey the destination's alignment requirement
David Majnemer [Tue, 3 Feb 2015 23:04:06 +0000 (23:04 +0000)]
CodeGen: Copy-ctorm must obey the destination's alignment requirement

We would synthesize memcpy intrinsics when emitting calls to trivial C++
constructors but we wouldn't take into account the alignment of the
destination.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228061 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoSEH: Track users of __try so we can pick a per-func EH personality
Reid Kleckner [Tue, 3 Feb 2015 22:52:35 +0000 (22:52 +0000)]
SEH: Track users of __try so we can pick a per-func EH personality

There are four major kinds of declarations that cause code generation:
- FunctionDecl (includes CXXMethodDecl etc)
- ObjCMethodDecl
- BlockDecl
- CapturedDecl

This patch tracks __try usage on FunctionDecls and diagnoses __try usage
in other decls. If someone wants to use __try from ObjC, they can use it
from a free function, since the ObjC code will need an ObjC-style EH
personality.

Eventually we will want to look through CapturedDecls and track SEH
usage on the parent FunctionDecl, if present.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228058 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDebugInfo: Ensure calls to functions with default arguments which themselves have...
David Blaikie [Tue, 3 Feb 2015 22:37:17 +0000 (22:37 +0000)]
DebugInfo: Ensure calls to functions with default arguments which themselves have default arguments, still have locations.

To handle default arguments in C++ in the debug info, we disable code
updating the debug location during the emission of default arguments.

This code was buggy in the case of default arguments which, themselves,
have default arguments - the inner default argument would re-enable
debug info when it was finished, but before the outer default argument
was finished.

This was already a bug, but got worse (because a crasher instead of just
a quality bug) with the recent improvements to debug info line quality
because... The ApplyDebugLocation scoped device would find the debug
info disabled and not save any debug location. But then in
~ApplyDebugLocation it would find the debug info had been enabled and
would then apply the no-location. Then the outer function call would be
emitted without any location. That's bad.

Arguably we could /also/ fix the ApplyDebugLocation to assert on this
situation (where debug info was disabled in the ctor and enabled in the
dtor, or the other way around) but this is at least the necessary fix
regardless.

(also, I imagine this disabling behavior might need to be in-place for
CGExprComplex and CGExprAgg too, maybe... ?)

And I seem to recall seeing some weird default arg stepping behavior
recently which might be related to this too... I'll have to look into
it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228053 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoDiagnose CXX 'this' pointer reference in funcs with naked attr
Weiming Zhao [Tue, 3 Feb 2015 22:35:58 +0000 (22:35 +0000)]
Diagnose CXX 'this' pointer reference in funcs with naked attr

Clang asserts for this pointer reference in asms of naked functions.
This patch diagnoses if this pointer reference is used.

Differential Revision: http://reviews.llvm.org/D7329

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228052 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThread Safety Analysis: add support for before/after annotations on mutexes.
DeLesley Hutchins [Tue, 3 Feb 2015 22:11:04 +0000 (22:11 +0000)]
Thread Safety Analysis: add support for before/after annotations on mutexes.
These checks detect potential deadlocks caused by inconsistent lock
ordering.  The checks are implemented under the -Wthread-safety-beta flag.

This patch also replaces calls to getAttrs() with calls to attrs() throughout
ThreadSafety.cpp, which fixes the earlier issue that cause assert failures.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228051 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoFix Driver/mg.c test when fgrep is a shell Cygwin shell script
Reid Kleckner [Tue, 3 Feb 2015 21:49:15 +0000 (21:49 +0000)]
Fix Driver/mg.c test when fgrep is a shell Cygwin shell script

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228036 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoInstrProf: Remove CoverageMapping::HasCodeBefore, it isn't used
Justin Bogner [Tue, 3 Feb 2015 21:35:49 +0000 (21:35 +0000)]
InstrProf: Remove CoverageMapping::HasCodeBefore, it isn't used

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228035 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoCodeGen: Update for LLVM API change in r228030
Duncan P. N. Exon Smith [Tue, 3 Feb 2015 21:25:34 +0000 (21:25 +0000)]
CodeGen: Update for LLVM API change in r228030

The mock tags are no longer in `dwarf::LLVMConstants`; they're in
`dwarf::Tag`.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228032 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAddress review feedback for r228003.
Adrian Prantl [Tue, 3 Feb 2015 20:00:54 +0000 (20:00 +0000)]
Address review feedback for r228003.
- use named constructors
- get rid of MarkAsPrologue

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228021 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoRevert "Thread Safety Analysis: add support for before/after annotations on mutexes."
Reid Kleckner [Tue, 3 Feb 2015 19:51:16 +0000 (19:51 +0000)]
Revert "Thread Safety Analysis: add support for before/after annotations on mutexes."

This reverts r227997, as well as r228009. It does not pass check-clang
for me locally on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228020 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMake the default module cache user-specific
Ben Langmuir [Tue, 3 Feb 2015 19:28:37 +0000 (19:28 +0000)]
Make the default module cache user-specific

Appends the username to the first component (after the temp dir) of the
module cache path.  If the username contains a character that shouldn't
go into a path (for now conservatively allow [a-zA-Z0-9_]), we fallback
to the user id.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228013 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agothread safety: Add move ctor to BeforeInfo to fix MSVC build
Reid Kleckner [Tue, 3 Feb 2015 19:04:26 +0000 (19:04 +0000)]
thread safety: Add move ctor to BeforeInfo to fix MSVC build

MSVC cannot infer move ctors yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228009 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMerge ArtificialLocation into ApplyDebugLocation and make a clear
Adrian Prantl [Tue, 3 Feb 2015 18:40:42 +0000 (18:40 +0000)]
Merge ArtificialLocation into ApplyDebugLocation and make a clear
distinction between the different use-cases. With the previous default
behavior we would occasionally emit empty debug locations in situations
where they actually were strictly required (= on invoke insns).
We now have a choice between defaulting to an empty location or an
artificial location.

Specifically, this fixes a bug caused by a missing debug location when
emitting C++ EH cleanup blocks from within an artificial function, such as
an ObjC destroy helper function.

rdar://problem/19670595

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228003 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd documentation to ApplyDebugLocation.
Adrian Prantl [Tue, 3 Feb 2015 18:40:38 +0000 (18:40 +0000)]
Add documentation to ApplyDebugLocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228002 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoThread Safety Analysis: add support for before/after annotations on mutexes.
DeLesley Hutchins [Tue, 3 Feb 2015 18:17:48 +0000 (18:17 +0000)]
Thread Safety Analysis: add support for before/after annotations on mutexes.
These checks detect potential deadlocks caused by inconsistent lock
ordering.  The checks are implemented under the -Wthread-safety-beta flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227997 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoImplement jump scope SEHmantic analysis.
Nico Weber [Tue, 3 Feb 2015 17:06:08 +0000 (17:06 +0000)]
Implement jump scope SEHmantic analysis.

Thou shall not jump into SEH blocks. Jumping out of SEH __try and __excepts
is A-ok. Jumping out of __finally blocks is B-ok (msvc doesn't error about it,
but warns that it has undefined behavior).

I've checked that clang's behavior with this patch matches msvc's behavior.
We don't have the warning on jumping out of a __finally yet, see the FIXME
in the test. clang also currently crashes on codegen for a jump out of a
__finally block, see PR22414 comment 7.

I also added a few tests for the interaction of indirect jumps and SEH blocks.
MSVC doesn't support indirect jumps, so there's no way to know if clang behave
the same way as msvc here.  clang's behavior with this patch does make sense
to me, but maybe it could be argued that it should be more permissive (see
FIXME in the indirect jump tests -- shout if you have an opinion on this).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227982 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoUse CLANG_LIBDIR_SUFFIX when looking for the gold plugin.
Rafael Espindola [Tue, 3 Feb 2015 16:33:53 +0000 (16:33 +0000)]
Use CLANG_LIBDIR_SUFFIX when looking for the gold plugin.

Patch by İsmail Dönmez!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227979 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMove "inline" to the right place.
Daniel Jasper [Tue, 3 Feb 2015 09:54:58 +0000 (09:54 +0000)]
Move "inline" to the right place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227957 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAdd some overloads so that floating point literals can be AST matched properly.
Daniel Jasper [Tue, 3 Feb 2015 09:45:52 +0000 (09:45 +0000)]
Add some overloads so that floating point literals can be AST matched properly.

I am not entirely sure whether the implemented sematics are ideal. In
particular, should floatLiteral(equals(0.5)) match "0.5f" and should
floatLiteral(equals(0.5f)) match "0.5". With the overloads in this
patch, the answer to both questions is yes, but I am happy to change
that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227956 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMS ABI: Records with fields with required aligmnet shouldn't be common
David Majnemer [Tue, 3 Feb 2015 08:49:32 +0000 (08:49 +0000)]
MS ABI: Records with fields with required aligmnet shouldn't be common

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227954 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoAST: Hoist RT->getDecl() into a variable
David Majnemer [Tue, 3 Feb 2015 08:49:29 +0000 (08:49 +0000)]
AST: Hoist RT->getDecl() into a variable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227953 91177308-0d34-0410-b5e6-96231b3b80d8

9 years agoMS ABI: Records with required alignment can't have common linkage
David Majnemer [Tue, 3 Feb 2015 07:35:55 +0000 (07:35 +0000)]
MS ABI: Records with required alignment can't have common linkage

This fixes PR22441.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@227950 91177308-0d34-0410-b5e6-96231b3b80d8