]> granicus.if.org Git - clang/log
clang
15 years agoRefactor. WIP. Eventually, this will all go into a vtable builder class.
Mike Stump [Wed, 12 Aug 2009 23:14:12 +0000 (23:14 +0000)]
Refactor.  WIP.  Eventually, this will all go into a vtable builder class.

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

15 years agoCleanup.
Mike Stump [Wed, 12 Aug 2009 23:03:28 +0000 (23:03 +0000)]
Cleanup.

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

15 years agoRefactor.
Mike Stump [Wed, 12 Aug 2009 23:00:59 +0000 (23:00 +0000)]
Refactor.

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

15 years agoRefactor.
Mike Stump [Wed, 12 Aug 2009 22:34:12 +0000 (22:34 +0000)]
Refactor.

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

15 years agoRemove another done audit FIXME.
Mike Stump [Wed, 12 Aug 2009 22:10:00 +0000 (22:10 +0000)]
Remove another done audit FIXME.

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

15 years agoRefactor a bit and remove some FIXME audit markers, now that the code
Mike Stump [Wed, 12 Aug 2009 22:06:55 +0000 (22:06 +0000)]
Refactor a bit and remove some FIXME audit markers, now that the code
has been audited for correctness.

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

15 years agoRefine primary vbase selection ordering. WIP.
Mike Stump [Wed, 12 Aug 2009 21:50:08 +0000 (21:50 +0000)]
Refine primary vbase selection ordering.  WIP.

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

15 years agoPatch for synthesizing copy assignment operator.
Fariborz Jahanian [Wed, 12 Aug 2009 21:14:35 +0000 (21:14 +0000)]
Patch for synthesizing copy assignment operator.
WIP.

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

15 years agoImprove the secondary vtables to not include vbase offsets. WIP.
Mike Stump [Wed, 12 Aug 2009 18:50:26 +0000 (18:50 +0000)]
Improve the secondary vtables to not include vbase offsets.  WIP.

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

15 years agoerror on property of objc interface type instead of crashing
Fariborz Jahanian [Wed, 12 Aug 2009 18:17:53 +0000 (18:17 +0000)]
error on property of objc interface type instead of crashing

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

15 years agoimprove path handling, patch by Baptiste Lepilleur!
Chris Lattner [Wed, 12 Aug 2009 17:50:39 +0000 (17:50 +0000)]
improve path handling, patch by Baptiste Lepilleur!

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

15 years agoRefine vtable building for the secondary vtables to exclude yet more
Mike Stump [Wed, 12 Aug 2009 17:42:21 +0000 (17:42 +0000)]
Refine vtable building for the secondary vtables to exclude yet more
cases where a virtual base was already used as a primary base class.
WIP.

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

15 years agouse the new llvm::Triple parsing stuffola for handling darwin version #'s.
Chris Lattner [Wed, 12 Aug 2009 06:24:27 +0000 (06:24 +0000)]
use the new llvm::Triple parsing stuffola for handling darwin version #'s.

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

15 years agoTransition the PCH support for ShuffleVectorExpr over to ASTContext allocation
Nate Begeman [Wed, 12 Aug 2009 02:28:50 +0000 (02:28 +0000)]
Transition the PCH support for ShuffleVectorExpr over to ASTContext allocation

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

15 years agoMore cleanups.
Zhongxing Xu [Wed, 12 Aug 2009 02:28:32 +0000 (02:28 +0000)]
More cleanups.

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

15 years agoRemove redundant forward declarations.
Zhongxing Xu [Wed, 12 Aug 2009 02:23:28 +0000 (02:23 +0000)]
Remove redundant forward declarations.

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

15 years agoFix a fixme by allocating ShuffleVectorExprs in the Context
Nate Begeman [Wed, 12 Aug 2009 02:10:25 +0000 (02:10 +0000)]
Fix a fixme by allocating ShuffleVectorExprs in the Context

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

15 years agoUse the new nsw form of add for signed integer addition.
Dan Gohman [Wed, 12 Aug 2009 01:16:29 +0000 (01:16 +0000)]
Use the new nsw form of add for signed integer addition.

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

15 years agoWarn on use of property dot syntax when unused.
Fariborz Jahanian [Wed, 12 Aug 2009 00:45:33 +0000 (00:45 +0000)]
Warn on use of property dot syntax when unused.

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

15 years agoUse the inbounds variant of getelementptr for common pointer arithmetic.
Dan Gohman [Wed, 12 Aug 2009 00:33:55 +0000 (00:33 +0000)]
Use the inbounds variant of getelementptr for common pointer arithmetic.

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

15 years agoAdd some information about temporaries to the statement dumper.
Anders Carlsson [Wed, 12 Aug 2009 00:21:52 +0000 (00:21 +0000)]
Add some information about temporaries to the statement dumper.

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

15 years agono more .inc files to be ignored in this directory
Gabor Greif [Tue, 11 Aug 2009 23:45:06 +0000 (23:45 +0000)]
no more .inc files to be ignored in this directory

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

15 years agoRename macro to avoid a name clash on FreeBSD.
Benjamin Kramer [Tue, 11 Aug 2009 22:46:25 +0000 (22:46 +0000)]
Rename macro to avoid a name clash on FreeBSD.

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

15 years agoRemove the hack that turns sdiv by a power of 2 to ashr, and
Dan Gohman [Tue, 11 Aug 2009 22:40:09 +0000 (22:40 +0000)]
Remove the hack that turns sdiv by a power of 2 to ashr, and
use the new "exact" sdiv to allow LLVM optimization to perform
this transformation.

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

15 years agoAdd newline at end of file.
Benjamin Kramer [Tue, 11 Aug 2009 22:33:06 +0000 (22:33 +0000)]
Add newline at end of file.

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

15 years agoPatch to warn if a property which is 'assign' by default
Fariborz Jahanian [Tue, 11 Aug 2009 22:02:25 +0000 (22:02 +0000)]
Patch to warn if a property which is 'assign' by default
may not implement NSCopying protocol in -fobjc-gc[-only] mode.

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

15 years agoAdd a FriendClassDecl type for holding declarations of friend types in
John McCall [Tue, 11 Aug 2009 21:13:21 +0000 (21:13 +0000)]
Add a FriendClassDecl type for holding declarations of friend types in
the AST, and create such declarations.

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

15 years agomerge two tests.
Chris Lattner [Tue, 11 Aug 2009 20:08:52 +0000 (20:08 +0000)]
merge two tests.

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

15 years agoFix rdar://7126285: don't warn on unused ObjC property access
Chris Lattner [Tue, 11 Aug 2009 20:08:03 +0000 (20:08 +0000)]
Fix rdar://7126285: don't warn on unused ObjC property access
that uses "dot syntax" since it might have a side effect.

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

15 years agoir-gen support for anonymous union data member
Fariborz Jahanian [Tue, 11 Aug 2009 18:49:54 +0000 (18:49 +0000)]
ir-gen support for anonymous union data member
copying in copy constructors and used in
default constructor's initializer list.

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

15 years agoUpdate test case.
Daniel Dunbar [Tue, 11 Aug 2009 18:37:40 +0000 (18:37 +0000)]
Update test case.

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

15 years agoLLVMContext is a class now.
Benjamin Kramer [Tue, 11 Aug 2009 17:46:57 +0000 (17:46 +0000)]
LLVMContext is a class now.

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

15 years agoFix DISABLE_SMART_POINTERS build
Douglas Gregor [Tue, 11 Aug 2009 15:56:57 +0000 (15:56 +0000)]
Fix DISABLE_SMART_POINTERS build

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

15 years agoArgument-dependent lookup for friend declarations. Add a new decl type,
John McCall [Tue, 11 Aug 2009 06:59:38 +0000 (06:59 +0000)]
Argument-dependent lookup for friend declarations.  Add a new decl type,
FriendFunctionDecl, and create instances as appropriate.

The design of FriendFunctionDecl is still somewhat up in the air;  you can
befriend arbitrary types of functions --- methods, constructors, etc. ---
and it's not clear that this representation captures that very well.
We'll have a better picture when we start consuming this data in access
control.

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

15 years agoRefactor the template-instantiation logic for expressions into a
Douglas Gregor [Tue, 11 Aug 2009 05:31:07 +0000 (05:31 +0000)]
Refactor the template-instantiation logic for expressions into a
generic tree transformation (also used for recanonicalization) and a
small amount of template-instantiation-specific logic.

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

15 years agoCheck whether a tag was defined in a C++ condition declaration using GetTypeForDeclar...
Argyrios Kyrtzidis [Tue, 11 Aug 2009 05:20:41 +0000 (05:20 +0000)]
Check whether a tag was defined in a C++ condition declaration using GetTypeForDeclarator.

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

15 years agoImplement more of the inductive case for vtable layout involving
Mike Stump [Tue, 11 Aug 2009 04:03:59 +0000 (04:03 +0000)]
Implement more of the inductive case for vtable layout involving
virtual base primaries and improve the layout of classes with virtual
bases.  WIP.

Hey, I've decided I want a change to FileCheck, I need to ensure that
the group is together, nothing in between.  Can we change it to check
the match line is from the line immediately following the last matched
line, if the source for the matched line is immediately after the
source for the previously matched line?

// CHECK: 1
// CHECK: 2
// CHECK: 3

// CHECK: 4
// CHECK: 5
// CHECK: 6

would require 1 2 and 3 to be continuous in the output, and 4 5 and 6
to be continuous.

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

15 years agoFix an indentation.
Fariborz Jahanian [Mon, 10 Aug 2009 23:59:59 +0000 (23:59 +0000)]
Fix an indentation.

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

15 years agoSupport for anonymous union in ctor's initializer and
Fariborz Jahanian [Mon, 10 Aug 2009 23:56:17 +0000 (23:56 +0000)]
Support for anonymous union in ctor's initializer and
bunch of FIXMEs for their is-gen.

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

15 years agoTake 2 on AltiVec-style vector initializers.
Nate Begeman [Mon, 10 Aug 2009 23:49:36 +0000 (23:49 +0000)]
Take 2 on AltiVec-style vector initializers.

Fixes PR4704 problems

Addresses Eli's patch feedback re: ugly cast code

Updates all postfix operators to remove ParenListExprs.  While this is awful,
no better solution (say, in the parser) is obvious to me.  Better solutions
welcome.

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

15 years agoAdd a CastInfo struct that will be used for cast information when constructing cast...
Anders Carlsson [Mon, 10 Aug 2009 21:30:22 +0000 (21:30 +0000)]
Add a CastInfo struct that will be used for cast information when constructing cast expressions. Right now it only stores the cast kind, but in the future it might store conversion functions and constructors.

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

15 years agofix a couple of problems with section attributes:
Chris Lattner [Mon, 10 Aug 2009 19:03:04 +0000 (19:03 +0000)]
fix a couple of problems with section attributes:

1. Passing something that isn't a string used to cause:
   "argument to annotate attribute was not a string literal"
  make it say "section attribute" instead.

2. Fix the location of the above message to point to the
   bad argument instead of the section token.

3. Implement rdar://4341926, by diagnosing invalid section
   specifiers in the frontend rather than letting them slip all
   the way to the assembler (a QoI win).

An example of #3 is that we used to produce something like this:

/var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Expected comma after segment-name
/var/folders/n7/n7Yno9ihEm894640nJdSQU+++TI/-Tmp-//ccFPFGtT.s:2:Rest of line ignored. 1st junk character valued 46 (.).

Daniel improved clang to use llvm_report_error, so now we got:

$ clang t.c -c
fatal error: error in backend: Global variable 'x' has an invalid section specifier 'sadf': mach-o section specifier
      requires a segment and section separated by a comma.

with no loc info.  Now we get:

$ clang t.c -fsyntax-only
t.c:4:30: error: argument to 'section' attribute is not valid for this target: mach-o section specifier requires a segment
      and section separated by a comma
int x __attribute__((section("sadf")));
                             ^

which is nice :)

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

15 years agothese tests include section specifiers that aren't valid on the
Chris Lattner [Mon, 10 Aug 2009 18:56:44 +0000 (18:56 +0000)]
these tests include section specifiers that aren't valid on the
mac, use an explicit triple.

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

15 years agominor refactoring. No change otherwise.
Fariborz Jahanian [Mon, 10 Aug 2009 18:46:38 +0000 (18:46 +0000)]
minor refactoring. No change otherwise.

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

15 years agoir-gen for generating copying of scalar data members in
Fariborz Jahanian [Mon, 10 Aug 2009 18:34:26 +0000 (18:34 +0000)]
ir-gen for generating copying of scalar data members in
a synthesized copy constructor.

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

15 years agoAdd walking bases in reverse order.
Mike Stump [Mon, 10 Aug 2009 18:21:22 +0000 (18:21 +0000)]
Add walking bases in reverse order.

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

15 years agoFixed a ir-gen bug in synthesizing copy constructors.
Fariborz Jahanian [Mon, 10 Aug 2009 17:20:45 +0000 (17:20 +0000)]
Fixed a ir-gen bug in synthesizing copy constructors.

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

15 years agoUse LLVM's new error handler API to report back end errors using Diagnostic.
Daniel Dunbar [Mon, 10 Aug 2009 03:40:28 +0000 (03:40 +0000)]
Use LLVM's new error handler API to report back end errors using Diagnostic.

For example,
--
ddunbar@giles:Frontend$ clang -c backend-errors.c
fatal error: error in backend: Global variable 'a' has an invalid section specifier
      'I AM, not, legal': mach-o section specifier uses an unknown section type.
--
compare to:
--
ddunbar@giles:Frontend$ gcc -c backend-errors.c
/var/folders/DQ/DQ8GT3++HESEzT1obWBynE+++TI/-Tmp-//cc45w2pq.s:2:Expected comma after segment-name
/var/folders/DQ/DQ8GT3++HESEzT1obWBynE+++TI/-Tmp-//cc45w2pq.s:2:Rest of line ignored. 1st junk character valued 77 (M).
--

Yay!

I am not tied to my wording choice, we could also go with "uncoverable error"
for the prefix, or just leave it off entirely.

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

15 years agoRevert r78535, it is causing a number of failures to build projects.
Daniel Dunbar [Mon, 10 Aug 2009 03:01:36 +0000 (03:01 +0000)]
Revert r78535, it is causing a number of failures to build projects.

--- Reverse-merging r78535 into '.':
D    test/Sema/altivec-init.c
U    include/clang/Basic/DiagnosticSemaKinds.td
U    include/clang/AST/Expr.h
U    include/clang/AST/StmtNodes.def
U    include/clang/Parse/Parser.h
U    include/clang/Parse/Action.h
U    tools/clang-cc/clang-cc.cpp
U    lib/Frontend/PrintParserCallbacks.cpp
U    lib/CodeGen/CGExprScalar.cpp
U    lib/Sema/SemaInit.cpp
U    lib/Sema/Sema.h
U    lib/Sema/SemaExpr.cpp
U    lib/Sema/SemaTemplateInstantiateExpr.cpp
U    lib/AST/StmtProfile.cpp
U    lib/AST/Expr.cpp
U    lib/AST/StmtPrinter.cpp
U    lib/Parse/ParseExpr.cpp
U    lib/Parse/ParseExprCXX.cpp

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

15 years agowarn, as gcc does, if __attribute__((malloc)) applied to function returning non-point...
Ryan Flynn [Sun, 9 Aug 2009 22:36:29 +0000 (22:36 +0000)]
warn, as gcc does, if __attribute__((malloc)) applied to function returning non-pointer type

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

15 years agomap previously ignored __attribute((malloc)) to noalias attribute of llvm function...
Ryan Flynn [Sun, 9 Aug 2009 20:07:29 +0000 (20:07 +0000)]
map previously ignored __attribute((malloc)) to noalias attribute of llvm function's return

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

15 years agoImprove handling of member pointers.
Anders Carlsson [Sun, 9 Aug 2009 18:26:27 +0000 (18:26 +0000)]
Improve handling of member pointers.

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

15 years agoAltiVec-style vector initializer syntax, vec4 a = (vec4)(a, b, c, d);
Nate Begeman [Sun, 9 Aug 2009 17:55:44 +0000 (17:55 +0000)]
AltiVec-style vector initializer syntax, vec4 a = (vec4)(a, b, c, d);

In addition to being defined by the AltiVec PIM, this is also the vector
initializer syntax used by OpenCL, so that vector literals are compatible
with macro arguments.

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

15 years agoOlder GCCs don't have vector::data().
Benjamin Kramer [Sat, 8 Aug 2009 23:43:26 +0000 (23:43 +0000)]
Older GCCs don't have vector::data().

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

15 years agoir-gen for initialization, in synthesize copy constructor,
Fariborz Jahanian [Sat, 8 Aug 2009 23:32:22 +0000 (23:32 +0000)]
ir-gen for initialization, in synthesize copy constructor,
 of base/field which have trivial copy constructor.

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

15 years agoAdd support for global initializers.
Anders Carlsson [Sat, 8 Aug 2009 23:24:23 +0000 (23:24 +0000)]
Add support for global initializers.

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

15 years agoRefactor some code and implement support for global destructors for static variables.
Anders Carlsson [Sat, 8 Aug 2009 21:45:14 +0000 (21:45 +0000)]
Refactor some code and implement support for global destructors for static variables.

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

15 years agoUse CastExpr::CK_ArrayToPointerDecay and fix an assert.
Anders Carlsson [Sat, 8 Aug 2009 21:04:35 +0000 (21:04 +0000)]
Use CastExpr::CK_ArrayToPointerDecay and fix an assert.

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

15 years agoAdd tests.
Anders Carlsson [Sat, 8 Aug 2009 19:43:14 +0000 (19:43 +0000)]
Add tests.

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

15 years agoTake #pragma pack into account when laying out structs. Fixes rdar://problem/7095436.
Anders Carlsson [Sat, 8 Aug 2009 19:38:24 +0000 (19:38 +0000)]
Take #pragma pack into account when laying out structs. Fixes rdar://problem/7095436.

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

15 years agoRefactoring of copy ctor ir-gen. No change in functionality.
Fariborz Jahanian [Sat, 8 Aug 2009 19:31:03 +0000 (19:31 +0000)]
Refactoring of copy ctor ir-gen. No change in functionality.

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

15 years agoPR4700 - remove shift by 0 warning
Ryan Flynn [Sat, 8 Aug 2009 19:18:23 +0000 (19:18 +0000)]
PR4700 - remove shift by 0 warning

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

15 years agoIntroduce a new PragmaPack attribute, and use it for #pragma pack. The PackedAttr...
Anders Carlsson [Sat, 8 Aug 2009 18:23:56 +0000 (18:23 +0000)]
Introduce a new PragmaPack attribute, and use it for #pragma pack. The PackedAttr now only represents __attribute__((packed)).

This is necessary because #pragma pack and __attribute__((packed)) have different semantics. No functionality change yet, but this lays the groundwork for fixing a record layout bug.

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

15 years agoAssert that the LLVM type has the same size as the RecordDecl size.
Anders Carlsson [Sat, 8 Aug 2009 18:01:57 +0000 (18:01 +0000)]
Assert that the LLVM type has the same size as the RecordDecl size.

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

15 years agogetFunctionLevelDeclContext needs to get the previous DeclContext if EnterDeclaratorC...
Anders Carlsson [Sat, 8 Aug 2009 17:48:49 +0000 (17:48 +0000)]
getFunctionLevelDeclContext needs to get the previous DeclContext if EnterDeclaratorContext has been called. Fixes PR4694. (Doug, please review)

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

15 years agoFactor some code to get the "function level" DeclContext out into a separate function.
Anders Carlsson [Sat, 8 Aug 2009 17:45:02 +0000 (17:45 +0000)]
Factor some code to get the "function level" DeclContext out into a separate function.

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

15 years agoMake sure to diagnose use of declarations in the case where we create an implicit...
Anders Carlsson [Sat, 8 Aug 2009 16:55:18 +0000 (16:55 +0000)]
Make sure to diagnose use of declarations in the case where we create an implicit CXXThisExpr.

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

15 years agoUpdate test case; I don't really understand why packed enums changed this, but
Daniel Dunbar [Sat, 8 Aug 2009 15:47:00 +0000 (15:47 +0000)]
Update test case; I don't really understand why packed enums changed this, but
the new havior is better so...

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

15 years agoPatch should implement packed enums - PR4098. Credit to Anders Johnsen.
Edward O'Callaghan [Sat, 8 Aug 2009 14:36:57 +0000 (14:36 +0000)]
Patch should implement packed enums - PR4098. Credit to Anders Johnsen.

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

15 years agoGet rid of Stmt::Clone now that we can reference count statements instead.
Anders Carlsson [Sat, 8 Aug 2009 02:50:17 +0000 (02:50 +0000)]
Get rid of Stmt::Clone now that we can reference count statements instead.

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

15 years agoIntroduce reference counting for statements and expressions, using it
Douglas Gregor [Sat, 8 Aug 2009 01:41:12 +0000 (01:41 +0000)]
Introduce reference counting for statements and expressions, using it
to allow sharing of nodes. Simplifies some aspects of template
instantiation, and fixes both PR3444 and <rdar://problem/6757457>.

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

15 years agoRemove use of uninitized variable.
Fariborz Jahanian [Sat, 8 Aug 2009 00:59:58 +0000 (00:59 +0000)]
Remove use of uninitized variable.

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

15 years agoSynthesize copying of non-static data members with
Fariborz Jahanian [Sat, 8 Aug 2009 00:15:41 +0000 (00:15 +0000)]
Synthesize copying of non-static data members with
non-trivial copy constructors.

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

15 years agoSynthesized copy constructor now generates code for
Fariborz Jahanian [Fri, 7 Aug 2009 23:51:33 +0000 (23:51 +0000)]
Synthesized copy constructor now generates code for
copying non-virtual base classes which have non-trivial
constructor. Work in progress.

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

15 years agoAdd a CK_ArrayToPointerDecay cast kind.
Anders Carlsson [Fri, 7 Aug 2009 23:48:20 +0000 (23:48 +0000)]
Add a CK_ArrayToPointerDecay cast kind.

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

15 years agoAdd CK_ToUnion and use it for aggregate expression codegen.
Anders Carlsson [Fri, 7 Aug 2009 23:22:37 +0000 (23:22 +0000)]
Add CK_ToUnion and use it for aggregate expression codegen.

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

15 years agoMore CastKind work.
Anders Carlsson [Fri, 7 Aug 2009 22:21:05 +0000 (22:21 +0000)]
More CastKind work.

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

15 years agoJust add global scope to the associated namespaces set instead of tracking it
John McCall [Fri, 7 Aug 2009 22:18:02 +0000 (22:18 +0000)]
Just add global scope to the associated namespaces set instead of tracking it
separately.  Add the framework (currently unfed) for finding friend declarations
during argument-dependent lookup.

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

15 years agoAdd vbase offsets to the vtable. Wow, having an rbegin was so
Mike Stump [Fri, 7 Aug 2009 21:54:03 +0000 (21:54 +0000)]
Add vbase offsets to the vtable.  Wow, having an rbegin was so
fortuitous.  WIP.

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

15 years agoAdd rbegin and rend for virtual bases, might come in handy some day.
Mike Stump [Fri, 7 Aug 2009 21:44:39 +0000 (21:44 +0000)]
Add rbegin and rend for virtual bases, might come in handy some day.

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

15 years agoFix: <rdar://problem/7075531> static analyzer wrongly detects unused ivars used in...
Ted Kremenek [Fri, 7 Aug 2009 21:13:23 +0000 (21:13 +0000)]
Fix: <rdar://problem/7075531> static analyzer wrongly detects unused ivars used in blocks

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

15 years agoConstify some pointers. No functionality change.
Ted Kremenek [Fri, 7 Aug 2009 20:55:20 +0000 (20:55 +0000)]
Constify some pointers.  No functionality change.

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

15 years agoMore synthesis of copy constructors. Work in progress.
Fariborz Jahanian [Fri, 7 Aug 2009 20:22:40 +0000 (20:22 +0000)]
More synthesis of copy constructors. Work in progress.

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

15 years agoFix typo.
Mike Stump [Fri, 7 Aug 2009 20:14:05 +0000 (20:14 +0000)]
Fix typo.

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

15 years agoAdd ability to generate vcall offsets for primary virtual base.
Mike Stump [Fri, 7 Aug 2009 19:00:50 +0000 (19:00 +0000)]
Add ability to generate vcall offsets for primary virtual base.

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

15 years agoUse the correct cast kind as suggested by Doug.
Anders Carlsson [Fri, 7 Aug 2009 18:45:49 +0000 (18:45 +0000)]
Use the correct cast kind as suggested by Doug.

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

15 years agoFix some const_cast issues. This is the beginning of the rabbit hole.
Mike Stump [Fri, 7 Aug 2009 18:05:12 +0000 (18:05 +0000)]
Fix some const_cast issues.  This is the beginning of the rabbit hole.

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

15 years agoPR3333: warn when shifting by invalid amount
Ryan Flynn [Fri, 7 Aug 2009 16:20:20 +0000 (16:20 +0000)]
PR3333: warn when shifting by invalid amount

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

15 years agoSeparate Stmt::Destroy into the entrypoint for destroying a statement
Douglas Gregor [Fri, 7 Aug 2009 06:08:38 +0000 (06:08 +0000)]
Separate Stmt::Destroy into the entrypoint for destroying a statement
or expression (Destroy) from the virtual function used to actually
destroy a given expression (DoDestroy).

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

15 years agoadd support for opensuse 11.1/11.2 search paths, patch by Stefan Reinauer
Chris Lattner [Fri, 7 Aug 2009 05:28:24 +0000 (05:28 +0000)]
add support for opensuse 11.1/11.2 search paths, patch by Stefan Reinauer
and Carl-Daniel Hailfinger!

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

15 years agoAdd support for vcall generation for vtables for virtual bases. WIP.
Mike Stump [Thu, 6 Aug 2009 23:48:32 +0000 (23:48 +0000)]
Add support for vcall generation for vtables for virtual bases.  WIP.

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

15 years agoPatch toward synthesizing copy constructors.
Fariborz Jahanian [Thu, 6 Aug 2009 23:38:16 +0000 (23:38 +0000)]
Patch toward synthesizing copy constructors.
Work in progress.

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

15 years agoFix a few more false positives involving RegionStore and unions, but this time
Ted Kremenek [Thu, 6 Aug 2009 22:33:36 +0000 (22:33 +0000)]
Fix a few more false positives involving RegionStore and unions, but this time
with array accesses. In the process, refactor some common logic in
RetrieveElement() and RetrieveField() into RetrieveFieldOrElementCommon().

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

15 years agoMinor refactoring to introduce a new transformation function,
Douglas Gregor [Thu, 6 Aug 2009 22:17:10 +0000 (22:17 +0000)]
Minor refactoring to introduce a new transformation function,
TransformStmt, into the tree transformer.

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

15 years agoAlmost forgot to turn on 32-bit test.
Mike Stump [Thu, 6 Aug 2009 22:02:55 +0000 (22:02 +0000)]
Almost forgot to turn on 32-bit test.

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

15 years agoTestcase for recent checkin.
Mike Stump [Thu, 6 Aug 2009 21:53:24 +0000 (21:53 +0000)]
Testcase for recent checkin.

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

15 years agoAlso generate the rtti field for virtual bases for vtables. Turn on
Mike Stump [Thu, 6 Aug 2009 21:49:36 +0000 (21:49 +0000)]
Also generate the rtti field for virtual bases for vtables.  Turn on
rtti so we can properly test it.  Refactor code a little.  Still a
work in progress.

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

15 years agoFix a couple false positive "uninitialized value" warnings with RegionStore
Ted Kremenek [Thu, 6 Aug 2009 21:43:54 +0000 (21:43 +0000)]
Fix a couple false positive "uninitialized value" warnings with RegionStore
involving reasoning about unions (which we don't handle yet).

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

15 years agoDrop the friend-inner-class diagnostic from an extwarn to an ext and don't
John McCall [Thu, 6 Aug 2009 21:21:21 +0000 (21:21 +0000)]
Drop the friend-inner-class diagnostic from an extwarn to an ext and don't
guard its report on GNUMode.

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

15 years agoAdd a simple tool for comparing two static analyzer runs, primarily for use from
Daniel Dunbar [Thu, 6 Aug 2009 21:15:33 +0000 (21:15 +0000)]
Add a simple tool for comparing two static analyzer runs, primarily for use from
buildbot.

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