Commit Graph

36991 Commits

Author SHA1 Message Date
Anna Zaks 54fd4a0766 [analyzer] Do not inline functions which previously reached max block
count.

This is an optimization for "retry without inlining" option. Here, if we
failed to inline a function due to reaching the basic block max count,
we are going to store this information and not try to inline it
again in the translation unit. This can be viewed as a function summary.

On sqlite, with this optimization, we are 30% faster then before and
cover 10% more basic blocks (partially because the number of times we
reach timeout is decreased by 20%).

llvm-svn: 153730
2012-03-30 05:48:10 +00:00
John McCall bc15335e58 Handle placeholder expressions in an ObjC for-collection loop.
The way we handle this implicitly removes the ability to use
property l-values in this position, but that's really okay.

llvm-svn: 153729
2012-03-30 05:43:39 +00:00
NAKAMURA Takumi e0538b9669 ItaniumCXXABI.cpp: Don't use nullptr. Clang source tree should be pre-c++11-compatible.
llvm-svn: 153728
2012-03-30 05:43:21 +00:00
Eric Christopher fef37f81b4 Revert previous commit changing location information to see if this
is causing the gdb test failures on the bots.

llvm-svn: 153727
2012-03-30 05:42:12 +00:00
Craig Topper 97f042f2d6 Add _mm_minpos_epu16 to smmintrin.h. Fixes PR12399.
llvm-svn: 153726
2012-03-30 05:41:28 +00:00
John McCall 67cd5e094e Forbid the block and lambda copy-capture of __autoreleasing variables
in ARC, under the usual reasoning limiting the use of __autoreleasing.

llvm-svn: 153725
2012-03-30 05:23:48 +00:00
Craig Topper 678a53c350 Fix shuffle vector calculation for mm_permute_ps. Fixes PR 12401.
llvm-svn: 153724
2012-03-30 05:09:18 +00:00
John McCall 947c1830e4 When emitting a static local variable in C++, handle
the case that the variable already exists.  Partly this is just
protection against people making crazy declarations with custom
asm labels or extern "C" names that intentionally collide with
the manglings of such variables, but the main reason is that we
can actually emit a static local variable twice with the
requirement that it match up.  There may be other cases with
(e.g.) the various nested functions, but the main exemplar is
with constructor variants, where we can be forced into
double-emitting the function body under certain circumstances
like (currently) the presence of virtual bases.

llvm-svn: 153723
2012-03-30 04:25:14 +00:00
John McCall 8831303e4f Add a note about a missing optimization in the case of virtual
inheritance.

llvm-svn: 153722
2012-03-30 04:25:03 +00:00
Eli Friedman 5a125b4040 Missing piece of r153720: make sure the vtable pointer is handled correctly.
llvm-svn: 153721
2012-03-30 04:16:06 +00:00
Eli Friedman a154dd5b33 ConstStructBuilder: fix offset math for base classes so it works correctly in general. Found by inspection.
llvm-svn: 153720
2012-03-30 03:55:31 +00:00
Eli Friedman 410fc7ae89 Make sure we perform the relevant implied conversions correctly for ObjC methods with related result types. PR12384.
llvm-svn: 153716
2012-03-30 01:13:43 +00:00
Eric Christopher f4d006348b Testcase for the previous commit.
llvm-svn: 153715
2012-03-30 01:07:51 +00:00
Eric Christopher df02b36a2c Change location information for synthesized properties to be at the
property file/line rather than the @synthesize file/line. Avoids
some nasty confusing-ness with conflating the file from the scope
and the line from the original declaration.

Update a couple of testcases accordingly since I had to change
that we actually use the passed in location in EmitFunctionStart.

Fixes rdar://11026482

llvm-svn: 153714
2012-03-30 01:07:48 +00:00
Bill Wendling 82b87f19e2 The UTF16 string referenced by a CFString should go into the __TEXT,__ustring
section. A 'normal' string will go into the __TEXT,__const section, but this
isn't good for UTF16 strings. The __ustring section allows for coalescing, among
other niceties (such as allowing the linker to easily split up strings).

Instead of outputting the UTF16 string as a series of bytes, output it as a
series of shorts. The back-end will then nicely place the UTF16 string into the
correct section, because it's a mensch.
<rdar://problem/10655949>

llvm-svn: 153710
2012-03-30 00:26:17 +00:00
Argyrios Kyrtzidis ab468b0381 Add info to ObjCPropertyRefExpr to indicate whether the dot syntax property
reference is going to message the setter, the getter, or both.

Having this info on the ObjCPropertyRefExpr node makes it easier for AST
clients (like libclang) to reason about the meaning of the property reference.

[AST/Sema]
-Use 2 bits (with a PointerIntPair) in ObjCPropertyRefExpr to record the above info
-Have ObjCPropertyOpBuilder set the info appropriately.

[libclang]
-When there is an implicit property reference (property syntax using methods)
have clang_getCursorReferenced return a cursor for the method. If the property
reference is going to result in messaging both the getter and the setter choose
to return a cursor for the setter because it is less obvious from source inspection
that the setter is getting called.

The general idea has the seal of approval by John.

rdar://11151621

llvm-svn: 153709
2012-03-30 00:19:18 +00:00
Argyrios Kyrtzidis c9754d6d9c [libclang] A MemberRefExpr cursor for a property dot syntax should have as
its location the location of the property.

Part of rdar://11113120

llvm-svn: 153708
2012-03-30 00:19:13 +00:00
Argyrios Kyrtzidis 7aa274fff3 [libclang] Have c-index-test output more information about a cursor with -cursor-at:
-the location of the cursor
-its extent
-its spelling

Part of radar://11113120

llvm-svn: 153707
2012-03-30 00:19:05 +00:00
Eli Friedman 2b22a6e61c Extend -Wc++11-narrowing to cover converted constant expressions as well as braced-initializers. <rdar://problem/11121178>.
llvm-svn: 153703
2012-03-29 23:39:39 +00:00
Anna Zaks 7e3e06a837 [analyzer] Add a malloc cpp test file.
Includes a test from a reported false positive fixed in some earlier
commit.

llvm-svn: 153702
2012-03-29 23:26:54 +00:00
Bill Wendling 07635cc792 Fix whitespace.
llvm-svn: 153698
2012-03-29 22:12:09 +00:00
Jim Grosbach 903e63fef3 ARM backend knows about cortex-m4. The front end should too.
llvm-svn: 153678
2012-03-29 19:53:34 +00:00
Fariborz Jahanian 064b5386f0 modern objc translator: avoid some duplicate declarations.
llvm-svn: 153674
2012-03-29 19:04:10 +00:00
Richard Smith 5704fe8356 Refactor special member function deletion. No functionality change.
llvm-svn: 153673
2012-03-29 19:00:10 +00:00
David Chisnall abf320d40e Relax the test slightly so that it should pass on other people's computers.
llvm-svn: 153670
2012-03-29 18:41:08 +00:00
Fariborz Jahanian 8f7c1d32a8 modern objc translator: additional test.
llvm-svn: 153669
2012-03-29 18:20:51 +00:00
David Chisnall db365f38ea Call out to GCC-compatible runtime functions for atomic ops that we can't use
LLVM intrinsics for.

I have an implementation of these functions, which wants to go in a libgcc_s
equivalent in compiler-rt.  It's currently here:

http://people.freebsd.org/~theraven/atomic.c

It will be committed to compiler-rt as soon as I work out where would be a
sensible place to put it...

llvm-svn: 153666
2012-03-29 18:01:11 +00:00
David Chisnall 891ec2870d Pass parameters in the correct order when assembling an AtomicExpr.
llvm-svn: 153665
2012-03-29 17:58:59 +00:00
Fariborz Jahanian f35e020ef3 modern objective-c translator: fix up assortment of
visibility directives for a variety of exported
meta-data symbols. // rdar://11144048

llvm-svn: 153663
2012-03-29 17:51:09 +00:00
Chad Rosier 615ed1a3a6 Revert r153613 as it's causing large compile-time regressions on the nightly testers.
llvm-svn: 153660
2012-03-29 17:37:10 +00:00
Eric Christopher bd9c910c8c Go back to using just the selector name for the getter and setter
in the property debug info. Any more isn't necessary after all.

rdar://11144023

llvm-svn: 153659
2012-03-29 17:31:33 +00:00
Eric Christopher 5d2b8d9042 Tidy.
llvm-svn: 153658
2012-03-29 17:31:31 +00:00
Benjamin Kramer 3e2320c8be Make ModuleMapParser own its TargetInfo, so it doesn't get leaked.
llvm-svn: 153648
2012-03-29 14:07:03 +00:00
Eric Christopher eb03169b9a Add support for objc property decls according to the page at:
http://llvm.org/docs/SourceLevelDebugging.html#objcproperty

    including type and DECL. Expand the getter and setter names
    into the fully qualified names.

    rdar://11144023

llvm-svn: 153640
2012-03-29 08:43:37 +00:00
Rafael Espindola c31d004ece unwind.h fix for -fvisibility=hidden users. This fixes firefox build in a system
with libunwind installed.
Patch by Jeffrey Yasskin!

llvm-svn: 153633
2012-03-29 03:37:17 +00:00
Richard Smith 0191023b5a Don't try to parse a malformed parameter list after a constructor or operator
name as a direct initializer.

llvm-svn: 153628
2012-03-29 01:46:00 +00:00
Richard Smith 0efa75c3e3 Reject 'template<typename...Ts> void f(Ts ...(x));'. Add a special-case
diagnostic and a fix-it to explain to the user where the ellipsis is
supposed to go.

llvm-svn: 153622
2012-03-29 01:16:42 +00:00
Argyrios Kyrtzidis 28e0a7f6c1 [arcmt] Fix a bug where a property in a class extension, that did not exist
in the interface, got its attribute rewritten twice, resulting in
'weakweak' or 'strongstrong'.

rdar://11047179

llvm-svn: 153621
2012-03-29 01:10:31 +00:00
Jan Wen Voung 1d4c2d9a48 Define __LITTLE_ENDIAN__ for le32, since "le" stands for little endian.
Add a test for this too.

llvm-svn: 153616
2012-03-29 00:05:59 +00:00
John McCall 1a0877f99d When we can't prove that the target of an aggregate copy is
a complete object, the memcpy needs to use the data size of
the structure instead of its sizeof() value.  Fixes PR12204.

llvm-svn: 153613
2012-03-28 23:30:44 +00:00
Fariborz Jahanian e798ba4b67 Fix typo in my last patch.
llvm-svn: 153602
2012-03-28 21:13:53 +00:00
Argyrios Kyrtzidis e26ba14fcd [libclang] Fix CIndexer::isOptEnabled(); not sure what I was thinking there.
llvm-svn: 153594
2012-03-28 20:42:59 +00:00
Anna Zaks 72eee39df7 [analyzer] Enable retry exhausted without inlining by default.
llvm-svn: 153591
2012-03-28 19:59:16 +00:00
David Chisnall b526e93d03 Fix the type of wchar_t on Solaris.
Patch by Dmitri Shubin!

llvm-svn: 153585
2012-03-28 18:04:14 +00:00
Fariborz Jahanian ba0afde486 objective-c: Improve diagnostics and
provide 'fixit' hint when dictionary index 
is not of proper type. // rdar://11062080

llvm-svn: 153584
2012-03-28 17:56:49 +00:00
Anna Zaks 850d2dea82 [analyser] Stats checker: do not mark a node as exhausted if we will
retry without inlining.

(+ other minor cleanups)

llvm-svn: 153581
2012-03-28 17:05:50 +00:00
Anna Zaks 8293bae850 [analyzer] Refactor: Use Decl when determining if the Block belongs to
the root function.

(This is a bit cleaner then using the StackFrame.)

llvm-svn: 153580
2012-03-28 17:05:46 +00:00
NAKAMURA Takumi 9c7f1242f1 CodeGen/CGDeclCXX.cpp: Twine-ize CreateGlobalInitOrDestructFunction().
llvm-svn: 153578
2012-03-28 16:24:29 +00:00
Douglas Gregor b7d17ddbf9 Unify and fix our checking of C++ [dcl.meaning]p1's requirements
concerning qualified declarator-ids. We now diagnose extraneous
qualification at namespace scope (which we had previously missed) and
diagnose these qualification errors for all kinds of declarations; it
was rather uneven before. Fixes <rdar://problem/11135644>.

llvm-svn: 153577
2012-03-28 16:01:27 +00:00
Douglas Gregor ce9978ff1f When we form a new function/class template specialization, we first
search for the specialization (in a folding set) and, if not found
form a *Decl that is then inserted into that folding set. In rare
cases, the folding set may be reallocated between the search and the
insertion, causing a crash. No test case, because triggering rehashing
consistently in a small test case is not feasible. Fixes
<rdar://problem/11115071>.

llvm-svn: 153575
2012-03-28 14:34:23 +00:00