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

3829 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 7e06390f8a Encapsulate template arguments lists in a new class,
TemplateArgumentList. This avoids the need to pass around
pointer/length pairs of template arguments lists, and will eventually
make it easier to introduce member templates and variadic templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71517 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 23:53:27 +00:00
Ted Kremenek 3ef538dd1b BugReport::getEndPath() - Only add a Stmt's range to the constructed PathDiagnosticEventPiece if the BugReport contained no explicit ranges.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 23:50:59 +00:00
Anders Carlsson 0033836b3c Friend declarations are only valid inside class definitions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71489 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 22:55:49 +00:00
Anders Carlsson 66e9977ddd Add an ActOnFriendDecl and call it for friend class decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71482 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 22:27:47 +00:00
Douglas Gregor 42af25f865 Implement the notions of the "current instantiation" and "unknown
specialization" within a C++ template, and permit name lookup into the
current instantiation. For example, given:

  template<typename T, typename U>
  struct X {
    typedef T type;

    X* x1;  // current instantiation
    X<T, U> *x2; // current instantiation
    X<U, T> *x3; // not current instantiation
    ::X<type, U> *x4; // current instantiation
    X<typename X<type, U>::type, U>: *x5; // current instantiation
  };



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71471 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 19:58:34 +00:00
Ted Kremenek b1b9f680f5 Add ParentMap:getParentIgnoreParens().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-11 19:49:27 +00:00
Douglas Gregor 7da97d0f31 Implement the semantics of the injected-class-name within a class
template. The injected-class-name is either a type or a template,
depending on whether a '<' follows it. As a type, the
injected-class-name's template argument list contains its template
parameters in declaration order.

As part of this, add logic for canonicalizing declarations, and be
sure to canonicalize declarations used in template names and template
arguments. 

A TagType is dependent if the declaration it references is dependent.

I'm not happy about the rather complicated protocol needed to use
ASTContext::getTemplateSpecializationType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 22:57:19 +00:00
Sebastian Redl 6e8ed16ffe Implement C++0x nullptr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71405 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-10 18:38:11 +00:00
Zhongxing Xu d9b6ad609e Rename:
SymbolRegionRValue => SymbolRegionValue
  SymExpr::RegionRValue => SymExpr::RegionValueKind


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 04:08:27 +00:00
Zhongxing Xu a82d8aa5b3 As discussed with Ted, rename TypedRegion::getObjectType() to
TypedRegion::getValueType().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71321 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 03:57:34 +00:00
Ted Kremenek b71368d285 Add back Parse/Sema support for attributes cf_returns_retained and
ns_returns_retained, but do not include the other ownership attributes
we previously had.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71308 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 02:44:38 +00:00
Ted Kremenek c1c739bd4b Fix lurking bug in one of the versions of
GRStmtNodeBuilder::generateNode() where the HasGeneratedNode flag
wouldn't properly be set.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71306 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 01:37:12 +00:00
Zhongxing Xu ff69782634 rename: MemRegion:
RValueType => ObjectType
 LValueType => LocationType

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71304 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 00:50:33 +00:00
Fariborz Jahanian 9f8f026fc1 We want to diagnose sending message to a forward class
and we also want to tell which message is actually 
being sent.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71296 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 23:45:49 +00:00
Ted Kremenek ab422d17dc Make BlockEntrace program points taggable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71280 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 23:08:34 +00:00
Ted Kremenek cbc8c791fd Fix typo in method name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71279 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 23:07:51 +00:00
Fariborz Jahanian 89bc314c6d Warn if forward class is used as a receiver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71278 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 23:02:36 +00:00
Fariborz Jahanian 4c2743f0af More type checking for properties, accessors and
use of dot-syntax expression. This is to match gcc's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71243 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 19:36:34 +00:00
Ted Kremenek 008fc73ac9 Remove experimental ownership attributes from Clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71216 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 15:19:25 +00:00
Chris Lattner 5caa370ea6 reimplement __sync_* builtins to be variadic and to follow the same
semantic rules that gcc and icc use.  This implements the variadic
and concrete versions as builtins and has sema do the 
disambiguation.  There are probably a bunch of details to finish up
but this seems like a large monotonic step forward :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71212 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 06:58:22 +00:00
Zhongxing Xu a15f7ac772 Revert r71079.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71202 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 01:33:18 +00:00
Mike Stump 046efd9271 Add a warning for a missing copy attribute on a property that is a
block pointer.  Radar 6441502


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71190 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 23:06:50 +00:00
Daniel Dunbar 913af35741 Remove -fobjc-tight-layout, seems to work!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 21:58:26 +00:00
Ted Kremenek 7704a33fb3 More attribute renaming:
- Rename 'ns_returns_owned' -> 'ns_returns_retained'.
- Rename 'cf_returns_owned' -> 'cf_returns_retained'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71182 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 21:49:45 +00:00
Anders Carlsson 908116859e add isFriendSpecified.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71174 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 19:41:51 +00:00
Ted Kremenek 7090d5465d analyzer: Add ProgramPoint 'PostLValue' just to distinguish (for
analysis introspection) when we computed an lvalue.  This shouldn't
effect the current analysis results in any way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71169 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 18:27:16 +00:00
Douglas Gregor 25a3ef7cc5 Start canonicalizing template names. This is not yet complete, but it
improves type identity with dependent types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71152 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 06:41:52 +00:00
Mike Stump dd3e1664b5 Improve semantic checking for blocks. Radar 6441502
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71145 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 03:14:14 +00:00
Ted Kremenek dd986cc998 Add preliminary support for enhancing null-pointer dereference diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71135 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 00:45:33 +00:00
Ted Kremenek 46a54eb500 Bug fix: Not all ConstraintManagers always return a null state when setting
isFeasible to false. This is something we may wish to do further validation on.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-07 00:45:08 +00:00
Sebastian Redl bfa2fcba54 Back out r70506 (exception spec in AST) again. We won't have exception specs until we've had a lot more discussion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71125 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 23:27:55 +00:00
Ted Kremenek 8966bc1c8c Refactor BugReporter interface to have a new 'BugReporterContext' and
'BugReporterVisitor'. This simplifies callbacks from BugReporter to BugReports
(via VisitNode). It also lays the foundation for arbitrary visitor "call backs"
that can be registered to a BugReporterContext as a PathDiagnostic is
constructed. These call backs can help operate as separate "experts" that can
work on constructed pieces of a PathDiagnostic for which they possess special
knowledge.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71121 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 21:39:49 +00:00
Daniel Dunbar 17ca3638e8 More x86 target feature support.
- Apologies for the extremely gross code duplication, I want to get
   this working and then decide how to get this information out of the
   back end.

 - This replaces -m[no-]sse4[12] by -m[no-]sse4, it appears gcc
   doesn't distinguish them?

 - -msse, etc. now properly disable/enable related features.

 - Don't always define __SSE3__...

 - The main missing functionality bit here is that we don't initialize
   the features based on the CPU for all -march options.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71117 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 21:07:50 +00:00
Zhongxing Xu 33c37b9b87 add getTargetInfo() method to ASTContext.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71079 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 11:48:29 +00:00
Zhongxing Xu 4c44e243e3 The super region of ElementRegion no longer needs to be TypedRegion. In the
future we would create ElementRegion directly on top of typeless regions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71075 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 08:15:46 +00:00
Anders Carlsson f47f7a1c40 Add parsing of friend specifiers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71067 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 04:46:28 +00:00
Douglas Gregor 2cc2b9ca22 Eliminate extra vertical space in Clang diagnostics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71066 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 04:43:47 +00:00
Daniel Dunbar 868bd0aa92 Improve handling of (X86) target features.
- This is a WIP...

 - This adds -march= handling to the driver, and fixes the defaulting
   of -mcpu on Darwin (which was using the wrong test).

Instead of handling -m{sse, ...} in the driver, pass them to clang-cc as
 -target-feature [+-]name

In clang-cc, communicate with the (clang) target to discover the legal
features of a target, and the features which are enabled based on
-mcpu. This is currently hardcoded just enough to not be a feature
regression, we need to get this information from the backend's
TableGen information somehow.

This is used to construct the full list of features which are being
used, which is in turn used to initialize the predefines.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71061 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 03:16:41 +00:00
Zhongxing Xu 889805931b Make StoreManager::CastRegion() virtual and implement a new CastRegion() for
RegionStore.

This CastRegion() performs casts according to the kind of the region being 
cast instead of the type that is cast to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 02:42:32 +00:00
Daniel Dunbar 63be57a832 Add --analyze-auto.
- Currently just an alias for --analyze, eventually we want to refit
   --analyze so that it is less automatic (i.e., does not force plist
   output and does not hard code the list of checks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71056 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 02:12:32 +00:00
Ted Kremenek 69aa08072d Implement attribute 'ns_autorelease'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70990 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 18:44:20 +00:00
Fariborz Jahanian 041f2fd623 Issue a warning in odd case of instance method used
in a 'Class' receiver which is not a root instance
method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70987 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 18:34:37 +00:00
Chris Lattner b0ed3029d9 remove some incorrect and unimplemented atomic builtins (e.g.
__sync_umin_and_fetch), add some missing atomic builtins (e.g.
__sync_fetch_and_nand) and reorder the list to match the GCC
documentation.  The builtins still need work and codegen 
implementation, more patches coming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70985 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 17:48:42 +00:00
Ted Kremenek e351aa10da Implement attribute 'cf_returns_owned' (mirrors 'ns_returns_owned').
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70952 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 00:46:09 +00:00
Ted Kremenek d331dd7fa4 Rename ownership attributes:
ns_ownership_returns -> ns_returns_owned
 ns_ownership_retain -> ns_retains
 ns_ownership_release -> ns_releases
 cf_ownership_retain ->  cf_retains
 cf_ownership_release -> cf_releases


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70949 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-05 00:21:59 +00:00
Ted Kremenek 6a08469ebe Rename attribute 'ns_ownership_returns' to 'ns_returns_ownership'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70941 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 23:52:59 +00:00
Ted Kremenek d99b345a1a Remove experimental attribute 'ns_ownership_make_collectable.'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70940 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 23:46:06 +00:00
Daniel Dunbar c2e57bfc7f Add ASTRecordLayout::getFieldCount accessor, change NextOffset field to 64-bits.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70914 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 21:10:32 +00:00
Daniel Dunbar f773737e35 Add ASTRecordLayout::getNextOffset accessor, and some doxygen comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70909 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 21:00:40 +00:00
Daniel Dunbar bc6ea8125a Initialize NextOffset correctly, otherwise tight layout fails for
empty classes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70905 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 20:52:37 +00:00