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

14 years agoTypo correction for C++ base and member initializers, e.g.,
Douglas Gregor [Thu, 31 Dec 2009 09:10:24 +0000 (09:10 +0000)]
Typo correction for C++ base and member initializers, e.g.,

test/FixIt/typo.cpp:41:15: error: initializer 'base' does not name a non-static
      data member or base class; did you mean the base class 'Base'?
  Derived() : base(),
              ^~~~
              Base
test/FixIt/typo.cpp:42:15: error: initializer 'ember' does not name a non-static
      data member or base class; did you mean the member 'member'?
              ember() { }
              ^~~~~
              member

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

14 years agoAdd another typo test for nested-name-specifiers
Douglas Gregor [Thu, 31 Dec 2009 08:27:32 +0000 (08:27 +0000)]
Add another typo test for nested-name-specifiers

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

14 years agoTypo correction for identifiers within nested name specifiers, e.g.,
Douglas Gregor [Thu, 31 Dec 2009 08:26:35 +0000 (08:26 +0000)]
Typo correction for identifiers within nested name specifiers, e.g.,

typo.cpp:18:1: error: use of undeclared identifier 'other_std'; did
      you mean 'otherstd'?
other_std::strng str1;
^~~~~~~~~
otherstd

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

14 years agoTypo correction for template names, e.g.,
Douglas Gregor [Thu, 31 Dec 2009 08:11:17 +0000 (08:11 +0000)]
Typo correction for template names, e.g.,

typo.cpp:27:8: error: no template named 'basic_sting' in namespace 'std';
    did you mean 'basic_string'?
  std::basic_sting<char> b2;
  ~~~~~^~~~~~~~~~~
       basic_string

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

14 years agoTypo correction for member access into classes/structs/unions, e.g.,
Douglas Gregor [Thu, 31 Dec 2009 07:42:17 +0000 (07:42 +0000)]
Typo correction for member access into classes/structs/unions, e.g.,

  s.fnd("hello")

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

14 years agoLet constraint manager inform checkers that some assumption logic has happend.
Zhongxing Xu [Thu, 31 Dec 2009 06:13:07 +0000 (06:13 +0000)]
Let constraint manager inform checkers that some assumption logic has happend.
Add new states for symbolic regions tracked by malloc checker. This enables us
to do malloc checking more accurately. See test case.

Based on Lei Zhang's patch and discussion.

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

14 years agoImplement typo correction for id-expressions, e.g.,
Douglas Gregor [Thu, 31 Dec 2009 05:20:13 +0000 (05:20 +0000)]
Implement typo correction for id-expressions, e.g.,

typo.cpp:22:10: error: use of undeclared identifier 'radious'; did
      you mean 'radius'?
  return radious * pi;
         ^~~~~~~
         radius

This was super-easy, since we already had decent recovery by looking
for names in dependent base classes.

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

14 years agoimprove diagnostics for case when a field type is unknown by
Chris Lattner [Thu, 31 Dec 2009 03:10:55 +0000 (03:10 +0000)]
improve diagnostics for case when a field type is unknown by
not emitting a follow-on error about 'int', which the user
never wrote.  PR5924.

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

14 years agoFix a bunch of bugs with VMI RTTI building, and add a whole bunch of tests.
Anders Carlsson [Wed, 30 Dec 2009 23:47:56 +0000 (23:47 +0000)]
Fix a bunch of bugs with VMI RTTI building, and add a whole bunch of tests.

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

14 years agoThe element type should also be canonicalized. Add a case for VariableArrayType.
Zhongxing Xu [Wed, 30 Dec 2009 22:59:54 +0000 (22:59 +0000)]
The element type should also be canonicalized. Add a case for VariableArrayType.

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

14 years agotestcase for previous patch!
Chris Lattner [Wed, 30 Dec 2009 22:10:22 +0000 (22:10 +0000)]
testcase for previous patch!

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

14 years agowhen making a decl for __builtin_fabsf() make sure to
Chris Lattner [Wed, 30 Dec 2009 22:06:22 +0000 (22:06 +0000)]
when making a decl for __builtin_fabsf() make sure to
attach the appropriate attributes to it.  I don't think
this manifests as any real change though, we're still
not getting the right LLVM IR attributes out of codegen.

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

14 years agoFix a comment.
Zhongxing Xu [Wed, 30 Dec 2009 21:24:23 +0000 (21:24 +0000)]
Fix a comment.

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

14 years agofix PR5917, L'x' was getting the wrong type in c++ mode. Per
Chris Lattner [Wed, 30 Dec 2009 21:19:39 +0000 (21:19 +0000)]
fix PR5917, L'x' was getting the wrong type in c++ mode. Per
C++2.13.2p2: "A wide-character literal has type wchar_t"

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

14 years agoWhen rewriting a __block declaration, use a suitable API to get location of
Fariborz Jahanian [Wed, 30 Dec 2009 20:38:08 +0000 (20:38 +0000)]
When rewriting a __block declaration, use a suitable API to get location of
the declaration in the presence of an initializer macro.

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

14 years agoremove extraneous #include
Chris Lattner [Wed, 30 Dec 2009 19:54:10 +0000 (19:54 +0000)]
remove extraneous #include

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

14 years agoTypo correction for type names when they appear in declarations, e.g., given
Douglas Gregor [Wed, 30 Dec 2009 17:04:44 +0000 (17:04 +0000)]
Typo correction for type names when they appear in declarations, e.g., given

  tring str2;

we produce the following diagnostic + fix-it:

typo.cpp:15:1: error: unknown type name 'tring'; did you mean 'string'?
  tring str2;
  ^~~~~
  string

To make this really useful, we'll need to introduce typo correction in
many more places (wherever we do name lookup), and implement
declaration-vs-expression heuristics that cope with typos
better. However, for now this will handle the simple cases where we
already get good "unknown type name" diagnostics.

The LookupVisibleDecls functions are intended to be used by code
completion as well as typo correction; that refactoring will happen
later.

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

14 years agoFix typo in comment
Douglas Gregor [Wed, 30 Dec 2009 16:01:52 +0000 (16:01 +0000)]
Fix typo in comment

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

14 years agoRemove an duplicated #include.
Zhongxing Xu [Wed, 30 Dec 2009 06:48:20 +0000 (06:48 +0000)]
Remove an duplicated #include.

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

14 years agoSimplify code by using an equivalent template class.
Zhongxing Xu [Wed, 30 Dec 2009 06:38:20 +0000 (06:38 +0000)]
Simplify code by using an equivalent template class.

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

14 years agoMore fixes to the handling of CVR-comparisons on array types. Adds a method to
Chandler Carruth [Wed, 30 Dec 2009 04:10:01 +0000 (04:10 +0000)]
More fixes to the handling of CVR-comparisons on array types. Adds a method to
QualType to get CVR-qualifiers through array types, and switches the primary
comparison methods to use it. This may allow simplifying some of the callers of
getUnqualifiedArrayType.

Also fix the normalizing of CV-qualification during template deduction to
normalize through arrays and allow a more qualified deduced array type. This
fixes PR5911.

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

14 years agoAdd base class checks.
Anders Carlsson [Wed, 30 Dec 2009 01:29:05 +0000 (01:29 +0000)]
Add base class checks.

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

14 years agoAdd more vtable tests.
Anders Carlsson [Wed, 30 Dec 2009 01:25:42 +0000 (01:25 +0000)]
Add more vtable tests.

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

14 years agoMore RTTI cleanup, test that RTTI classes have the correct vtables.
Anders Carlsson [Wed, 30 Dec 2009 01:00:12 +0000 (01:00 +0000)]
More RTTI cleanup, test that RTTI classes have the correct vtables.

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

14 years agoTypedefs can be redeclared. That seems like something we should record in
John McCall [Wed, 30 Dec 2009 00:31:22 +0000 (00:31 +0000)]
Typedefs can be redeclared.  That seems like something we should record in
the AST lest we run into some crazy canonicalization bug like PR5874.

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

14 years agoTest for PR5908.
Eli Friedman [Wed, 30 Dec 2009 00:20:14 +0000 (00:20 +0000)]
Test for PR5908.

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