Граф коммитов

32763 Коммитов

Автор SHA1 Сообщение Дата
NAKAMURA Takumi a4ca95a6eb c-index-test.c: Fix a comment style. /* It is C source. */
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144274 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 10:07:57 +00:00
Richard Smith 6c95787b25 Constant expression evaluation: support for constexpr member functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144273 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 09:31:24 +00:00
NAKAMURA Takumi 9190943fef c-index-test.c: Fix syntax. It is C source.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144272 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 09:30:15 +00:00
John McCall b99785bdd1 Fix a subtle bug with cleanups: when activating
a previously-inactive cleanup, not only do we need a
flag variable, but we should also force the cleanup to
query the flag variable.  However, we only need to do
this when we're activating in a context that's
conditionally executed;  otherwise, we may safely
assume that the cleanup is dominated by the activation
point.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144271 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 09:22:44 +00:00
Richard Smith c430ef4f92 PR11148: Fix crash-on-invalid if an invalid member declaration is marked as
defaulted or deleted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144270 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 09:08:44 +00:00
Ted Kremenek 153221717e serialized diagnostics: implement full deserialization of clang diagnostics via the libclang API.
I've tested it on simple cases and it works.  Test cases to follow as well as a few tweaks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144269 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 08:43:12 +00:00
John McCall 1a343ebbf4 Enter the cleanups for a block outside the enclosing
full-expression.  Naturally they're inactive before we enter
the block literal expression.  This restores the intended
behavior that blocks belong to their enclosing scope.

There's a useful -O0 / compile-time optimization that we're
missing here with activating cleanups following straight-line
code from their inactive beginnings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144268 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 08:15:53 +00:00
Richard Smith 180f47959a Constant expression evaluation: support for evaluation of structs and unions of
literal types, as well as derived-to-base casts for lvalues and
derived-to-virtual-base casts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144265 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 06:34:14 +00:00
David Blaikie 64b4b43a23 Removing unused initialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144264 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 05:42:04 +00:00
John McCall 80ee6e878a There's no good reason to track temporaries in ExprWithCleanups,
but it is sometimes useful to track blocks.  Do so.  Also
optimize the storage of these expressions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144263 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 05:35:25 +00:00
Richard Smith 1445bbacf4 Temporary fix for a performance problem Eli spotted. The APValue representation
is currently too inefficient to allow us to use it for array initializers, but
fortunately we usually don't yet need to evaluate such initializers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144260 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 03:30:42 +00:00
Nick Lewycky 7480d96830 Reflow lines, remove else-if after returns, rename variable "TydefContext" to
"TypedefContext". No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144248 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 00:34:02 +00:00
Eli Friedman 347208968c Fix some additional x86 intrinsics to use "I" (ICE) markings. Fix *mmintrin.h to take them into account.
<rdar://problem/10341145>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144246 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-10 00:11:13 +00:00
Rafael Espindola cb6542f486 Fix the signature of __sigsetjmp and sigsetjmp. Patch by Dimitry Andric.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144237 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 22:46:10 +00:00
Devang Patel a8ecd7c82a Remove unnecessary include.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144210 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 21:08:24 +00:00
Fariborz Jahanian 108fb14563 objc rewriter: use a more specific name for local variable used
in fast enumeration rewrite. // rdar://10415026


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144191 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 17:41:43 +00:00
John McCall f3fb5c5395 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 17:10:36 +00:00
Douglas Gregor c9a237168c Define some built-ins macros on mips32 platform, from Simon Atanasyan!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144189 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 15:17:16 +00:00
Benjamin Kramer 608b402209 Update test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144185 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 12:43:30 +00:00
Chandler Carruth a720287340 Try to fix an issue on some hosts where the 'lib' in the builtin include
path is actually a multilib.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144177 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 08:26:57 +00:00
David Blaikie ba243b59a1 Fixing 80 col violations (& removing any trailing whitespace on files I was touching anyway)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144171 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 06:07:30 +00:00
David Blaikie a8fbc053eb Fix 80 cols violations & remove trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144170 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 05:30:24 +00:00
Nick Lewycky 7b3819dfb8 Reflow one line I missed in previous cleanup commit. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144168 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 04:27:23 +00:00
Nick Lewycky d4c100e98d 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144167 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 04:25:21 +00:00
Chandler Carruth d936d9d9ab 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144165 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 03:46:20 +00:00
John McCall a59e4b7fca 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144162 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 03:17:26 +00:00
Douglas Gregor d3891e9fb7 Workaround for compilers that don't implement C++ DR45, from Tom Honermann!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144161 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 03:05:27 +00:00
Douglas Gregor b31dd8ff34 Put ext_offsetof_extended_field_designator under the warning flag
-Wextended-offsetof, from Jeff Walden!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144160 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 03:01:42 +00:00
Douglas Gregor 6b18e74049 Don't crash when transforming an ill-formed pseudo-destructor
expression. Fixes PR11339.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144159 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 02:19:47 +00:00
John McCall 3382f65767 Extract the blocks-related ARC tests into their own file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144158 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 02:16:13 +00:00
Douglas Gregor 6ef920976a Introduce proper spacing after the Objective-C parameter qualifiers
(bycopy, inout, etc.). Fixes <rdar://problem/10402900>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144157 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 02:13:45 +00:00
Richard Smith 3d75ca8362 Constant expression evaluation: support for default arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144156 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 02:12:41 +00:00
Devang Patel 790c372f38 Remove extra ';'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144155 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 01:57:23 +00:00
Argyrios Kyrtzidis 87429a05ff [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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144153 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 01:24:17 +00:00
Eli Friedman 75d0fe7100 Add "I" (ICE) annotations onto a few more x86 intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144152 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 01:08:43 +00:00
Argyrios Kyrtzidis ccc9e767f2 Don't crash on invalid objc code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144150 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-09 00:22:48 +00:00
Argyrios Kyrtzidis 8b08eb3456 [arcmt] Take into account that all properties are strong-by-default now and fix the test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144146 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 23:09:34 +00:00
John McCall a5493f8850 Bind function "r-values" as l-values when emitting them as
opaque values.  Silly C type system.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144144 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 22:54:08 +00:00
Fariborz Jahanian 90f7b62aba objc: Don't crash on missing @interface decl.
// rdar://10415026


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144143 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 22:51:27 +00:00
Anna Zaks 8d4a515b03 [analyzer] Testing: test with all the non-experimental checker packages.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144142 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 22:41:25 +00:00
Anna Zaks 86f14abc02 [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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144141 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 22:41:22 +00:00
Argyrios Kyrtzidis af9b5e9f3e [arcmt] Now that readonly properties are strong-by-default, do not add redundant 'strong'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144136 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 22:10:58 +00:00
Douglas Gregor 3f54d48a75 Fix comment typos
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144120 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 21:07:04 +00:00
Fariborz Jahanian f21a92d359 objc-arc: 'readonly' property of retainable object
type is strong by default too. // rdar://10410903


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144118 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 20:58:53 +00:00
Ted Kremenek 4c11772bb9 Sort contents of exports file. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144116 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 20:42:13 +00:00
Ted Kremenek 0b69aa8563 serialized diagnostics: serialize the version info in a separate meta block.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144115 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 20:27:29 +00:00
Anna Zaks 8d0ffc7f8c [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);
"

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144114 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 19:56:35 +00:00
Anna Zaks a7a2564ff5 [analyzer] Testing: Display the number of reported differences in the main log.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144113 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 19:56:31 +00:00
Eli Friedman 4219c6652b This test isn't portable to non-x86 platforms; specify a triple.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144112 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 19:55:32 +00:00
Douglas Gregor 5b0c5199a7 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144110 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-08 19:45:38 +00:00