]> granicus.if.org Git - clang/log
clang
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

14 years agoFix warnings.
Mike Stump [Tue, 5 Jan 2010 00:29:29 +0000 (00:29 +0000)]
Fix warnings.

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

14 years agoRemove references to 'Checker' and 'GRTransferFuncs' from
Ted Kremenek [Tue, 5 Jan 2010 00:15:18 +0000 (00:15 +0000)]
Remove references to 'Checker' and 'GRTransferFuncs' from
GRStateManager.  Having these references was an abstraction violation,
as they really should only be known about GRExprEngine.

This change required adding a new 'ProcessAssume' callback in
GRSubEngine.  GRExprEngine implements this callback by calling
'EvalAssume' on all registered Checker objects as well as the
registered GRTransferFunc object.

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

14 years agoMove the -Wconversion logic into SemaChecking.cpp. There's a fair amount of
John McCall [Mon, 4 Jan 2010 23:31:57 +0000 (23:31 +0000)]
Move the -Wconversion logic into SemaChecking.cpp.  There's a fair amount of
overlap between this and -Wsign-compare, which is why I want them in the same
place.

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

14 years agoMove the -Wsign-compare logic into SemaChecking.cpp.
John McCall [Mon, 4 Jan 2010 23:21:16 +0000 (23:21 +0000)]
Move the -Wsign-compare logic into SemaChecking.cpp.

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

14 years agoAvoid warnings for functions that return a value using MS-style inline
Mike Stump [Mon, 4 Jan 2010 23:01:10 +0000 (23:01 +0000)]
Avoid warnings for functions that return a value using MS-style inline
assembly code.  This avoids changing the bahvior when normal asm("")
statements are used.

The type of code affected would be:

  void* t4(void) { __asm mov eax, fs:[0x10] }

I hope people like this version, if not, let me know.

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

14 years agoRemember if the AsmStmt came from Microsoft-style inline assembly code.
Mike Stump [Mon, 4 Jan 2010 22:37:17 +0000 (22:37 +0000)]
Remember if the AsmStmt came from Microsoft-style inline assembly code.

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

14 years ago-Wsign-compare shouldn't warn when the signed operand is a conditional operator
John McCall [Mon, 4 Jan 2010 22:35:07 +0000 (22:35 +0000)]
-Wsign-compare shouldn't warn when the signed operand is a conditional operator
whose operands are non-negative integer constant expressions.  This comes up
in LLVM in a few places.

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

14 years agoMake sure to use ASTContext::getAs*ArrayType() when decomposing array
Douglas Gregor [Mon, 4 Jan 2010 22:11:45 +0000 (22:11 +0000)]
Make sure to use ASTContext::getAs*ArrayType() when decomposing array
types. Fixes APFloat.cpp compilation failure.

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

14 years agoAdd missing newline (which breaks MSVC build???)
Daniel Dunbar [Mon, 4 Jan 2010 22:04:01 +0000 (22:04 +0000)]
Add missing newline (which breaks MSVC build???)

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

14 years agoMore rewriting of __block declared objective-c/block pointers.
Fariborz Jahanian [Mon, 4 Jan 2010 19:50:07 +0000 (19:50 +0000)]
More rewriting of __block declared objective-c/block pointers.
This is wip.

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

14 years agoTurn on code-completion for macros within CIndex
Douglas Gregor [Mon, 4 Jan 2010 19:45:17 +0000 (19:45 +0000)]
Turn on code-completion for macros within CIndex

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

14 years agoTeach Preprocessor::macro_begin/macro_end to lazily load all macro
Douglas Gregor [Mon, 4 Jan 2010 19:18:44 +0000 (19:18 +0000)]
Teach Preprocessor::macro_begin/macro_end to lazily load all macro
definitions from a precompiled header. This ensures that
code-completion with macro names behaves the same with or without
precompiled headers.

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

14 years agoRevert r92431, this code isn't dead and broke the ntfs build.
Daniel Dunbar [Mon, 4 Jan 2010 18:47:06 +0000 (18:47 +0000)]
Revert r92431, this code isn't dead and broke the ntfs build.

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

14 years agoFix -Asserts warning.
Daniel Dunbar [Mon, 4 Jan 2010 18:02:28 +0000 (18:02 +0000)]
Fix -Asserts warning.

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

14 years agoWhen declaring an Objective-C implementation without a corresponding
Douglas Gregor [Mon, 4 Jan 2010 17:27:12 +0000 (17:27 +0000)]
When declaring an Objective-C implementation without a corresponding
interface, suggest correction of typos. For example, given:

  @interface NSString
  @end

  @implementation NSstring
  @end

we'll warn with:

t.m:4:19: warning: cannot find interface declaration for 'NSstring';
    did you mean 'NSString'?
  @implementation NSstring
                  ^

However, since this is just a warning, we don't provide a fix-it
hint. Good idea, Ted!

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

14 years ago__builtin_object_size(ptr, type) returns -1 for type = {0,1} if there are any side...
Benjamin Kramer [Sun, 3 Jan 2010 18:18:37 +0000 (18:18 +0000)]
__builtin_object_size(ptr, type) returns -1 for type = {0,1} if there are any side-effects.

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

14 years agoImplement typo correction for a variety of Objective-C-specific
Douglas Gregor [Sun, 3 Jan 2010 18:01:57 +0000 (18:01 +0000)]
Implement typo correction for a variety of Objective-C-specific
constructs:

  - Instance variable lookup ("foo->ivar" and, in instance methods, "ivar")
  - Property name lookup ("foo.prop")
  - Superclasses
  - Various places where a class name is required
  - Protocol names (e.g., id<proto>)

This seems to cover many of the common places where typos could occur.

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

14 years agoBetter coverage for -dump-record-layouts and -print-decl-contexts.
Eli Friedman [Sun, 3 Jan 2010 02:01:11 +0000 (02:01 +0000)]
Better coverage for -dump-record-layouts and -print-decl-contexts.

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

14 years agoImprove coverage for test.
Eli Friedman [Sun, 3 Jan 2010 01:20:41 +0000 (01:20 +0000)]
Improve coverage for test.

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

14 years agoGet rid of more dead code.
Eli Friedman [Sun, 3 Jan 2010 01:11:47 +0000 (01:11 +0000)]
Get rid of more dead code.

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

14 years agoAdd test for annotate attribute for coverage.
Eli Friedman [Sun, 3 Jan 2010 00:51:58 +0000 (00:51 +0000)]
Add test for annotate attribute for coverage.

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

14 years agoFix minor oversight for increment/decrement of complex int. Add tests for
Eli Friedman [Sun, 3 Jan 2010 00:20:48 +0000 (00:20 +0000)]
Fix minor oversight for increment/decrement of complex int.  Add tests for
coverage.

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

14 years agoGet rid of some unnecessary code.
Eli Friedman [Sat, 2 Jan 2010 23:43:59 +0000 (23:43 +0000)]
Get rid of some unnecessary code.

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

14 years agoDelete impossible case.
Eli Friedman [Sat, 2 Jan 2010 23:28:56 +0000 (23:28 +0000)]
Delete impossible case.

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

14 years agoAdd a couple more tests for coverage.
Eli Friedman [Sat, 2 Jan 2010 23:21:40 +0000 (23:21 +0000)]
Add a couple more tests for coverage.

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

14 years agoGet rid of more unnecessary code.
Eli Friedman [Sat, 2 Jan 2010 22:56:07 +0000 (22:56 +0000)]
Get rid of more unnecessary code.

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

14 years agoGet rid of some unnecessary code.
Eli Friedman [Sat, 2 Jan 2010 22:43:56 +0000 (22:43 +0000)]
Get rid of some unnecessary code.

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

14 years agoEliminate dead code.
Eli Friedman [Sat, 2 Jan 2010 21:44:36 +0000 (21:44 +0000)]
Eliminate dead code.

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

14 years agoSpeculative MSVC fix.
Anders Carlsson [Sat, 2 Jan 2010 18:46:23 +0000 (18:46 +0000)]
Speculative MSVC fix.

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

14 years agoMove address points to CGVtableInfo, no functionality change.
Anders Carlsson [Sat, 2 Jan 2010 18:02:32 +0000 (18:02 +0000)]
Move address points to CGVtableInfo, no functionality change.

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

14 years agoCorrectly pass VTT parameters to constructors and destructors. The VTTs aren't yet...
Anders Carlsson [Sat, 2 Jan 2010 01:01:18 +0000 (01:01 +0000)]
Correctly pass VTT parameters to constructors and destructors. The VTTs aren't yet used in the ctors/dtors, but that will follow.

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

14 years agoMove a few more functions away from CGCXX and to CGClass and CGExprCXX.
Anders Carlsson [Fri, 1 Jan 2010 20:29:01 +0000 (20:29 +0000)]
Move a few more functions away from CGCXX and to CGClass and CGExprCXX.

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

14 years agoMake sure that the search for visible declarations looks into the semantic parents...
Douglas Gregor [Fri, 1 Jan 2010 17:44:25 +0000 (17:44 +0000)]
Make sure that the search for visible declarations looks into the semantic parents of out-of-line function contexts

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

14 years agoFix typo test RUN lines
Douglas Gregor [Fri, 1 Jan 2010 17:23:17 +0000 (17:23 +0000)]
Fix typo test RUN lines

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

14 years agoFix last patch, catch of reference to non-pointer.
Mike Stump [Fri, 1 Jan 2010 03:20:32 +0000 (03:20 +0000)]
Fix last patch, catch of reference to non-pointer.

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

14 years agoFix catching a reference to a pointer.
Mike Stump [Fri, 1 Jan 2010 02:51:52 +0000 (02:51 +0000)]
Fix catching a reference to a pointer.

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

14 years agoWhen typo correction for an id-expression finds a type (or Objective-C
Douglas Gregor [Fri, 1 Jan 2010 00:15:04 +0000 (00:15 +0000)]
When typo correction for an id-expression finds a type (or Objective-C
class), provide a suggestion for the type or class found. However,
since we can't recover properly in this case, don't provide a fix-it
hint. Example:

test/FixIt/typo.m:8:3: error: use of undeclared identifier 'NSstring';
did you
      mean 'NSString'?
  NSstring *str = @"A string";
  ...
  ^
1 diagnostic generated.

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

14 years agoTypo correction for C99 designated field initializers, e.g.,
Douglas Gregor [Fri, 1 Jan 2010 00:03:05 +0000 (00:03 +0000)]
Typo correction for C99 designated field initializers, e.g.,

test/FixIt/typo.c:19:4: error: field designator 'bunds' does not refer to any
      field in type 'struct Window'; did you mean 'bounds'?
  .bunds.
   ^~~~~
   bounds

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

14 years agoIf the key function of a record is inline, then the RTTI data should have weak_odr...
Anders Carlsson [Thu, 31 Dec 2009 19:36:25 +0000 (19:36 +0000)]
If the key function of a record is inline, then the RTTI data should have weak_odr linkage.

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

14 years agoIt's OK for a return type to be incomplete if it's being defined.
Anders Carlsson [Thu, 31 Dec 2009 18:54:35 +0000 (18:54 +0000)]
It's OK for a return type to be incomplete if it's being defined.

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

14 years agoMake sure that an overriding return type is complete before checking if it's covarian...
Anders Carlsson [Thu, 31 Dec 2009 18:34:24 +0000 (18:34 +0000)]
Make sure that an overriding return type is complete before checking if it's covariant. Fixes PR5920.

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

14 years agoRemove rtti.cpp, it's very fragile and has been marked XFAIL for a while now. Between...
Anders Carlsson [Thu, 31 Dec 2009 17:44:32 +0000 (17:44 +0000)]
Remove rtti.cpp, it's very fragile and has been marked XFAIL for a while now. Between rtti-layout.cpp and rtti-linkage.cpp, RTTI testing should be covered.

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

14 years agoMore RTTI builder cleanup.
Anders Carlsson [Thu, 31 Dec 2009 17:43:53 +0000 (17:43 +0000)]
More RTTI builder cleanup.

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

14 years agoAvoid an unnecessary copy of Predefines. getMemBufferCopy does the null termination...
Benjamin Kramer [Thu, 31 Dec 2009 15:33:09 +0000 (15:33 +0000)]
Avoid an unnecessary copy of Predefines. getMemBufferCopy does the null termination for us.

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

14 years agoConvert to StringRef, avoid a memcpy in the common case.
Benjamin Kramer [Thu, 31 Dec 2009 13:32:38 +0000 (13:32 +0000)]
Convert to StringRef, avoid a memcpy in the common case.

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