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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 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

14 years agoAllow a string literal to initialize a tail array (PR8217), patch
Chris Lattner [Sun, 10 Oct 2010 17:49:49 +0000 (17:49 +0000)]
Allow a string literal to initialize a tail array (PR8217), patch
by Pierre Habouzit!

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

14 years agoUnbreak the CMake build.
Francois Pichet [Sun, 10 Oct 2010 09:17:09 +0000 (09:17 +0000)]
Unbreak the CMake build.

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

14 years agoAdd experimental chroot check which checks improper use of chroot(). Patch by
Zhongxing Xu [Sun, 10 Oct 2010 05:45:30 +0000 (05:45 +0000)]
Add experimental chroot check which checks improper use of chroot(). Patch by
Lei Zhang.

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

14 years agoImplement __builtin_ia32_vec_ext_v2si function (required by Qt).
Argyrios Kyrtzidis [Sun, 10 Oct 2010 03:19:11 +0000 (03:19 +0000)]
Implement __builtin_ia32_vec_ext_v2si function (required by Qt).

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

14 years agolib/Driver/Tools.cpp: Disable cxa_atexit by default also on Cygwin.
NAKAMURA Takumi [Sun, 10 Oct 2010 01:53:03 +0000 (01:53 +0000)]
lib/Driver/Tools.cpp:  Disable cxa_atexit by default also on Cygwin.

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

14 years agoDon't rely on a StringRef being null-terminated (it's not) for deprecation messages.
Benjamin Kramer [Sat, 9 Oct 2010 15:49:00 +0000 (15:49 +0000)]
Don't rely on a StringRef being null-terminated (it's not) for deprecation messages.
Store pointer and length of the message in DelayedDiagnostic and hide the gory union details.

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

14 years agoAdd target implementations for the X86 builtins:
Bill Wendling [Sat, 9 Oct 2010 08:47:25 +0000 (08:47 +0000)]
Add target implementations for the X86 builtins:

  __builtin_ia32_vec_init_v8qi
  __builtin_ia32_vec_init_v4hi
  __builtin_ia32_vec_init_v2si

They are lowered to bitcasts. (These are all ready tested by the gcc testsuite.)
<rdar://problem/8529957>

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

14 years agoFixed __builtin_constant_p return type.
Abramo Bagnara [Sat, 9 Oct 2010 04:51:06 +0000 (04:51 +0000)]
Fixed __builtin_constant_p return type.

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

14 years agoFix g++.dg regressions introduced at r115347 (rdar://8529993)
Argyrios Kyrtzidis [Sat, 9 Oct 2010 04:39:54 +0000 (04:39 +0000)]
Fix g++.dg regressions introduced at r115347 (rdar://8529993)

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

14 years agoSecure this test against slightly different number formatters.
John McCall [Sat, 9 Oct 2010 02:28:39 +0000 (02:28 +0000)]
Secure this test against slightly different number formatters.

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

14 years agoPermit constant evaluation of const floating-point variables with
John McCall [Sat, 9 Oct 2010 01:34:31 +0000 (01:34 +0000)]
Permit constant evaluation of const floating-point variables with
constant initializers.

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

14 years agoAdd support for UCNs for character literals
Nico Weber [Sat, 9 Oct 2010 00:27:47 +0000 (00:27 +0000)]
Add support for UCNs for character literals

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