]> granicus.if.org Git - clang/log
clang
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

13 years agoRemove explicit summaries from retain/release
Ted Kremenek [Fri, 17 Dec 2010 07:12:00 +0000 (07:12 +0000)]
Remove explicit summaries from retain/release
checker that are automatically handled now
by the Cocoa conventions logic.

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

13 years agoFix assertion failure in cocoa::deriveNamingConvention()
Ted Kremenek [Fri, 17 Dec 2010 07:11:57 +0000 (07:11 +0000)]
Fix assertion failure in cocoa::deriveNamingConvention()
when the selector is the string 'mutable'.

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

13 years agofix typo
Chris Lattner [Fri, 17 Dec 2010 05:40:22 +0000 (05:40 +0000)]
fix typo

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

13 years agoMove CocoaConventions.[h,cpp] from libChecker
Ted Kremenek [Fri, 17 Dec 2010 05:21:58 +0000 (05:21 +0000)]
Move CocoaConventions.[h,cpp] from libChecker
to libAnalysis.  Similar to Format (format string checking),
CocoaConventions has the
potential to serve clients other than the
static analyzer.

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

13 years agoRevise Cocoa conventions detection: 'copy' and 'mutableCopy'
Ted Kremenek [Fri, 17 Dec 2010 04:44:43 +0000 (04:44 +0000)]
Revise Cocoa conventions detection: 'copy' and 'mutableCopy'
only indicates the create rule if it starts
at the beginning of the method name, not
within the method name.

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

13 years agoRename several methods/functions in the analyzer
Ted Kremenek [Fri, 17 Dec 2010 04:44:39 +0000 (04:44 +0000)]
Rename several methods/functions in the analyzer
to start with lowercase characters.  No
functionality change.

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

13 years agoGive hidden visibility to RTTI for derived types. This is kindof a hacky
John McCall [Fri, 17 Dec 2010 02:58:03 +0000 (02:58 +0000)]
Give hidden visibility to RTTI for derived types.  This is kindof a hacky
way to do this, but it fixes rdar://problem/8778973

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

13 years agoMicrosoft's __uuidof operator returns a lvalue. Part 2.
Francois Pichet [Fri, 17 Dec 2010 02:38:13 +0000 (02:38 +0000)]
Microsoft's __uuidof operator returns a lvalue. Part 2.

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

13 years agoMicrosoft's __uuidof operator returns a lvalue.
Francois Pichet [Fri, 17 Dec 2010 02:00:06 +0000 (02:00 +0000)]
Microsoft's __uuidof operator returns a lvalue.

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

13 years agoGetting Started: Add VS2010 instructions and specify an out of source build.
Michael J. Spencer [Thu, 16 Dec 2010 22:01:14 +0000 (22:01 +0000)]
Getting Started: Add VS2010 instructions and specify an out of source build.

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

13 years agoDo lvalue-to-rvalue conversions on the LHS of a shift operator.
John McCall [Thu, 16 Dec 2010 19:28:59 +0000 (19:28 +0000)]
Do lvalue-to-rvalue conversions on the LHS of a shift operator.
Fixes rdar://problem/8776586.

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

13 years agoAdd tests checking for unexpanded parameter packs in declarations that
Douglas Gregor [Thu, 16 Dec 2010 17:48:04 +0000 (17:48 +0000)]
Add tests checking for unexpanded parameter packs in declarations that
occur within statements. Teach Sema::ActOnExceptionDeclarator() to
check for unexpanded parameter packs in the exception type.

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

13 years agoTweak a comment
Douglas Gregor [Thu, 16 Dec 2010 17:19:19 +0000 (17:19 +0000)]
Tweak a comment

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

13 years agoDelay the check for unexpanded parameter packs in the types of
Douglas Gregor [Thu, 16 Dec 2010 15:36:43 +0000 (15:36 +0000)]
Delay the check for unexpanded parameter packs in the types of
non-type template parameters until we know that we have an actual
template declaration of some sort. This cannot be tested yet, but will
become important when we have template template parameter packs.

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

13 years agoCheck for unexpanded parameter packs in non-type template parameter types.
Douglas Gregor [Thu, 16 Dec 2010 08:56:23 +0000 (08:56 +0000)]
Check for unexpanded parameter packs in non-type template parameter types.

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

13 years agoRevert r121961, which seems to be breaking the buildbots and my local tests.
Douglas Gregor [Thu, 16 Dec 2010 08:51:25 +0000 (08:51 +0000)]
Revert r121961, which seems to be breaking the buildbots and my local tests.

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

13 years agoCheck for unexpanded parameter packs in default arguments.
Douglas Gregor [Thu, 16 Dec 2010 08:48:57 +0000 (08:48 +0000)]
Check for unexpanded parameter packs in default arguments.

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

13 years agoTweak location of diagnostic for -Wunreachable-code
Ted Kremenek [Thu, 16 Dec 2010 08:22:16 +0000 (08:22 +0000)]
Tweak location of diagnostic for -Wunreachable-code
test due to recent changes to the CFG.  The
diagnostic is somewhat in the wrong place, but
the -Wunreachable-code diagnostic needs to be
revamped anyway since most of the diagnostics
in this test case are redundant.

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

13 years agoStart migration of static analyzer to using the
Ted Kremenek [Thu, 16 Dec 2010 07:46:53 +0000 (07:46 +0000)]
Start migration of static analyzer to using the
implicit lvalue-to-rvalue casts that John McCall
recently introduced.  This causes a whole bunch
of logic in the analyzer for handling lvalues
to vanish.  It does, however, raise a few issues
in the analyzer w.r.t to modeling various constructs
(e.g., field accesses to compound literals).

The .c/.m analysis test cases that fail are
due to a missing lvalue-to-rvalue cast that
will get introduced into the AST.  The .cpp
failures were more than I could investigate in
one go, and the patch was already getting huge.
I have XFAILED some of these tests, and they
should obviously be further investigated.

Some highlights of this patch include:

- CFG no longer requires an lvalue bit for
  CFGElements
- StackFrameContext doesn't need an 'asLValue'
  flag
- The "VisitLValue" path from GRExprEngine has
  been eliminated.

Besides the test case failures (XFAILed), there
are surely other bugs that are fallout from
this change.

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

13 years agoCMake: Add runtime dir.
Michael J. Spencer [Thu, 16 Dec 2010 03:28:42 +0000 (03:28 +0000)]
CMake: Add runtime dir.

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

13 years agoMemoryBuffer API update.
Michael J. Spencer [Thu, 16 Dec 2010 03:28:14 +0000 (03:28 +0000)]
MemoryBuffer API update.

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

13 years agoUpdate for LLVM API change.
Daniel Dunbar [Thu, 16 Dec 2010 03:06:05 +0000 (03:06 +0000)]
Update for LLVM API change.

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

13 years agoFix a regression I caused in r121930. It turns out that
Douglas Gregor [Thu, 16 Dec 2010 01:40:04 +0000 (01:40 +0000)]
Fix a regression I caused in r121930. It turns out that
DeclarationNameInfo instances don't always have a non-NULL
TypeSourceInfo?

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

13 years agoCheck for unexpanded parameter packs within variable initializers.
Douglas Gregor [Thu, 16 Dec 2010 01:31:22 +0000 (01:31 +0000)]
Check for unexpanded parameter packs within variable initializers.

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

13 years agoCheck for unexpanded parameter packs in friend declarations.
Douglas Gregor [Thu, 16 Dec 2010 01:14:37 +0000 (01:14 +0000)]
Check for unexpanded parameter packs in friend declarations.

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

13 years agoImprove diagnostics when property being looked up
Fariborz Jahanian [Thu, 16 Dec 2010 00:56:28 +0000 (00:56 +0000)]
Improve diagnostics when property being looked up
in a forward @class object. // rdar://8774513

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

13 years agoCheck for unexpanded parameter packs in using declarations. As a
Douglas Gregor [Thu, 16 Dec 2010 00:46:58 +0000 (00:46 +0000)]
Check for unexpanded parameter packs in using declarations. As a
drive-by, make sure to check for unexpanded parameter packs within the
name of a declaration.

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

13 years agoCheck for unexpanded parameter packs in enumeration types and enumerators.
Douglas Gregor [Thu, 16 Dec 2010 00:24:44 +0000 (00:24 +0000)]
Check for unexpanded parameter packs in enumeration types and enumerators.

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

13 years agoCheck for unexpanded parameter packs in static assertion expressions.
Douglas Gregor [Wed, 15 Dec 2010 23:55:21 +0000 (23:55 +0000)]
Check for unexpanded parameter packs in static assertion expressions.

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

13 years agoImplement builtins for Neon half-precision float conversions.
Bob Wilson [Wed, 15 Dec 2010 23:36:44 +0000 (23:36 +0000)]
Implement builtins for Neon half-precision float conversions.
Also tweak the VCVT_F32_F16 entry in arm_neon.td to be more consistent with
the other floating-point conversion builtins.  Radar 8068427.

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

13 years agoivars craeted for explicit @synthesize and those
Fariborz Jahanian [Wed, 15 Dec 2010 23:29:04 +0000 (23:29 +0000)]
ivars craeted for explicit @synthesize and those
created for auto-synthesis are @private.
Fixes: // rdar://8769582
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121913 91177308-0d34-0410-b5e6-96231b3b80d8

13 years agoCheck for unexpanded parameter packs in various kinds of
Douglas Gregor [Wed, 15 Dec 2010 23:18:36 +0000 (23:18 +0000)]
Check for unexpanded parameter packs in various kinds of
declarations. This is a work in progress, as I go through the C++
declaration grammar to identify where unexpanded parameter packs can
occur.

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

13 years agoTeach the RecursiveASTVisitor to traverse the type-location
Douglas Gregor [Wed, 15 Dec 2010 22:07:31 +0000 (22:07 +0000)]
Teach the RecursiveASTVisitor to traverse the type-location
information for all of the explicit casts.

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

13 years agoTest that all of the relevant types properly compute the "contains
Douglas Gregor [Wed, 15 Dec 2010 21:57:59 +0000 (21:57 +0000)]
Test that all of the relevant types properly compute the "contains
unexpanded parameter pack" bit and that the recursive AST visitor can
then find those unexpanded parameter packs.

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

13 years agoIntroduce a RecursiveASTVisitor subclass that finds all unexpanded
Douglas Gregor [Wed, 15 Dec 2010 19:43:21 +0000 (19:43 +0000)]
Introduce a RecursiveASTVisitor subclass that finds all unexpanded
parameter packs within a statement, type, etc. Use this visitor to
provide improved diagnostics for the presence of unexpanded parameter
packs in a full expression, base type, declaration type, etc., by
highlighting the unexpanded parameter packs and providing their names,
e.g.,

test/CXX/temp/temp.decls/temp.variadic/p5.cpp:28:85: error: declaration type
      contains unexpanded parameter packs 'VeryInnerTypes',
      'OuterTypes', ...
  ...VeryInnerTypes, OuterTypes>, pair<InnerTypes, OuterTypes> > types;
     ~~~~~~~~~~~~~~  ~~~~~~~~~~        ~~~~~~~~~~  ~~~~~~~~~~    ^

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

13 years agoFix diagnostic pragmas.
Argyrios Kyrtzidis [Wed, 15 Dec 2010 18:44:22 +0000 (18:44 +0000)]
Fix diagnostic pragmas.

Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state.
Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect
a lot of places, like C++ inline methods, template instantiations, the lexer, etc.

Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location.

Fixes rdar://8365684.

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

13 years agoMove the work-in-progress implementation of variadic templates to its own file in...
Douglas Gregor [Wed, 15 Dec 2010 17:38:57 +0000 (17:38 +0000)]
Move the work-in-progress implementation of variadic templates to its own file in Sema. No functionality change.

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

13 years agoReorganize LookupMemberExpr for clarity and to make the obvious fast paths
John McCall [Wed, 15 Dec 2010 16:46:44 +0000 (16:46 +0000)]
Reorganize LookupMemberExpr for clarity and to make the obvious fast paths
come first.

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

13 years ago__attribute__((nonnull)) can apply to reference-to-pointer
Douglas Gregor [Wed, 15 Dec 2010 15:41:46 +0000 (15:41 +0000)]
__attribute__((nonnull)) can apply to reference-to-pointer
parameters. Fixes <rdar://problem/8769025>.

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

13 years agoSema: have BuildExpressionFromIntegralTemplateArgument produce well-formed IntegerLit...
Peter Collingbourne [Wed, 15 Dec 2010 15:06:14 +0000 (15:06 +0000)]
Sema: have BuildExpressionFromIntegralTemplateArgument produce well-formed IntegerLiterals

BuildExpressionFromIntegralTemplateArgument can produce malformed
IntegerLiterals with an EnumType if the template parameter type
is an EnumType.  This breaks the AST printer which expects all
IntegerLiterals to have a plain integer type.  Instead, give the
IntegerLiteral the enum's promotion type and wrap in an implicit cast
to the EnumType.

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

13 years agoSilence GCC warning about control reaching the end of the function and explicitly...
Chandler Carruth [Wed, 15 Dec 2010 07:29:18 +0000 (07:29 +0000)]
Silence GCC warning about control reaching the end of the function and explicitly mark that all cases are handled.

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

13 years agoFix gcc warning: 'clang::ASTStmtReader' is already a friend of 'clang::OverloadExpr'
Nico Weber [Wed, 15 Dec 2010 07:13:32 +0000 (07:13 +0000)]
Fix gcc warning: 'clang::ASTStmtReader' is already a friend of 'clang::OverloadExpr'

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

13 years agoSundry missing lvalue-to-rvalue conversions. Also leave a TODO for the vital
John McCall [Wed, 15 Dec 2010 04:42:30 +0000 (04:42 +0000)]
Sundry missing lvalue-to-rvalue conversions.  Also leave a TODO for the vital
future task of performing contextual conversion to size_t in a VLA size
expression. :)

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

13 years agoSet the "implicitly inline" bit on a method as soon as we see a definition
John McCall [Wed, 15 Dec 2010 04:00:32 +0000 (04:00 +0000)]
Set the "implicitly inline" bit on a method as soon as we see a definition
within the class.  Teach IR gen to look for function definitions in record
lexical contexts when deciding whether to emit a function whose address
was taken.  Fixes PR8789.

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

13 years agoVariadic templates: extend the Expr class with a bit that specifies
Douglas Gregor [Wed, 15 Dec 2010 01:34:56 +0000 (01:34 +0000)]
Variadic templates: extend the Expr class with a bit that specifies
whether the expression contains an unexpanded parameter pack, in the
same vein as the changes to the Type hierarchy. Compute this bit
within all of the Expr subclasses.

This change required a bunch of reshuffling of dependency
calculations, mainly to consolidate them inside the constructors and
to fuse multiple loops that iterate over arguments to determine type
dependence, value dependence, and (now) containment of unexpanded
parameter packs.

Again, testing is painfully sparse, because all of the diagnostics
will change and it is more important to test the to-be-written visitor
that collects unexpanded parameter packs.

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

13 years agoFunction types are compatible (in the C sense) if their regparms are identical.
John McCall [Wed, 15 Dec 2010 01:06:38 +0000 (01:06 +0000)]
Function types are compatible (in the C sense) if their regparms are identical.

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

13 years agoAdded missing IgnoreParens().
Abramo Bagnara [Tue, 14 Dec 2010 22:11:44 +0000 (22:11 +0000)]
Added missing IgnoreParens().

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

13 years agoRewrite ComplexExprEvaluator::VisitCastExpr to use cast kinds, and fix
John McCall [Tue, 14 Dec 2010 17:51:41 +0000 (17:51 +0000)]
Rewrite ComplexExprEvaluator::VisitCastExpr to use cast kinds, and fix
the basic casting logic to insert intermediate casts and preserve the
exact complex-cast design.  Fixes a crash in the test suite.

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

13 years agoMinor fix for clang-completion-mode, from Dve Abrahams
Douglas Gregor [Tue, 14 Dec 2010 16:52:29 +0000 (16:52 +0000)]
Minor fix for clang-completion-mode, from Dve Abrahams

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

13 years agoImprove some comments, shrink FunctionType::ExtInfo, and fix a bug found
John McCall [Tue, 14 Dec 2010 16:45:57 +0000 (16:45 +0000)]
Improve some comments, shrink FunctionType::ExtInfo, and fix a bug found
by valgrind where we were doing the wrong thing in the presence of invalid
exception specs.

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

13 years agoFix documentation typo, from nobled.
Douglas Gregor [Tue, 14 Dec 2010 16:21:49 +0000 (16:21 +0000)]
Fix documentation typo, from nobled.

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

13 years agoRestore r121752 without modification.
John McCall [Tue, 14 Dec 2010 08:05:40 +0000 (08:05 +0000)]
Restore r121752 without modification.

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

13 years agoPull out r121752 in case it's causing the selfhost breakage.
John McCall [Tue, 14 Dec 2010 07:30:51 +0000 (07:30 +0000)]
Pull out r121752 in case it's causing the selfhost breakage.

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

13 years agoFactor out most of the extra state in a FunctionProtoType into a separate
John McCall [Tue, 14 Dec 2010 06:51:39 +0000 (06:51 +0000)]
Factor out most of the extra state in a FunctionProtoType into a separate
class to be passed around.  The line between argument and return types and
everything else is kindof vague, but I think it's justifiable.

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

13 years agoGeneralize this test to work without instruction names.
Dan Gohman [Tue, 14 Dec 2010 01:33:14 +0000 (01:33 +0000)]
Generalize this test to work without instruction names.

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

13 years agoImplement CodeGen support for the may_alias attribute.
Dan Gohman [Mon, 13 Dec 2010 23:51:08 +0000 (23:51 +0000)]
Implement CodeGen support for the may_alias attribute.

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

13 years agoVariadic templates: extend Type, NestedNameSpecifier, TemplateName,
Douglas Gregor [Mon, 13 Dec 2010 22:49:22 +0000 (22:49 +0000)]
Variadic templates: extend Type, NestedNameSpecifier, TemplateName,
and TemplateArgument with an operation that determines whether there
are any unexpanded parameter packs within that construct. Use this
information to diagnose the appearance of the names of parameter packs
that have not been expanded (C++ [temp.variadic]p5). Since this
property is checked often (every declaration, ever expression
statement, etc.), we extend Type and Expr with a bit storing the
result of this computation, rather than walking the AST each time to
determine whether any unexpanded parameter packs occur.

This commit is deficient in several ways, which will be remedied with
future commits:
  - Expr has a bit to store the presence of an unexpanded parameter
  pack, but it is never set.
  - The error messages don't point out where the unexpanded parameter
  packs were named in the type/expression, but they should.
  - We don't check for unexpanded parameter packs in all of the places
  where we should.
  - Testing is sparse, pending the resolution of the above three
  issues.

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

13 years agoSkip ParenType on function instantiations.
Abramo Bagnara [Mon, 13 Dec 2010 22:27:55 +0000 (22:27 +0000)]
Skip ParenType on function instantiations.

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

13 years agoRemove a type that got reduced away from this test case but not actually deleted.
Chandler Carruth [Mon, 13 Dec 2010 08:01:53 +0000 (08:01 +0000)]
Remove a type that got reduced away from this test case but not actually deleted.

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

13 years agoFix PR8774 by restricting when hasInit returns true. Previously, it
Chandler Carruth [Mon, 13 Dec 2010 07:40:47 +0000 (07:40 +0000)]
Fix PR8774 by restricting when hasInit returns true. Previously, it
would return true if the initializer pointer union had *any* non-null
pointer in it, even if the pointer wasn't one that would actually be
returned via getInit(). This makes it more accurately model the logic of
'getInit() != NULL'.

This still isn't completely satisfying. From a principled stance,
I suspect we should make hasInit() and getInit() *always* return false
and NULL (resp.) for ParmVarDecl. We shouldn't at the API level treat
initializers and default arguments as the same thing.

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

13 years agoReduce the number of builtin operator overload candidates added in certain
Chandler Carruth [Mon, 13 Dec 2010 01:44:01 +0000 (01:44 +0000)]
Reduce the number of builtin operator overload candidates added in certain
cases. First, omit all builtin overloads when no non-record type is in the set
of candidate types. Second, avoid arithmetic type overloads for non-arithmetic
or enumeral types (counting vector types as arithmetic due to Clang
extensions). When heavily using constructs such as STL's '<<' based stream
logging, this can have a significant impact. One logging-heavy test case's
compile time dropped by 10% with this. Self-host shows 1-2% improvement in
compile time, but that's likely in the noise.

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

13 years agoBasic, Sema: add support for CUDA launch_bounds attribute
Peter Collingbourne [Sun, 12 Dec 2010 23:03:07 +0000 (23:03 +0000)]
Basic, Sema: add support for CUDA launch_bounds attribute

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

13 years agoSema: diagnose kernel functions with non-void return type
Peter Collingbourne [Sun, 12 Dec 2010 23:02:57 +0000 (23:02 +0000)]
Sema: diagnose kernel functions with non-void return type

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