]> granicus.if.org Git - clang/log
clang
14 years agoMark FunctionNoProtoType's argument as unspecified parameters.
Devang Patel [Wed, 6 Oct 2010 20:51:45 +0000 (20:51 +0000)]
Mark FunctionNoProtoType's argument as unspecified parameters.

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

14 years agoRe-enable EH cleanups to destroy __block variables, now that we have a moment to
John McCall [Wed, 6 Oct 2010 18:56:43 +0000 (18:56 +0000)]
Re-enable EH cleanups to destroy __block variables, now that we have a moment to
deal with the consequences.  Fixes rdar://problem/8224178.

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

14 years agoSilence unused variable warning in Release builds.
Nick Lewycky [Wed, 6 Oct 2010 18:37:39 +0000 (18:37 +0000)]
Silence unused variable warning in Release builds.

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

14 years agoDo not emit subrange for incomplete array type.
Devang Patel [Wed, 6 Oct 2010 18:30:00 +0000 (18:30 +0000)]
Do not emit subrange for incomplete array type.
This is tested by ptype.exp in gdb testsuite.

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

14 years agoIssue deprecated warning when typeof uses typedef
Fariborz Jahanian [Wed, 6 Oct 2010 17:00:02 +0000 (17:00 +0000)]
Issue deprecated warning when typeof uses typedef
based on underlying type's deprecatedness.

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

14 years agoReject the allocation of variably-modified types in C++ 'new'
Douglas Gregor [Wed, 6 Oct 2010 16:00:31 +0000 (16:00 +0000)]
Reject the allocation of variably-modified types in C++ 'new'
expressions. Fixes PR8209 in the narrowest way possible. I'm still
considering whether I want to implement the extension that permits the
use of VLA types in a 'new' expression.

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

14 years agoRemove unused argument.
Devang Patel [Wed, 6 Oct 2010 15:58:57 +0000 (15:58 +0000)]
Remove unused argument.

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

14 years ago_inline is an alias for inline in MSVC.
Francois Pichet [Wed, 6 Oct 2010 13:02:48 +0000 (13:02 +0000)]
_inline is an alias for inline in MSVC.

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

14 years agoRemove hard CRLF end-of-line markers from two files. These should be added
Chandler Carruth [Wed, 6 Oct 2010 06:50:05 +0000 (06:50 +0000)]
Remove hard CRLF end-of-line markers from two files. These should be added
automatically when syncing due to the auto-props selecting svn:eol-style of
'native'.

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

14 years agoAdd support for 4-byte UCNs like \U12345678. Warn about UCNs in c90 mode.
Nico Weber [Wed, 6 Oct 2010 04:57:26 +0000 (04:57 +0000)]
Add support for 4-byte UCNs like \U12345678. Warn about UCNs in c90 mode.

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

14 years agoErm...this isn't the same as PR6658.
Bill Wendling [Wed, 6 Oct 2010 03:33:37 +0000 (03:33 +0000)]
Erm...this isn't the same as PR6658.

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

14 years agoMMX conversion work is done. We can remove the FIXMEs.
Bill Wendling [Wed, 6 Oct 2010 03:31:26 +0000 (03:31 +0000)]
MMX conversion work is done. We can remove the FIXMEs.

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

14 years agoAdd same hack to mmx-builtins.c as in Headers/c89.c to get it to pass on Win32. PR6658.
Bill Wendling [Wed, 6 Oct 2010 03:31:09 +0000 (03:31 +0000)]
Add same hack to mmx-builtins.c as in Headers/c89.c to get it to pass on Win32. PR6658.

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

14 years agoWhen checking for uninitialized fields in member initializers, special case static...
Anders Carlsson [Wed, 6 Oct 2010 02:43:25 +0000 (02:43 +0000)]
When checking for uninitialized fields in member initializers, special case static variables and enums. Fixes PR8075.

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

14 years agoTeach the driver to pass -fexceptions in Objective-C inputs on ARM.
John McCall [Wed, 6 Oct 2010 01:40:51 +0000 (01:40 +0000)]
Teach the driver to pass -fexceptions in Objective-C inputs on ARM.
I don't know when this stopped happening, but this seems to be the
right place to do it.

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

14 years agoProvide a slightly specialized diagnostic for tautological comparisons
John McCall [Wed, 6 Oct 2010 00:25:24 +0000 (00:25 +0000)]
Provide a slightly specialized diagnostic for tautological comparisons
of an enum value.

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

14 years agoUse a more conventional/efficient implementation for isEnumeralType()
John McCall [Wed, 6 Oct 2010 00:23:35 +0000 (00:23 +0000)]
Use a more conventional/efficient implementation for isEnumeralType()
and isBuiltinType().

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

14 years agoUe TagType, added a FIXME. Per John's comment.
Fariborz Jahanian [Wed, 6 Oct 2010 00:23:25 +0000 (00:23 +0000)]
Ue TagType, added a FIXME. Per John's comment.

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

14 years agoIssue deprecated warning when typeof uses an
Fariborz Jahanian [Tue, 5 Oct 2010 23:24:00 +0000 (23:24 +0000)]
Issue deprecated warning when typeof uses an
expression of deprecated type.

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

14 years agoWhen instantiating a new-expression, force a rebuild if there were default
John McCall [Tue, 5 Oct 2010 22:36:42 +0000 (22:36 +0000)]
When instantiating a new-expression, force a rebuild if there were default
arguments in either the placement or constructor arguments.  This is
important if the default arguments refer to a declaration or create a
temporary.

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

14 years agoMethod declaration and its implementation must match in all their types.
Fariborz Jahanian [Tue, 5 Oct 2010 21:02:11 +0000 (21:02 +0000)]
Method declaration and its implementation must match in all their types.
Previously, compiler warned only if it was unsafe if types
did not match. Fixes // rdar: //7933061

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

14 years ago...without leaving a temporary file behind.
John McCall [Tue, 5 Oct 2010 20:53:58 +0000 (20:53 +0000)]
...without leaving a temporary file behind.

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

14 years agoEr, this test should actually run IR generation.
John McCall [Tue, 5 Oct 2010 20:53:00 +0000 (20:53 +0000)]
Er, this test should actually run IR generation.

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

14 years agoTeach PopCleanupBlock to correctly handle the possibility of branching through
John McCall [Tue, 5 Oct 2010 20:48:15 +0000 (20:48 +0000)]
Teach PopCleanupBlock to correctly handle the possibility of branching through
a EH-only cleanup as part of a fallthrough branch-through.  That this happens
for this test case is actually a separate bug.

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

14 years agoSerialize the "inline" bit for namespaces. Fixes <rdar://problem/8515069>.
Douglas Gregor [Tue, 5 Oct 2010 20:41:58 +0000 (20:41 +0000)]
Serialize the "inline" bit for namespaces. Fixes <rdar://problem/8515069>.

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

14 years agoFix a marvelous chained AST writing bug, where we end up with the
Douglas Gregor [Tue, 5 Oct 2010 18:37:06 +0000 (18:37 +0000)]
Fix a marvelous chained AST writing bug, where we end up with the
following amusing sequence:
  - AST writing schedules writing a type X* that it had never seen
  before
  - AST writing starts writing another declaration, ends up
  deserializing X* from a prior AST file. Now we have two type IDs for
  the same type!
  - AST writer tries to write X*. It only has the lower-numbered ID
  from the the prior AST file, so references to the higher-numbered ID
  that was scheduled for writing go off into lalaland.

To fix this, keep the higher-numbered ID so we end up writing the type
twice. Since this issue occurs so rarely, and type records are
generally rather small, I deemed this better than the alternative: to
keep a separate mapping from the higher-numbered IDs to the
lower-numbered IDs, which we would end up having to check whenever we
want to deserialize any type.

Fixes <rdar://problem/8511624>, I think.

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

14 years agoFix a block rewriter bug where copy/dispose entries in
Fariborz Jahanian [Tue, 5 Oct 2010 18:05:06 +0000 (18:05 +0000)]
Fix a block rewriter bug where copy/dispose entries in
block descriptor for outer block was missing even though
the block was importing objects into its inner blocks.
//rdar://84995992

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

14 years agoFix handling of the 'Invalid' argument in SourceManager's methods (patch by Dean...
Zhanyong Wan [Tue, 5 Oct 2010 17:56:33 +0000 (17:56 +0000)]
Fix handling of the 'Invalid' argument in SourceManager's methods (patch by Dean Sturtevant, reviewed by chandlerc and Sebastian Redl).

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

14 years agoGive every file that ASTReader loads a type: module, PCH, precompiled preamble or...
Sebastian Redl [Tue, 5 Oct 2010 16:15:19 +0000 (16:15 +0000)]
Give every file that ASTReader loads a type: module, PCH, precompiled preamble or main file. Base Decls' PCHLevel on this to make it more sane.

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

14 years agoThread PerFileData through the ASTReader again, this time with the LLVM changes.
Sebastian Redl [Tue, 5 Oct 2010 15:59:54 +0000 (15:59 +0000)]
Thread PerFileData through the ASTReader again, this time with the LLVM changes.

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

14 years agoRegister the __builtin_va_list_type node when we parse it, rather than
Douglas Gregor [Tue, 5 Oct 2010 15:41:24 +0000 (15:41 +0000)]
Register the __builtin_va_list_type node when we parse it, rather than
waiting until we think we need it: we didn't catch all of the places
where we actually needed it, and we probably wouldn't ever. Fixes a
C++ PCH crasher.

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

14 years agoRemove a rogue typo
Douglas Gregor [Tue, 5 Oct 2010 14:58:05 +0000 (14:58 +0000)]
Remove a rogue typo

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

14 years agoRegister the __builtin_va_list_type node when we parse it, rather than
Douglas Gregor [Tue, 5 Oct 2010 14:55:45 +0000 (14:55 +0000)]
Register the __builtin_va_list_type node when we parse it, rather than
waiting until we think we need it: we didn't catch all of the places
where we actually needed it, and we probably wouldn't ever. Fixes a
C++ PCH crasher.

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

14 years ago* Simplify code
Zhongxing Xu [Tue, 5 Oct 2010 08:38:06 +0000 (08:38 +0000)]
* Simplify code
* Fix dump() to make it consistent with the test case.

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

14 years agoAdded support for base and member destructors in destructor.
Marcin Swiderski [Tue, 5 Oct 2010 05:37:00 +0000 (05:37 +0000)]
Added support for base and member destructors in destructor.

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

14 years agoAdd test case for r115588.
Argyrios Kyrtzidis [Tue, 5 Oct 2010 03:15:43 +0000 (03:15 +0000)]
Add test case for r115588.

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

14 years agoIn Sema's TryRefInitWithConversionFunction, suppress user conversions for the overloa...
Argyrios Kyrtzidis [Tue, 5 Oct 2010 03:05:30 +0000 (03:05 +0000)]
In Sema's TryRefInitWithConversionFunction, suppress user conversions for the overload candidates.
Fixes an infinite recursion in overload resolution for rdar://8499524.
Many thanks to Doug!

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

14 years agoIf we're resolving all outstanding fixups, and there are multiple fixups
John McCall [Tue, 5 Oct 2010 02:33:56 +0000 (02:33 +0000)]
If we're resolving all outstanding fixups, and there are multiple fixups
for the same destination, then we must potentially rewrite the initial branch
of every fixup.  Without this patch, a short-circuit check meant to prevent
a switch case from being redundantly added was preventing later fixups from
being processed.  Fixes PR8175 (again).

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

14 years agoIn the fragile ObjC ABI, save the caught exception to the side if there are
John McCall [Mon, 4 Oct 2010 23:42:51 +0000 (23:42 +0000)]
In the fragile ObjC ABI, save the caught exception to the side if there are
both @catches and a @finally, because the second call to @objc_exception_try_enter
will clobber the exception slot.  Fixes rdar://problem/8440970.

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

14 years agodyn_cast is more appropriate here.
Devang Patel [Mon, 4 Oct 2010 22:28:23 +0000 (22:28 +0000)]
dyn_cast is more appropriate here.

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

14 years agoAdd missing '}' :)
Devang Patel [Mon, 4 Oct 2010 22:13:18 +0000 (22:13 +0000)]
Add missing '}' :)

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

14 years agoEmit debug info for an aggregate while processing MemberExpr if the aggregate's debug...
Devang Patel [Mon, 4 Oct 2010 21:46:04 +0000 (21:46 +0000)]
Emit debug info for an aggregate while processing MemberExpr if the aggregate's debug info was delayed untill now.

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

14 years agoFix filename in header comment.
Devang Patel [Mon, 4 Oct 2010 21:15:33 +0000 (21:15 +0000)]
Fix filename in header comment.

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

14 years agoWhen a type comes from a previously-loaded PCH/AST file, don't try to write it into...
Douglas Gregor [Mon, 4 Oct 2010 18:21:45 +0000 (18:21 +0000)]
When a type comes from a previously-loaded PCH/AST file, don't try to write it into a chained PCH file.

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

14 years agowww: Add a "Clang Related Projects" page, to collect links to external projects
Daniel Dunbar [Mon, 4 Oct 2010 15:40:45 +0000 (15:40 +0000)]
www: Add a "Clang Related Projects" page, to collect links to external projects
using Clang in one way or another. Additions welcome!

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

14 years agoAdded support for C++ initializers in CFG.
Marcin Swiderski [Mon, 4 Oct 2010 03:38:22 +0000 (03:38 +0000)]
Added support for C++ initializers in CFG.

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

14 years agoChange to match 115473.
Chris Lattner [Sun, 3 Oct 2010 19:09:22 +0000 (19:09 +0000)]
Change to match 115473.

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

14 years agoDo x86_64.
Bill Wendling [Sun, 3 Oct 2010 08:34:05 +0000 (08:34 +0000)]
Do x86_64.

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

14 years agoTest to verify that all of the MMX builtins are handled by the front-end.
Bill Wendling [Sun, 3 Oct 2010 03:39:54 +0000 (03:39 +0000)]
Test to verify that all of the MMX builtins are handled by the front-end.

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

14 years agoWhen providing a block literal as a code completion for a
Douglas Gregor [Sat, 2 Oct 2010 23:49:58 +0000 (23:49 +0000)]
When providing a block literal as a code completion for a
function/method argument, include the parameter name and always
include parentheses (even for zero-parameter blocks). Otherwise, the
block literal placeholder '^' can look very weird.

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

14 years agoIntroduce a new libclang function, clang_getCursorDisplayName(), which
Douglas Gregor [Sat, 2 Oct 2010 22:49:11 +0000 (22:49 +0000)]
Introduce a new libclang function, clang_getCursorDisplayName(), which
produces a simple "display" name that captures the
arguments/parameters for a function, function template, class
template, or class template specialization.

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

14 years agoTeach clang_getCursorType() about base specifiers and other references
Douglas Gregor [Sat, 2 Oct 2010 21:57:58 +0000 (21:57 +0000)]
Teach clang_getCursorType() about base specifiers and other references
to types.

Also, teach clang_getTypeDeclaration() about template specializations,
injected-class-names, and elaborated types.

Fixes <rdar://problem/8506460>.

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

14 years agothe mmx intrinsic for pshufw should map to the IR intrinsic, not
Chris Lattner [Sat, 2 Oct 2010 21:32:59 +0000 (21:32 +0000)]
the mmx intrinsic for pshufw should map to the IR intrinsic, not
to a shufflevector.  Otherwise it doesn't turn into a pshufw.
This bug was introduced in the mmx rewrite.

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

14 years agoWhen we insert a category (or class extension) into an interface, mark
Douglas Gregor [Sat, 2 Oct 2010 21:06:43 +0000 (21:06 +0000)]
When we insert a category (or class extension) into an interface, mark
the interface as having changed since it was originally
serialized. This ensures that we see class extensions/categories in
chained PCH files.

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

14 years agoDon't add -fno-spell-checking in libclang if a spell-checking-related argument is...
Douglas Gregor [Sat, 2 Oct 2010 20:06:51 +0000 (20:06 +0000)]
Don't add -fno-spell-checking in libclang if a spell-checking-related argument is already in the command-line arguments

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

14 years agoProvide proper source location and range information for C++ base
Douglas Gregor [Sat, 2 Oct 2010 19:51:13 +0000 (19:51 +0000)]
Provide proper source location and range information for C++ base
specifier cursors in libclang. FIXME -=2, fixes the rest of
<rdar://problem/8274883>.

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

14 years agoImplement chained PCH support for the macro definitions stored within
Douglas Gregor [Sat, 2 Oct 2010 19:29:26 +0000 (19:29 +0000)]
Implement chained PCH support for the macro definitions stored within
the "detailed" preprocessing record.

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

14 years agoUse ParseObjCSelectorPiece for parsing getter and setter names in @property declarati...
Anders Carlsson [Sat, 2 Oct 2010 17:45:21 +0000 (17:45 +0000)]
Use ParseObjCSelectorPiece for parsing getter and setter names in @property declarations. Fixes PR8169.

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

14 years agoRename a test in preparation for fixing PR8169.
Anders Carlsson [Sat, 2 Oct 2010 17:08:38 +0000 (17:08 +0000)]
Rename a test in preparation for fixing PR8169.

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

14 years agowhen expanding a builtin, if the argument is required to be a constant,
Chris Lattner [Sat, 2 Oct 2010 00:09:12 +0000 (00:09 +0000)]
when expanding a builtin, if the argument is required to be a constant,
force it to be a constant instead of emitting with EmitScalarExpr.  In
-ftrapv mode, they are not the same.

This fixes rdar://8478728 + PR8221

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

14 years agoDon't add an imported function into its lexical context until *after*
Douglas Gregor [Fri, 1 Oct 2010 23:55:07 +0000 (23:55 +0000)]
Don't add an imported function into its lexical context until *after*
we've set all of its parameters. Fixes <rdar://problem/8499598>;
thanks to Sean for the diagnosis.

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

14 years agotidy
Chris Lattner [Fri, 1 Oct 2010 23:43:16 +0000 (23:43 +0000)]
tidy

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

14 years agokill off CheckX86BuiltinFunctionCall
Chris Lattner [Fri, 1 Oct 2010 23:40:43 +0000 (23:40 +0000)]
kill off CheckX86BuiltinFunctionCall

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

14 years agomove imperative code to declarative definitions.
Chris Lattner [Fri, 1 Oct 2010 23:35:58 +0000 (23:35 +0000)]
move imperative code to declarative definitions.

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

14 years agoMark explict methods as explict in debug info.
Devang Patel [Fri, 1 Oct 2010 23:32:17 +0000 (23:32 +0000)]
Mark explict methods as explict in debug info.

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

14 years agodiagnose errors when a builtin that require constant arguments don't have them.
Chris Lattner [Fri, 1 Oct 2010 23:23:24 +0000 (23:23 +0000)]
diagnose errors when a builtin that require constant arguments don't have them.
For example, on:

#include <emmintrin.h>
int foo(int N) {
 __m128i white2;
 white2 = _mm_slli_si128(white2, N);
 return 0;
}

we used to get:
fatal error: error in backend: Cannot yet select: intrinsic %llvm.x86.sse2.psll.dq

now we get:
/Users/sabre/t.c:4:11: error: argument to '__builtin_ia32_pslldqi128' must be a
      constant integer
 white2 = _mm_slli_si128(white2, N);
          ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/sabre/t.c:1:
/Volumes/Projects/cvs/llvm/Debug+Asserts/lib/clang/2.9/include/emmintrin.h:781:13: note: instantiated from:
  ((__m128i)__builtin_ia32_pslldqi128((__m128i)(VEC), (IMM)*8))
            ^                                         ~~~~~~~
1 error generated.

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

14 years agoenhance ASTContext::GetBuiltinType to return a bitmask indicating which arguments
Chris Lattner [Fri, 1 Oct 2010 22:53:11 +0000 (22:53 +0000)]
enhance ASTContext::GetBuiltinType to return a bitmask indicating which arguments
are required to be ICE's.  No clients of this new functionality yet!

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

14 years agorandom cleanups, no functionality change.
Chris Lattner [Fri, 1 Oct 2010 22:42:38 +0000 (22:42 +0000)]
random cleanups, no functionality change.

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

14 years agoDoug's feedback
Gabor Greif [Fri, 1 Oct 2010 22:12:38 +0000 (22:12 +0000)]
Doug's feedback

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

14 years agoFactor out enumerator APSInt adjustment into
Gabor Greif [Fri, 1 Oct 2010 22:05:14 +0000 (22:05 +0000)]
Factor out enumerator APSInt adjustment into
a helper function (AdjustAPSInt) and use that
for adjusting the high bounds of case ranges
before APSInt comparisons. Fixes
http://llvm.org/bugs/show_bug.cgi?id=8135

Some minor refacorings while I am here.

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

14 years agoRestore test. Is for //rdar://8493239
Fariborz Jahanian [Fri, 1 Oct 2010 21:26:26 +0000 (21:26 +0000)]
Restore test. Is for //rdar://8493239

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

14 years agoBetter diagnostic for superfluous scope specifier inside a class definition for membe...
Francois Pichet [Fri, 1 Oct 2010 21:19:28 +0000 (21:19 +0000)]
Better diagnostic for superfluous scope specifier inside a class definition for member functions. + Fixit.

Example:
class A {
   void A::foo(); //warning: extra qualification on member 'foo'
};

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

14 years agoTeach clang_getCursorReferenced() about Objective-C property reference
Douglas Gregor [Fri, 1 Oct 2010 21:11:22 +0000 (21:11 +0000)]
Teach clang_getCursorReferenced() about Objective-C property reference
and protocol expressions. Fixes <rdar://problem/7833565>.

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

14 years agoUnreachableCodeChecker does not need to inherit from CheckerVisitor, only Checker...
Tom Care [Fri, 1 Oct 2010 20:52:07 +0000 (20:52 +0000)]
UnreachableCodeChecker does not need to inherit from CheckerVisitor, only Checker. It does not use any AST Stmt hooks, only VisitEndAnalysis.

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

14 years agoRevert r115336 ("Thread PerFileData through everything."), because
Douglas Gregor [Fri, 1 Oct 2010 20:33:34 +0000 (20:33 +0000)]
Revert r115336 ("Thread PerFileData through everything."), because
we're missing the corresponding changes in the LLVM repository.

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

14 years agoExtend libclang with an API that determines, given a C++ virtual
Douglas Gregor [Fri, 1 Oct 2010 20:25:15 +0000 (20:25 +0000)]
Extend libclang with an API that determines, given a C++ virtual
member function or an Objective-C method, which other member
functions/methods it overrides.

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

14 years agoThread PerFileData through everything. This allows us to remap stuff later.
Sebastian Redl [Fri, 1 Oct 2010 19:59:15 +0000 (19:59 +0000)]
Thread PerFileData through everything. This allows us to remap stuff later.

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

14 years agoRecord module loaders and module source order.
Sebastian Redl [Fri, 1 Oct 2010 19:59:12 +0000 (19:59 +0000)]
Record module loaders and module source order.

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

14 years agofix a bogus "I" that I added to the per-function attribute list.
Chris Lattner [Fri, 1 Oct 2010 19:47:04 +0000 (19:47 +0000)]
fix a bogus "I" that I added to the per-function attribute list.

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

14 years agoImplement the C++0x "trailing return type" feature, e.g.,
Douglas Gregor [Fri, 1 Oct 2010 18:44:50 +0000 (18:44 +0000)]
Implement the C++0x "trailing return type" feature, e.g.,

  auto f(int) -> int

from Daniel Wallin!

(With a few minor bug fixes from me).

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

14 years agoVarious builtins a require an integer constant. Not providing
Chris Lattner [Fri, 1 Oct 2010 07:13:18 +0000 (07:13 +0000)]
Various builtins a require an integer constant.  Not providing
one results in an obscure error from the backend that doesn't make
sense.  Capture this information in the .def files for builtins with
a new "I" modifier letter indicating the an argument needs to be an ICE.

Nothing uses this yet, but sema will eventually enforce this (eliminating
some special cases from semachecking.cpp) and codegen will use this to
force an ICE value, preventing backend error messages.

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

14 years ago__builtin_ia32_psrldqi128 too
Chris Lattner [Fri, 1 Oct 2010 06:58:49 +0000 (06:58 +0000)]
__builtin_ia32_psrldqi128 too

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

14 years agothe second argument to __builtin_ia32_pslldqi128 must be an immediate,
Chris Lattner [Fri, 1 Oct 2010 06:52:23 +0000 (06:52 +0000)]
the second argument to __builtin_ia32_pslldqi128 must be an immediate,
so it needs to be called from a macro, not a function.  This is a necessary
but insufficient step towards fixing PR8221

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

14 years agoNow the whether adding implicit dtors is controlled by cmd option.
Zhongxing Xu [Fri, 1 Oct 2010 03:31:06 +0000 (03:31 +0000)]
Now the whether adding implicit dtors is controlled by cmd option.

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

14 years agoThe return value is never used.
Zhongxing Xu [Fri, 1 Oct 2010 03:22:39 +0000 (03:22 +0000)]
The return value is never used.

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

14 years agoUse default augument.
Zhongxing Xu [Fri, 1 Oct 2010 03:09:09 +0000 (03:09 +0000)]
Use default augument.

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

14 years agoSimplify interface for addLocalScopeForStmt().
Zhongxing Xu [Fri, 1 Oct 2010 03:00:16 +0000 (03:00 +0000)]
Simplify interface for addLocalScopeForStmt().

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

14 years agoThe old logic would add non-struct and non C++ struct variables to the local
Zhongxing Xu [Fri, 1 Oct 2010 02:47:11 +0000 (02:47 +0000)]
The old logic would add non-struct and non C++ struct variables to the local
scope. Now we only add C++ struct with non-trivial destructor variables to the
local scope.

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

14 years agoAdded generating CFGAutomaticObjDtors for exception variable in catch statement.
Marcin Swiderski [Fri, 1 Oct 2010 01:46:52 +0000 (01:46 +0000)]
Added generating CFGAutomaticObjDtors for exception variable in catch statement.

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

14 years agoAdded generating CFGAutomaticObjDtors for init statement, condition variable and...
Marcin Swiderski [Fri, 1 Oct 2010 01:38:14 +0000 (01:38 +0000)]
Added generating CFGAutomaticObjDtors for init statement, condition variable and implicit scope in for statement.

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

14 years agodded generating CFGAutomaticObjDtors for condition variable and implicit scopes in...
Marcin Swiderski [Fri, 1 Oct 2010 01:24:41 +0000 (01:24 +0000)]
dded generating CFGAutomaticObjDtors for condition variable and implicit scopes in switch statement.

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

14 years agoIf we get a TU_CONTEXT update from a chained PCH file before we
Douglas Gregor [Fri, 1 Oct 2010 01:18:02 +0000 (01:18 +0000)]
If we get a TU_CONTEXT update from a chained PCH file before we
actually have an ASTContext, delay the processing of that
update. Patch by Sebastian Redl! Fixes <rdar://problem/8499034>.

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

14 years agoAdded generating CFGAutomaticObjDtors for condition variable and implicit scopes...
Marcin Swiderski [Fri, 1 Oct 2010 01:14:17 +0000 (01:14 +0000)]
Added generating CFGAutomaticObjDtors for condition variable and implicit scopes in while and do statements.

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

14 years agoEnable chained precompiled headers for use with precompiled preambles
Douglas Gregor [Fri, 1 Oct 2010 01:05:22 +0000 (01:05 +0000)]
Enable chained precompiled headers for use with precompiled preambles

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

14 years agoWhen an identifier that has a macro definition in the original PCH
Douglas Gregor [Fri, 1 Oct 2010 01:03:07 +0000 (01:03 +0000)]
When an identifier that has a macro definition in the original PCH
file is somehow changed in a chained PCH file, make sure that we write
out the macro definition. Fixes part of <rdar://problem/8499034>.

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

14 years agoRemove test until further notice.
Fariborz Jahanian [Fri, 1 Oct 2010 01:01:03 +0000 (01:01 +0000)]
Remove test until further notice.

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

14 years agoAdded generating CFGAutomaticObjDtors for condition variable and implicit scopes...
Marcin Swiderski [Fri, 1 Oct 2010 00:52:17 +0000 (00:52 +0000)]
Added generating CFGAutomaticObjDtors for condition variable and implicit scopes in if statement.

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

14 years agoFixed checking for trivial destructor in CFGBuilder::addLocalScopeForVarDecl. Checked...
Marcin Swiderski [Fri, 1 Oct 2010 00:31:22 +0000 (00:31 +0000)]
Fixed checking for trivial destructor in CFGBuilder::addLocalScopeForVarDecl. Checked type does not have to represent C++ class.

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

14 years agoFix test.
Fariborz Jahanian [Fri, 1 Oct 2010 00:27:17 +0000 (00:27 +0000)]
Fix test.

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

14 years agoAdded:
Marcin Swiderski [Fri, 1 Oct 2010 00:23:17 +0000 (00:23 +0000)]
Added:
- Adding LocalScope for CompoundStmt,
- Adding CFGAutomaticObjDtors for end of scope, return, goto, break, continue,
- Regression tests for above cases.

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