]> granicus.if.org Git - clang/log
clang
15 years agoSupport va_arg on _Complex.
Daniel Dunbar [Tue, 10 Feb 2009 03:03:30 +0000 (03:03 +0000)]
Support va_arg on _Complex.

gcc compat test suite results (Darwin x86-32 & -64):
--
# of expected passes 1110
# of unexpected failures 74
# of unresolved testcases 168
# of unsupported tests 2

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

15 years agoBring in 'CHAR_BIT' for GCC 4.3.
Argyrios Kyrtzidis [Tue, 10 Feb 2009 02:14:34 +0000 (02:14 +0000)]
Bring in 'CHAR_BIT' for GCC 4.3.

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

15 years agoEnable parameter passing test for x86_64.
Daniel Dunbar [Tue, 10 Feb 2009 01:53:22 +0000 (01:53 +0000)]
Enable parameter passing test for x86_64.

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

15 years agoABI: Correctly handle load/store of values which have a different LLVM
Daniel Dunbar [Tue, 10 Feb 2009 01:51:39 +0000 (01:51 +0000)]
ABI: Correctly handle load/store of values which have a different LLVM
memory representation (e.g., bool).
 - This upgrades (downgrades) MultiSource/Applications/ClamAV/clamscan
   to a miscompile and fixes
   SingleSource/UnitTests/2003-05-31-CastToBool.

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

15 years agoRearrange code. No functionality change.
Ted Kremenek [Tue, 10 Feb 2009 01:14:45 +0000 (01:14 +0000)]
Rearrange code. No functionality change.

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

15 years agoFix potential padding error in PTH file and add stub code for emitting an on-disk...
Ted Kremenek [Tue, 10 Feb 2009 01:06:17 +0000 (01:06 +0000)]
Fix potential padding error in PTH file and add stub code for emitting an on-disk chained hash table.

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

15 years agoAdd util Emit{LoadOf,StoreTo}Scalar methods to encapsulate conversion
Daniel Dunbar [Tue, 10 Feb 2009 00:57:50 +0000 (00:57 +0000)]
Add util Emit{LoadOf,StoreTo}Scalar methods to encapsulate conversion
from LLVM memory type to/from LLVM temporary type.
 - No intended functionality change.

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

15 years agoUpdate checker build.
Ted Kremenek [Tue, 10 Feb 2009 00:53:39 +0000 (00:53 +0000)]
Update checker build.

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

15 years agoTeach the type-id/expression disambiguator about different
Douglas Gregor [Tue, 10 Feb 2009 00:53:15 +0000 (00:53 +0000)]
Teach the type-id/expression disambiguator about different
disambiguation contexts, so that we properly parse template arguments
such as

  A<int()>

as type-ids rather than as expressions. Since this can be confusing
(especially when the template parameter is a non-type template
parameter), we try to give a friendly error message.

Almost, eliminate a redundant error message (that should have been a
note) and add some ultra-basic checks for non-type template
arguments.

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

15 years agoCheck template template arguments against their corresponding template
Douglas Gregor [Tue, 10 Feb 2009 00:24:35 +0000 (00:24 +0000)]
Check template template arguments against their corresponding template
template parameters.

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

15 years agoMake sure to initialize local variables, even if they were ignored by
Daniel Dunbar [Tue, 10 Feb 2009 00:06:49 +0000 (00:06 +0000)]
Make sure to initialize local variables, even if they were ignored by
ABI.

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

15 years agoRudimentary checking of template arguments against their corresponding
Douglas Gregor [Mon, 9 Feb 2009 23:23:08 +0000 (23:23 +0000)]
Rudimentary checking of template arguments against their corresponding
template parameters when performing semantic analysis of a template-id
naming a class template specialization.

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

15 years agoid<Foo> is a POD type.
Anders Carlsson [Mon, 9 Feb 2009 21:53:01 +0000 (21:53 +0000)]
id<Foo> is a POD type.

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

15 years agoMove previously unsupported VLA test to vla.c
Anders Carlsson [Mon, 9 Feb 2009 21:48:07 +0000 (21:48 +0000)]
Move previously unsupported VLA test to vla.c

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

15 years agoccc: -dM wasn't being passed to Darwin/CC1 correctly.
Daniel Dunbar [Mon, 9 Feb 2009 21:22:38 +0000 (21:22 +0000)]
ccc: -dM wasn't being passed to Darwin/CC1 correctly.

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

15 years agoUpdate test case; VLA's are now supported.
Daniel Dunbar [Mon, 9 Feb 2009 21:19:23 +0000 (21:19 +0000)]
Update test case; VLA's are now supported.

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

15 years agoImplement Sebastian's idea for simplifying our handling of the greater-than operator...
Douglas Gregor [Mon, 9 Feb 2009 21:04:56 +0000 (21:04 +0000)]
Implement Sebastian's idea for simplifying our handling of the greater-than operator/delimiter. Also, clean up after ourselves following a failed parse of a template-argument-list

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

15 years agoCallExpr now uses ASTContext's allocate to allocate/delete its array of subexpressions.
Ted Kremenek [Mon, 9 Feb 2009 20:51:47 +0000 (20:51 +0000)]
CallExpr now uses ASTContext's allocate to allocate/delete its array of subexpressions.

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

15 years agoUse the new cleanup infrastructure for VLAs. The next iteration of patches will remov...
Anders Carlsson [Mon, 9 Feb 2009 20:41:50 +0000 (20:41 +0000)]
Use the new cleanup infrastructure for VLAs. The next iteration of patches will remove the old Obj-C EH cleanup code.

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

15 years agoUse the new cleanup infrastructure for @try/@finally
Anders Carlsson [Mon, 9 Feb 2009 20:38:58 +0000 (20:38 +0000)]
Use the new cleanup infrastructure for @try/@finally

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

15 years agoReplace a bunch of EmitBranch calls with EmitBranchThroughCleanup. No functionality...
Anders Carlsson [Mon, 9 Feb 2009 20:31:03 +0000 (20:31 +0000)]
Replace a bunch of EmitBranch calls with EmitBranchThroughCleanup. No functionality change (yet).

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

15 years agoSave and restore the DidCallStackSave variable
Anders Carlsson [Mon, 9 Feb 2009 20:23:40 +0000 (20:23 +0000)]
Save and restore the DidCallStackSave variable

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

15 years agoAdd DidCallStackSave variable to CodeGenFunction.
Anders Carlsson [Mon, 9 Feb 2009 20:20:56 +0000 (20:20 +0000)]
Add DidCallStackSave variable to CodeGenFunction.

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

15 years agoWhen handling "the rest" of a designated array subobject, maybe sure
Douglas Gregor [Mon, 9 Feb 2009 19:45:19 +0000 (19:45 +0000)]
When handling "the rest" of a designated array subobject, maybe sure
to tell it that it wasn't (directly) designated. This way, we unwind
back to the explicit initializer list properly rather than getting
stuck in the wrong subobject. Fixes llvm.org/PR3519

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

15 years agoEliminate TemplateArg so that we only have a single kind of
Douglas Gregor [Mon, 9 Feb 2009 19:34:22 +0000 (19:34 +0000)]
Eliminate TemplateArg so that we only have a single kind of
representation for template arguments. Also simplifies the interface
for ActOnClassTemplateSpecialization and eliminates some annoying
allocations of TemplateArgs.

My attempt at smart pointers for template arguments lists is
relatively lame. We can improve it once we're sure that we have the
right representation for template arguments.

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

15 years agoStart processing template-ids as types when the template-name refers
Douglas Gregor [Mon, 9 Feb 2009 18:46:07 +0000 (18:46 +0000)]
Start processing template-ids as types when the template-name refers
to a class template. For example, the template-id 'vector<int>' now
has a nice, sugary type in the type system. What we can do now:

  - Parse template-ids like 'vector<int>' (where 'vector' names a
    class template) and form proper types for them in the type system.
  - Parse icky template-ids like 'A<5>' and 'A<(5 > 0)>' properly,
    using (sadly) a bool in the parser to tell it whether '>' should
    be treated as an operator or not.

This is a baby-step, with major problems and limitations:
  - There are currently two ways that we handle template arguments
  (whether they are types or expressions). These will be merged, and,
  most likely, TemplateArg will disappear.
  - We don't have any notion of the declaration of class template
  specializations or of template instantiations, so all template-ids
  are fancy names for 'int' :)

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

15 years agoUpdate new expression to make use of Declarator::getSourceRange().
Sebastian Redl [Mon, 9 Feb 2009 18:24:27 +0000 (18:24 +0000)]
Update new expression to make use of Declarator::getSourceRange().
References are not objects; implement this in Type::isObjectType().

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

15 years agoImplement Declarator::getSourceRange().
Sebastian Redl [Mon, 9 Feb 2009 18:23:29 +0000 (18:23 +0000)]
Implement Declarator::getSourceRange().

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

15 years agoFix PR 2514: Do not flag dead initializations for variables initialized to a constant...
Ted Kremenek [Mon, 9 Feb 2009 18:01:00 +0000 (18:01 +0000)]
Fix PR 2514: Do not flag dead initializations for variables initialized to a constant global variable.

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

15 years agoDeallocate the StringLiteral itself in StringLiteral::Destroy() and deallocate the...
Ted Kremenek [Mon, 9 Feb 2009 17:10:09 +0000 (17:10 +0000)]
Deallocate the StringLiteral itself in StringLiteral::Destroy() and deallocate the string data before running StringLiteral's destructor.

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

15 years agoAllocate the subexpression array for OberloadExpr from ASTContext's allocator.
Ted Kremenek [Mon, 9 Feb 2009 17:08:14 +0000 (17:08 +0000)]
Allocate the subexpression array for OberloadExpr from ASTContext's allocator.

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

15 years agoRefine PostStmtCustom to reference a tagged data pair with the tag to indicate the...
Ted Kremenek [Mon, 9 Feb 2009 16:59:59 +0000 (16:59 +0000)]
Refine PostStmtCustom to reference a tagged data pair with the tag to indicate the checker.

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

15 years agoAdded a new ProgramPoint 'PostStmtCustom' to enable checker-specific ProgramPoints.
Ted Kremenek [Mon, 9 Feb 2009 16:52:31 +0000 (16:52 +0000)]
Added a new ProgramPoint 'PostStmtCustom' to enable checker-specific ProgramPoints.

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

15 years agoMake Sema::getTypeName return the opaque pointer of a QualType rather
Douglas Gregor [Mon, 9 Feb 2009 15:09:02 +0000 (15:09 +0000)]
Make Sema::getTypeName return the opaque pointer of a QualType rather
than a Decl, which gives us some more flexibility to express the
results with the type system. There are no clients using this
flexibility yet, but it's meant to be able to describe qualified names
as written in the source (e.g., "foo::type") or template-ids that name
a class template specialization (e.g., "std::vector<INT>").

DeclSpec's TST_typedef has become TST_typename, to reflect its use to
describe types found by name (that may or may not be typedefs). The
type representation of a DeclSpec with TST_typename is an opaque
QualType pointer. All users of TST_typedef, both direct and indirect,
have been updated for these changes.

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

15 years agospell out explicitly
Chris Lattner [Mon, 9 Feb 2009 08:47:44 +0000 (08:47 +0000)]
spell out explicitly

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

15 years agoadd doc
Chris Lattner [Mon, 9 Feb 2009 08:47:17 +0000 (08:47 +0000)]
add doc

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

15 years agonew document.
Chris Lattner [Mon, 9 Feb 2009 08:46:11 +0000 (08:46 +0000)]
new document.

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

15 years agoAdd some more documentation. Also reflowed comments to 80 col.
Mike Stump [Sun, 8 Feb 2009 23:14:22 +0000 (23:14 +0000)]
Add some more documentation.  Also reflowed comments to 80 col.

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

15 years agoReuse case destinations.
Anders Carlsson [Sun, 8 Feb 2009 22:46:50 +0000 (22:46 +0000)]
Reuse case destinations.

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

15 years agoAlways check if we can remove branch fixups, even if the cleanup stack is empty.
Anders Carlsson [Sun, 8 Feb 2009 22:45:15 +0000 (22:45 +0000)]
Always check if we can remove branch fixups, even if the cleanup stack is empty.

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

15 years agoAdd a simplified EmitJumpThroughFinally and use it in CGObjC in preparation of making...
Anders Carlsson [Sun, 8 Feb 2009 22:25:30 +0000 (22:25 +0000)]
Add a simplified EmitJumpThroughFinally and use it in CGObjC in preparation of making it use the cleanup stack.

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

15 years agoMisc fixes to the cleanup stack code.
Anders Carlsson [Sun, 8 Feb 2009 22:13:37 +0000 (22:13 +0000)]
Misc fixes to the cleanup stack code.

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

15 years agoWhen we're at the stack depth we want, there isn't anything to do.
Mike Stump [Sun, 8 Feb 2009 22:00:53 +0000 (22:00 +0000)]
When we're at the stack depth we want, there isn't anything to do.

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

15 years agoadd another crazy idea :)
Chris Lattner [Sun, 8 Feb 2009 20:41:34 +0000 (20:41 +0000)]
add another crazy idea :)

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

15 years agojust remove this insane testcase :)
Chris Lattner [Sun, 8 Feb 2009 19:44:51 +0000 (19:44 +0000)]
just remove this insane testcase :)

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

15 years agoTeach the constant evaluator about C++ const integral variables.
Sebastian Redl [Sun, 8 Feb 2009 15:51:17 +0000 (15:51 +0000)]
Teach the constant evaluator about C++ const integral variables.

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

15 years agoFix redundant errors with missing default arguments in member declarations.
Sebastian Redl [Sun, 8 Feb 2009 14:56:26 +0000 (14:56 +0000)]
Fix redundant errors with missing default arguments in member declarations.

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

15 years agoFix redundant errors for redefinitions with multiple existing definitions.
Sebastian Redl [Sun, 8 Feb 2009 10:49:44 +0000 (10:49 +0000)]
Fix redundant errors for redefinitions with multiple existing definitions.

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

15 years agoMake the test cases failing due to exact diagnostic matching XFAIL.
Sebastian Redl [Sun, 8 Feb 2009 10:28:44 +0000 (10:28 +0000)]
Make the test cases failing due to exact diagnostic matching XFAIL.

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

15 years agoWire up break and continue processing to the new stack depth adjuster.
Mike Stump [Sun, 8 Feb 2009 09:22:19 +0000 (09:22 +0000)]
Wire up break and continue processing to the new stack depth adjuster.
If people could beat on it and let me know if there are any new
semantics required by newer language standards or DRs or any little
details I goofed on, I'd be happy to fix any issues found.

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

15 years agoFixup expected errors.
Mike Stump [Sun, 8 Feb 2009 07:59:54 +0000 (07:59 +0000)]
Fixup expected errors.

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

15 years agoMore cleanup stack work, PopCleanupBlock now returns a struct with the switch block...
Anders Carlsson [Sun, 8 Feb 2009 07:46:24 +0000 (07:46 +0000)]
More cleanup stack work, PopCleanupBlock now returns a struct with the switch block and end block.

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

15 years agoUpdated checker build.
Ted Kremenek [Sun, 8 Feb 2009 05:05:02 +0000 (05:05 +0000)]
Updated checker build.

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

15 years agoSplit some functions up
Anders Carlsson [Sun, 8 Feb 2009 03:55:35 +0000 (03:55 +0000)]
Split some functions up

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

15 years agoCleanupScope needs to push the cleanup block in its destructor
Anders Carlsson [Sun, 8 Feb 2009 03:22:36 +0000 (03:22 +0000)]
CleanupScope needs to push the cleanup block in its destructor

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

15 years agoImplement support for branch fixups.
Anders Carlsson [Sun, 8 Feb 2009 01:23:05 +0000 (01:23 +0000)]
Implement support for branch fixups.

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

15 years agouse some references to simplify code.
Chris Lattner [Sun, 8 Feb 2009 01:00:10 +0000 (01:00 +0000)]
use some references to simplify code.

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

15 years agoGenericize the existing logic for removing duplicate header dirs to apply
Chris Lattner [Sun, 8 Feb 2009 00:55:22 +0000 (00:55 +0000)]
Genericize the existing logic for removing duplicate header dirs to apply
the "system dirs win over user dirs" logic to framework and headermap
search locations as well as normal directories.  This means that
clang t.m -F/System/Library/Frameworks  will treat /System/Library/Frameworks
as a system directory not a user directory.  If you use -v, the difference is:

Before:
ignoring nonexistent directory "/usr/libdata/gcc41"
ignoring duplicate framework "/System/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:

After:
ignoring nonexistent directory "/usr/libdata/gcc41"
ignoring duplicate directory "/System/Library/Frameworks"
  as it is a non-system directory that duplicates a system directory
#include "..." search starts here:
#include <...> search starts here:

This fixes rdar://6566429.

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

15 years agoMore cleanup stack work.
Anders Carlsson [Sun, 8 Feb 2009 00:50:42 +0000 (00:50 +0000)]
More cleanup stack work.

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

15 years agoAdd public placement-delete operators. These are automatically used if the allocation...
Douglas Gregor [Sun, 8 Feb 2009 00:29:56 +0000 (00:29 +0000)]
Add public placement-delete operators. These are automatically used if the allocation throws

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

15 years agoWhen emitting blocks, keep track of which cleanup scope they have. Minor fixes and...
Anders Carlsson [Sun, 8 Feb 2009 00:16:35 +0000 (00:16 +0000)]
When emitting blocks, keep track of which cleanup scope they have. Minor fixes and cleanup.

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

15 years agoEmit a cleanup block for the cleanup attribute
Anders Carlsson [Sat, 7 Feb 2009 23:51:38 +0000 (23:51 +0000)]
Emit a cleanup block for the cleanup attribute

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

15 years agoAdd support for emitting cleanup blocks. Make EmitCompoundStatement emit cleanup...
Anders Carlsson [Sat, 7 Feb 2009 23:50:39 +0000 (23:50 +0000)]
Add support for emitting cleanup blocks. Make EmitCompoundStatement emit cleanup blocks if necessary

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

15 years agoAdd a simple RAII object, to be used for pushing a cleanup entry and make the inserti...
Anders Carlsson [Sat, 7 Feb 2009 23:30:41 +0000 (23:30 +0000)]
Add a simple RAII object, to be used for pushing a cleanup entry and make the insertion point be the cleanup block.

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

15 years agoImprove Sema of the cleanup attribute somewhat.
Anders Carlsson [Sat, 7 Feb 2009 23:16:50 +0000 (23:16 +0000)]
Improve Sema of the cleanup attribute somewhat.

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

15 years agoEnsure we track all the stack depths for all break and continue points
Mike Stump [Sat, 7 Feb 2009 23:02:10 +0000 (23:02 +0000)]
Ensure we track all the stack depths for all break and continue points
correctly.  This should lay the ground work to throw the big switch
and start code gening break and continue in the presense of vlas.

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

15 years agoUpdate test case.
Ted Kremenek [Sat, 7 Feb 2009 22:55:48 +0000 (22:55 +0000)]
Update test case.

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

15 years agoFix null dereference.
Ted Kremenek [Sat, 7 Feb 2009 22:54:59 +0000 (22:54 +0000)]
Fix null dereference.

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

15 years agoAdd plumbing for the cleanup stack.
Anders Carlsson [Sat, 7 Feb 2009 22:53:43 +0000 (22:53 +0000)]
Add plumbing for the cleanup stack.

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

15 years agoCommit header.
Ted Kremenek [Sat, 7 Feb 2009 22:46:46 +0000 (22:46 +0000)]
Commit header.

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

15 years agoFor retain/release leaks, have the BugReport description indicate the allocation...
Ted Kremenek [Sat, 7 Feb 2009 22:38:00 +0000 (22:38 +0000)]
For retain/release leaks, have the BugReport description indicate the allocation site and initial bindings.

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

15 years agoTidy up bug descriptions.
Ted Kremenek [Sat, 7 Feb 2009 22:37:02 +0000 (22:37 +0000)]
Tidy up bug descriptions.

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

15 years agoUse BugReport::getDescription() for the compiler warning text.
Ted Kremenek [Sat, 7 Feb 2009 22:36:41 +0000 (22:36 +0000)]
Use BugReport::getDescription() for the compiler warning text.

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

15 years agoC++ really shouldn't check these #defines, thanks to Howard
Chris Lattner [Sat, 7 Feb 2009 22:21:31 +0000 (22:21 +0000)]
C++ really shouldn't check these #defines, thanks to Howard
for pointing this out!

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

15 years agoDetermining the allocation site for a leak when constructing a CFRefLeakReport. ...
Ted Kremenek [Sat, 7 Feb 2009 22:19:59 +0000 (22:19 +0000)]
Determining the allocation site for a leak when constructing a CFRefLeakReport.  This avoids repeated calls to GetAllocationSite when Profiling a CFRefLeakReport object.

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

15 years agoSplit logic for 'getEndPath()' for CFRefReport and CFRefLeakReport.
Ted Kremenek [Sat, 7 Feb 2009 22:04:05 +0000 (22:04 +0000)]
Split logic for 'getEndPath()' for CFRefReport and CFRefLeakReport.

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

15 years agoConvert a use of 'std::ostringstream' to 'llvm::raw_string_ostream'.
Ted Kremenek [Sat, 7 Feb 2009 21:59:45 +0000 (21:59 +0000)]
Convert a use of 'std::ostringstream' to 'llvm::raw_string_ostream'.

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

15 years agoSplit the exception object out into its own stack.
Anders Carlsson [Sat, 7 Feb 2009 21:37:21 +0000 (21:37 +0000)]
Split the exception object out into its own stack.

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

15 years agoSimplify the Objective-C exception handling.
Anders Carlsson [Sat, 7 Feb 2009 21:26:04 +0000 (21:26 +0000)]
Simplify the Objective-C exception handling.

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

15 years agoFormat for 80-cols.
Mike Stump [Sat, 7 Feb 2009 20:14:12 +0000 (20:14 +0000)]
Format for 80-cols.

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

15 years agoMove CheckPointerToMemberOperands to SemaExprCXX.cpp
Sebastian Redl [Sat, 7 Feb 2009 20:10:22 +0000 (20:10 +0000)]
Move CheckPointerToMemberOperands to SemaExprCXX.cpp

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

15 years agoEnsure that we don't miscodegen if vlas creap into the top of the for.
Mike Stump [Sat, 7 Feb 2009 20:09:00 +0000 (20:09 +0000)]
Ensure that we don't miscodegen if vlas creap into the top of the for.
This will allow us to generate break and continue even if vlas are
involved without worry that we'll silently generate bad code.

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

15 years agoFix pretty-printing of if conditions. Patch by Ben Lickly.
Sebastian Redl [Sat, 7 Feb 2009 20:05:48 +0000 (20:05 +0000)]
Fix pretty-printing of if conditions. Patch by Ben Lickly.

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

15 years agoMake one expected-diag directive match exactly one actual diagnostic.
Sebastian Redl [Sat, 7 Feb 2009 19:52:04 +0000 (19:52 +0000)]
Make one expected-diag directive match exactly one actual diagnostic.
This uncovers some bugs, so several test cases now fail.

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

15 years agoArrange to have the correct StackDepth for while statements.
Mike Stump [Sat, 7 Feb 2009 18:08:12 +0000 (18:08 +0000)]
Arrange to have the correct StackDepth for while statements.

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

15 years agoFit into 80-col.
Mike Stump [Sat, 7 Feb 2009 17:18:33 +0000 (17:18 +0000)]
Fit into 80-col.

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

15 years agoAdd a test case for some Objective-C behavior that will not be supported in Objective-C++
Douglas Gregor [Sat, 7 Feb 2009 17:16:20 +0000 (17:16 +0000)]
Add a test case for some Objective-C behavior that will not be supported in Objective-C++

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

15 years agoMake const-initialized const integral variables I-C-Es in C++.
Sebastian Redl [Sat, 7 Feb 2009 13:06:23 +0000 (13:06 +0000)]
Make const-initialized const integral variables I-C-Es in C++.

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

15 years agoFixup goto codegen in and around VLAs.
Mike Stump [Sat, 7 Feb 2009 12:52:26 +0000 (12:52 +0000)]
Fixup goto codegen in and around VLAs.

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

15 years agoFill in C++ status table for section 7 (declarations).
Sebastian Redl [Sat, 7 Feb 2009 12:42:13 +0000 (12:42 +0000)]
Fill in C++ status table for section 7 (declarations).

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

15 years agoremove two eroneous suffixes, these promote to int. Thanks to Neil
Chris Lattner [Sat, 7 Feb 2009 08:49:37 +0000 (08:49 +0000)]
remove two eroneous suffixes, these promote to int.  Thanks to Neil
for pointing this out.

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

15 years agoadd note, weirdness.
Chris Lattner [Sat, 7 Feb 2009 07:13:51 +0000 (07:13 +0000)]
add note, weirdness.

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

15 years agofix some missing parens, thanks for Eli's review!
Chris Lattner [Sat, 7 Feb 2009 06:42:04 +0000 (06:42 +0000)]
fix some missing parens, thanks for Eli's review!
Obviously I make a miserable header developer :)

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

15 years agofix a typo that Sebastian noticed!
Chris Lattner [Sat, 7 Feb 2009 06:38:41 +0000 (06:38 +0000)]
fix a typo that Sebastian noticed!

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

15 years agomake sure that UINTMAX_MAX has an unsigned type. This assumes that
Chris Lattner [Sat, 7 Feb 2009 06:38:06 +0000 (06:38 +0000)]
make sure that UINTMAX_MAX has an unsigned type.  This assumes that
uintmax_t is unsigned long long, which is not optimal, but is assumed
elsewhere already.

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

15 years agomake various MAX/MIN constants be preprocessor constants, not C constants.
Chris Lattner [Sat, 7 Feb 2009 06:33:44 +0000 (06:33 +0000)]
make various MAX/MIN constants be preprocessor constants, not C constants.
Thanks to Eli for pointing this out.

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

15 years agoEnsure that we assert if given an unhandled value.
Mike Stump [Sat, 7 Feb 2009 03:46:08 +0000 (03:46 +0000)]
Ensure that we assert if given an unhandled value.

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

15 years agoSet load/store alignment when doing ABI coercions.
Daniel Dunbar [Sat, 7 Feb 2009 02:46:03 +0000 (02:46 +0000)]
Set load/store alignment when doing ABI coercions.
 - Currently, this is producing poor code, but we prefer correctness
   to performance for now. Eventually we should be able to generally
   avoid having to set the alignment when we control the alignment of
   the alloca.

 - This knocks out 33/1000 failures on my single argument ABI tests,
   down to 22/1000 and 18 of these appear to be gcc bugs. Woot.

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

15 years agoUse 'Destroy(Context)' instead of 'Context.Deallocate()' (does recursive freeing...
Ted Kremenek [Sat, 7 Feb 2009 01:51:40 +0000 (01:51 +0000)]
Use 'Destroy(Context)' instead of 'Context.Deallocate()' (does recursive freeing of memory).

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

15 years agoOverhaul of Stmt allocation:
Ted Kremenek [Sat, 7 Feb 2009 01:47:29 +0000 (01:47 +0000)]
Overhaul of Stmt allocation:
- Made allocation of Stmt objects using vanilla new/delete a *compiler
  error* by making this new/delete "protected" within class Stmt.
- Now the only way to allocate Stmt objects is by using the new
  operator that takes ASTContext& as an argument.  This ensures that
  all Stmt nodes are allocated from the same (pool) allocator.
- Naturally, these two changes required that *all* creation sites for
  AST nodes use new (ASTContext&).  This is a large patch, but the
  majority of the changes are just this mechanical adjustment.
- The above changes also mean that AST nodes can no longer be
  deallocated using 'delete'.  Instead, one most do
  StmtObject->Destroy(ASTContext&) or do
  ASTContextObject.Deallocate(StmtObject) (the latter not running the
  'Destroy' method).

Along the way I also...
- Made CompoundStmt allocate its array of Stmt* using the allocator in
  ASTContext (previously it used std::vector).  There are a whole
  bunch of other Stmt classes that need to be similarly changed to
  ensure that all memory allocated for ASTs comes from the allocator
  in ASTContext.
- Added a new smart pointer ExprOwningPtr to Sema.h.  This replaces
  the uses of llvm::OwningPtr within Sema, as llvm::OwningPtr used
  'delete' to free memory instead of a Stmt's 'Destroy' method.

Big thanks to Doug Gregor for helping with the acrobatics of making
'new/delete' private and the new smart pointer ExprOwningPtr!

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