]> granicus.if.org Git - clang/log
clang
13 years agoAdd an empty robots.txt, mostly just to reduce errors in HTTP log.
Daniel Dunbar [Sat, 16 Oct 2010 04:10:37 +0000 (04:10 +0000)]
Add an empty robots.txt, mostly just to reduce errors in HTTP log.

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

13 years agoAdd a favicon.ico, mostly just to reduce errors in HTTP log.
Daniel Dunbar [Sat, 16 Oct 2010 04:08:19 +0000 (04:08 +0000)]
Add a favicon.ico, mostly just to reduce errors in HTTP log.

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

13 years agoIRgen/Obj-C/NeXT: Fix the IR signature for objc_exception_rethrow, so we don't
Daniel Dunbar [Sat, 16 Oct 2010 04:08:16 +0000 (04:08 +0000)]
IRgen/Obj-C/NeXT: Fix the IR signature for objc_exception_rethrow, so we don't
generate unnecessary %al clear on x86_64.

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

13 years agoFix a rewriting bug of rewriting properties declared in
Fariborz Jahanian [Sat, 16 Oct 2010 00:29:27 +0000 (00:29 +0000)]
Fix a rewriting bug of rewriting properties declared in
protocols. // rdar: //8558702

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

13 years agoTweak scan-build to work with naked clang commands.
Ted Kremenek [Sat, 16 Oct 2010 00:29:16 +0000 (00:29 +0000)]
Tweak scan-build to work with naked clang commands.

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

13 years agoNot really sure how this worked, but it seems like a clear typo. =]
Chandler Carruth [Sat, 16 Oct 2010 00:24:52 +0000 (00:24 +0000)]
Not really sure how this worked, but it seems like a clear typo. =]

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

13 years agoAllow list-initialization of a local variable of class type with a
Douglas Gregor [Fri, 15 Oct 2010 23:53:28 +0000 (23:53 +0000)]
Allow list-initialization of a local variable of class type with a
flexible array member, so long as the flexibility array member is
either not initialized or is initialized with an empty initializer
list. Fixes <rdar://problem/8540437>.

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

13 years agoDisable this test again, which naturally fails on every platform except the one I...
Douglas Gregor [Fri, 15 Oct 2010 23:23:05 +0000 (23:23 +0000)]
Disable this test again, which naturally fails on every platform except the one I'm building with

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

13 years agoTweak retain/release checker diagnostics to specify a leak occurs because an object...
Ted Kremenek [Fri, 15 Oct 2010 22:50:23 +0000 (22:50 +0000)]
Tweak retain/release checker diagnostics to specify a leak occurs because an object is not referenced later in the path,
not that it isn't referenced later in the code.  Fixes <rdar://problem/8527839>.

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

13 years agoCheck for ivar being a C++ object before attempting to
Fariborz Jahanian [Fri, 15 Oct 2010 22:42:59 +0000 (22:42 +0000)]
Check for ivar being a C++ object before attempting to
find a copy constructor/assignment operator used
in getter/setter synthesis. This removes an unintended
diagnostics and makes objc++ consistant with objective-c.
// rdar: //8550657.

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

13 years agoDriver: Error on -fno-for-scope, which we have no intention of supporting.
Daniel Dunbar [Fri, 15 Oct 2010 22:30:42 +0000 (22:30 +0000)]
Driver: Error on -fno-for-scope, which we have no intention of supporting.

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

13 years agoReport the location of the syntax error inside a macro. Fixes PR7944.
Nick Lewycky [Fri, 15 Oct 2010 21:43:24 +0000 (21:43 +0000)]
Report the location of the syntax error inside a macro. Fixes PR7944.

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

13 years agobool bit fields are causing problems with MSVC. Replace them with unsigned bit fields.
Francois Pichet [Fri, 15 Oct 2010 21:34:50 +0000 (21:34 +0000)]
bool bit fields are causing problems with MSVC. Replace them with unsigned bit fields.

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

13 years agoMention the paragraphs in the standards which sanction TBAA.
Dan Gohman [Fri, 15 Oct 2010 20:54:41 +0000 (20:54 +0000)]
Mention the paragraphs in the standards which sanction TBAA.

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

13 years agoUse a different name for pointer types in tbaa, to be a little
Dan Gohman [Fri, 15 Oct 2010 20:26:20 +0000 (20:26 +0000)]
Use a different name for pointer types in tbaa, to be a little
more consistent with other names, and to look less like a magic name.

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

13 years agoAdd a comment.
Dan Gohman [Fri, 15 Oct 2010 20:24:53 +0000 (20:24 +0000)]
Add a comment.

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

13 years agoFix a typo in a comment Frits van Bommel spotted.
Dan Gohman [Fri, 15 Oct 2010 20:24:10 +0000 (20:24 +0000)]
Fix a typo in a comment Frits van Bommel spotted.

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

13 years agoExperimental TBAA support for enum types.
Dan Gohman [Fri, 15 Oct 2010 20:23:12 +0000 (20:23 +0000)]
Experimental TBAA support for enum types.

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

13 years agoAgain, add '-include-pch' option to the driver, so it can get passed to the cc1 driver.
Argyrios Kyrtzidis [Fri, 15 Oct 2010 18:52:45 +0000 (18:52 +0000)]
Again, add '-include-pch' option to the driver, so it can get passed to the cc1 driver.

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

13 years agoRevert r116605, a lot more were committed by mistake.
Argyrios Kyrtzidis [Fri, 15 Oct 2010 18:51:34 +0000 (18:51 +0000)]
Revert r116605, a lot more were committed by mistake.

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

13 years agoAdd '-include-pch' option to the driver, so it can get passed to the cc1 driver.
Argyrios Kyrtzidis [Fri, 15 Oct 2010 18:49:01 +0000 (18:49 +0000)]
Add '-include-pch' option to the driver, so it can get passed to the cc1 driver.

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

13 years agoEradicate IsSuper field from ObjCImplicitSetterGetterRefExprClass
Fariborz Jahanian [Fri, 15 Oct 2010 18:40:05 +0000 (18:40 +0000)]
Eradicate IsSuper field from ObjCImplicitSetterGetterRefExprClass
AST node. (finishing off radar 8525788).

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

13 years agoTBAA = Type Based Alias Analysis
Devang Patel [Fri, 15 Oct 2010 18:23:36 +0000 (18:23 +0000)]
TBAA = Type Based Alias Analysis

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

13 years agoRead/write to/from PCH DeclarationNameLocs, DeclarationNameInfos and QualifierInfos...
Argyrios Kyrtzidis [Fri, 15 Oct 2010 18:21:24 +0000 (18:21 +0000)]
Read/write to/from PCH DeclarationNameLocs, DeclarationNameInfos and QualifierInfos (rdar://8513756).

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

13 years agoDon't leak the TBAA object.
Dan Gohman [Fri, 15 Oct 2010 18:04:46 +0000 (18:04 +0000)]
Don't leak the TBAA object.

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

13 years agoAdd a comment about odd "signed char" incompatibility between C++ and C.
Dan Gohman [Fri, 15 Oct 2010 17:52:03 +0000 (17:52 +0000)]
Add a comment about odd "signed char" incompatibility between C++ and C.

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

13 years agoAdd clang_getLocationForOffset() to libclang, for gives a source location from a...
David Chisnall [Fri, 15 Oct 2010 17:07:39 +0000 (17:07 +0000)]
Add clang_getLocationForOffset() to libclang, for gives a source location from a character index into a file.

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

13 years agoWhen performing typo correction, keep track of whether the last lookup
Douglas Gregor [Fri, 15 Oct 2010 16:49:56 +0000 (16:49 +0000)]
When performing typo correction, keep track of whether the last lookup
we did was an acceptable lookup. If it is, then we can re-use that
lookup result. If it isn't, we have to perform the lookup again. This
is almost surely the cause behind the mysterious typo.m failures on
some builders; we were getting the wrong lookup results returned.

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

13 years agoDisable type.m while failures are investigated.
Daniel Dunbar [Fri, 15 Oct 2010 15:28:09 +0000 (15:28 +0000)]
Disable type.m while failures are investigated.

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

13 years agoMake test more consistent.
Daniel Dunbar [Fri, 15 Oct 2010 15:13:02 +0000 (15:13 +0000)]
Make test more consistent.

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

13 years agoWhen we're in the context of an Objective-C message send's receiver,
Douglas Gregor [Fri, 15 Oct 2010 13:35:25 +0000 (13:35 +0000)]
When we're in the context of an Objective-C message send's receiver,
typo correction prefers "super" over other, equivalent completions. I
believe this will fix the regression on the buildbot.

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

13 years agoDiagnose C++ [class.mem]p13-14, where a class member has the same name
Douglas Gregor [Fri, 15 Oct 2010 13:21:21 +0000 (13:21 +0000)]
Diagnose C++ [class.mem]p13-14, where a class member has the same name
as the class itself. Fixes PR7082.

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

13 years agozap trailing whitespace
Gabor Greif [Fri, 15 Oct 2010 08:48:51 +0000 (08:48 +0000)]
zap trailing whitespace

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

13 years agotestcase for http://llvm.org/PR8371 of my last commit, r116570
Gabor Greif [Fri, 15 Oct 2010 08:44:44 +0000 (08:44 +0000)]
testcase for http://llvm.org/PR8371 of my last commit, r116570

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

13 years agofix http://llvm.org/PR8371 in the straightforward way, also adding a comment
Gabor Greif [Fri, 15 Oct 2010 08:26:25 +0000 (08:26 +0000)]
fix http://llvm.org/PR8371 in the straightforward way, also adding a comment

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

13 years agoTreat __extension__ like ParenExpr.
Abramo Bagnara [Fri, 15 Oct 2010 07:51:18 +0000 (07:51 +0000)]
Treat __extension__ like ParenExpr.

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

13 years agoRecurse on a TypeLoc rather than a Type for TypedefDecl, now that the
Craig Silverstein [Fri, 15 Oct 2010 06:51:01 +0000 (06:51 +0000)]
Recurse on a TypeLoc rather than a Type for TypedefDecl, now that the
typloc information is available (I don't think it was, originally).
Submitted as a 'trivial' change.

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

13 years agoDeath to blocks, or at least the word "block" in one particular obnoxiously
John McCall [Fri, 15 Oct 2010 04:57:14 +0000 (04:57 +0000)]
Death to blocks, or at least the word "block" in one particular obnoxiously
ambiguous context.

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

13 years agoDon't complain about a variable within a linkage-specification that is
Douglas Gregor [Fri, 15 Oct 2010 01:21:46 +0000 (01:21 +0000)]
Don't complain about a variable within a linkage-specification that is
initialized. Fixes PR7076.

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

13 years agoWhen we are missing the ',' or '>' to terminate a template parameter
Douglas Gregor [Fri, 15 Oct 2010 01:15:58 +0000 (01:15 +0000)]
When we are missing the ',' or '>' to terminate a template parameter
list, complain about it! Fixes PR7053.

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

13 years agoAdd builtin conditional operator candidates for scoped enumeration
Douglas Gregor [Fri, 15 Oct 2010 00:50:56 +0000 (00:50 +0000)]
Add builtin conditional operator candidates for scoped enumeration
types, from Alp Toker! Fixes PR8344.

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

13 years agoUpdate CMake.
Daniel Dunbar [Fri, 15 Oct 2010 00:39:31 +0000 (00:39 +0000)]
Update CMake.

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

13 years agoCopied some flags from the Makefile build to the list of GCC flags.
Oscar Fuentes [Fri, 15 Oct 2010 00:16:22 +0000 (00:16 +0000)]
Copied some flags from the Makefile build to the list of GCC flags.

This removes a lot of warnings.

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

13 years agoAdd a TBAA type for pointer types.
Dan Gohman [Fri, 15 Oct 2010 00:01:39 +0000 (00:01 +0000)]
Add a TBAA type for pointer types.

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

13 years agoUnsigned types are TBAA-compatible with their signed counterparts.
Dan Gohman [Thu, 14 Oct 2010 23:39:00 +0000 (23:39 +0000)]
Unsigned types are TBAA-compatible with their signed counterparts.
Also, handle unknown types conservatively.

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

13 years agoRewrite bug fix rewriting a property assignment when
Fariborz Jahanian [Thu, 14 Oct 2010 23:31:39 +0000 (23:31 +0000)]
Rewrite bug fix rewriting a property assignment when
its RHS is an ivar. Fixes //rdar: //8541517.

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

13 years agoExperimental TBAA support.
Dan Gohman [Thu, 14 Oct 2010 23:06:10 +0000 (23:06 +0000)]
Experimental TBAA support.

This enables metadata generation by default, however the TBAA pass
in the optimizer is still disabled for now.

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

13 years agoUse root non-virtual primary base class, not just immediate primary base class, for...
Devang Patel [Thu, 14 Oct 2010 22:59:23 +0000 (22:59 +0000)]
Use root non-virtual primary base class, not just immediate primary base class, for AT_containing_type.
This is tested by virtfunc.exp in gdb testsuite.

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

13 years agoWire up the -fstrict-aliasing and -fno-strict-aliasing options
Dan Gohman [Thu, 14 Oct 2010 22:36:56 +0000 (22:36 +0000)]
Wire up the -fstrict-aliasing and -fno-strict-aliasing options
to CodeGenOption flags.

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

13 years agotemplate-ids are looked up differently in friend declarations.
John McCall [Thu, 14 Oct 2010 22:22:28 +0000 (22:22 +0000)]
template-ids are looked up differently in friend declarations.

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

13 years agoWhen performing typo correction, look through the set of known
Douglas Gregor [Thu, 14 Oct 2010 22:11:03 +0000 (22:11 +0000)]
When performing typo correction, look through the set of known
identifiers to determine good typo-correction candidates. Once we've
identified those candidates, we perform name lookup on each of them
and the consider the results.

This optimization makes typo correction > 2x faster on a benchmark
example using a single typo (NSstring) in a tiny file that includes
Cocoa.h from a precompiled header, since we are deserializing far less
information now during typo correction.

There is a semantic change here, which is interesting. The presence of
a similarly-named entity that is not visible can now affect typo
correction. This is both good (you won't get weird corrections if the
thing you wanted isn't in scope) and bad (you won't get good
corrections if there is a similarly-named-but-completely-unrelated
thing). Time will tell whether it was a good choice or not.

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

13 years agoMake sure that we diagnose invalid qualifiers on friend functions.
Douglas Gregor [Thu, 14 Oct 2010 22:03:51 +0000 (22:03 +0000)]
Make sure that we diagnose invalid qualifiers on friend functions.

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

13 years agoAt Fariborz's request, a somewhat cleaner bit-combining hack.
John McCall [Thu, 14 Oct 2010 21:48:26 +0000 (21:48 +0000)]
At Fariborz's request, a somewhat cleaner bit-combining hack.

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

13 years agoReverting r116493: removes a test that failed on clang selfhost and msvc
Andrew Trick [Thu, 14 Oct 2010 21:41:16 +0000 (21:41 +0000)]
Reverting r116493: removes a test that failed on clang selfhost and msvc

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

13 years agoFix compiler error that clang didn't report (probably same problem as rdar://8552377).
Argyrios Kyrtzidis [Thu, 14 Oct 2010 21:35:29 +0000 (21:35 +0000)]
Fix compiler error that clang didn't report (probably same problem as rdar://8552377).

It's more stress-free without access checking though..

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

13 years agoPut line number on the diagnostic. //rdar: //8550657.
Fariborz Jahanian [Thu, 14 Oct 2010 21:30:10 +0000 (21:30 +0000)]
Put line number on the diagnostic. //rdar: //8550657.

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

13 years agor116509 fixed the Win32 XFAIL.
Francois Pichet [Thu, 14 Oct 2010 20:49:46 +0000 (20:49 +0000)]
r116509 fixed the Win32 XFAIL.

The failing was due to this:
1. preamble.c contains CR+LF new lines
2. write() is called with a buffer containing the original (CR+LF) to output the result on the console.
3. In text mode(the default), write() convert LF to CR+LF even if LF is preceded by CR, hence we have CR+CR+LF which filecheck interprets as 2 lines.

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

13 years agoTweak the typo-correction implementation to determine corrections
Douglas Gregor [Thu, 14 Oct 2010 20:34:08 +0000 (20:34 +0000)]
Tweak the typo-correction implementation to determine corrections
solely based on the names it sees, rather than actual declarations it
gets. In essence, we determine the set of names that are "close
enough" to the typo'd name. Then, we perform name lookup for each of
those names, filtering out those that aren't actually visible, and
typo-correct from the remaining results.

Overall, there isn't much of a change in the behavior of typo
correction here. The only test-suite change comes from the fact that
we make good on our promise to require that the user type 3 characters
for each 1 character corrected.

The real intent behind this change is to set the stage for an
optimization to typo correction (so that we don't need to deserialize
all declarations in a translation unit) and future work in finding
missing qualification ("'vector' isn't in scope; did you mean
'std::vector'?). Plus, the code is cleaner this way.

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

13 years agoStore in PCH the key function of C++ class to avoid deserializing the complete declar...
Argyrios Kyrtzidis [Thu, 14 Oct 2010 20:14:38 +0000 (20:14 +0000)]
Store in PCH the key function of C++ class to avoid deserializing the complete declaration context in order to compute it.
Progress for rdar://7260160.

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

13 years agoAllow deserialization of just the fields of a record, when we want to iterate over...
Argyrios Kyrtzidis [Thu, 14 Oct 2010 20:14:34 +0000 (20:14 +0000)]
Allow deserialization of just the fields of a record, when we want to iterate over them,
instead of deserializing the complete declaration context of the record.

Iterating over the fields of a record is very common (e.g to determine the layout), unfortunately we needlessly deserialize every declaration
that the declaration context of the record contains; this can be bad for large C++ classes that contain a lot of methods.
Fix this by allow deserialization of just the fields when we want to iterate over them.
Progress for rdar://7260160.

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

13 years agoGive a default implementation for ASTDeserializationListener's methods, no functional...
Argyrios Kyrtzidis [Thu, 14 Oct 2010 20:14:28 +0000 (20:14 +0000)]
Give a default implementation for ASTDeserializationListener's methods, no functionality change.

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

13 years agoIntroduce command line option -error-on-deserialized-decl that is accompanied by...
Argyrios Kyrtzidis [Thu, 14 Oct 2010 20:14:25 +0000 (20:14 +0000)]
Introduce command line option -error-on-deserialized-decl that is accompanied by a name
and emits an error if a declaration with this name is deserialized from PCH.

This is for testing, to make sure that we don't deserialize stuff needlessly.

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

13 years agoDon't add the injected class name to the redeclarations chain; the chain should conta...
Argyrios Kyrtzidis [Thu, 14 Oct 2010 20:14:21 +0000 (20:14 +0000)]
Don't add the injected class name to the redeclarations chain; the chain should contain actual redeclarations, not implicits.
As a bonus, now we don't deserialize it unless we need it.

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

13 years agoIntroduce command line option -dump-deserialized-decls which is used to print the...
Argyrios Kyrtzidis [Thu, 14 Oct 2010 20:14:18 +0000 (20:14 +0000)]
Introduce command line option -dump-deserialized-decls which is used to print the PCH decls that got deserialized, for testing purposes.

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

13 years agoTest case for r116439
David Chisnall [Thu, 14 Oct 2010 18:15:20 +0000 (18:15 +0000)]
Test case for r116439

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

13 years agoEliminate usage of ObjCSuperExpr used for
Fariborz Jahanian [Thu, 14 Oct 2010 16:04:05 +0000 (16:04 +0000)]
Eliminate usage of ObjCSuperExpr used for
'super' as receiver of property or a setter/getter
methods. //rdar: //8525788

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

13 years agosupport for AltiVec extensions from the Cell architecture
Anton Yartsev [Thu, 14 Oct 2010 14:37:46 +0000 (14:37 +0000)]
support for AltiVec extensions from the Cell architecture

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

13 years agoCall PreVisitDeclStmt for C++ aggregate initializers. Patch by Jim Goodnow II.
Zhongxing Xu [Thu, 14 Oct 2010 05:22:59 +0000 (05:22 +0000)]
Call PreVisitDeclStmt for C++ aggregate initializers. Patch by Jim Goodnow II.

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

13 years agoCompress bit fields / enums from ReferenceType, BuiltinType, FunctionType, and
John McCall [Thu, 14 Oct 2010 03:00:17 +0000 (03:00 +0000)]
Compress bit fields / enums from ReferenceType, BuiltinType, FunctionType, and
ObjCObjectType into Type.

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

13 years agoWhoops. This really shouldn't compile in clang, either.
John McCall [Thu, 14 Oct 2010 02:06:32 +0000 (02:06 +0000)]
Whoops.  This really shouldn't compile in clang, either.

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

13 years agoPerform range restrictions on regparm when applied to a type and
John McCall [Thu, 14 Oct 2010 01:57:10 +0000 (01:57 +0000)]
Perform range restrictions on regparm when applied to a type and
not a decl.

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

13 years agoTeach Diagnostic to recursively expand inside %plural formats.
John McCall [Thu, 14 Oct 2010 01:55:31 +0000 (01:55 +0000)]
Teach Diagnostic to recursively expand inside %plural formats.

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

13 years agoallow I128 suffixes in msextensions mode just like i128 suffixes, patch
Chris Lattner [Thu, 14 Oct 2010 00:24:10 +0000 (00:24 +0000)]
allow I128 suffixes in msextensions mode just like i128 suffixes, patch
by Martin Vejnar!

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

13 years agomove logic for computing signed integer overflow when constant folding
Chris Lattner [Wed, 13 Oct 2010 23:46:56 +0000 (23:46 +0000)]
move logic for computing signed integer overflow when constant folding
into APInt.

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

13 years agoDiagnose when a 'static' member function overrides a virtual function
Douglas Gregor [Wed, 13 Oct 2010 22:55:32 +0000 (22:55 +0000)]
Diagnose when a 'static' member function overrides a virtual function
in a base class. Fixes PR8168.

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

13 years agoGeneralize the checking for qualification of (non-friend) class
Douglas Gregor [Wed, 13 Oct 2010 22:19:53 +0000 (22:19 +0000)]
Generalize the checking for qualification of (non-friend) class
members. Provide a hard error when the qualification doesn't match the
current class type, or a warning + Fix-it if it does match the current
class type. Fixes PR8159.

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

13 years agoDon't claim that things that are Objective-C keywords if preceded by an @ are keyword...
David Chisnall [Wed, 13 Oct 2010 21:44:48 +0000 (21:44 +0000)]
Don't claim that things that are Objective-C keywords if preceded by an @ are keywords unless they are preceded by an @.

For example, don't claim that end is a keyword in:

unsigned end;

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

13 years agoEliminate the use of ObjCSuperExpr in code completion.
Douglas Gregor [Wed, 13 Oct 2010 21:24:53 +0000 (21:24 +0000)]
Eliminate the use of ObjCSuperExpr in code completion.

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

13 years agoThere is no reason for dereferencing a pointer-to-member to require
Douglas Gregor [Wed, 13 Oct 2010 20:41:14 +0000 (20:41 +0000)]
There is no reason for dereferencing a pointer-to-member to require
that the class type into which the pointer points be complete, even
though the standard requires it. GCC/EDG do not require a complete
type here, so we're calling this a problem with the standard. Fixes
PR8328.

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

13 years agoUpdate Type::BitsRemainingInType
Douglas Gregor [Wed, 13 Oct 2010 20:07:36 +0000 (20:07 +0000)]
Update Type::BitsRemainingInType

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

13 years ago_Bool is not a keyword in C++. Fixes PR7388 and PR8349.
Douglas Gregor [Wed, 13 Oct 2010 20:00:38 +0000 (20:00 +0000)]
_Bool is not a keyword in C++. Fixes PR7388 and PR8349.

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

13 years agoPlace conversion warnings for non-type template arguments under the
Douglas Gregor [Wed, 13 Oct 2010 18:27:55 +0000 (18:27 +0000)]
Place conversion warnings for non-type template arguments under the
control of -Wconversion, and ignore them by default.

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

13 years agoIntroduce a bit into Type that keeps track of whether there are any
Douglas Gregor [Wed, 13 Oct 2010 18:05:20 +0000 (18:05 +0000)]
Introduce a bit into Type that keeps track of whether there are any
unnamed or local types within that type. This bit is cached along with
the linkage of a type, so that it can be recomputed (e.g., when we see
that a typedef has given a name to an anonymous declaration).

Use this bit when checking C++03 [temp.arg.type]p2, so that we don't
walk template argument types repeatedly.

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

13 years agoFix a silly bug in the suppression of non-error diagnostics in a
Douglas Gregor [Wed, 13 Oct 2010 17:22:14 +0000 (17:22 +0000)]
Fix a silly bug in the suppression of non-error diagnostics in a
SFINAE context, where we weren't getting the right diagnostic argument
count. I blame DiagnosticBuilder's weirdness. Fixes PR8372.

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

13 years agoCompute whether a type is variably modified as we build the type,
Douglas Gregor [Wed, 13 Oct 2010 16:58:14 +0000 (16:58 +0000)]
Compute whether a type is variably modified as we build the type,
rather than walking the type's structure every time we request this
information. Performance optimization; no functionality change.

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

13 years agoEliminates a clang warning.
Fariborz Jahanian [Wed, 13 Oct 2010 16:19:16 +0000 (16:19 +0000)]
Eliminates a clang warning.

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

13 years agoCall InitSections when assembling. This makes clang's output match that of
Rafael Espindola [Wed, 13 Oct 2010 14:53:57 +0000 (14:53 +0000)]
Call InitSections when assembling. This makes clang's output match that of
llvm-mc.

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

13 years agoPreserve the original scope when picking the right scope for a friend
John McCall [Wed, 13 Oct 2010 06:22:15 +0000 (06:22 +0000)]
Preserve the original scope when picking the right scope for a friend
declaration, because we'll need it later.  Hopefully fixed self-host.

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

13 years agoSupport friend function declarations in local classes correctly.
John McCall [Wed, 13 Oct 2010 05:45:15 +0000 (05:45 +0000)]
Support friend function declarations in local classes correctly.
Fixes a crash and diagnoses the error condition of an unqualified
friend which doesn't resolve to something.  I'm still not certain how
this is useful.

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

13 years agoEmbrace C++ ABI 5.2.6 and consider that template instantiations don't have key functi...
Argyrios Kyrtzidis [Wed, 13 Oct 2010 02:39:41 +0000 (02:39 +0000)]
Embrace C++ ABI 5.2.6 and consider that template instantiations don't have key functions (same as GCC).

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

13 years agoTeach the warning about unnamed/local types in template arguments to
Douglas Gregor [Wed, 13 Oct 2010 00:27:52 +0000 (00:27 +0000)]
Teach the warning about unnamed/local types in template arguments to
actually walk the template argument type to find any unnamed/local
types within it. Fixes PR6784.

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

13 years agoIntroduce support for emitting diagnostics (warnings + their notes)
Douglas Gregor [Tue, 12 Oct 2010 23:32:35 +0000 (23:32 +0000)]
Introduce support for emitting diagnostics (warnings + their notes)
that are suppressed during template argument deduction. This change
queues diagnostics computed during template argument deduction. Then,
if the resulting function template specialization or partial
specialization is chosen by overload resolution or partial ordering
(respectively), we will emit the queued diagnostics at that point.

This addresses most of PR6784. However, the check for unnamed/local
template arguments (which existed before this change) is still only
skin-deep, and needs to be extended to look deeper into types. It must
be improved to finish PR6784.

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

13 years agoFix debug info for anon union.
Devang Patel [Tue, 12 Oct 2010 23:24:54 +0000 (23:24 +0000)]
Fix debug info for anon union.
This is tested by anon-union.exp.

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

13 years agoFix anon union member assignment expression's location.
Devang Patel [Tue, 12 Oct 2010 23:23:25 +0000 (23:23 +0000)]
Fix anon union member assignment expression's location.
This is tested by anon-union.exp in gdb testsuite.

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

13 years agoHandle dependent friends more explicitly and deal with the possibility
John McCall [Tue, 12 Oct 2010 23:13:28 +0000 (23:13 +0000)]
Handle dependent friends more explicitly and deal with the possibility
of templated-scope friends by marking them invalid and white-listing all
accesses until such time as we implement them.  Fixes a crash, this time
without a broken test case.

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

13 years agoPR8325: don't do destructor checking when a pointer is thrown.
Eli Friedman [Tue, 12 Oct 2010 20:32:36 +0000 (20:32 +0000)]
PR8325: don't do destructor checking when a pointer is thrown.

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

13 years agoEnter the context of the declared function template when performing
John McCall [Tue, 12 Oct 2010 19:40:14 +0000 (19:40 +0000)]
Enter the context of the declared function template when performing
deduction and the final substitution, but not while substituting the
explicit template arguments.  Fixes rdar://problem/8537391

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

13 years agoWhen finalizing a function template specialization following template
Douglas Gregor [Tue, 12 Oct 2010 18:51:08 +0000 (18:51 +0000)]
When finalizing a function template specialization following template
argument deduction, make sure to check the correctness of deduced template
type arguments (which we had previously skipped) along with other
kinds of template arguments. This fixes part of PR6784, but we're
still swallowing the extension warning about unnamed/local template
arguments.

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

13 years agoIf we end up instantiating a function parameter whose default argument
Douglas Gregor [Tue, 12 Oct 2010 18:23:32 +0000 (18:23 +0000)]
If we end up instantiating a function parameter whose default argument
has not yet been parsed, note that the default argument hasn't been
parsed and keep track of all of the instantiations of that function
parameter. When its default argument does get parsed, imbue the
instantiations with that default argument. Fixes PR8245.

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

13 years agofix PR7885, rejecting invalid uses of __builtin_constant_p.
Chris Lattner [Tue, 12 Oct 2010 17:47:42 +0000 (17:47 +0000)]
fix PR7885, rejecting invalid uses of __builtin_constant_p.

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