]> granicus.if.org Git - clang/log
clang
14 years agoimprove support for dragonfly, patch by Sascha Wildner!
Chris Lattner [Sat, 9 Jan 2010 05:41:14 +0000 (05:41 +0000)]
improve support for dragonfly, patch by Sascha Wildner!

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

14 years agoFix indentation.
Mike Stump [Fri, 8 Jan 2010 19:28:41 +0000 (19:28 +0000)]
Fix indentation.

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

14 years agoAdd in final overrider logic.
Mike Stump [Fri, 8 Jan 2010 19:25:36 +0000 (19:25 +0000)]
Add in final overrider logic.

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

14 years agoFix handling in GRExprEngine of 'default' branch in switch statements
Ted Kremenek [Fri, 8 Jan 2010 18:54:04 +0000 (18:54 +0000)]
Fix handling in GRExprEngine of 'default' branch in switch statements
when the default case is winnowed down to be infeasible.  When all
cases were ruled out (and the analysis state for the default case
would be infeasible) we would still consider the default case
possible.  This fixes PR 5969.

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

14 years agoOrganize testcase into namespaces.
John McCall [Fri, 8 Jan 2010 18:40:32 +0000 (18:40 +0000)]
Organize testcase into namespaces.

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

14 years agoFor now, add back clang_getDeclSource().
Ted Kremenek [Fri, 8 Jan 2010 17:11:32 +0000 (17:11 +0000)]
For now, add back clang_getDeclSource().

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

14 years agoChange the printing of OR_Deleted overload results to print all the candidates,
John McCall [Fri, 8 Jan 2010 04:41:39 +0000 (04:41 +0000)]
Change the printing of OR_Deleted overload results to print all the candidates,
not just the viable ones.  This is reasonable because the most common use of
deleted functions is to exclude some implicit conversion during calls;  users
therefore will want to figure out why some other options were excluded.

Started sorting overload results.  Right now it just sorts by location in the
translation unit (after putting viable functions first), but we can do better than
that.

Changed bool OnlyViable parameter to PrintOverloadCandidates to an enum for better
self-documentation.

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

14 years agoUse -fno-math-errno by default, and remove the IsMathErrnoDefault
Dan Gohman [Fri, 8 Jan 2010 02:20:44 +0000 (02:20 +0000)]
Use -fno-math-errno by default, and remove the IsMathErrnoDefault
targethook, which is no longer being used. This fixes PR5971.

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

14 years agoclang ObjC rewriter: generated code used in "for (x in y)" loop uses
Fariborz Jahanian [Fri, 8 Jan 2010 01:29:44 +0000 (01:29 +0000)]
clang ObjC rewriter: generated code used in "for (x in y)" loop uses
incorrect cast, causing compile error (fixes radar 7342867).

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

14 years agoReorganize PrintOverloadCandidates. No functionality change.
John McCall [Fri, 8 Jan 2010 00:58:21 +0000 (00:58 +0000)]
Reorganize PrintOverloadCandidates.  No functionality change.

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

14 years agoFix for PR5967: Make const-marking for LLVM globals correct for cases requiring
Eli Friedman [Fri, 8 Jan 2010 00:50:11 +0000 (00:50 +0000)]
Fix for PR5967: Make const-marking for LLVM globals correct for cases requiring
run-time initialization, and emit run-time initializers aggresively to avoid
ordering issues with deferred globals.

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

14 years agoImprove the fix-its for -Wparentheses to ensure that the fix-it
Douglas Gregor [Fri, 8 Jan 2010 00:20:23 +0000 (00:20 +0000)]
Improve the fix-its for -Wparentheses to ensure that the fix-it
suggestions follow recovery. Additionally, add a note to these
diagnostics which suggests a fix-it for changing the behavior to what
the user probably meant. Examples:

t.cpp:2:9: warning: & has lower precedence than ==; == will be evaluated first
      [-Wparentheses]
  if (i & j == k) {
        ^~~~~~~~
          (     )
t.cpp:2:9: note: place parentheses around the & expression to evaluate it first
  if (i & j == k) {
        ^
      (    )

t.cpp:14:9: warning: using the result of an assignment as a condition
without
      parentheses [-Wparentheses]
  if (i = f()) {
      ~~^~~~~
      (      )
t.cpp:14:9: note: use '==' to turn this assignment into an equality
comparison
  if (i = f()) {
        ^
        ==

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

14 years agoExport a public symbol for classes with the GNU runtime.
David Chisnall [Fri, 8 Jan 2010 00:14:31 +0000 (00:14 +0000)]
Export a public symbol for classes with the GNU runtime.

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

14 years agoMore crashtracer enhancements to CIndex. When "popping" a crashtracer string
Ted Kremenek [Thu, 7 Jan 2010 23:13:53 +0000 (23:13 +0000)]
More crashtracer enhancements to CIndex.  When "popping" a crashtracer string
restore to the one most recently created.

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

14 years agoAdd an "implicit" bit to CXXThisExpr, so that we can track
Douglas Gregor [Thu, 7 Jan 2010 23:12:05 +0000 (23:12 +0000)]
Add an "implicit" bit to CXXThisExpr, so that we can track
implicitness without losing track of the (logical or actual) location
where "this" would occur in the source.

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

14 years agoFixes a bug where we were rewriting two definitions of
Fariborz Jahanian [Thu, 7 Jan 2010 22:51:18 +0000 (22:51 +0000)]
Fixes a bug where we were rewriting two definitions of
_objc_method (part of radar 7490408).

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

14 years agoAdd checker for type infos.
Mike Stump [Thu, 7 Jan 2010 22:50:03 +0000 (22:50 +0000)]
Add checker for type infos.

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

14 years agoTidy up crashtracer logic in CIndex.
Ted Kremenek [Thu, 7 Jan 2010 22:49:05 +0000 (22:49 +0000)]
Tidy up crashtracer logic in CIndex.

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

14 years agoAdd checked for VTTs.
Mike Stump [Thu, 7 Jan 2010 22:28:10 +0000 (22:28 +0000)]
Add checked for VTTs.

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

14 years agoDetailed vtable checker.
Mike Stump [Thu, 7 Jan 2010 22:21:26 +0000 (22:21 +0000)]
Detailed vtable checker.

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

14 years agoFixes a bug in my last patch (related to radar 7490331).
Fariborz Jahanian [Thu, 7 Jan 2010 22:15:31 +0000 (22:15 +0000)]
Fixes a bug in my last patch (related to radar 7490331).

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

14 years ago1/2 off all structs should not have any virtual functions.
Mike Stump [Thu, 7 Jan 2010 20:55:28 +0000 (20:55 +0000)]
1/2 off all structs should not have any virtual functions.
Replace magic numbers with uuids.

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

14 years agoAdd a descriptive tag to each line to make the exact differences
Mike Stump [Thu, 7 Jan 2010 19:39:43 +0000 (19:39 +0000)]
Add a descriptive tag to each line to make the exact differences
easier to understand.

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

14 years agoWhen parsing an identifier as an expression in C++, only try to annotate it
John McCall [Thu, 7 Jan 2010 19:29:58 +0000 (19:29 +0000)]
When parsing an identifier as an expression in C++, only try to annotate it
as a type or scope token if the next token requires it.

This eliminates a lot of redundant lookups in C++, but there's room for
improvement;  a better solution would do a single lookup whose kind and
results would be passed through the parser.

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

14 years agoDon't use two argument mixing function.
Mike Stump [Thu, 7 Jan 2010 19:24:27 +0000 (19:24 +0000)]
Don't use two argument mixing function.

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

14 years agoAlso generate the .s files.
Mike Stump [Thu, 7 Jan 2010 19:19:39 +0000 (19:19 +0000)]
Also generate the .s files.

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

14 years agoAdd a testcase generator for vtable/rtti testing. WIP.
Mike Stump [Thu, 7 Jan 2010 18:58:28 +0000 (18:58 +0000)]
Add a testcase generator for vtable/rtti testing.  WIP.

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

14 years agoAvoid error when convering a pointer to integer in
Fariborz Jahanian [Thu, 7 Jan 2010 18:31:42 +0000 (18:31 +0000)]
Avoid error when convering a pointer to integer in
rewriting.

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

14 years agoFix rewriting of ivars. Fixes radar 7490331.
Fariborz Jahanian [Thu, 7 Jan 2010 18:18:32 +0000 (18:18 +0000)]
Fix rewriting of ivars. Fixes radar 7490331.

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

14 years agoConvert from char pointer to char array
Kovarththanan Rajaratnam [Thu, 7 Jan 2010 18:11:14 +0000 (18:11 +0000)]
Convert from char pointer to char array

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

14 years agoFix typo: rename Rewriter::getRewritenText() -> Rewriter::getRewrittenText().
Ted Kremenek [Thu, 7 Jan 2010 18:00:35 +0000 (18:00 +0000)]
Fix typo: rename Rewriter::getRewritenText() -> Rewriter::getRewrittenText().

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

14 years agoTigthen scope of local char array
Kovarththanan Rajaratnam [Thu, 7 Jan 2010 16:01:54 +0000 (16:01 +0000)]
Tigthen scope of local char array

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

14 years agofix PR5869: mangle static symbols like gcc does to make it easier to diff symbol...
Nuno Lopes [Thu, 7 Jan 2010 09:36:51 +0000 (09:36 +0000)]
fix PR5869: mangle static symbols like gcc does to make it easier to diff symbol tables

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

14 years agoTest linkage of typeinfo and typeinfo names for class templates
Douglas Gregor [Thu, 7 Jan 2010 04:09:30 +0000 (04:09 +0000)]
Test linkage of typeinfo and typeinfo names for class templates

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

14 years agoImprove the lead diagnostic for C++ object subscript expressions with
John McCall [Thu, 7 Jan 2010 02:04:15 +0000 (02:04 +0000)]
Improve the lead diagnostic for C++ object subscript expressions with
no viable overloads.  Use a different message when the class provides
no operator[] overloads at all; use it for operator(), too.

Partially addresses PR 5900.

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

14 years agoChange ObjCContainerDecl to contain the entire range for the '@end'
Ted Kremenek [Thu, 7 Jan 2010 01:20:12 +0000 (01:20 +0000)]
Change ObjCContainerDecl to contain the entire range for the '@end'
piece of the declaration.  The '@' and the 'end' are separate tokens,
and require two SourceLocations to accurately track.

This change was motivated because ObjCContainerDecl::getSourceRange()
would previously not return the entire range of the declaration (the
'end' would be left off).

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

14 years agoAdd FileCheck prefix to another location in the output of c-index-test.
Ted Kremenek [Thu, 7 Jan 2010 01:17:12 +0000 (01:17 +0000)]
Add FileCheck prefix to another location in the output of c-index-test.

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

14 years agoAdd a test case for code-completion in the presence of tabs
Douglas Gregor [Thu, 7 Jan 2010 00:40:35 +0000 (00:40 +0000)]
Add a test case for code-completion in the presence of tabs

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

14 years ago_mm_xor_ps does a xor not a nxor. The other 'xor' builtins look fine,
Chris Lattner [Thu, 7 Jan 2010 00:36:41 +0000 (00:36 +0000)]
_mm_xor_ps does a xor not a nxor. The other 'xor' builtins look fine,
but this one is wrong.  Thanks to Tanya for noticing this.

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

14 years agoMake this test be ingored for linux.
Fariborz Jahanian [Thu, 7 Jan 2010 00:31:48 +0000 (00:31 +0000)]
Make this test be ingored for linux.

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

14 years agoFix the search for visible declarations within a Scope to ensure that
Douglas Gregor [Thu, 7 Jan 2010 00:31:29 +0000 (00:31 +0000)]
Fix the search for visible declarations within a Scope to ensure that
we look into a Scope that corresponds to a compound statement whose
scope was combined with the scope of the function that owns it. This
improves typo correction in many common cases.

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

14 years agoWhen we typo-correct a base class initializer, point to the base class
Douglas Gregor [Thu, 7 Jan 2010 00:26:25 +0000 (00:26 +0000)]
When we typo-correct a base class initializer, point to the base class
specifier that we corrected to.

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

14 years agoWhenever we emit a typo-correction diagnostic, also emit a note
Douglas Gregor [Thu, 7 Jan 2010 00:17:44 +0000 (00:17 +0000)]
Whenever we emit a typo-correction diagnostic, also emit a note
pointing to the declaration that we found that has that name (if it is
unique).

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

14 years agoFixes the test.
Fariborz Jahanian [Wed, 6 Jan 2010 23:54:34 +0000 (23:54 +0000)]
Fixes the test.

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

14 years agoWhen suggesting a typo correction for an @implementation without a
Douglas Gregor [Wed, 6 Jan 2010 23:44:25 +0000 (23:44 +0000)]
When suggesting a typo correction for an @implementation without a
corresponding @interface, provide a note showing which interface we're
referring to. This note has the fix-it hint on it.

Also, don't automatically apply fix-it hints for notes. They're meant
to express fix-its that would change semantics.

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

14 years agoChange clang_getDeclExtent() to have the endpoint point to the last character in...
Ted Kremenek [Wed, 6 Jan 2010 23:43:31 +0000 (23:43 +0000)]
Change clang_getDeclExtent() to have the endpoint point to the last character in the last token.

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

14 years agoTest case for rewriting of __weak byref objects.
Fariborz Jahanian [Wed, 6 Jan 2010 23:31:34 +0000 (23:31 +0000)]
Test case for rewriting of __weak byref objects.

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

14 years agoMove the allocation of designators in DesignatedInitExpr to the
Douglas Gregor [Wed, 6 Jan 2010 23:17:19 +0000 (23:17 +0000)]
Move the allocation of designators in DesignatedInitExpr to the
ASTContext. Fixes <rdar://problem/7495428>.

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

14 years agoDon't assert when dealing with unsigned casts of lvalues. Fixes PR5961.
John McCall [Wed, 6 Jan 2010 22:57:21 +0000 (22:57 +0000)]
Don't assert when dealing with unsigned casts of lvalues.  Fixes PR5961.

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

14 years agoAdd test from PR5913, which has already been fixed
Douglas Gregor [Wed, 6 Jan 2010 22:09:05 +0000 (22:09 +0000)]
Add test from PR5913, which has already been fixed

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

14 years agoDerive tighter ranges for & and >> in the conversion-checking code.
John McCall [Wed, 6 Jan 2010 22:07:33 +0000 (22:07 +0000)]
Derive tighter ranges for & and >> in the conversion-checking code.

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

14 years agoAdd testcase for PR5817, although the bug was already fixed
Douglas Gregor [Wed, 6 Jan 2010 22:06:13 +0000 (22:06 +0000)]
Add testcase for PR5817, although the bug was already fixed

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

14 years agoFix linkage for RTTI names by re-using the logic for computing the
Douglas Gregor [Wed, 6 Jan 2010 22:00:56 +0000 (22:00 +0000)]
Fix linkage for RTTI names by re-using the logic for computing the
linkage of vtables. Before this, we were emitting RTTI names for
template instantiations with strong external linkage rather than with
weak ODR linkage.

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

14 years agoFix a bug when property is redeclared in multiple
Fariborz Jahanian [Wed, 6 Jan 2010 21:38:30 +0000 (21:38 +0000)]
Fix a bug when property is redeclared in multiple
continuation classes and its original declaration
is imported from a protocol. This fixes radar 7509234.

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

14 years agoFix marking of virtual members for nested classes whose first non-pure virtual functi...
Douglas Gregor [Wed, 6 Jan 2010 20:27:16 +0000 (20:27 +0000)]
Fix marking of virtual members for nested classes whose first non-pure virtual function has a body inlined in the class

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

14 years agoFix for PR5691
David Chisnall [Wed, 6 Jan 2010 18:02:59 +0000 (18:02 +0000)]
Fix for PR5691

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

14 years agoMake sure that the key-function computation produces the correct
Douglas Gregor [Wed, 6 Jan 2010 17:00:51 +0000 (17:00 +0000)]
Make sure that the key-function computation produces the correct
result for a nested class whose first non-pure virtual member function
has an inline body. Previously, we were checking for the key function
before we had seen the (delayed) inline body.

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

14 years agoImprove the diagnostics used to report implicitly-generated class members
John McCall [Wed, 6 Jan 2010 09:43:14 +0000 (09:43 +0000)]
Improve the diagnostics used to report implicitly-generated class members
as parts of overload sets.  Also, refer to constructors as 'constructors'
rather than functions.

Adjust a lot of tests.

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

14 years agoFix (invalid) may-be-uninitialized warning.
Daniel Dunbar [Wed, 6 Jan 2010 07:13:04 +0000 (07:13 +0000)]
Fix (invalid) may-be-uninitialized warning.

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

14 years agoAdd missing CINDEX_LINKAGE.
Daniel Dunbar [Wed, 6 Jan 2010 06:51:48 +0000 (06:51 +0000)]
Add missing CINDEX_LINKAGE.

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

14 years agoAdd _clang_getDeclExtent to export list.
Daniel Dunbar [Wed, 6 Jan 2010 05:41:00 +0000 (05:41 +0000)]
Add _clang_getDeclExtent to export list.

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

14 years agoSignificantly rework the calculation of effective integer-expression ranges
John McCall [Wed, 6 Jan 2010 05:24:50 +0000 (05:24 +0000)]
Significantly rework the calculation of effective integer-expression ranges
for -Wsign-compare and -Wconversion, and use that coordinated logic to drive
both diagnostics.  The new logic works more transparently with implicit
conversions, conditional operators, etc., as well as bringing -Wconversion's
ability to deal with pseudo-closed operations (e.g. arithmetic on shorts) to
-Wsign-compare.

Fixes PRs 5887, 5937, 5938, and 5939.

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

14 years agoRevert my available_externally vtables experiment. It's breaking the LLVM-with-Clang...
Douglas Gregor [Wed, 6 Jan 2010 04:50:56 +0000 (04:50 +0000)]
Revert my available_externally vtables experiment. It's breaking the LLVM-with-Clang build with linker errors that I have yet to investigate.

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

14 years agoMake our marking of virtual members functions in a class be
Douglas Gregor [Wed, 6 Jan 2010 04:44:19 +0000 (04:44 +0000)]
Make our marking of virtual members functions in a class be
deterministic and work properly with templates. Once a class that
needs a vtable has been defined, we now do one if two things:

  - If the class has no key function, we place the class on a list of
    classes whose virtual functions will need to be "marked" at the
    end of the translation unit. The delay until the end of the
    translation unit is needed because we might see template
    specializations of these virtual functions.
  - If the class has a key function, we do nothing; when the key
    function is defined, the class will be placed on the
    aforementioned list.

At the end of the translation unit, we "mark" all of the virtual
functions of the classes on the list as used, possibly causing
template instantiation and other classes to be added to the
list. This gets LLVM's lib/Support/CommandLine.cpp compiling again.

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

14 years agoAdd enhanced crash reporter breadcrumbs for clang_createTranslationUnitFromSourceFile().
Ted Kremenek [Wed, 6 Jan 2010 03:42:32 +0000 (03:42 +0000)]
Add enhanced crash reporter breadcrumbs for clang_createTranslationUnitFromSourceFile().

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

14 years agoReorder to avoid invalidating idx which is an accessor into VCall.
Mike Stump [Wed, 6 Jan 2010 03:09:19 +0000 (03:09 +0000)]
Reorder to avoid invalidating idx which is an accessor into VCall.

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

14 years agoFix spelling.
Mike Stump [Wed, 6 Jan 2010 02:05:39 +0000 (02:05 +0000)]
Fix spelling.

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

14 years agoPer offline discussion with Doug, don't perform typo correction when we have encounte...
Ted Kremenek [Wed, 6 Jan 2010 00:23:04 +0000 (00:23 +0000)]
Per offline discussion with Doug, don't perform typo correction when we have encountered a fatal error.  On some files that are woefully wrong (missing headers) this can cause a 3x slowdown in some cases when parsing the file.  It makes sense not to perform typo correction in this case because after a fatal error diagnostics will either be suppressed or not really make any sense.

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

14 years agoDo not diagnose method disguised as property setter
Fariborz Jahanian [Wed, 6 Jan 2010 00:18:12 +0000 (00:18 +0000)]
Do not diagnose  method disguised as property setter
for a 'readonly' property. Fixes radar 7427072.

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

14 years agoAdd Expr::EvaluateAsBooleanCondition(), which does unprincipled folding to
John McCall [Tue, 5 Jan 2010 23:42:56 +0000 (23:42 +0000)]
Add Expr::EvaluateAsBooleanCondition(), which does unprincipled folding to
try to evaluate an expression as a constant boolean condition.  This has
the same intended semantics as used in folding conditional operators.

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

14 years agoRemove unused variables.
Ted Kremenek [Tue, 5 Jan 2010 23:22:20 +0000 (23:22 +0000)]
Remove unused variables.

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

14 years agoRemove deprecated function 'clang_getDeclSource()'. Use 'clang_getDeclFile()' instead.
Ted Kremenek [Tue, 5 Jan 2010 23:21:30 +0000 (23:21 +0000)]
Remove deprecated function 'clang_getDeclSource()'.  Use 'clang_getDeclFile()' instead.

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

14 years agoAdd C API hook 'clang_getDeclExtent()', which returns the source extent of a declarat...
Ted Kremenek [Tue, 5 Jan 2010 23:18:49 +0000 (23:18 +0000)]
Add C API hook 'clang_getDeclExtent()', which returns the source extent of a declaration.  This implements <rdar://problem/7280072>.

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

14 years agoFixed a bug where initializer is a macro in rewrite.
Fariborz Jahanian [Tue, 5 Jan 2010 23:06:29 +0000 (23:06 +0000)]
Fixed a bug where initializer is a macro in rewrite.

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

14 years agoSplit (mostly nonexistent) USR code out from the main CIndex logic.
Ted Kremenek [Tue, 5 Jan 2010 22:06:45 +0000 (22:06 +0000)]
Split (mostly nonexistent) USR code out from the main CIndex logic.

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

14 years agoSilence bogus GCC warning
Douglas Gregor [Tue, 5 Jan 2010 21:55:26 +0000 (21:55 +0000)]
Silence bogus GCC warning

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

14 years agoFix -plugin command line argument syntax for clang -cc1 change.
Daniel Dunbar [Tue, 5 Jan 2010 21:42:23 +0000 (21:42 +0000)]
Fix -plugin command line argument syntax for clang -cc1 change.

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

14 years agoMake use of available_externally linkage for vtables when the
Douglas Gregor [Tue, 5 Jan 2010 21:40:05 +0000 (21:40 +0000)]
Make use of available_externally linkage for vtables when the
non-inline key function of a class template instantiation, when no key
function is present, the class template instantiation itself was
instantiated with an explicit instantiation declaration (aka extern
template). I'm fairly certain that the C++0x specification gives us
this lattitude, although GCC doesn't take advantage of it.

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

14 years agoAdd back #include of 'cstdio' to hopefully unbreak the build on Linux.
Ted Kremenek [Tue, 5 Jan 2010 20:55:39 +0000 (20:55 +0000)]
Add back #include of 'cstdio' to hopefully unbreak the build on Linux.

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

14 years agoSplit code in CIndex.cpp into multiple source files, and remove some unnecessary...
Ted Kremenek [Tue, 5 Jan 2010 19:32:54 +0000 (19:32 +0000)]
Split code in CIndex.cpp into multiple source files, and remove some unnecessary #includes.

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

14 years agoAPI support for __block variables which are also __weak.
Fariborz Jahanian [Tue, 5 Jan 2010 19:21:35 +0000 (19:21 +0000)]
API support for __block variables which are also __weak.

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

14 years agoImprove key-function computation for templates. In particular:
Douglas Gregor [Tue, 5 Jan 2010 19:06:31 +0000 (19:06 +0000)]
Improve key-function computation for templates. In particular:
  - All classes can have a key function; templates don't change that.
  non-template classes when computing the key function.
  - We always mark all of the virtual member functions of class
  template instantiations.
  - The vtable for an instantiation of a class template has weak
  linkage.

We could probably use available_externally linkage for vtables of
classes instantiated by explicit instantiation declarations (extern
templates), but GCC doesn't do this and I'm not 100% that the ABI
permits it.

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

14 years agoAdd code to skip the emission of available externally functions at -O0. WIP.
Mike Stump [Tue, 5 Jan 2010 18:48:04 +0000 (18:48 +0000)]
Add code to skip the emission of available externally functions at -O0.  WIP.

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

14 years agoMinor clean up.
Fariborz Jahanian [Tue, 5 Jan 2010 18:15:57 +0000 (18:15 +0000)]
Minor clean up.

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

14 years agoRemove bogus "C" from preamble block decls.
Steve Naroff [Tue, 5 Jan 2010 18:09:31 +0000 (18:09 +0000)]
Remove bogus "C" from preamble block decls.

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

14 years agoMore rewriting of __block APIs. wip.
Fariborz Jahanian [Tue, 5 Jan 2010 18:04:40 +0000 (18:04 +0000)]
More rewriting of __block APIs. wip.

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

14 years agoFix <rdar://problem/7490212> clang rewriter: return of the mixed line endings, which is
Steve Naroff [Tue, 5 Jan 2010 17:33:23 +0000 (17:33 +0000)]
Fix <rdar://problem/7490212> clang rewriter: return of the mixed line endings, which is
related to <rdar://problem/6596843> clang ObjC rewriter: Line endings still mixed in rewrite output

This fix was dropped when I integrated the 'objective-rewrite' branch.

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

14 years agoMove test case to a more appropriate file.
Zhongxing Xu [Tue, 5 Jan 2010 11:49:21 +0000 (11:49 +0000)]
Move test case to a more appropriate file.

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

14 years agoAdd test case.
Zhongxing Xu [Tue, 5 Jan 2010 11:47:58 +0000 (11:47 +0000)]
Add test case.

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

14 years agoRevert r92318. Instead fix the analyzer: do not call
Zhongxing Xu [Tue, 5 Jan 2010 09:27:03 +0000 (09:27 +0000)]
Revert r92318. Instead fix the analyzer: do not call
ASTContext::hasSameUnqualifiedType() when one of the type is VariableArrayType.

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

14 years agoif an arraytype is canonical, then its element is guaranteed to be canonical.
Zhongxing Xu [Tue, 5 Jan 2010 08:15:06 +0000 (08:15 +0000)]
if an arraytype is canonical, then its element is guaranteed to be canonical.

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

14 years agoAllow clang to pass -x cl through to compiler driver.
Nate Begeman [Tue, 5 Jan 2010 06:00:15 +0000 (06:00 +0000)]
Allow clang to pass -x cl through to compiler driver.

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

14 years agoWhen emitting member function pointers, use the canonical decl if the member function...
Anders Carlsson [Tue, 5 Jan 2010 05:04:05 +0000 (05:04 +0000)]
When emitting member function pointers, use the canonical decl if the member function is virtual. Fixes PR5940.

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

14 years agoAdd a radar reference.
Mike Stump [Tue, 5 Jan 2010 03:16:33 +0000 (03:16 +0000)]
Add a radar reference.

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

14 years agoDisallow captured arrays in blocks as well. Radar 7438948.
Mike Stump [Tue, 5 Jan 2010 03:10:36 +0000 (03:10 +0000)]
Disallow captured arrays in blocks as well.  Radar 7438948.

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

14 years agoDisallow capturing vlas inside blocks.
Mike Stump [Tue, 5 Jan 2010 02:56:35 +0000 (02:56 +0000)]
Disallow capturing vlas inside blocks.

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

14 years agoMake static analysis support for C++ 'this' expression context-sensitive. Essentiall...
Ted Kremenek [Tue, 5 Jan 2010 02:18:06 +0000 (02:18 +0000)]
Make static analysis support for C++ 'this' expression context-sensitive.  Essentially treat 'this' as a implicit parameter to the method call, and associate a region with it.

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

14 years agofix a bug mike noticed.
Chris Lattner [Tue, 5 Jan 2010 01:23:25 +0000 (01:23 +0000)]
fix a bug mike noticed.

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

14 years agoMore rewriting of __block objective-c pointer variables. wip.
Fariborz Jahanian [Tue, 5 Jan 2010 01:16:51 +0000 (01:16 +0000)]
More rewriting of __block objective-c pointer variables. wip.

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

14 years agoRemove stale comment. We already do format string checking for functions with the...
Ted Kremenek [Tue, 5 Jan 2010 00:37:42 +0000 (00:37 +0000)]
Remove stale comment.  We already do format string checking for functions with the format attribute.

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