]> granicus.if.org Git - clang/log
clang
13 years agoFurther tweak nonloc::ConcreteInt pretty printing
Ted Kremenek [Thu, 23 Dec 2010 02:42:46 +0000 (02:42 +0000)]
Further tweak nonloc::ConcreteInt pretty printing
to correctly print out negative values for
signed integers.

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

13 years agoAdd WIP prototype of a new buffer overflow
Ted Kremenek [Thu, 23 Dec 2010 02:42:43 +0000 (02:42 +0000)]
Add WIP prototype of a new buffer overflow
checker based on using raw (symbolic) byte offsets
from a base region.

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

13 years agoChange MemRegion extent type to be the same type used
Ted Kremenek [Thu, 23 Dec 2010 02:42:36 +0000 (02:42 +0000)]
Change MemRegion extent type to be the same type used
for array indices.

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

13 years agoAdd 'getConditionType()' and 'getArrayIndexType()'
Ted Kremenek [Thu, 23 Dec 2010 02:42:34 +0000 (02:42 +0000)]
Add 'getConditionType()' and 'getArrayIndexType()'
to SValBuilder.  These two query methods are useful
for constructing SVals.

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

13 years agoEnhance pretty-printing for nonloc::ConcreteInt
Ted Kremenek [Thu, 23 Dec 2010 02:42:31 +0000 (02:42 +0000)]
Enhance pretty-printing for nonloc::ConcreteInt
to also include signedness and bitwidth of
the underlying integer.

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

13 years agoImplement the part of C++0x [temp.arg.explicit]p3 that pertains to
Douglas Gregor [Thu, 23 Dec 2010 01:52:01 +0000 (01:52 +0000)]
Implement the part of C++0x [temp.arg.explicit]p3 that pertains to
parameter packs. In particular, a parameter pack not otherwise deduced
is deduced to an empty parameter pack.

The C++0x wording here is a bit unfortunate; this should really only
apply to function templates, and it mentions "trailing" parameter
packs, which doesn't really make sense in the context of function
templates. Will file a core issue separately.

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

13 years agoImplement the rest of C++0x [temp.deduct.type]p9, which specifies that
Douglas Gregor [Thu, 23 Dec 2010 01:24:45 +0000 (01:24 +0000)]
Implement the rest of C++0x [temp.deduct.type]p9, which specifies that
the presence of a pack expansion anywhere except at the end of a
template-argument-list causes the entire template-argument-list to be
a non-deduced context.

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

13 years agoChange all self assignments X=X to (void)X, so that we can turn on a
Jeffrey Yasskin [Thu, 23 Dec 2010 01:01:28 +0000 (01:01 +0000)]
Change all self assignments X=X to (void)X, so that we can turn on a
new gcc warning that complains on self-assignments and
self-initializations.  Fix one bug found by the warning, in which one
clang::OverloadCandidate constructor failed to initialize its
FunctionTemplate member.

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

13 years agoBe paranoid about NULL size expressions in dependently-sized array types
Douglas Gregor [Wed, 22 Dec 2010 23:15:38 +0000 (23:15 +0000)]
Be paranoid about NULL size expressions in dependently-sized array types

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

13 years agoUnify the consistency checking for deduced template arguments into a
Douglas Gregor [Wed, 22 Dec 2010 23:09:49 +0000 (23:09 +0000)]
Unify the consistency checking for deduced template arguments into a
single routine. Extend that routine to handle consistency
checking for template argument packs, so that we can compare the
deduced packs for template parameter packs across different pack
expansions.

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

13 years agobuild: Use CLANG_NO_RUNTIME=1 specifically, not just any definition.
Daniel Dunbar [Wed, 22 Dec 2010 22:23:39 +0000 (22:23 +0000)]
build: Use CLANG_NO_RUNTIME=1 specifically, not just any definition.

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

13 years agoSubsequent attempt to fix linux build.
Argyrios Kyrtzidis [Wed, 22 Dec 2010 21:41:01 +0000 (21:41 +0000)]
Subsequent attempt to fix linux build.

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

13 years agoImplement template argument deduction for pack expansions whose
Douglas Gregor [Wed, 22 Dec 2010 21:19:48 +0000 (21:19 +0000)]
Implement template argument deduction for pack expansions whose
pattern is a template argument, which involves repeatedly deducing
template arguments using the pattern of the pack expansion, then
bundling the resulting deductions into an argument pack.

We can now handle a variety of simple list-handling metaprograms using
variadic templates. See, e.g., the new "count" metaprogram.

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

13 years agoApparently I'm on a mission to break as many builds as possible.
Argyrios Kyrtzidis [Wed, 22 Dec 2010 21:10:38 +0000 (21:10 +0000)]
Apparently I'm on a mission to break as many builds as possible.

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

13 years agoForgot to move the files in CMakeLists.txt.
Argyrios Kyrtzidis [Wed, 22 Dec 2010 20:30:07 +0000 (20:30 +0000)]
Forgot to move the files in CMakeLists.txt.

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

13 years agoAdd GR/Checkers subdir for CMake build.
Argyrios Kyrtzidis [Wed, 22 Dec 2010 20:22:35 +0000 (20:22 +0000)]
Add GR/Checkers subdir for CMake build.

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

13 years agoMove AnalysisConsumer.cpp and ExprEngine.cpp into the Checkers subdir temporarily
Argyrios Kyrtzidis [Wed, 22 Dec 2010 20:15:43 +0000 (20:15 +0000)]
Move AnalysisConsumer.cpp and ExprEngine.cpp into the Checkers subdir temporarily
to avoid cyclic dependency between the libraries and fix the linux build.

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

13 years agoComplain on missing property getter method only
Fariborz Jahanian [Wed, 22 Dec 2010 19:46:35 +0000 (19:46 +0000)]
Complain on missing property getter method only
if property-dot expression is decidedly
an rvalue. // rdar://8155806.

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

13 years agoWhen performing template argument deduction where the argument is a
Douglas Gregor [Wed, 22 Dec 2010 18:55:49 +0000 (18:55 +0000)]
When performing template argument deduction where the argument is a
dependent template specialization type, the number of template
arguments need not match precisely. Rather than checking the number of
arguments eagerly (which does not consider argument packs), let the
deduction routine for template argument lists cope with too many/too
few arguments.

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

13 years ago[analyzer] Refactoring: Drop the 'GR' prefix.
Argyrios Kyrtzidis [Wed, 22 Dec 2010 18:53:44 +0000 (18:53 +0000)]
[analyzer] Refactoring: Drop the 'GR' prefix.

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

13 years ago[analyzer] Refactoring: Move stuff into namespace 'GR'.
Argyrios Kyrtzidis [Wed, 22 Dec 2010 18:53:20 +0000 (18:53 +0000)]
[analyzer] Refactoring: Move stuff into namespace 'GR'.

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

13 years ago[analyzer] Refactoring: Move checkers into lib/GR/Checkers and their own library...
Argyrios Kyrtzidis [Wed, 22 Dec 2010 18:52:56 +0000 (18:52 +0000)]
[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

13 years ago[analyzer] Refactoring: lib/Checker -> lib/GR and libclangChecker -> libclangGRCore
Argyrios Kyrtzidis [Wed, 22 Dec 2010 18:52:29 +0000 (18:52 +0000)]
[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

13 years ago[analyzer] Refactoring: include/clang/Checker -> include/clang/GR
Argyrios Kyrtzidis [Wed, 22 Dec 2010 18:51:49 +0000 (18:51 +0000)]
[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

13 years agoImplicitly expand argument packs when performing template argument
Douglas Gregor [Wed, 22 Dec 2010 18:17:10 +0000 (18:17 +0000)]
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

13 years agoIf the unary operator is prefix and an lvalue (in C++), bind
Zhongxing Xu [Wed, 22 Dec 2010 08:38:13 +0000 (08:38 +0000)]
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

13 years agoIntroduced raw_identifier token kind.
Abramo Bagnara [Wed, 22 Dec 2010 08:23:18 +0000 (08:23 +0000)]
Introduced raw_identifier token kind.

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

13 years agoThe base type is not always pointer type. We may cast to a base reference.
Zhongxing Xu [Wed, 22 Dec 2010 08:12:57 +0000 (08:12 +0000)]
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

13 years agoAlways blast through no-op casts when getting expr SVals.
Zhongxing Xu [Wed, 22 Dec 2010 07:40:30 +0000 (07:40 +0000)]
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

13 years agoAfter inlining the CXXConstructExpr, bind the temporary object region to it.
Zhongxing Xu [Wed, 22 Dec 2010 07:20:27 +0000 (07:20 +0000)]
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

13 years agoRedesign the way anonymous fields are handled in designated-initializers.
Francois Pichet [Wed, 22 Dec 2010 03:46:10 +0000 (03:46 +0000)]
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

13 years agoTweak the checking of class template partial specialization arguments
Douglas Gregor [Tue, 21 Dec 2010 22:27:23 +0000 (22:27 +0000)]
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

13 years agoAdd a hack to work around the lack of proper type-source info in a pack expansion...
Douglas Gregor [Tue, 21 Dec 2010 22:10:26 +0000 (22:10 +0000)]
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

13 years agoAdd some const qualifiers
Douglas Gregor [Tue, 21 Dec 2010 21:51:48 +0000 (21:51 +0000)]
Add some const qualifiers

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

13 years agoFor member pointer conversions potentially involving derived-to-base
Douglas Gregor [Tue, 21 Dec 2010 21:40:41 +0000 (21:40 +0000)]
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

13 years agoWhen searching for the instantiation of a locally-scoped tag
Douglas Gregor [Tue, 21 Dec 2010 21:22:51 +0000 (21:22 +0000)]
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

13 years agoIn C++, if the user redeclares a builtin function with a type that is
Douglas Gregor [Tue, 21 Dec 2010 19:47:46 +0000 (19:47 +0000)]
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

13 years agoWhen determining which preprocessed entities to traverse in libclang,
Douglas Gregor [Tue, 21 Dec 2010 19:07:48 +0000 (19:07 +0000)]
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

13 years agoFix test to be platform-agnostic
Douglas Gregor [Tue, 21 Dec 2010 17:52:09 +0000 (17:52 +0000)]
Fix test to be platform-agnostic

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

13 years agoFix a major inconsistency in the representation of Objective-C
Douglas Gregor [Tue, 21 Dec 2010 17:34:17 +0000 (17:34 +0000)]
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

13 years agoReplace all uses of PathV1::makeAbsolute with PathV2::fs::make_absolute.
Michael J. Spencer [Tue, 21 Dec 2010 16:45:57 +0000 (16:45 +0000)]
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

13 years agoFix spelling.
Michael J. Spencer [Tue, 21 Dec 2010 16:45:42 +0000 (16:45 +0000)]
Fix spelling.

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

13 years agoImplement BlockDecl::getSourceRange(). The bogus source-range
Douglas Gregor [Tue, 21 Dec 2010 16:27:07 +0000 (16:27 +0000)]
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

13 years agoAdd test for C++ [temp.friend]p8, which bans partial specializations from being friends
Douglas Gregor [Tue, 21 Dec 2010 16:05:12 +0000 (16:05 +0000)]
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

13 years agoA class template partial specialization cannot be a friend. Fixes PR8649.
Douglas Gregor [Tue, 21 Dec 2010 08:14:57 +0000 (08:14 +0000)]
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

13 years agoTeach clang_getCursorSemanticParent() and
Douglas Gregor [Tue, 21 Dec 2010 07:55:45 +0000 (07:55 +0000)]
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

13 years agoWhen checking a using declaration, make sure that the context we're
Douglas Gregor [Tue, 21 Dec 2010 07:41:49 +0000 (07:41 +0000)]
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

13 years agoDon't try to compute the value of a value-dependent expression when
Douglas Gregor [Tue, 21 Dec 2010 07:22:56 +0000 (07:22 +0000)]
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

13 years agoInitialize LangOptions::MSCVersion. Thanks to Csaba Raduly for noting the omission
Douglas Gregor [Tue, 21 Dec 2010 06:21:20 +0000 (06:21 +0000)]
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

13 years agoAdd back the late-specified return type paper
Douglas Gregor [Tue, 21 Dec 2010 05:54:22 +0000 (05:54 +0000)]
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

13 years agoUpdates to the C++ status page for C++0x features, from Michael Price
Douglas Gregor [Tue, 21 Dec 2010 05:43:31 +0000 (05:43 +0000)]
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

13 years agoAdd IndirectField case in DeclContextPrinter::PrintDeclContext.
Francois Pichet [Tue, 21 Dec 2010 03:08:02 +0000 (03:08 +0000)]
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

13 years agoadd missing newlines at end of file.
Chris Lattner [Tue, 21 Dec 2010 02:36:58 +0000 (02:36 +0000)]
add missing newlines at end of file.

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

13 years agoImplement instantiation of pack expansions whose pattern is a type-id
Douglas Gregor [Tue, 21 Dec 2010 00:52:54 +0000 (00:52 +0000)]
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

13 years agoFix the noreturn conversion to only strip off a single level of indirection.
John McCall [Tue, 21 Dec 2010 00:44:39 +0000 (00:44 +0000)]
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

13 years agoWarn when message is sent to receiver of
Fariborz Jahanian [Tue, 21 Dec 2010 00:44:01 +0000 (00:44 +0000)]
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

13 years agoExtend the parser to support pack expansions within exception
Douglas Gregor [Mon, 20 Dec 2010 23:57:46 +0000 (23:57 +0000)]
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

13 years agoFurther refactoring of the tree transformation for template argument
Douglas Gregor [Mon, 20 Dec 2010 23:36:19 +0000 (23:36 +0000)]
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

13 years agoGive the RecursiveASTVisitor a configuration function
Douglas Gregor [Mon, 20 Dec 2010 23:07:20 +0000 (23:07 +0000)]
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

13 years agoHandle instantiation of template type parameter packs that occur as
Douglas Gregor [Mon, 20 Dec 2010 22:48:17 +0000 (22:48 +0000)]
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

13 years agoTest template instantiation of pack expansions where the parameter pack is in a neste...
Douglas Gregor [Mon, 20 Dec 2010 22:46:22 +0000 (22:46 +0000)]
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

13 years agoFix PR8639 by making the "argument unused during compilation" less agressive. Now we
Rafael Espindola [Mon, 20 Dec 2010 22:45:09 +0000 (22:45 +0000)]
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

13 years agoClean up the printing of template argument packs; previously, we were
Douglas Gregor [Mon, 20 Dec 2010 22:28:59 +0000 (22:28 +0000)]
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

13 years agoImplement basic support for template instantiation of pack expansions
Douglas Gregor [Mon, 20 Dec 2010 22:05:00 +0000 (22:05 +0000)]
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

13 years agoRename 'VisitLocation' to 'visitLocation'.
Ted Kremenek [Mon, 20 Dec 2010 21:22:47 +0000 (21:22 +0000)]
Rename 'VisitLocation' to 'visitLocation'.

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

13 years agoRename 'Generate[Node,Sink]' to 'generate[Node,Sink]'.
Ted Kremenek [Mon, 20 Dec 2010 21:19:09 +0000 (21:19 +0000)]
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

13 years agoRemove unused variable
Matt Beaumont-Gay [Mon, 20 Dec 2010 19:38:37 +0000 (19:38 +0000)]
Remove unused variable

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

13 years agoFinish refactoring the transformation of template argument lists,
Douglas Gregor [Mon, 20 Dec 2010 17:42:22 +0000 (17:42 +0000)]
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

13 years agoRefactor the transformation of template argument lists to centralize
Douglas Gregor [Mon, 20 Dec 2010 17:31:10 +0000 (17:31 +0000)]
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

13 years agoWhen checking a template argument list against a template containing
Douglas Gregor [Mon, 20 Dec 2010 16:57:52 +0000 (16:57 +0000)]
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

13 years agoClean up the handling of template argument packs, especially in the
Douglas Gregor [Mon, 20 Dec 2010 16:52:59 +0000 (16:52 +0000)]
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

13 years agoAdding a line for XFAIL win32 broke the test.
Francois Pichet [Mon, 20 Dec 2010 05:53:40 +0000 (05:53 +0000)]
Adding a line for XFAIL win32 broke the test.
Remove a line: this test is line position sensitive.

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

13 years agoXFAIL vtable-debug-info.cpp on WIN32 and fix curly brace.
Francois Pichet [Mon, 20 Dec 2010 05:44:28 +0000 (05:44 +0000)]
XFAIL vtable-debug-info.cpp on WIN32 and fix curly brace.

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

13 years agotest/PCH/reloc.c fails on Win32.
Francois Pichet [Mon, 20 Dec 2010 04:36:21 +0000 (04:36 +0000)]
test/PCH/reloc.c fails on Win32.
XFAIL for now, I'll investigate why later.

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

13 years agoDisable this test on Windows; it crashes and popup an dialog on each lit test run.
Francois Pichet [Mon, 20 Dec 2010 04:14:03 +0000 (04:14 +0000)]
Disable this test on Windows; it crashes and popup an dialog on each lit test run.
I have no idea how to fix it.

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

13 years agoEmit an error if operator __uuidof() is called on a type with no associated GUID.
Francois Pichet [Mon, 20 Dec 2010 03:51:03 +0000 (03:51 +0000)]
Emit an error if operator __uuidof() is called on a type with no associated GUID.

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

13 years agoIntroduce a new type, PackExpansionType, to capture types that are
Douglas Gregor [Mon, 20 Dec 2010 02:24:11 +0000 (02:24 +0000)]
Introduce a new type, PackExpansionType, to capture types that are
pack expansions, e.g. given

  template<typename... Types> struct tuple;

  template<typename... Types>
  struct tuple_of_refs {
    typedef tuple<Types&...> types;
  };

the type of the "types" typedef is a PackExpansionType whose pattern
is Types&.

This commit introduces support for creating pack expansions for
template type arguments, as above, but not for any other kind of pack
expansion, nor for any form of instantiation.

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

13 years agoValidate Microsoft's uuid attribute string.
Francois Pichet [Mon, 20 Dec 2010 01:41:49 +0000 (01:41 +0000)]
Validate Microsoft's uuid attribute string.

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

13 years agoAdd missing standard includes. Patch by Joerg Sonnenberger!
Nick Lewycky [Sun, 19 Dec 2010 20:49:25 +0000 (20:49 +0000)]
Add missing standard includes. Patch by Joerg Sonnenberger!

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

13 years ago1. Add some ABI information for the Microblaze.
Wesley Peck [Sun, 19 Dec 2010 19:57:51 +0000 (19:57 +0000)]
1. Add some ABI information for the Microblaze.
2. Add attibutes "interrupt_handler" and "save_volatiles" for the Microblaze target.

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

13 years agoAdd support for the Microsoft uuid attribute:
Francois Pichet [Sun, 19 Dec 2010 06:50:37 +0000 (06:50 +0000)]
Add support for the Microsoft uuid attribute:

example:
struct __declspec(uuid("6d5140c1-7436-11ce-8034-00aa006009fa"))
test { };

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

13 years agoMotions towards simplifying how we deal with attribute-qualified function types.
John McCall [Sun, 19 Dec 2010 02:44:49 +0000 (02:44 +0000)]
Motions towards simplifying how we deal with attribute-qualified function types.

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

13 years agoIf the initializer is an rvalue and the variable is a const reference,
Zhongxing Xu [Sun, 19 Dec 2010 02:26:37 +0000 (02:26 +0000)]
If the initializer is an rvalue and the variable is a const reference,
create a temporary object for it.

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

13 years agoThe evaluation of dereference and address-of is identical.
Zhongxing Xu [Sat, 18 Dec 2010 05:16:43 +0000 (05:16 +0000)]
The evaluation of dereference and address-of is identical.

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

13 years agoReplace all uses of PathV1::get{Basename,Dirname,Suffix} with their PathV2 equivalents.
Michael J. Spencer [Sat, 18 Dec 2010 04:13:32 +0000 (04:13 +0000)]
Replace all uses of PathV1::get{Basename,Dirname,Suffix} with their PathV2 equivalents.

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

13 years agoFix test. I added one last test and then forget to re-check.
John McCall [Sat, 18 Dec 2010 03:52:04 +0000 (03:52 +0000)]
Fix test.  I added one last test and then forget to re-check.

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

13 years agoApply attributes to explicit specializations. Specializations which
John McCall [Sat, 18 Dec 2010 03:30:47 +0000 (03:30 +0000)]
Apply attributes to explicit specializations.  Specializations which
don't provide their own explicit visibility attributes should get them
from the template.  Fixes rdar://problem/8778497.

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

13 years agoReplace all uses of PathV1::getLast with PathV2::filename.
Michael J. Spencer [Sat, 18 Dec 2010 00:19:12 +0000 (00:19 +0000)]
Replace all uses of PathV1::getLast with PathV2::filename.

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

13 years agoGoing back to the drawing board with these two awful hacks.
Eric Christopher [Fri, 17 Dec 2010 22:46:41 +0000 (22:46 +0000)]
Going back to the drawing board with these two awful hacks.

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

13 years agoWarn when synthesizing a property which is
Fariborz Jahanian [Fri, 17 Dec 2010 22:28:16 +0000 (22:28 +0000)]
Warn when synthesizing a property which is
implicitly atomic under -Wimplicit-atomic-properties
flag. // rdar://8774580

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

13 years agoFix spelling.
Michael J. Spencer [Fri, 17 Dec 2010 21:22:33 +0000 (21:22 +0000)]
Fix spelling.

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

13 years agoReplace all uses of PathV1::isAbsolute with PathV2::is_{absolute,relative}.
Michael J. Spencer [Fri, 17 Dec 2010 21:22:22 +0000 (21:22 +0000)]
Replace all uses of PathV1::isAbsolute with PathV2::is_{absolute,relative}.

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

13 years agoInitialize variables in the correct order.
Bill Wendling [Fri, 17 Dec 2010 19:53:28 +0000 (19:53 +0000)]
Initialize variables in the correct order.

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

13 years agoEncapsulate TemplateArgument::Kind
Douglas Gregor [Fri, 17 Dec 2010 19:31:15 +0000 (19:31 +0000)]
Encapsulate TemplateArgument::Kind

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

13 years agoHorrible hack for systems that use -dumpversion with clang to expect versions
Eric Christopher [Fri, 17 Dec 2010 19:13:21 +0000 (19:13 +0000)]
Horrible hack for systems that use -dumpversion with clang to expect versions
that match gcc versions. Eew.

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

13 years agoNom nom nom, tasty unused option with an argument.
Eric Christopher [Fri, 17 Dec 2010 19:12:09 +0000 (19:12 +0000)]
Nom nom nom, tasty unused option with an argument.

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

13 years agoSwap the order of the condition and body of a do-while statement in
Douglas Gregor [Fri, 17 Dec 2010 16:18:04 +0000 (16:18 +0000)]
Swap the order of the condition and body of a do-while statement in
the AST, so that we visit them in source order. Fixes <rdar://problem/8779113>.

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

13 years agoUse hasSameType to compare types for equality.
Abramo Bagnara [Fri, 17 Dec 2010 15:49:53 +0000 (15:49 +0000)]
Use hasSameType to compare types for equality.

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

13 years agoAvoid to emit redundant implicit cast for enum constants init expressions.
Abramo Bagnara [Fri, 17 Dec 2010 12:21:11 +0000 (12:21 +0000)]
Avoid to emit redundant implicit cast for enum constants init expressions.

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

13 years agoUpdate checker build.
Ted Kremenek [Fri, 17 Dec 2010 07:56:27 +0000 (07:56 +0000)]
Update checker build.

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