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

13 years agoReplace \r\n with \n in this file.
Nick Lewycky [Tue, 12 Oct 2010 16:46:35 +0000 (16:46 +0000)]
Replace \r\n with \n in this file.

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

13 years agoParse default arguments within member functions in source order, from
Douglas Gregor [Tue, 12 Oct 2010 16:25:54 +0000 (16:25 +0000)]
Parse default arguments within member functions in source order, from
Manuel Klimek! Fixes PR7715.

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

13 years agoPacify gcc-4.4.
Duncan Sands [Tue, 12 Oct 2010 14:07:59 +0000 (14:07 +0000)]
Pacify gcc-4.4.

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

13 years agoC's comma operator performs lvalue conversion on both its operands;
John McCall [Tue, 12 Oct 2010 07:14:40 +0000 (07:14 +0000)]
C's comma operator performs lvalue conversion on both its operands;
require them to have complete types.

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

13 years agoFlesh out test.
John McCall [Tue, 12 Oct 2010 03:38:33 +0000 (03:38 +0000)]
Flesh out test.

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

13 years agoI just do what the comments tell me to do.
John McCall [Tue, 12 Oct 2010 02:19:57 +0000 (02:19 +0000)]
I just do what the comments tell me to do.

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

13 years agofix the definition of __builtin_constant_p, the first arg isn't a short.
Chris Lattner [Tue, 12 Oct 2010 02:16:39 +0000 (02:16 +0000)]
fix the definition of __builtin_constant_p, the first arg isn't a short.
Patch by the "pax team"

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

13 years agoProgress.
John McCall [Tue, 12 Oct 2010 02:09:17 +0000 (02:09 +0000)]
Progress.

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

13 years agoThis patch remove the Win32 XFAIL from remap-complete.c
Francois Pichet [Tue, 12 Oct 2010 01:01:43 +0000 (01:01 +0000)]
This patch remove the Win32 XFAIL from remap-complete.c

The problem was that text files were open in text mode and Microsoft implementation of fread and write will try to do nasty line-feed conversion which make the line position no longer valid. The fix is to read and write files in binary mode.

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

13 years agoWhen we load an ASTUnit from command-line arguments, hold on to the
Douglas Gregor [Tue, 12 Oct 2010 00:50:20 +0000 (00:50 +0000)]
When we load an ASTUnit from command-line arguments, hold on to the
diagnostics produced by the driver itself. Previously, we were
allowing these to either be dropped or to slip through to stderr.

Fixes <rdar://problem/7595339>.

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

13 years agoFix spelling error.
Cameron Esfahani [Tue, 12 Oct 2010 00:21:25 +0000 (00:21 +0000)]
Fix spelling error.

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

13 years agoAdd some infrastructure for dealing with expressions of 'placeholder' type,
John McCall [Tue, 12 Oct 2010 00:20:44 +0000 (00:20 +0000)]
Add some infrastructure for dealing with expressions of 'placeholder' type,
i.e. expressions with an internally-convenient type which should not be
appearing in generally valid, complete ASTs.

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

13 years agoFixes a typo which caused byte offset in debug info
Fariborz Jahanian [Mon, 11 Oct 2010 23:55:47 +0000 (23:55 +0000)]
Fixes a typo which caused byte offset in debug info
for ivars to be 0. Fixes pr8353.

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

13 years agoBasic: Tweak attempt to make version tags work from 'svn export's again, clip
Daniel Dunbar [Mon, 11 Oct 2010 23:50:34 +0000 (23:50 +0000)]
Basic: Tweak attempt to make version tags work from 'svn export's again, clip
off the extra parts of the $URL$ SVN keyword.

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

13 years agoBasic: Attempt to make version tags work from 'svn export's again.
Daniel Dunbar [Mon, 11 Oct 2010 23:44:19 +0000 (23:44 +0000)]
Basic: Attempt to make version tags work from 'svn export's again.

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

13 years agoDriver/Darwin: Remove a useless warning about missing runtime libraries. These
Daniel Dunbar [Mon, 11 Oct 2010 23:31:07 +0000 (23:31 +0000)]
Driver/Darwin: Remove a useless warning about missing runtime libraries. These
are almost never needed, so the warning isn't very useful.

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

13 years agoThis test should now work on windows, since we're no longer using temporary files...
Douglas Gregor [Mon, 11 Oct 2010 23:18:55 +0000 (23:18 +0000)]
This test should now work on windows, since we're no longer using temporary files badly

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

13 years agoEliminate CIndexer::getClangPath(), since libclang no longer depends
Douglas Gregor [Mon, 11 Oct 2010 23:17:59 +0000 (23:17 +0000)]
Eliminate CIndexer::getClangPath(), since libclang no longer depends
on the presence of a 'clang' executable. Simplify
CIndexer::getClangResourcesPath() a bit.

Patch up the CMake makefiles to install headers into two locations in
the build tree, for those silly cases where 'clang' will end up
looking into the wrong build directory for headers.

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

13 years agoTest for //rdar: //8493239
Fariborz Jahanian [Mon, 11 Oct 2010 23:15:47 +0000 (23:15 +0000)]
Test for //rdar: //8493239

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

13 years agoSome refactoring of property rewriting stuff
Fariborz Jahanian [Mon, 11 Oct 2010 22:21:03 +0000 (22:21 +0000)]
Some refactoring of property rewriting stuff
in rewriter. No functionality change.

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

13 years agoEliminate the (de-)serialization of code completion results, now that
Douglas Gregor [Mon, 11 Oct 2010 22:12:15 +0000 (22:12 +0000)]
Eliminate the (de-)serialization of code completion results, now that
libclang does not support out-of-process code completion.

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

13 years agoEliminate -fdiagnostics-binary and all of the infrastructure for
Douglas Gregor [Mon, 11 Oct 2010 22:02:06 +0000 (22:02 +0000)]
Eliminate -fdiagnostics-binary and all of the infrastructure for
emitting diagnostics in a binary form to be consumed by libclang,
since libclang no longer does any of its work out-of-process, making
this code dead. Besides, this stuff never worked at 100% anyway.

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

13 years agoFix debug info for functions whose context is a namespace.
Devang Patel [Mon, 11 Oct 2010 21:58:41 +0000 (21:58 +0000)]
Fix debug info for functions whose context is a namespace.
This is tested by namespace.exp in gdb testsuite.

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

13 years agoEliminate clang_codeComplete(). libclang clients should be using the
Douglas Gregor [Mon, 11 Oct 2010 21:51:20 +0000 (21:51 +0000)]
Eliminate clang_codeComplete(). libclang clients should be using the
faster, in-process, more-configurable clang_codeCompleteAt().

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

13 years agoSwitch c-index-test from clang_codeComplete() over to
Douglas Gregor [Mon, 11 Oct 2010 21:37:58 +0000 (21:37 +0000)]
Switch c-index-test from clang_codeComplete() over to
clang_codeCompleteAt(). This uncovered a few issues with the latter:

  - ASTUnit wasn't saving/restoring diagnostic state appropriately between
    reparses and code completions.
  - "Overload" completions weren't being passed through to the client

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

13 years agoThis patch does a few things in the area of objective-c
Fariborz Jahanian [Mon, 11 Oct 2010 21:29:12 +0000 (21:29 +0000)]
This patch does a few things in the area of objective-c
properties.
1. Generates the AST for lexical info. of accessing
   getter/setter methods using dot-syntax notation.
   This fixes //rdar: //8528170.
2. Modifes rewriter to handle the AST putout in 1.
3. Supportes in rewriter ObjCImplicitSetterGetter ASTs.

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

13 years agoIRgen/Obj-C: Fix encoding of "long double".
Daniel Dunbar [Mon, 11 Oct 2010 21:13:48 +0000 (21:13 +0000)]
IRgen/Obj-C: Fix encoding of "long double".
 - The mind boggles.

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

13 years agoMerge encode-test-1.m into encode-test.m
Daniel Dunbar [Mon, 11 Oct 2010 21:13:46 +0000 (21:13 +0000)]
Merge encode-test-1.m into encode-test.m

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

13 years agoFileCheck'ize test.
Daniel Dunbar [Mon, 11 Oct 2010 21:13:44 +0000 (21:13 +0000)]
FileCheck'ize test.

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

13 years agoEliminate clang_setUseExternalASTGeneration() from libclang. Between
Douglas Gregor [Mon, 11 Oct 2010 16:52:23 +0000 (16:52 +0000)]
Eliminate clang_setUseExternalASTGeneration() from libclang. Between
improvements to the compiler and the introduction of crash recovery,
it no longer makes sense to allow this mode. Moreover, this eliminates
one use of the "clang" executable from within libclang; we'd like them
all to go away.

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

13 years agoAdd parsing support for Microsoft attributes. MS attributes will just be skipped...
Francois Pichet [Mon, 11 Oct 2010 12:59:39 +0000 (12:59 +0000)]
Add parsing support for Microsoft attributes. MS attributes will just be skipped and not inserted into the AST for now.

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

13 years agoAdd 2 Microsoft compiler intrinsics that don't require prototypes:
Francois Pichet [Mon, 11 Oct 2010 12:00:10 +0000 (12:00 +0000)]
Add 2 Microsoft compiler intrinsics that don't require prototypes:
__assume
__noop

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

13 years agoDeclare argv parameters as const char* const* instead of to char** to clarify that...
Axel Naumann [Mon, 11 Oct 2010 09:18:43 +0000 (09:18 +0000)]
Declare argv parameters as const char* const* instead of to char** to clarify that they are not modified, and to allow for string literals as arguments.

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

13 years agoTighten up constness of argv parameters to allow for string literals as argumants...
Axel Naumann [Mon, 11 Oct 2010 09:13:46 +0000 (09:13 +0000)]
Tighten up constness of argv parameters to allow for string literals as argumants and to reflect actual (non-modifying) use.

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

13 years agoPer discussion with Sanjiv, remove the PIC16 target from mainline. When/if
Chris Lattner [Mon, 11 Oct 2010 05:44:49 +0000 (05:44 +0000)]
Per discussion with Sanjiv, remove the PIC16 target from mainline.  When/if
it comes back, it will be largely a rewrite, so keeping the old codebase
in tree isn't helping anyone.

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

13 years agocomment out unused function
Chris Lattner [Mon, 11 Oct 2010 05:38:10 +0000 (05:38 +0000)]
comment out unused function

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

13 years agobe less threatening.
Chris Lattner [Mon, 11 Oct 2010 05:20:49 +0000 (05:20 +0000)]
be less threatening.

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

13 years agoMake sure the VTables for template instantiations are emitted even if the key functio...
Argyrios Kyrtzidis [Mon, 11 Oct 2010 03:25:57 +0000 (03:25 +0000)]
Make sure the VTables for template instantiations are emitted even if the key function doesn't have a body.

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

13 years agoDon't let typeinfo name symbols be 'internal hidden', it can lead to linker conflicts
Argyrios Kyrtzidis [Mon, 11 Oct 2010 03:25:53 +0000 (03:25 +0000)]
Don't let typeinfo name symbols be 'internal hidden', it can lead to linker conflicts
with similarly named classes in anonymous namespaces.

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

13 years agolib/CodeGen/CodeGenModule.cpp: DLLImportLinkage should be processed also on declaration.
NAKAMURA Takumi [Mon, 11 Oct 2010 02:30:56 +0000 (02:30 +0000)]
lib/CodeGen/CodeGenModule.cpp: DLLImportLinkage should be processed also on declaration.

It enables clang to compile Mingw's headers.

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

13 years agolib/Driver/Driver.cpp: Use the driver g++-4 for Cygwin-1.5.
NAKAMURA Takumi [Mon, 11 Oct 2010 02:28:42 +0000 (02:28 +0000)]
lib/Driver/Driver.cpp: Use the driver g++-4 for Cygwin-1.5.

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

13 years agolib/Frontend/InitHeaderSearch.cpp: Fix compatibility to Cygming.
NAKAMURA Takumi [Mon, 11 Oct 2010 02:27:37 +0000 (02:27 +0000)]
lib/Frontend/InitHeaderSearch.cpp: Fix compatibility to Cygming.

  - lib/gcc/include should not be included. Clang oughta have alternatives. (PR7956)
  - Cygwin: /usr/include/w32api should be included. gcc/cygwin does.
  - gcc/cygwin uses gcc paths as /usr/lib not /lib. They are same on Cygwin environment, though, We have to take what gcc/cygwin does.
  - Cygwin-1.7: Use 4.3.4.
  - Cygwin-1.5: Use 4.3.2 for gcc-4.

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

13 years agofix PR8217, a silent miscompilation of invalid code.
Chris Lattner [Sun, 10 Oct 2010 18:16:20 +0000 (18:16 +0000)]
fix PR8217, a silent miscompilation of invalid code.

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