Граф коммитов

8284 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 5908e9f25b 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
2009-02-09 19:34:22 +00:00
Douglas Gregor 55f6b14230 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
2009-02-09 18:46:07 +00:00
Sebastian Redl 00e68e2cc5 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
2009-02-09 18:24:27 +00:00
Sebastian Redl ab197baec1 Implement Declarator::getSourceRange().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64151 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 18:23:29 +00:00
Ted Kremenek d3098ee64c 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
2009-02-09 18:01:00 +00:00
Ted Kremenek 353ffceafc 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
2009-02-09 17:10:09 +00:00
Ted Kremenek fb7413f126 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
2009-02-09 17:08:14 +00:00
Ted Kremenek 59753441b6 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
2009-02-09 16:59:59 +00:00
Ted Kremenek f4be8ee748 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
2009-02-09 16:52:31 +00:00
Douglas Gregor 1a51b4a11b 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
2009-02-09 15:09:02 +00:00
Chris Lattner ceca466513 spell out explicitly
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64129 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 08:47:44 +00:00
Chris Lattner dc3b86f6b4 add doc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64128 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 08:47:17 +00:00
Chris Lattner 5ce933f68c new document.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64127 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-09 08:46:11 +00:00
Mike Stump 0dd9e88aa9 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
2009-02-08 23:14:22 +00:00
Anders Carlsson cc8992021c Reuse case destinations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64100 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 22:46:50 +00:00
Anders Carlsson ad9d00e371 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
2009-02-08 22:45:15 +00:00
Anders Carlsson 48de1012a2 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
2009-02-08 22:25:30 +00:00
Anders Carlsson 46831a93e1 Misc fixes to the cleanup stack code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64096 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 22:13:37 +00:00
Mike Stump 225b16dbaa 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
2009-02-08 22:00:53 +00:00
Chris Lattner 0a5166cb0a add another crazy idea :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64092 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 20:41:34 +00:00
Chris Lattner 41df3f32ac just remove this insane testcase :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 19:44:51 +00:00
Sebastian Redl b2bc62bd35 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
2009-02-08 15:51:17 +00:00
Sebastian Redl 00d50747e8 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
2009-02-08 14:56:26 +00:00
Sebastian Redl 89ef6e0366 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
2009-02-08 10:49:44 +00:00
Sebastian Redl ddf7e994b5 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
2009-02-08 10:28:44 +00:00
Mike Stump ec9771d57f 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
2009-02-08 09:22:19 +00:00
Mike Stump bfa2ac06d4 Fixup expected errors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64074 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 07:59:54 +00:00
Anders Carlsson bb66f9f2e4 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
2009-02-08 07:46:24 +00:00
Ted Kremenek 300e1d6b57 Updated checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64071 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 05:05:02 +00:00
Anders Carlsson d66a9f9019 Split some functions up
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64069 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 03:55:35 +00:00
Anders Carlsson 6fc559136b 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
2009-02-08 03:22:36 +00:00
Anders Carlsson 1093c2c40a Implement support for branch fixups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64064 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 01:23:05 +00:00
Chris Lattner 43eee07270 use some references to simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64063 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 01:00:10 +00:00
Chris Lattner 30f05b553d 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
2009-02-08 00:55:22 +00:00
Anders Carlsson 87eaf17cc8 More cleanup stack work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64059 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-08 00:50:42 +00:00
Douglas Gregor e2dedf8f61 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
2009-02-08 00:29:56 +00:00
Anders Carlsson bd6fa3d032 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
2009-02-08 00:16:35 +00:00
Anders Carlsson 69c68b7454 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
2009-02-07 23:51:38 +00:00
Anders Carlsson c71c845fe7 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
2009-02-07 23:50:39 +00:00
Anders Carlsson 0d5c685139 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
2009-02-07 23:30:41 +00:00
Anders Carlsson 89941c1c68 Improve Sema of the cleanup attribute somewhat.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64047 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 23:16:50 +00:00
Mike Stump 3e9da66ac7 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
2009-02-07 23:02:10 +00:00
Ted Kremenek 043254a9d2 Update test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64045 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 22:55:48 +00:00
Ted Kremenek c5c6000fed Fix null dereference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64044 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 22:54:59 +00:00
Anders Carlsson 6ccc47698d Add plumbing for the cleanup stack.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 22:53:43 +00:00
Ted Kremenek 7a9bb52171 Commit header.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 22:46:46 +00:00
Ted Kremenek d305721d58 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
2009-02-07 22:38:00 +00:00
Ted Kremenek faea26943e Tidy up bug descriptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64039 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07 22:37:02 +00:00
Ted Kremenek d90e708195 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
2009-02-07 22:36:41 +00:00
Chris Lattner 6148428024 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
2009-02-07 22:21:31 +00:00