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

24675 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 593b0c1047 Add some missing concurrency checks into libclang
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114682 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 18:47:53 +00:00
Argyrios Kyrtzidis 2b64239a8e Fix bogus compiler errors when declaring anonymous union, outside a class, with
members with the same name as a decl outside the scope where the members are actually introduced.
Fixes http://llvm.org/PR6741

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114641 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 14:26:01 +00:00
Argyrios Kyrtzidis f765d76407 If -fcolor-diagnostics is explicitly passed to the driver respect that even if the driver is of the opinion that
stderr can't handle them. (see http://llvm.org/PR8150)
Patch by Frits van Bommel!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114638 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 12:56:06 +00:00
Argyrios Kyrtzidis 47423bdaa0 Don't crash on _Imaginary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114637 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 09:40:31 +00:00
Argyrios Kyrtzidis 7d8eb519ce Use -emit-llvm-only in the test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114636 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 09:40:20 +00:00
Ted Kremenek c69c43845a Refactor GRExprEngine::VisitCall() to use EvalArguments(), just like VisitCXXMemberCallExpr(). Ideally we should unify these code paths as much as possible, since they only differ by a few details.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114628 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 05:14:51 +00:00
Daniel Dunbar 7bb1d23213 Tweak test to pass -ffreestanding, to avoid platform dependent header issues.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114627 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 04:40:10 +00:00
Daniel Dunbar f554b1cc30 IRgen/ABI/ARM: Return large vectors in memory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114619 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 01:54:32 +00:00
Daniel Dunbar 8aa87c71d9 IRgen/ABI/ARM: Trust the backend to pass vectors correctly for the given ABI.
- Therefore, we can lower out the NEON wrapper structs and pass the vectors
   directly. This makes a huge difference in the cleanliness of the IR after
   optimization.
 - I will trust, but verify, via future ABITest testing (for APCS-GNU, at
   least).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114618 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 01:54:28 +00:00
Ted Kremenek 3df2f31c4e Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114615 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-23 00:35:46 +00:00
Douglas Gregor 2be5bc9ad3 Implement libclang API functions for retrieving the lexical and
semantic parents of the given cursor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114587 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 21:22:29 +00:00
Devang Patel b4a9aec74a Testcase for r114585.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114586 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 21:13:48 +00:00
Tom Care 0e1cd94439 Fix an inverse boolean and unnecessary new line in warning output from AnalyzerStatsChecker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114581 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 21:07:51 +00:00
Sebastian Redl 8db9faed41 Change source manager serialization to be less tied to the PCH model.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114575 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 20:19:08 +00:00
Douglas Gregor e45bb6aefb Fix a hard-to-reproduce crash-on-invalid, where we weren't checking for a valid result from ActOnIdExpression
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114548 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 16:33:13 +00:00
Argyrios Kyrtzidis 78a916ec5f Implement -Wpadded and -Wpacked.
-Wpadded warns when undesired padding is introduced in a struct. (rdar://7469556)
-Wpacked warns if a struct is given the packed attribute, but the packed attribute has no effect
  on the layout or the size of the struct. Such structs may be mis-aligned for little benefit.

The warnings are emitted at the point where layout is calculated, that is at RecordLayoutBuilder.
To avoid calculating the layouts of all structs regardless of whether they are needed or not,
I let the layouts be lazily constructed when needed. This has the disadvantage that the above warnings
will be emitted only when they are used for IR gen, and not e.g with -fsyntax-only:

$ cat t.c
struct S {
  char c;
  int i;
};
void f(struct S* s) {}

$ clang -fsyntax-only -Wpadded t.c
$ clang -c -Wpadded t.c -o t.o
t.c:3:7: warning: padding struct 'struct S' with 3 bytes to align 'i' [-Wpadded]
  int i;
      ^
1 warning generated.

This is a good tradeoff between providing the warnings and not calculating layouts for all
structs in case the user has enabled a couple of rarely used warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114544 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 14:32:24 +00:00
Chris Lattner 398e6b90f5 update a bunch of tests that are using the x86 backend instead of grepping IR :(
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114535 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 06:09:31 +00:00
Sebastian Redl 4ee5a6f9bd Only preload SLocEntries after the entire PCH chain was loaded.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114518 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 00:42:30 +00:00
Sebastian Redl 301c9b0b67 Reshuffle PerFileData's members to make more sense.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114517 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 00:42:27 +00:00
Daniel Dunbar 885b1dbc6e Driver/Darwin: Add a runtime library just for ___eprintf -- when targeting i386
some projects still depend on ___eprintf being available.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114509 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-22 00:03:52 +00:00
Chris Lattner 4f209445c0 fix the rest of rdar://8461279 - clang miscompiles address-space qualified atomics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114503 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 23:40:48 +00:00
Chris Lattner 780a2eb227 same bug as before, this time with __sync_val_compare_and_swap.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114502 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 23:35:30 +00:00
Chris Lattner f2b95277be fix __sync_bool_compare_and_swap to work with address-space qualified types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114498 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 23:24:52 +00:00
Chris Lattner c7f78c74e1 filecheckize.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114497 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 23:22:41 +00:00
Fariborz Jahanian f443570387 Fixes an IRgen ICE due to cast of null pointer to
a vla type (fixes pr7827).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114495 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 22:53:33 +00:00
John Thompson 7ccc58f9ff Fixed pr20314-2.c failure, added E, F, p constraint letters.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114490 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 22:04:54 +00:00
Ted Kremenek a054fb46b1 Correctly register the class extension as the lexical DeclContext for ObjC methods declared with @property in class extensions.
This matches the behavior for setters.

Also pass the class extension to ProcessPropertyDecl as the lexical DeclContext, even when not redeclaring the @property.

This fixes the remaining issues in <rdar://problem/7410145>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114477 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 20:52:59 +00:00
Fariborz Jahanian 0b78710636 IRgen for gnu extension's conditional lvalue expression
with missing LHS. radar 8453812. Executable test is checked 
into llvm test suite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114457 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 18:32:21 +00:00
Ted Kremenek 8254aa62d9 For ObjCPropertyDecls in class extensions, use the class extension as the lexical DeclContext for newly created
ObjCMethodDecls.  Further, use the location of the new property declaration as the location of new ObjCMethodDecls
(if they didn't previously exist).

This fixes more of the issues reported in <rdar://problem/7410145>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114456 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 18:28:43 +00:00
Douglas Gregor 6f942b2cab Add code completion for C++ constructors wherever we see the class (or
class template) and are in a context where we can have a value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114441 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 16:06:22 +00:00
Benjamin Kramer 3475cfeebe Adjust for debug info API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114438 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 15:59:59 +00:00
Argyrios Kyrtzidis ff8819be64 Do not warn with -Wuninitialized when the member is used in a sizeof or address-of expression.
Fixes rdar://8331312.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114426 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 10:47:20 +00:00
Marcin Swiderski 1cff132e48 Added:
- definitions of interfaces for CFGInitializer and CFGAutomaticObjDtor,
- support for above classes to print_elem function (renamed print_stmt),
- support for VarDecls in StmtPrinterHelper.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114403 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 05:58:15 +00:00
Ted Kremenek 097727ba0c Fix indentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114394 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 04:47:01 +00:00
Ted Kremenek c52d069277 Check for null ObjCInterfaceDecls returned from getClassInterface() when generating USRs. While I have no test case for this (could not create one), this shows up in crash reports. Tentatively fixes <rdar://problem/8452791>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114392 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 04:45:46 +00:00
Bill Wendling 2e81caa143 Add a comment explaining why the MMX builtins are segregated and what we plan on
doing with them. It's a "FIXME" right now because this change hasn't been
implemented yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114385 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 01:39:34 +00:00
Douglas Gregor b9d775734b When providing code completions for an argument in an Objective-C
message send, e.g.,

  [[NSString alloc] initWithCString:<CC>

look up all of the possible methods and determine the preferred type
for the argument expression based on the type of the corresponding
parameter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114379 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-21 00:03:25 +00:00
Fariborz Jahanian aa3b57ee9e Implements in IRgen gnu extensions missing LHS for
complex conditionals. Radar 8453812.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114376 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 23:50:22 +00:00
Douglas Gregor 70c5ac70ac Refactor code completion for expressions that occur as arguments in
Objective-C message sends. There is no functionality change here; this
is prep work for using the parameter types to help guide the
expression results when code-completing the argument.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114375 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 23:34:21 +00:00
Douglas Gregor 08f43cd5d9 Code completion has no reason to prefer values over types, especially
at the statement level or in Objective-C message receivers. Therefore,
just give types and declarations the same basic priority, and adjust
from there.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114374 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 23:11:55 +00:00
Nate Begeman 6155d73ad1 Check in support for OpenCL conditional operator on vector types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114371 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 22:41:17 +00:00
Douglas Gregor cee9ff1668 Slight refactoring in code-completion results generation, placing the
various priority adjustments for preferences (based on selectors,
types) in a single function to make extension easier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114370 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 22:39:41 +00:00
Douglas Gregor d475aad02d Get rid of the lame attempt to prioritize "void" functions at
statement context; it really isn't helpful in practice (remember
printf!) and we'll be doing other adjustments for statements very soon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114358 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 21:25:19 +00:00
Douglas Gregor b05496dbd6 Tweak priorities for some types and macros:
- In Objective-C, we prefer BOOL to bool for historic reasons;
  slightly penalize "bool".
  - Treat Nil macro as a NULL pointer constant.
  - Treat YES, NO, true, and false macros as constants.
  - Treat the bool macro as a type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114356 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 21:11:48 +00:00
Bill Wendling 957b03be80 The builtins __builtin_ia32_paddq and __builtin_ia32_psubq were missing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114349 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 20:40:00 +00:00
Douglas Gregor 66b7fbfa7b Introduce a simple, substitution-based compression scheme for USRs, so
that redundant types don't result in super-long USRs. Fixes
<rdar://problem/8447875>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114347 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 20:37:39 +00:00
Douglas Gregor b3decb6cea Fix CMake clangIndex library dependencies, from Logan Chien
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114336 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 18:32:29 +00:00
Daniel Dunbar dea63134a5 Driver/Objective-C: Retool Objective-C ABI flags to be more usable, and actually
document behavior. Will wonders never cease.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114334 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 18:19:55 +00:00
Douglas Gregor ea844f3aa2 Check that an overloaded function name, when used by the ! operator,
actually resolves to a particular function. Fixes PR8181, from Faisal
Vali!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114331 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 17:13:33 +00:00
Douglas Gregor 4ada9d3aa4 Give implicitly-defined default constructors and destructors empty
bodies, from Martin Vejnar!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114329 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-20 16:48:21 +00:00