Commit Graph

33885 Commits

Author SHA1 Message Date
Fariborz Jahanian e0e6505660 objc rewriter: use a more specific name for local variable used
in fast enumeration rewrite. // rdar://10415026

llvm-svn: 144191
2011-11-09 17:41:43 +00:00
John McCall 29928fc563 We don't add ExprWithCleanups to the CFG, and getSVal looks
through it, so we should look through it for the live-values
analysis as well.

llvm-svn: 144190
2011-11-09 17:10:36 +00:00
Douglas Gregor 7240a95282 Define some built-ins macros on mips32 platform, from Simon Atanasyan!
llvm-svn: 144189
2011-11-09 15:17:16 +00:00
Benjamin Kramer 3757be395e Update test.
llvm-svn: 144185
2011-11-09 12:43:30 +00:00
Chandler Carruth b4aabc88f7 Try to fix an issue on some hosts where the 'lib' in the builtin include
path is actually a multilib.

llvm-svn: 144177
2011-11-09 08:26:57 +00:00
David Blaikie 21bfbf8d7c Fixing 80 col violations (& removing any trailing whitespace on files I was touching anyway)
llvm-svn: 144171
2011-11-09 06:07:30 +00:00
David Blaikie 8569b53e81 Fix 80 cols violations & remove trailing whitespace.
llvm-svn: 144170
2011-11-09 05:30:24 +00:00
Nick Lewycky 6aad6df4d1 Reflow one line I missed in previous cleanup commit. No functionality change.
llvm-svn: 144168
2011-11-09 04:27:23 +00:00
Nick Lewycky 2219ef0b68 Minor cleanup, mostly reindenting. Remove one helper function that just called
the other helper functions, since we already differentiated the cases it was
testing between. No functionality change.

llvm-svn: 144167
2011-11-09 04:25:21 +00:00
Chandler Carruth 6e46ca2c10 Fix an issue that Duncan discovered on a specific (no longer current)
version of Ubuntu. It has a very broken multiarch configuration, and so
we need special logic to handle it correctly. Fixing and testing this
uncovered a few other trivial issues with the logic that are fixed as
well.

I added tests to cover this as it is hard to notice if you install
recent versions of the OS.

llvm-svn: 144165
2011-11-09 03:46:20 +00:00
John McCall 3a237aa31c Emit the copy and dipose helpers for ARC __strong
block-typed __block variables using objc_retainBlock
and objc_dispose.  Previously we were using
_Block_object_assign and _Block_object_destroy
with BLOCK_BYREF_CALLER, which causes the runtime
to completely ignore the retain and release.
In most cases this doesn't cause catastrophe
because the retain/release are balanced and
because the block in the variable was copied
upon assignment there.  However, the stack
copy of the variable will be released when
it goes out of scope, which is a problem if
that value was released due to an assignment
to the heap copy.  Similarly, a leak can occur
if the variable is assigned after the copy to
the heap.

llvm-svn: 144162
2011-11-09 03:17:26 +00:00
Douglas Gregor 68b8fad7d2 Workaround for compilers that don't implement C++ DR45, from Tom Honermann!
llvm-svn: 144161
2011-11-09 03:05:27 +00:00
Douglas Gregor dbb9ea51fa Put ext_offsetof_extended_field_designator under the warning flag
-Wextended-offsetof, from Jeff Walden!

llvm-svn: 144160
2011-11-09 03:01:42 +00:00
Douglas Gregor f39a8dd445 Don't crash when transforming an ill-formed pseudo-destructor
expression. Fixes PR11339.

llvm-svn: 144159
2011-11-09 02:19:47 +00:00
John McCall d86532ee2c Extract the blocks-related ARC tests into their own file.
llvm-svn: 144158
2011-11-09 02:16:13 +00:00
Douglas Gregor 407d1f9624 Introduce proper spacing after the Objective-C parameter qualifiers
(bycopy, inout, etc.). Fixes <rdar://problem/10402900>.

llvm-svn: 144157
2011-11-09 02:13:45 +00:00
Richard Smith f8120cad16 Constant expression evaluation: support for default arguments.
llvm-svn: 144156
2011-11-09 02:12:41 +00:00
Devang Patel 8c2418594e Remove extra ';'
llvm-svn: 144155
2011-11-09 01:57:23 +00:00
Argyrios Kyrtzidis c137d0d62f [PCH] Fix reading from PCH of diagnostic pragmas.
In certain cases ASTReader would call the normal DiagnosticsEngine API to initialize
the state of diagnostic pragmas but DiagnosticsEngine would try to compare source locations
leading to crash because the main FileID was not yet initialized.

Yet another case of the ASTReader trying to use the normal APIs and inadvertently breaking
invariants. Fix this by having the ASTReader set up the internal state directly.

llvm-svn: 144153
2011-11-09 01:24:17 +00:00
Eli Friedman 16932001c9 Add "I" (ICE) annotations onto a few more x86 intrinsics.
llvm-svn: 144152
2011-11-09 01:08:43 +00:00
Argyrios Kyrtzidis 3a8de5b560 Don't crash on invalid objc code.
llvm-svn: 144150
2011-11-09 00:22:48 +00:00
Argyrios Kyrtzidis 485eceed38 [arcmt] Take into account that all properties are strong-by-default now and fix the test.
llvm-svn: 144146
2011-11-08 23:09:34 +00:00
John McCall 9a54961e01 Bind function "r-values" as l-values when emitting them as
opaque values.  Silly C type system.

llvm-svn: 144144
2011-11-08 22:54:08 +00:00
Fariborz Jahanian 557fc9a99d objc: Don't crash on missing @interface decl.
// rdar://10415026

llvm-svn: 144143
2011-11-08 22:51:27 +00:00
Anna Zaks 26573c5585 [analyzer] Testing: test with all the non-experimental checker packages.
llvm-svn: 144142
2011-11-08 22:41:25 +00:00
Anna Zaks a1b56e2aa3 [analyzer] Testing: support for regenerate reference output
Change the flow of the SATestAdd so that it could be used for regenerating
the reference output without exiting with an error.

llvm-svn: 144141
2011-11-08 22:41:22 +00:00
Argyrios Kyrtzidis e4a38a73fd [arcmt] Now that readonly properties are strong-by-default, do not add redundant 'strong'.
llvm-svn: 144136
2011-11-08 22:10:58 +00:00
Douglas Gregor 9bd86daa95 Fix comment typos
llvm-svn: 144120
2011-11-08 21:07:04 +00:00
Fariborz Jahanian b1ac0813a6 objc-arc: 'readonly' property of retainable object
type is strong by default too. // rdar://10410903

llvm-svn: 144118
2011-11-08 20:58:53 +00:00
Ted Kremenek da3cfc9fef Sort contents of exports file. No functionality change.
llvm-svn: 144116
2011-11-08 20:42:13 +00:00
Ted Kremenek cc88d264eb serialized diagnostics: serialize the version info in a separate meta block.
llvm-svn: 144115
2011-11-08 20:27:29 +00:00
Anna Zaks 0d58033bdb [analyzer] Remove redundant check from DivZeroChecker
Analysis by Ted:
"
    if (stateZero && !stateNotZero) {

is checking to see if:

  (A)  "it is possible for the value to be zero"   (stateZero)

    AND

  (B) "it is not possible for the value to be non-zero"  (!stateNotZero)

That said, the only way for both B to be true AND A to be false is if the path is completely infeasible by the time we reach the divide-by-zero check.  For the most part (all cases?), such cases should automatically get pruned out at branches (i.e., an infeasible path gets dropped), which is the case in our tests.  So the question is whether or not such an infeasible path might not get dropped earlier?  I can't envision any right now.

Indeed, the rest of the checker assumes that if the bug condition didn't fire then 'stateNotZero' is non-NULL:

    C.addTransition(stateNotZero);
"

llvm-svn: 144114
2011-11-08 19:56:35 +00:00
Anna Zaks 767d356f87 [analyzer] Testing: Display the number of reported differences in the main log.
llvm-svn: 144113
2011-11-08 19:56:31 +00:00
Eli Friedman 1307652185 This test isn't portable to non-x86 platforms; specify a triple.
llvm-svn: 144112
2011-11-08 19:55:32 +00:00
Douglas Gregor 6ea1d665a7 Mark the overloaded atomic builtins as having custom type checking,
which they do. This avoids all of the default argument promotions that
we (1) don't want, and (2) undo during that custom type checking, and
makes sure that we don't run into trouble during template
instantiation. Fixes PR11320.

llvm-svn: 144110
2011-11-08 19:45:38 +00:00
Eli Friedman 27b8c4f3fb Misc fixes for clang driver on Mips Linux. Patch by Simon Atanasyan.
llvm-svn: 144108
2011-11-08 19:43:37 +00:00
Axel Naumann fbc7b98e58 From Vassil Vassilev: add checks for removing Decls for more use cases.
llvm-svn: 144094
2011-11-08 18:21:06 +00:00
Chandler Carruth 475ab6ad7b Add a default system include of '/include'. This isn't particularly
useful when using Clang as a system-compiler, but its harmless. When
using Clang as a cross-compiler, this can be very handy as quite a few
toolchains ship their libc headers here rather than under
'/usr/include'.

For reference, this is the beginning of my work to also make the Clang
driver more suitable as a cross-compiler.

llvm-svn: 144089
2011-11-08 17:19:47 +00:00
Argyrios Kyrtzidis dbe077a89d [arcmt] Now that properties are strong by default, avoid adding redundant '(strong)'
property attribute.

llvm-svn: 144078
2011-11-08 05:56:11 +00:00
Argyrios Kyrtzidis 3befb8cd8a [arcmt] NSViewController does not support weak.
llvm-svn: 144077
2011-11-08 05:56:08 +00:00
Bob Wilson e4d7723b87 Check pointer types for arguments of Neon load/store macros. rdar://9958031
The Neon load/store intrinsics need to be implemented as macros to avoid
hiding alignment attributes on the pointer arguments, and the macros can
only evaluate those pointer arguments once (in case they have side effects),
so it has been hard to get the right type checking for those pointers.
I tried various alternatives in the arm_neon.h header, but it's much more
straightforward to just check directly in Sema.

llvm-svn: 144075
2011-11-08 05:04:11 +00:00
Eli Friedman 9586cdb01e Misc fixes to pcmp*stri.
llvm-svn: 144073
2011-11-08 04:13:51 +00:00
John McCall 0153cd3027 Fix the layout of vb-tables and vf-tables in the MS C++ ABI.
Based on work by Dmitry Sokolov!

llvm-svn: 144072
2011-11-08 04:01:03 +00:00
NAKAMURA Takumi dabda6b839 lib/CodeGen/CGBuiltin.cpp: Tweak the identifier "Type" to appease msvc.
llvm-svn: 144065
2011-11-08 03:27:04 +00:00
Peter Collingbourne 5ad3ebaefd TypePrinter: print OpenCL address space names. Patch by Richard
Membarth, test case by myself.

llvm-svn: 144063
2011-11-08 02:52:58 +00:00
Peter Collingbourne 32fab902de DeclPrinter: print the declaration's storage class specifier as
written, instead of the resolved storage class, which might not be
legal to specify on the declaration (such as out-of-line definitions
of static class members in C++, and __local variables in OpenCL).
Initial patch by Richard Membarth.

llvm-svn: 144062
2011-11-08 02:52:52 +00:00
Richard Smith ad45a8681d Some tests missed from r144056.
llvm-svn: 144060
2011-11-08 02:18:13 +00:00
Argyrios Kyrtzidis 2519a0801f [arcmt] When we already removed a __weak, don't try to change it to __unsafe_unretained
later on, or we will end up with a redundant '__unsafe_unretained'.

llvm-svn: 144059
2011-11-08 02:02:38 +00:00
Matt Beaumont-Gay fb3cb9a861 Revert r143972, which didn't actually compile under -Wnon-virtual-dtor.
(TIL: -Wnon-virtual-dtor is not in -Wall.)

llvm-svn: 144058
2011-11-08 01:53:17 +00:00
Richard Smith ec8dcd2716 Fix a cluster of related issues involving value-dependence and constant
expression evaluation:
 - When folding a non-value-dependent expression, we may try to use the
   initializer of a value-dependent variable. If that happens, give up.
 - In C++98, actually check that a const, non-volatile DeclRefExpr inside an ICE
   is of integral or enumeration type (a reference isn't OK!)
 - In C++11, DeclRefExprs for objects of const literal type initialized with
   value-dependent expressions are themselves value-dependent.
 - So are references initialized with value-dependent expressions (though this
   case is missing from the C++11 standard, along with many others).

llvm-svn: 144056
2011-11-08 01:31:09 +00:00