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

26355 Коммитов

Автор SHA1 Сообщение Дата
Argyrios Kyrtzidis a7af5ea88a [analyzer] Refactoring: Move checkers into lib/GR/Checkers and their own library, libclangGRCheckers
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122422 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 18:52:56 +00:00
Argyrios Kyrtzidis bce30c533a [analyzer] Refactoring: lib/Checker -> lib/GR and libclangChecker -> libclangGRCore
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122421 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 18:52:29 +00:00
Argyrios Kyrtzidis 98cabbad47 [analyzer] Refactoring: include/clang/Checker -> include/clang/GR
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122420 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 18:51:49 +00:00
Douglas Gregor 20a55e2515 Implicitly expand argument packs when performing template argument
deduction. Unify all of the looping over template arguments for
deduction purposes into a single place, where argument pack expansion
occurs; this is also the hook for deducing from pack expansions, which
itself is not yet implemented.

For now, at least we can handle a basic "count" metafunction written
with variadics. See the new test for the formulation that works.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122418 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 18:17:10 +00:00
Zhongxing Xu 250704bc52 If the unary operator is prefix and an lvalue (in C++), bind
the location (l-value) to it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 08:38:13 +00:00
Abramo Bagnara c4bf2b9afb Introduced raw_identifier token kind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122394 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 08:23:18 +00:00
Zhongxing Xu eee1df1e7a The base type is not always pointer type. We may cast to a base reference.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122393 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 08:12:57 +00:00
Zhongxing Xu a8d835abb8 Always blast through no-op casts when getting expr SVals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122390 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 07:40:30 +00:00
Zhongxing Xu 05e539175d After inlining the CXXConstructExpr, bind the temporary object region to it.
This change is necessary when the variable is a const reference and we need
the l-value of the construct expr.  After that, when binding the variable,
recover the lazy compound value when the variable is not a reference.

In Environment, use the value of a no-op cast expression when it has one.
Otherwise, blast-through it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122388 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 07:20:27 +00:00
Francois Pichet a0e27f0015 Redesign the way anonymous fields are handled in designated-initializers.
Previously designated anonymous fields were found via name lookup. This redesign uses the fact that an IndirectFieldDecl declaration will always follow an anonymous implicit field to remove the special case of name lookup. 

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122387 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-22 03:46:10 +00:00
Douglas Gregor f97ecf3566 Tweak the checking of class template partial specialization arguments
to cope with parameter packs. This is a band-aid I will be
revisiting this section when I implement declaration matching
semantics for variadic templates.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122369 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 22:27:23 +00:00
Douglas Gregor 03491de7b4 Add a hack to work around the lack of proper type-source info in a pack expansion TypeLoc
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122367 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 22:10:26 +00:00
Douglas Gregor f7dd69969a Add some const qualifiers
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122365 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 21:51:48 +00:00
Douglas Gregor cfddf7be79 For member pointer conversions potentially involving derived-to-base
conversions, make sure that the (possibly) derived type is complete
before looking for base classes.

Finishes the fix for PR8801.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122363 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 21:40:41 +00:00
Douglas Gregor ebb1c56a4b When searching for the instantiation of a locally-scoped tag
declaration, also look for an instantiation of its previous
declarations. Fixes PR8801.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122361 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 21:22:51 +00:00
Douglas Gregor b68e39930d In C++, if the user redeclares a builtin function with a type that is
inconsistent with the type that the builtin *should* have, forget
about the builtin altogether: we don't want subsequence analyses,
CodeGen, etc., to think that we have a proper builtin function.

C is protected from errors here because it allows one to use a
library builtin without having a declaration, and detects inconsistent
(re-)declarations of builtins during declaration merging. C++ was
unprotected, and therefore would crash.

Fixes PR8839.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122351 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 19:47:46 +00:00
Douglas Gregor 32038bb848 When determining which preprocessed entities to traverse in libclang,
take into account the region of interest. Otherwise, we may fail to
traverse some important preprocessed entity cursors. 
Fixes <rdar://problem/8554072>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122350 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 19:07:48 +00:00
Douglas Gregor 52e64c8813 Fix test to be platform-agnostic
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122348 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 17:52:09 +00:00
Douglas Gregor bdb2d5056f Fix a major inconsistency in the representation of Objective-C
classes, categories, protocols, and class extensions, where the
methods and properties of these entities would be inserted into the
DeclContext in an ordering that doesn't necessarily reflect source
order. The culprits were Sema::ActOnMethodDeclaration(), which did not
perform the insertion of the just-created method declaration into
the DeclContext for these Objective-C entities, and
Sema::ActOnAtEnd(), which inserted all method declarations at the
*end* of the DeclContext. 

With this fix in hand, clean up the code-completion actions for
property setters/getters that worked around this brokenness in the AST.

Fixes <rdar://problem/8062781>, where this problem manifested as poor
token-annotation information, but this would have struck again in many
other places.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122347 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 17:34:17 +00:00
Michael J. Spencer fbfd180495 Replace all uses of PathV1::makeAbsolute with PathV2::fs::make_absolute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122340 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 16:45:57 +00:00
Michael J. Spencer 06a8dc616e Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122339 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 16:45:42 +00:00
Douglas Gregor 2fcbceff97 Implement BlockDecl::getSourceRange(). The bogus source-range
information caused token-annotation to fail in funny ways. Fixes
<rdar://problem/8595386>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122338 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 16:27:07 +00:00
Douglas Gregor 55dc95b698 Add test for C++ [temp.friend]p8, which bans partial specializations from being friends
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122335 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 16:05:12 +00:00
Douglas Gregor b0ee93cf94 A class template partial specialization cannot be a friend. Fixes PR8649.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122325 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 08:14:57 +00:00
Douglas Gregor 3910cfd17f Teach clang_getCursorSemanticParent() and
clang_getCursorLexicalParent() to cope with class and function
templates, along with the parent of the translation unit. Fixes PR8761
and PR8766.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122324 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 07:55:45 +00:00
Douglas Gregor 6fb0729241 When checking a using declaration, make sure that the context we're
looking in is complete. Fixes PR8756.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122323 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 07:41:49 +00:00
Douglas Gregor 14af91a38c Don't try to compute the value of a value-dependent expression when
checking trivial comparisons. Fixes PR8795.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122322 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 07:22:56 +00:00
Douglas Gregor 786e61717c Initialize LangOptions::MSCVersion. Thanks to Csaba Raduly for noting the omission
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122318 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 06:21:20 +00:00
Douglas Gregor 1ce7965c33 Add back the late-specified return type paper
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122317 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 05:54:22 +00:00
Douglas Gregor 08765a9c4f Updates to the C++ status page for C++0x features, from Michael Price
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 05:43:31 +00:00
Francois Pichet a3d39c0665 Add IndirectField case in DeclContextPrinter::PrintDeclContext.
Fix PR8832.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122311 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 03:08:02 +00:00
Chris Lattner 124b3def9e add missing newlines at end of file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122309 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 02:36:58 +00:00
Douglas Gregor b99268b308 Implement instantiation of pack expansions whose pattern is a type-id
in an exception specification.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122297 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 00:52:54 +00:00
John McCall 00ccbefcff Fix the noreturn conversion to only strip off a single level of indirection.
Apply the noreturn attribute while creating a builtin function's type.
Remove the getNoReturnType() API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122295 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 00:44:39 +00:00
Fariborz Jahanian 8e5fc9be37 Warn when message is sent to receiver of
unknown type and there is a possibility that
at runtime method is resolved to a deprecated or 
unavailable method.  Addreses // rdar://8769853


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122294 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21 00:44:01 +00:00
Douglas Gregor a04426c541 Extend the parser to support pack expansions within exception
specifications. We can't yet instantiate them, however, since I
tripped over PR8835.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122292 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 23:57:46 +00:00
Douglas Gregor 7ca7ac40ad Further refactoring of the tree transformation for template argument
lists, so that all such transformations go through a single,
iterator-based transformation function. This is the only place where
we need to implement the logic for transforming pack expansions whose
pattern is a template argument.

Unfortunately, the new cases this refactoring brings into the fold
can't be meaningfully tested yet. We need template argument deduction
to work well enough for variadic function templates first.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122289 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 23:36:19 +00:00
Douglas Gregor a40bc72484 Give the RecursiveASTVisitor a configuration function
shouldWalkTypesOfTypeLocs() that determines whether it should walk the
Types within TypeLocs. This walk is redundant, but perhaps required
for some clients. Disabling this redundant walk in the unexpanded
parameter pack finder produces better results, because we get
parameter packs with source location info *unless* such source
location information isn't available.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122287 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 23:07:20 +00:00
Douglas Gregor 984a58b6c6 Handle instantiation of template type parameter packs that occur as
the first qualifier in scope. We can't adequately test this test,
unfortunately.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122283 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 22:48:17 +00:00
Douglas Gregor 88f30dee6c Test template instantiation of pack expansions where the parameter pack is in a nested-name-specifier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122282 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 22:46:22 +00:00
Rafael Espindola 592f241d0a Fix PR8639 by making the "argument unused during compilation" less agressive. Now we
don't warn if an argument is not used because it is shadowed by a subsequent argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122281 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 22:45:09 +00:00
Douglas Gregor dace95b13e Clean up the printing of template argument packs; previously, we were
getting extra "<>" delimiters around template argument packs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122280 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 22:28:59 +00:00
Douglas Gregor 8491ffe86c Implement basic support for template instantiation of pack expansions
whose patterns are template arguments. We can now instantiate, e.g.,

  typedef tuple<pair<OuterTypes, InnerTypes>...> type;

where OuterTypes and InnerTypes are template type parameter packs.

There is a horrible inefficiency in
TemplateArgumentLoc::getPackExpansionPattern(), where we need to
create copies of TypeLoc data because our interfaces traffic in
TypeSourceInfo pointers where they should traffic in TypeLocs
instead. I've isolated in efficiency in this one routine; once we
refactor our interfaces to traffic in TypeLocs, we can eliminate it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122278 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 22:05:00 +00:00
Ted Kremenek 342e907d72 Rename 'VisitLocation' to 'visitLocation'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122271 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 21:22:47 +00:00
Ted Kremenek d048c6ef5b Rename 'Generate[Node,Sink]' to 'generate[Node,Sink]'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122270 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 21:19:09 +00:00
Matt Beaumont-Gay 21a288f2ee Remove unused variable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122257 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 19:38:37 +00:00
Douglas Gregor 7f61f2fc1a Finish refactoring the transformation of template argument lists,
centralizing the transformation into two routines. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122253 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 17:42:22 +00:00
Douglas Gregor fcc1253ba2 Refactor the transformation of template argument lists to centralize
the list traversal. Part 1, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122252 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 17:31:10 +00:00
Douglas Gregor 14be16b939 When checking a template argument list against a template containing
a parameter pack, check the parameter pack against each of the
template arguments it corresponds to, then pack the converted
arguments into a template argument pack. Allows us to use variadic
class templates so long as instantiation isn't required, e.g.,

  template<typename... Types> struct Tuple;
  Tuple<int, float> *t2;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122251 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 16:57:52 +00:00
Douglas Gregor 87dd697dcc Clean up the handling of template argument packs, especially in the
area of printing template arguments. The functionality changes here
are limited to cases of variadic templates that aren't yet enabled.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122250 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-20 16:52:59 +00:00