]> granicus.if.org Git - clang/log
clang
14 years agoDriver: Add -fallow-unsupported which disables some of the eager error'ing we do
Daniel Dunbar [Fri, 24 Sep 2010 19:39:37 +0000 (19:39 +0000)]
Driver: Add -fallow-unsupported which disables some of the eager error'ing we do
to prevent users from trying unsupported stuff. Useful for testing.

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

14 years agoFix rewriting of property declared in @protocol's.
Fariborz Jahanian [Fri, 24 Sep 2010 18:36:58 +0000 (18:36 +0000)]
Fix rewriting of property declared in @protocol's.
Fixed //rdar://8472487.

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

14 years agoPatch implements passing arrays to functions expecting
Fariborz Jahanian [Fri, 24 Sep 2010 17:30:16 +0000 (17:30 +0000)]
Patch implements passing arrays to functions expecting
vla. Implements pr7827.

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

14 years agoUpdate Clang man page to say a little bit more about C++
Douglas Gregor [Fri, 24 Sep 2010 17:26:14 +0000 (17:26 +0000)]
Update Clang man page to say a little bit more about C++

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

14 years agoRemove this test for now until I figure out how to get it to work with c-index-test...
Ted Kremenek [Fri, 24 Sep 2010 02:43:32 +0000 (02:43 +0000)]
Remove this test for now until I figure out how to get it to work with c-index-test in a portable way.

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

14 years agoPass -fobjc-nonfragile-abi2 in test.
Ted Kremenek [Fri, 24 Sep 2010 02:00:46 +0000 (02:00 +0000)]
Pass -fobjc-nonfragile-abi2 in test.

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

14 years agoSince this test depends on default ivar synthesis, specify the target triple. This...
Ted Kremenek [Fri, 24 Sep 2010 01:51:38 +0000 (01:51 +0000)]
Since this test depends on default ivar synthesis, specify the target triple.  This hopefully unbreaks the buildbot
on some archs.

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

14 years agoUpdate comment in test with reference to bug report.
Ted Kremenek [Fri, 24 Sep 2010 01:24:15 +0000 (01:24 +0000)]
Update comment in test with reference to bug report.

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

14 years agoDefault synthesized ivars don't really have a location in the source. Using the...
Ted Kremenek [Fri, 24 Sep 2010 01:23:01 +0000 (01:23 +0000)]
Default synthesized ivars don't really have a location in the source.  Using the location of the @implementation
is just confusing for clients that want to use SourceLocations for syntactic references.

Fixes: <rdar://problem/8470540>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114714 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoRevert r114712 due to failure on darwin buildbot.
Nick Lewycky [Fri, 24 Sep 2010 00:46:53 +0000 (00:46 +0000)]
Revert r114712 due to failure on darwin buildbot.

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

14 years agoMake -M/-MM behave like in gcc; use -MF first then -o else use stdout.
Nick Lewycky [Thu, 23 Sep 2010 23:49:25 +0000 (23:49 +0000)]
Make -M/-MM behave like in gcc; use -MF first then -o else use stdout.

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

14 years agoFix header comment so we don't break emacs.
Nick Lewycky [Thu, 23 Sep 2010 23:48:20 +0000 (23:48 +0000)]
Fix header comment so we don't break emacs.

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

14 years agoSynchronize globally-cached code completion results with the results
Douglas Gregor [Thu, 23 Sep 2010 23:01:17 +0000 (23:01 +0000)]
Synchronize globally-cached code completion results with the results
provided when the optimization is disabled. In particular, split
the completion context CCC_Other into two contexts: CCC_Other, which
means that it's an undisclosed context for which any other results are
unwelcome, and CCC_Recovery, which is used in recovery cases.

Since we're now using the completion context within the completion
results builder, make sure that it's always set to something.

Fixes <rdar://problem/8470644>.

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

14 years agoFix typo.
Nick Lewycky [Thu, 23 Sep 2010 21:43:57 +0000 (21:43 +0000)]
Fix typo.

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

14 years agoWhen warning about comparing an unsigned int to being >= 0, don't issue a warning...
Ted Kremenek [Thu, 23 Sep 2010 21:43:44 +0000 (21:43 +0000)]
When warning about comparing an unsigned int to being >= 0, don't issue a warning if the zero value was an
enum or was expanded from a macro.

Fixes: <rdar://problem/8414119>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114695 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd test case for c-index-test showing that @property declarations added in class...
Ted Kremenek [Thu, 23 Sep 2010 21:25:13 +0000 (21:25 +0000)]
Add test case for c-index-test showing that @property declarations added in class extensions don't get reported
in the @interface.

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

14 years agoFor properties declared in a @protocol and redeclared in a class extension, use the...
Ted Kremenek [Thu, 23 Sep 2010 21:18:05 +0000 (21:18 +0000)]
For properties declared in a @protocol and redeclared in a class extension, use the class extension
as the lexical DeclContext for the @property declaration that gets auto-created for the @interface.

Fixes: <rdar://problem/8467189>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114693 91177308-0d34-0410-b5e6-96231b3b80d8

14 years agoAdd some missing concurrency checks into libclang
Douglas Gregor [Thu, 23 Sep 2010 18:47:53 +0000 (18:47 +0000)]
Add some missing concurrency checks into libclang

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

14 years agoFix bogus compiler errors when declaring anonymous union, outside a class, with
Argyrios Kyrtzidis [Thu, 23 Sep 2010 14:26:01 +0000 (14:26 +0000)]
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

14 years agoIf -fcolor-diagnostics is explicitly passed to the driver respect that even if the...
Argyrios Kyrtzidis [Thu, 23 Sep 2010 12:56:06 +0000 (12:56 +0000)]
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

14 years agoDon't crash on _Imaginary.
Argyrios Kyrtzidis [Thu, 23 Sep 2010 09:40:31 +0000 (09:40 +0000)]
Don't crash on _Imaginary.

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

14 years agoUse -emit-llvm-only in the test.
Argyrios Kyrtzidis [Thu, 23 Sep 2010 09:40:20 +0000 (09:40 +0000)]
Use -emit-llvm-only in the test.

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

14 years agoRefactor GRExprEngine::VisitCall() to use EvalArguments(), just like VisitCXXMemberCa...
Ted Kremenek [Thu, 23 Sep 2010 05:14:51 +0000 (05:14 +0000)]
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

14 years agoTweak test to pass -ffreestanding, to avoid platform dependent header issues.
Daniel Dunbar [Thu, 23 Sep 2010 04:40:10 +0000 (04:40 +0000)]
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

14 years agoIRgen/ABI/ARM: Return large vectors in memory.
Daniel Dunbar [Thu, 23 Sep 2010 01:54:32 +0000 (01:54 +0000)]
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

14 years agoIRgen/ABI/ARM: Trust the backend to pass vectors correctly for the given ABI.
Daniel Dunbar [Thu, 23 Sep 2010 01:54:28 +0000 (01:54 +0000)]
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

14 years agoUpdate checker build.
Ted Kremenek [Thu, 23 Sep 2010 00:35:46 +0000 (00:35 +0000)]
Update checker build.

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

14 years agoImplement libclang API functions for retrieving the lexical and
Douglas Gregor [Wed, 22 Sep 2010 21:22:29 +0000 (21:22 +0000)]
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

14 years agoTestcase for r114585.
Devang Patel [Wed, 22 Sep 2010 21:13:48 +0000 (21:13 +0000)]
Testcase for r114585.

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

14 years agoFix an inverse boolean and unnecessary new line in warning output from AnalyzerStatsC...
Tom Care [Wed, 22 Sep 2010 21:07:51 +0000 (21:07 +0000)]
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

14 years agoChange source manager serialization to be less tied to the PCH model.
Sebastian Redl [Wed, 22 Sep 2010 20:19:08 +0000 (20:19 +0000)]
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

14 years agoFix a hard-to-reproduce crash-on-invalid, where we weren't checking for a valid resul...
Douglas Gregor [Wed, 22 Sep 2010 16:33:13 +0000 (16:33 +0000)]
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

14 years agoImplement -Wpadded and -Wpacked.
Argyrios Kyrtzidis [Wed, 22 Sep 2010 14:32:24 +0000 (14:32 +0000)]
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

14 years agoupdate a bunch of tests that are using the x86 backend instead of grepping IR :(
Chris Lattner [Wed, 22 Sep 2010 06:09:31 +0000 (06:09 +0000)]
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

14 years agoOnly preload SLocEntries after the entire PCH chain was loaded.
Sebastian Redl [Wed, 22 Sep 2010 00:42:30 +0000 (00:42 +0000)]
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

14 years agoReshuffle PerFileData's members to make more sense.
Sebastian Redl [Wed, 22 Sep 2010 00:42:27 +0000 (00:42 +0000)]
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

14 years agoDriver/Darwin: Add a runtime library just for ___eprintf -- when targeting i386
Daniel Dunbar [Wed, 22 Sep 2010 00:03:52 +0000 (00:03 +0000)]
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

14 years agofix the rest of rdar://8461279 - clang miscompiles address-space qualified atomics
Chris Lattner [Tue, 21 Sep 2010 23:40:48 +0000 (23:40 +0000)]
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

14 years agosame bug as before, this time with __sync_val_compare_and_swap.
Chris Lattner [Tue, 21 Sep 2010 23:35:30 +0000 (23:35 +0000)]
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

14 years agofix __sync_bool_compare_and_swap to work with address-space qualified types.
Chris Lattner [Tue, 21 Sep 2010 23:24:52 +0000 (23:24 +0000)]
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

14 years agofilecheckize.
Chris Lattner [Tue, 21 Sep 2010 23:22:41 +0000 (23:22 +0000)]
filecheckize.

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

14 years agoFixes an IRgen ICE due to cast of null pointer to
Fariborz Jahanian [Tue, 21 Sep 2010 22:53:33 +0000 (22:53 +0000)]
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

14 years agoFixed pr20314-2.c failure, added E, F, p constraint letters.
John Thompson [Tue, 21 Sep 2010 22:04:54 +0000 (22:04 +0000)]
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

14 years agoCorrectly register the class extension as the lexical DeclContext for ObjC methods...
Ted Kremenek [Tue, 21 Sep 2010 20:52:59 +0000 (20:52 +0000)]
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

14 years agoIRgen for gnu extension's conditional lvalue expression
Fariborz Jahanian [Tue, 21 Sep 2010 18:32:21 +0000 (18:32 +0000)]
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

14 years agoFor ObjCPropertyDecls in class extensions, use the class extension as the lexical...
Ted Kremenek [Tue, 21 Sep 2010 18:28:43 +0000 (18:28 +0000)]
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

14 years agoAdd code completion for C++ constructors wherever we see the class (or
Douglas Gregor [Tue, 21 Sep 2010 16:06:22 +0000 (16:06 +0000)]
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

14 years agoAdjust for debug info API change.
Benjamin Kramer [Tue, 21 Sep 2010 15:59:59 +0000 (15:59 +0000)]
Adjust for debug info API change.

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

14 years agoDo not warn with -Wuninitialized when the member is used in a sizeof or address-of...
Argyrios Kyrtzidis [Tue, 21 Sep 2010 10:47:20 +0000 (10:47 +0000)]
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

14 years agoAdded:
Marcin Swiderski [Tue, 21 Sep 2010 05:58:15 +0000 (05:58 +0000)]
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

14 years agoFix indentation.
Ted Kremenek [Tue, 21 Sep 2010 04:47:01 +0000 (04:47 +0000)]
Fix indentation.

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

14 years agoCheck for null ObjCInterfaceDecls returned from getClassInterface() when generating...
Ted Kremenek [Tue, 21 Sep 2010 04:45:46 +0000 (04:45 +0000)]
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

14 years agoAdd a comment explaining why the MMX builtins are segregated and what we plan on
Bill Wendling [Tue, 21 Sep 2010 01:39:34 +0000 (01:39 +0000)]
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

14 years agoWhen providing code completions for an argument in an Objective-C
Douglas Gregor [Tue, 21 Sep 2010 00:03:25 +0000 (00:03 +0000)]
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

14 years agoImplements in IRgen gnu extensions missing LHS for
Fariborz Jahanian [Mon, 20 Sep 2010 23:50:22 +0000 (23:50 +0000)]
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

14 years agoRefactor code completion for expressions that occur as arguments in
Douglas Gregor [Mon, 20 Sep 2010 23:34:21 +0000 (23:34 +0000)]
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

14 years agoCode completion has no reason to prefer values over types, especially
Douglas Gregor [Mon, 20 Sep 2010 23:11:55 +0000 (23:11 +0000)]
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

14 years agoCheck in support for OpenCL conditional operator on vector types.
Nate Begeman [Mon, 20 Sep 2010 22:41:17 +0000 (22:41 +0000)]
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

14 years agoSlight refactoring in code-completion results generation, placing the
Douglas Gregor [Mon, 20 Sep 2010 22:39:41 +0000 (22:39 +0000)]
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

14 years agoGet rid of the lame attempt to prioritize "void" functions at
Douglas Gregor [Mon, 20 Sep 2010 21:25:19 +0000 (21:25 +0000)]
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

14 years agoTweak priorities for some types and macros:
Douglas Gregor [Mon, 20 Sep 2010 21:11:48 +0000 (21:11 +0000)]
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

14 years agoThe builtins __builtin_ia32_paddq and __builtin_ia32_psubq were missing.
Bill Wendling [Mon, 20 Sep 2010 20:40:00 +0000 (20:40 +0000)]
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

14 years agoIntroduce a simple, substitution-based compression scheme for USRs, so
Douglas Gregor [Mon, 20 Sep 2010 20:37:39 +0000 (20:37 +0000)]
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

14 years agoFix CMake clangIndex library dependencies, from Logan Chien
Douglas Gregor [Mon, 20 Sep 2010 18:32:29 +0000 (18:32 +0000)]
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

14 years agoDriver/Objective-C: Retool Objective-C ABI flags to be more usable, and actually
Daniel Dunbar [Mon, 20 Sep 2010 18:19:55 +0000 (18:19 +0000)]
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

14 years agoCheck that an overloaded function name, when used by the ! operator,
Douglas Gregor [Mon, 20 Sep 2010 17:13:33 +0000 (17:13 +0000)]
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

14 years agoGive implicitly-defined default constructors and destructors empty
Douglas Gregor [Mon, 20 Sep 2010 16:48:21 +0000 (16:48 +0000)]
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

14 years agoRevert r114316, -Wunused-value enabled by default was intended.
Argyrios Kyrtzidis [Sun, 19 Sep 2010 23:03:35 +0000 (23:03 +0000)]
Revert r114316, -Wunused-value enabled by default was intended.

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

14 years agoMake -Wunused-value off by default, matching GCC. Fixes rdar://7126194.
Argyrios Kyrtzidis [Sun, 19 Sep 2010 21:21:44 +0000 (21:21 +0000)]
Make -Wunused-value off by default, matching GCC. Fixes rdar://7126194.

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

14 years agoImplement -Wunused-label.
Argyrios Kyrtzidis [Sun, 19 Sep 2010 21:21:25 +0000 (21:21 +0000)]
Implement -Wunused-label.

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

14 years agoWarn when an expression result in a LabelStmt is unused.
Argyrios Kyrtzidis [Sun, 19 Sep 2010 21:21:10 +0000 (21:21 +0000)]
Warn when an expression result in a LabelStmt is unused.

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

14 years agoUpdate users manual comments on X86 and ARM support.
Daniel Dunbar [Sun, 19 Sep 2010 19:26:59 +0000 (19:26 +0000)]
Update users manual comments on X86 and ARM support.

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

14 years agoFixes IRgen bug in objc++ reference binding of a
Fariborz Jahanian [Sat, 18 Sep 2010 20:47:25 +0000 (20:47 +0000)]
Fixes IRgen bug in objc++ reference binding of a
getter expression.
Fixes // rdar://8437240

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

14 years agoProblem with gnu conditional extension with missing
Fariborz Jahanian [Sat, 18 Sep 2010 19:38:38 +0000 (19:38 +0000)]
Problem with gnu conditional extension with missing
LHS and when conditional expression is an array. Since
it will be decayed, saved expression must be saved with
decayed expression. This is necessary to preserve semantics
of this extension (and prevent an IRGen crash which expects
an array to always be decayed). I am sure there will be other
cases in c++ (aggregate conditionals for example) when saving of the
expression must happen after some transformation on conditional
expression has happened.
Doug, please review.  Fixes // rdar://8446940

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

14 years agoGive the Objective-C _cmd an "unlikely" code completion priority; it's
Douglas Gregor [Sat, 18 Sep 2010 15:16:27 +0000 (15:16 +0000)]
Give the Objective-C _cmd an "unlikely" code completion priority; it's
very rarely used.

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

14 years agodo not rely on the implicit-dereference semantics of dyn_cast_or_null
Gabor Greif [Sat, 18 Sep 2010 13:00:17 +0000 (13:00 +0000)]
do not rely on the implicit-dereference semantics of dyn_cast_or_null

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

14 years agostatic local variables with destructors don't require a global destructor
John McCall [Sat, 18 Sep 2010 05:25:11 +0000 (05:25 +0000)]
static local variables with destructors don't require a global destructor
unless we're on a platform without __cxa_atexit (or use thereof has been
disabled).  This patch actually just disables the check completely for
static locals, but I've filed http://llvm.org/bugs/show_bug.cgi?id=8176 to
track the platform-specific fix.

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

14 years agoAdjust a fixup's starting branch if it's being resolved because
John McCall [Sat, 18 Sep 2010 02:24:39 +0000 (02:24 +0000)]
Adjust a fixup's starting branch if it's being resolved because
it reached the outermost scope and it hasn't yet been forwarded
to a cleanup.  Fixed PR8175.

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

14 years agoAdd another text for code completion after recovery
Douglas Gregor [Sat, 18 Sep 2010 02:10:40 +0000 (02:10 +0000)]
Add another text for code completion after recovery

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

14 years agoContinue parsing more postfix expressions, even after semantic
Douglas Gregor [Sat, 18 Sep 2010 01:28:11 +0000 (01:28 +0000)]
Continue parsing more postfix expressions, even after semantic
errors. Improves code completion in yet another case.

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

14 years agoAdded '|' delimiter to separate inline asm multiple alternative constraints for Clang...
John Thompson [Sat, 18 Sep 2010 01:15:13 +0000 (01:15 +0000)]
Added '|' delimiter to separate inline asm multiple alternative constraints for Clang side of support.

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

14 years agoAdd more error checking to attribute vecreturn
John Thompson [Sat, 18 Sep 2010 01:12:07 +0000 (01:12 +0000)]
Add more error checking to attribute vecreturn

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

14 years agoFix a bug with binding l-values to elided temporaries, and leave a couple
John McCall [Sat, 18 Sep 2010 00:58:34 +0000 (00:58 +0000)]
Fix a bug with binding l-values to elided temporaries, and leave a couple
helpful asserts behind.

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

14 years agoformatted everything to fit within 80 columns
Anton Yartsev [Sat, 18 Sep 2010 00:39:16 +0000 (00:39 +0000)]
formatted everything to fit within 80 columns

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

14 years agoTestcase for r114239.
Bill Wendling [Sat, 18 Sep 2010 00:26:29 +0000 (00:26 +0000)]
Testcase for r114239.

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

14 years agoRevert r114244 since it breaks a test in Analysis.
Tom Care [Sat, 18 Sep 2010 00:17:17 +0000 (00:17 +0000)]
Revert r114244 since it breaks a test in Analysis.

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

14 years agoIdempotentOperationChecker no longer reports errors that are post-dominated by a...
Tom Care [Sat, 18 Sep 2010 00:06:34 +0000 (00:06 +0000)]
IdempotentOperationChecker no longer reports errors that are post-dominated by a sink. This fixes some false positives that were flagged because a path was incomplete (usually in a loop).

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

14 years agoThe MMX shift-with-immediate builtins require the equivalent
Bill Wendling [Fri, 17 Sep 2010 23:46:16 +0000 (23:46 +0000)]
The MMX shift-with-immediate builtins require the equivalent
shift-with-immediate LLVM intrinsics.

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

14 years agoRemove FIXME. The type is correct.
Bill Wendling [Fri, 17 Sep 2010 23:45:24 +0000 (23:45 +0000)]
Remove FIXME. The type is correct.

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

14 years agoSema/transparent_union: Make sure to add implicit cast when constructing
Daniel Dunbar [Fri, 17 Sep 2010 23:21:43 +0000 (23:21 +0000)]
Sema/transparent_union: Make sure to add implicit cast when constructing
implicit union values for the transparent_union extension.

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

14 years agoTweak in DeclPrinter printing of uses of copy constructors. Patch by Jim Goodnow II.
Ted Kremenek [Fri, 17 Sep 2010 23:04:38 +0000 (23:04 +0000)]
Tweak in DeclPrinter printing of uses of copy constructors.  Patch by Jim Goodnow II.

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

14 years agoUpdate test
Douglas Gregor [Fri, 17 Sep 2010 23:01:08 +0000 (23:01 +0000)]
Update test

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

14 years agoImprove recovery when the middle expression of a ternary operator is ill-formed
Douglas Gregor [Fri, 17 Sep 2010 22:41:34 +0000 (22:41 +0000)]
Improve recovery when the middle expression of a ternary operator is ill-formed

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

14 years agoWhen we run into an error parsing or type-checking the left-hand side
Douglas Gregor [Fri, 17 Sep 2010 22:25:06 +0000 (22:25 +0000)]
When we run into an error parsing or type-checking the left-hand side
of a binary expression, continue on and parse the right-hand side of
the binary expression anyway, but don't call the semantic actions to
type-check. Previously, we would see the error and then, effectively,
skip tokens until the end of the statement.

The result should be more useful recovery, both in the normal case
(we'll actually see errors beyond the first one in a statement), but
it also helps code completion do a much better job, because we do
"real" code completion on the right-hand side of an invalid binary
expression rather than completing with the recovery completion. For
example, given

  x = p->y

if there is no variable named "x", we can still complete after the p->
as a member expression. Along the recovery path, we would have
completed after the "->" as if we were in an expression context, which
is mostly useless.

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

14 years agoDiagnose use of incomplete type on method argument type of
Fariborz Jahanian [Fri, 17 Sep 2010 22:07:07 +0000 (22:07 +0000)]
Diagnose use of incomplete type on method argument type of
method definitions instead of crashing in code gen.
Fixes radar 8421082.

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

14 years agoUpdate C++0x status
Douglas Gregor [Fri, 17 Sep 2010 21:37:49 +0000 (21:37 +0000)]
Update C++0x status

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

14 years agofix rdar://8445858 - __sync_* intrinsics erroneously reject ObjC pointers
Chris Lattner [Fri, 17 Sep 2010 21:12:38 +0000 (21:12 +0000)]
fix rdar://8445858 - __sync_* intrinsics erroneously reject ObjC pointers

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

14 years agoOnly assignment operator triggers property setter call.
Fariborz Jahanian [Fri, 17 Sep 2010 20:45:45 +0000 (20:45 +0000)]
Only assignment operator triggers property setter call.
Fixes radar 8437253.

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

14 years agoWhen traversing an InitListExpr, there may not be a syntactic form;
Douglas Gregor [Fri, 17 Sep 2010 20:26:51 +0000 (20:26 +0000)]
When traversing an InitListExpr, there may not be a syntactic form;
check for NULL and visit the InitListExpr we have if there is no
syntactic form.

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

14 years agoDriver: implement driver automagic support for -lcc_kext
Shantonu Sen [Fri, 17 Sep 2010 18:39:08 +0000 (18:39 +0000)]
Driver: implement driver automagic support for -lcc_kext

Rewrite linker arguments to use libclang_rt.cc_kext.a
instead of gcc-specific libcc_kext.a

Resolves Radar 7808495

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