]> granicus.if.org Git - clang/log
clang
14 years agodocument -fdiagnostics-show-category
Chris Lattner [Wed, 5 May 2010 01:35:28 +0000 (01:35 +0000)]
document -fdiagnostics-show-category

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

14 years agoRework clang_annotateTokens() to annotate tokens with information that more closely...
Ted Kremenek [Wed, 5 May 2010 00:55:23 +0000 (00:55 +0000)]
Rework clang_annotateTokens() to annotate tokens with information that more closely matches
clang_getCursor().  Tokens are now annotated with the cursor (for the matching AST element)
that most closely encompasses that token.

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

14 years agoMap Objective-C keywords to CXToken_Keyword.
Ted Kremenek [Wed, 5 May 2010 00:55:20 +0000 (00:55 +0000)]
Map Objective-C keywords to CXToken_Keyword.

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

14 years agoMove post-processing of token annotations to method in AnnotateTokensWorker.
Ted Kremenek [Wed, 5 May 2010 00:55:17 +0000 (00:55 +0000)]
Move post-processing of token annotations to method in AnnotateTokensWorker.

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

14 years agoRefactor visitor logic for clang_annotateTokens() into a worker class. No functional...
Ted Kremenek [Wed, 5 May 2010 00:55:15 +0000 (00:55 +0000)]
Refactor visitor logic for clang_annotateTokens() into a worker class.  No functionality change yet.

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

14 years agoadd a new -fdiagnostics-show-category=none/id/name option, giving control
Chris Lattner [Tue, 4 May 2010 21:55:25 +0000 (21:55 +0000)]
add a new -fdiagnostics-show-category=none/id/name option, giving control
over choice of:

t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat]
t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,1]
t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,Format String]

dox to come.

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

14 years agoWhen -fdiagnostics-print-source-range-info is specified,
Chris Lattner [Tue, 4 May 2010 21:13:21 +0000 (21:13 +0000)]
When -fdiagnostics-print-source-range-info is specified,
print the diagnostic category number in the [] at the end
of the line.  For example:

$ cat t.c
#include <stdio.h>
void foo() {
 printf("%s", 4);
}
$  clang t.c -fsyntax-only -fdiagnostics-print-source-range-info
t.c:3:11:{3:10-3:12}{3:15-3:16}: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,1]
  printf("%s", 4);
          ~^   ~
1 warning generated.

Clients that want category information can now pick the number
out of the output, rdar://7928231.

More coming.

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

14 years agoEmit the globals, metadata, etc. associated with static variables even when
John McCall [Tue, 4 May 2010 20:45:42 +0000 (20:45 +0000)]
Emit the globals, metadata, etc. associated with static variables even when
they're unreachable.  This matters because (if they're POD, or if this is C)
the scope containing the variable might be reachable even if the variable
isn't.  Fixes PR7044.

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

14 years agoadd the ability to associate 'category' names with diagnostics
Chris Lattner [Tue, 4 May 2010 20:44:26 +0000 (20:44 +0000)]
add the ability to associate 'category' names with diagnostics
and diagnostic groups.  This allows the compiler to group
diagnostics together (e.g. "Logic Warning",
"Format String Warning", etc) like the static analyzer does.
This is not exposed through anything in the compiler yet.

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

14 years agoFixes a code gen. crash when ivar object has trivial constructor.
Fariborz Jahanian [Tue, 4 May 2010 19:29:32 +0000 (19:29 +0000)]
Fixes a code gen. crash when ivar object has trivial constructor.

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

14 years agoWhen instantiating a function that was declared via a typedef, e.g.,
Douglas Gregor [Tue, 4 May 2010 18:18:31 +0000 (18:18 +0000)]
When instantiating a function that was declared via a typedef, e.g.,

    typedef int functype(int, int);
    functype func;

also instantiate the synthesized function parameters for the resulting
function declaration.

With this change, Boost.Wave builds and passes all of its regression
tests.

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

14 years agoFixes a code gen crash when block is a reference type, etc.
Fariborz Jahanian [Tue, 4 May 2010 17:59:32 +0000 (17:59 +0000)]
Fixes a code gen crash when block is a reference type, etc.
(radar 7495203).

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

14 years agoIntroduce a limit on the depth of the macro instantiation backtrace
Douglas Gregor [Tue, 4 May 2010 17:13:42 +0000 (17:13 +0000)]
Introduce a limit on the depth of the macro instantiation backtrace
printed in a diagnostic, similar to the limit we already have on the
depth of the template instantiation backtrace. The macro instantiation
backtrace is limited to 10 "instantiated from:" diagnostics; when it's
longer than that, we'll show the first half, then say how many were
suppressed, then show the second half. The limit can be changed with
-fmacro-instantiation-limit=N, and turned off with N=0.

This eliminates a lot of note spew with libraries making use of the
Boost.Preprocess library.

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

14 years agoWhen creating a call to a base subobject's operator= in an
Douglas Gregor [Tue, 4 May 2010 15:20:55 +0000 (15:20 +0000)]
When creating a call to a base subobject's operator= in an
implicitly-defined copy assignment operator, suppress the protected
access check. This eliminates the remaining failure in the
Boost.SmartPtr library (that was a product of the copy-assignment
generation rewrite) and, presumably, the Boost.TR1 library as well.

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

14 years agoLet StmtDumper.cpp handle using declarations.
Sebastian Redl [Tue, 4 May 2010 10:20:17 +0000 (10:20 +0000)]
Let StmtDumper.cpp handle using declarations.

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

14 years agoAn access is permitted if the current template instantiates to the appropriate
John McCall [Tue, 4 May 2010 05:11:27 +0000 (05:11 +0000)]
An access is permitted if the current template instantiates to the appropriate
class.  Add some conservative support for the idea.  Fixes PR 7024.

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

14 years agoWhen inheriting a default argument expression, inherit the full expression,
John McCall [Tue, 4 May 2010 01:53:42 +0000 (01:53 +0000)]
When inheriting a default argument expression, inherit the full expression,
not just the inner expression.  This is important if the expression has any
temporaries.  Fixes PR 7028.

Basically a symptom of really tragic method names.

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

14 years agoFixes a Code Gen. Crash when calling destructor on a __block
Fariborz Jahanian [Tue, 4 May 2010 00:26:07 +0000 (00:26 +0000)]
Fixes a Code Gen. Crash when calling destructor on a __block
variabe. Blocks and their construction/destruction is
wip though.

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

14 years agoWhen computing the template arguments for the instantiation of a
Douglas Gregor [Mon, 3 May 2010 23:29:10 +0000 (23:29 +0000)]
When computing the template arguments for the instantiation of a
friend function template, be sure to adjust the computed template
argument lists based on the location of the definition of the function
template: it's possible that the definition we're instantiating with
and the template declaration that we found when creating the
specialization are in different contexts, which meant that we would
end up using the wrong template arguments for instantiation.

Fixes PR7013; all Boost.DynamicBitset tests now pass.

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

14 years agoJust bail out immediately when emitting an unreachable function-local static
John McCall [Mon, 3 May 2010 21:39:56 +0000 (21:39 +0000)]
Just bail out immediately when emitting an unreachable function-local static
variable.  Surprisingly, this does seem to be the right way to solve this.

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

14 years agoTest for my last patch.
Fariborz Jahanian [Mon, 3 May 2010 21:06:59 +0000 (21:06 +0000)]
Test for my last patch.

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

14 years agoFor the sake of Objective-c++ overload resolution,
Fariborz Jahanian [Mon, 3 May 2010 21:06:18 +0000 (21:06 +0000)]
For the sake of Objective-c++ overload resolution,
treat argument types of objective-c pointer types
which only differ in their protocol qualifiers as
the same type (radar 7925668).

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

14 years agoWhen instantiating a function-local variable definition, introduce the
Douglas Gregor [Mon, 3 May 2010 20:22:41 +0000 (20:22 +0000)]
When instantiating a function-local variable definition, introduce the
mapping from the declaration in the template to the instantiated
declaration before transforming the initializer, in case some crazy
lunatic decides to use a variable in its own initializer. Fixes PR7016.

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

14 years agoWorkaround: Don't add ObjCMethodDecls to the vector of TopLevelDecls since they don...
Ted Kremenek [Mon, 3 May 2010 20:16:35 +0000 (20:16 +0000)]
Workaround: Don't add ObjCMethodDecls to the vector of TopLevelDecls since they don't go in
the DeclContext for the translation unit.  This is to workaround a fundamental issue in how
ObjC decls (within an @implementation) are parsed before the ObjCContainerDecl is available.

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

14 years agoIf we're generating code to create a pointer-to-member function
Douglas Gregor [Mon, 3 May 2010 20:00:27 +0000 (20:00 +0000)]
If we're generating code to create a pointer-to-member function
aggregate and the result of the aggregate is unused, bail out
early. Fixes PR7027.

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

14 years agoDiagnose unused exception parameters under a different warning group
Douglas Gregor [Mon, 3 May 2010 18:51:14 +0000 (18:51 +0000)]
Diagnose unused exception parameters under a different warning group
(-Wunused-exception-parameter) than normal variables, since it's more
common to name and then ignore an exception parameter. This warning is
neither enabled by default nor by -Wall. Fixes <rdar://problem/7931045>.

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

14 years agoComplain when we try to initialize an object of Objective-C class type
Douglas Gregor [Mon, 3 May 2010 18:24:37 +0000 (18:24 +0000)]
Complain when we try to initialize an object of Objective-C class type
(which is ill-formed) with an initializer list. Also, change the
fallback from an assertion to a generic error message, which is far
friendlier. Fixes <rdar://problem/7730948>.

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

14 years agoIt's okay to reference an enum in a template definition, even though
Douglas Gregor [Mon, 3 May 2010 17:48:54 +0000 (17:48 +0000)]
It's okay to reference an enum in a template definition, even though
it's ill-formed to form an enum template. Fixes <rdar://problem/7933063>.

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

14 years agoWhen computing the address of a virtual member function pointer, use the pointer...
Anders Carlsson [Mon, 3 May 2010 16:05:06 +0000 (16:05 +0000)]
When computing the address of a virtual member function pointer, use the pointer width instead of hardcoding for 64-bit.

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

14 years agoTry to unbreak clang-i686-darawin10 builder
Douglas Gregor [Mon, 3 May 2010 15:51:04 +0000 (15:51 +0000)]
Try to unbreak clang-i686-darawin10 builder

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

14 years agoDo not issue warning on unimplemented property in the class, if it
Fariborz Jahanian [Mon, 3 May 2010 15:49:20 +0000 (15:49 +0000)]
Do not issue warning on unimplemented property in the class, if it
conforms to a protocol as one of its super classes does. This is because
conforming super class will implement the property. This implements
new warning rules for unimplemented properties (radar 7884086).

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

14 years agoGet rid of virt.cpp.
Anders Carlsson [Mon, 3 May 2010 15:49:15 +0000 (15:49 +0000)]
Get rid of virt.cpp.

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

14 years agoThe array form of 'new' can never have initializers.
Anders Carlsson [Mon, 3 May 2010 15:45:23 +0000 (15:45 +0000)]
The array form of 'new' can never have initializers.

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

14 years agoWhen creating the declaration reference for implicit copy-construction
Douglas Gregor [Mon, 3 May 2010 15:43:53 +0000 (15:43 +0000)]
When creating the declaration reference for implicit copy-construction
of a base class, give it real source-location information. Fixes PR7017.

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

14 years agoWhen declaring a namespace alias, ignore previous declarations that
Douglas Gregor [Mon, 3 May 2010 15:37:31 +0000 (15:37 +0000)]
When declaring a namespace alias, ignore previous declarations that
aren't in scope. Fixes PR7014.

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

14 years agoWhen instantiating a member function declared via a typedef, don't try
Douglas Gregor [Mon, 3 May 2010 15:32:18 +0000 (15:32 +0000)]
When instantiating a member function declared via a typedef, don't try
to enter the instantiated parameter declarations into the local
instantiation scope; they can't be referenced anyway. Fixes PR7022.

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

14 years agoWhen a class contains a non-empty anonymous union or struct, mark is
Douglas Gregor [Mon, 3 May 2010 15:18:25 +0000 (15:18 +0000)]
When a class contains a non-empty anonymous union or struct, mark is
as non-empty. Fixes PR7021.

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

14 years agoDon't build an aggregate constructor loop when the constructor is trivial.
Anders Carlsson [Mon, 3 May 2010 15:09:17 +0000 (15:09 +0000)]
Don't build an aggregate constructor loop when the constructor is trivial.

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

14 years agoAdd test case that I forgot to check in.
Anders Carlsson [Mon, 3 May 2010 14:22:40 +0000 (14:22 +0000)]
Add test case that I forgot to check in.

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

14 years agoReplace a char*/size pair with stringref.
Benjamin Kramer [Mon, 3 May 2010 13:08:54 +0000 (13:08 +0000)]
Replace a char*/size pair with stringref.

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

14 years agoSimplify.
Anders Carlsson [Mon, 3 May 2010 02:07:56 +0000 (02:07 +0000)]
Simplify.

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

14 years agoDon't copy or initialize empty classes. Fixes PR7012.
Anders Carlsson [Mon, 3 May 2010 01:20:20 +0000 (01:20 +0000)]
Don't copy or initialize empty classes. Fixes PR7012.

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

14 years agoStore the entire base subobject in SubVTTIndices.
Anders Carlsson [Mon, 3 May 2010 00:55:11 +0000 (00:55 +0000)]
Store the entire base subobject in SubVTTIndices.

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

14 years agoRemove OldGetAddressOfBaseClass - bye bye ambiguities.
Anders Carlsson [Mon, 3 May 2010 00:32:27 +0000 (00:32 +0000)]
Remove OldGetAddressOfBaseClass - bye bye ambiguities.

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

14 years agoGet rid of the last caller of OldGetAddressOfBaseClass.
Anders Carlsson [Mon, 3 May 2010 00:29:58 +0000 (00:29 +0000)]
Get rid of the last caller of OldGetAddressOfBaseClass.

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

14 years agoMore work towards getting rid of OldGetAddressOfBaseClass.
Anders Carlsson [Mon, 3 May 2010 00:07:07 +0000 (00:07 +0000)]
More work towards getting rid of OldGetAddressOfBaseClass.

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

14 years agoGet rid of a call to GetAddressOfDirectBaseInCompleteClass.
Anders Carlsson [Sun, 2 May 2010 23:57:15 +0000 (23:57 +0000)]
Get rid of a call to GetAddressOfDirectBaseInCompleteClass.

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

14 years agoHave getSubVTTIndex take a BaseSubobject instead of just a base.
Anders Carlsson [Sun, 2 May 2010 23:53:25 +0000 (23:53 +0000)]
Have getSubVTTIndex take a BaseSubobject instead of just a base.

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

14 years agoChange CXXConstructExpr::Create to take a ConstructionKind.
Anders Carlsson [Sun, 2 May 2010 23:53:04 +0000 (23:53 +0000)]
Change CXXConstructExpr::Create to take a ConstructionKind.

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

14 years agoPass ForVirtualBase all the way to GetVTTParameter.
Anders Carlsson [Sun, 2 May 2010 23:33:10 +0000 (23:33 +0000)]
Pass ForVirtualBase all the way to GetVTTParameter.

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

14 years agoAdd the same 'ForVirtualBase' parameter to EmitCXXDestructorCall.
Anders Carlsson [Sun, 2 May 2010 23:29:11 +0000 (23:29 +0000)]
Add the same 'ForVirtualBase' parameter to EmitCXXDestructorCall.

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

14 years agoRevert my last change and add a 'ForVirtualBase' parameter to EmitCXXConstructorCall...
Anders Carlsson [Sun, 2 May 2010 23:20:53 +0000 (23:20 +0000)]
Revert my last change and add a 'ForVirtualBase' parameter to EmitCXXConstructorCall instead.

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

14 years agoPass the construction kind down to EmitCXXConstructorCall.
Anders Carlsson [Sun, 2 May 2010 23:01:10 +0000 (23:01 +0000)]
Pass the construction kind down to EmitCXXConstructorCall.

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

14 years agoAdd an enum to CXXConstructExpr so we can determine if the construction expression...
Anders Carlsson [Sun, 2 May 2010 22:54:08 +0000 (22:54 +0000)]
Add an enum to CXXConstructExpr so we can determine if the construction expression constructs a non-virtual or virtual base.

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

14 years agoRemove another unused function.
Anders Carlsson [Sun, 2 May 2010 18:13:35 +0000 (18:13 +0000)]
Remove another unused function.

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

14 years agoRemove an unused function.
Anders Carlsson [Sun, 2 May 2010 18:12:22 +0000 (18:12 +0000)]
Remove an unused function.

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

14 years agoCodeGen: Shrink RValue. 4 words -> 2 words.
Benjamin Kramer [Sun, 2 May 2010 14:59:10 +0000 (14:59 +0000)]
CodeGen: Shrink RValue. 4 words -> 2 words.

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

14 years agoAs per Chris' request, return the Instruction from EmitCall and add the metadata...
David Chisnall [Sun, 2 May 2010 13:41:58 +0000 (13:41 +0000)]
As per Chris' request, return the Instruction from EmitCall and add the metadata in the caller.

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

14 years agoComplete reimplementation of the synthesis for implicitly-defined copy
Douglas Gregor [Sat, 1 May 2010 20:49:11 +0000 (20:49 +0000)]
Complete reimplementation of the synthesis for implicitly-defined copy
assignment operators.

Previously, Sema provided type-checking and template instantiation for
copy assignment operators, then CodeGen would synthesize the actual
body of the copy constructor. Unfortunately, the two were not in sync,
and CodeGen might pick a copy-assignment operator that is different
from what Sema chose, leading to strange failures, e.g., link-time
failures when CodeGen called a copy-assignment operator that was not
instantiation, run-time failures when copy-assignment operators were
overloaded for const/non-const references and the wrong one was
picked, and run-time failures when by-value copy-assignment operators
did not have their arguments properly copy-initialized.

This implementation synthesizes the implicitly-defined copy assignment
operator bodies in Sema, so that the resulting ASTs encode exactly
what CodeGen needs to do; there is no longer any special code in
CodeGen to synthesize copy-assignment operators. The synthesis of the
body is relatively simple, and we generate one of three different
kinds of copy statements for each base or member:

  - For a class subobject, call the appropriate copy-assignment
    operator, after overload resolution has determined what that is.
  - For an array of scalar types or an array of class types that have
    trivial copy assignment operators, construct a call to
    __builtin_memcpy.
  - For an array of class types with non-trivial copy assignment
    operators, synthesize a (possibly nested!) for loop whose inner
    statement calls the copy constructor.
  - For a scalar type, use built-in assignment.

This patch fixes at least a few tests cases in Boost.Spirit that were
failing because CodeGen picked the wrong copy-assignment operator
(leading to link-time failures), and I suspect a number of undiagnosed
problems will also go away with this change.

Some of the diagnostics we had previously have gotten worse with this
change, since we're going through generic code for our
type-checking. I will improve this in a subsequent patch.

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

14 years agofix a broken link, diagnostickinds.td was fissioned.
Chris Lattner [Sat, 1 May 2010 17:35:19 +0000 (17:35 +0000)]
fix a broken link, diagnostickinds.td was fissioned.

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

14 years agoSimplify EmitCopyCtorCall.
Anders Carlsson [Sat, 1 May 2010 17:07:40 +0000 (17:07 +0000)]
Simplify EmitCopyCtorCall.

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

14 years agoSimplify EmitClassAggrMemberwiseCopy.
Anders Carlsson [Sat, 1 May 2010 17:02:18 +0000 (17:02 +0000)]
Simplify EmitClassAggrMemberwiseCopy.

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

14 years agoBump default template instantiation depth to 1024, as required by C++0x
Douglas Gregor [Sat, 1 May 2010 16:59:21 +0000 (16:59 +0000)]
Bump default template instantiation depth to 1024, as required by C++0x

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

14 years agoClean up EmitClassMemberwiseCopy further.
Anders Carlsson [Sat, 1 May 2010 16:54:05 +0000 (16:54 +0000)]
Clean up EmitClassMemberwiseCopy further.

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

14 years agoGet rid of a parameter from EmitClassMemberwiseCopy.
Anders Carlsson [Sat, 1 May 2010 16:49:43 +0000 (16:49 +0000)]
Get rid of a parameter from EmitClassMemberwiseCopy.

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

14 years agoWhen defining implicit copy constructors, use SetBaseOrMemberInitializers to initiali...
Anders Carlsson [Sat, 1 May 2010 16:39:01 +0000 (16:39 +0000)]
When defining implicit copy constructors, use SetBaseOrMemberInitializers to initialize the bases.

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

14 years agoAdded an RAII object that helps set up/tear down the Sema context
Douglas Gregor [Sat, 1 May 2010 15:04:51 +0000 (15:04 +0000)]
Added an RAII object that helps set up/tear down the Sema context
information required to implicitly define a C++ special member
function. Use it rather than explicitly setting CurContext on entry
and exit, which is fragile.

Use this RAII object for the implicitly-defined default constructor,
copy constructor, copy assignment operator, and destructor.

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

14 years agoAttach message send metadata to the lookup as well as to the call (GNU runtime).
David Chisnall [Sat, 1 May 2010 12:56:56 +0000 (12:56 +0000)]
Attach message send metadata to the lookup as well as to the call (GNU runtime).

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

14 years agoMake super message lookups cacheable (GNUstep Runtime)
David Chisnall [Sat, 1 May 2010 12:37:16 +0000 (12:37 +0000)]
Make super message lookups cacheable (GNUstep Runtime)

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

14 years agoTweaked EmitCall() to permit the caller to provide some metadata to attach to the...
David Chisnall [Sat, 1 May 2010 11:15:56 +0000 (11:15 +0000)]
Tweaked EmitCall() to permit the caller to provide some metadata to attach to the call site.

Used this in CGObjCGNU to attach metadata about message sends to permit speculative inlining.

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

14 years agoRemove empty directory.
Benjamin Kramer [Sat, 1 May 2010 10:30:16 +0000 (10:30 +0000)]
Remove empty directory.

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

14 years agowith recent optimizer changes, these all get devirtualized.
Chris Lattner [Sat, 1 May 2010 01:42:06 +0000 (01:42 +0000)]
with recent optimizer changes, these all get devirtualized.

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

14 years agoIt turns out that basically every caller to RequireCompleteDeclContext
John McCall [Sat, 1 May 2010 00:40:08 +0000 (00:40 +0000)]
It turns out that basically every caller to RequireCompleteDeclContext
already knows what context it's looking in.  Just pass that context in
instead of (questionably) recalculating it.

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

14 years agoFix NON_ANSI_COMPILE_FLAGS setting, for MSVC.
Daniel Dunbar [Sat, 1 May 2010 00:06:42 +0000 (00:06 +0000)]
Fix NON_ANSI_COMPILE_FLAGS setting, for MSVC.

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

14 years agoAdd null check in CFGBuilder::VisitStmt() to make CFG construction
Ted Kremenek [Fri, 30 Apr 2010 22:25:53 +0000 (22:25 +0000)]
Add null check in CFGBuilder::VisitStmt() to make CFG construction
more resilient to bad code.

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

14 years agoRename 'CIndex' to 'libclang', since it has basically become our stable public
Daniel Dunbar [Fri, 30 Apr 2010 21:51:10 +0000 (21:51 +0000)]
Rename 'CIndex' to 'libclang', since it has basically become our stable public
(C) API, and will likely grow further in this direction in the future.

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

14 years agoDon't perform AnalysisBasedWarnings in Sema or run the static analyzer when a
Ted Kremenek [Fri, 30 Apr 2010 21:49:25 +0000 (21:49 +0000)]
Don't perform AnalysisBasedWarnings in Sema or run the static analyzer when a
fatal error has occurred.

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

14 years agoAfter substituting a template argument for a non-type template
Douglas Gregor [Fri, 30 Apr 2010 21:46:38 +0000 (21:46 +0000)]
After substituting a template argument for a non-type template
parameter with pointer-to-member type, we may have to perform a
qualification conversion, since the pointee type of the parameter
might be more qualified than the pointee type of the argument we form
from the declaration. Fixes PR6986.

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

14 years agoWhen synthesizing Objective C records, give the synthetic fields public
John McCall [Fri, 30 Apr 2010 21:35:41 +0000 (21:35 +0000)]
When synthesizing Objective C records, give the synthetic fields public
access.  Fixes an assertion.

Fixes rdar://problem/7927811.  Too lazy to reduce a test case.

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

14 years agoFix a thinko that caused us not to compute __builtin_offset as a
Douglas Gregor [Fri, 30 Apr 2010 20:35:01 +0000 (20:35 +0000)]
Fix a thinko that caused us not to compute __builtin_offset as a
constant expression in C.

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

14 years agoTeach clang_getLocation() to cope with a NULL file argument.
Douglas Gregor [Fri, 30 Apr 2010 19:45:53 +0000 (19:45 +0000)]
Teach clang_getLocation() to cope with a NULL file argument.

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

14 years agoRemove an unnecessary parameter from EmitClassCopyAssignment.
Anders Carlsson [Fri, 30 Apr 2010 19:45:28 +0000 (19:45 +0000)]
Remove an unnecessary parameter from EmitClassCopyAssignment.

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

14 years agoClean up our handling of local instantiation scopes, which keep track
Douglas Gregor [Fri, 30 Apr 2010 18:55:50 +0000 (18:55 +0000)]
Clean up our handling of local instantiation scopes, which keep track
of the mapping from local declarations to their instantiated
counterparts during template instantiation. Previously, we tried to do
some unholy merging of local instantiation scopes that involved
storing a single hash table along with an "undo" list on the
side... which was ugly, and never handled function parameters
properly.

Now, we just keep separate hash tables for each local instantiation
scope, and "combining" two scopes means that we'll look in each of the
combined hash tables. The combined scope stack is rarely deep, and
this makes it easy to avoid the "undo" issues we were hitting. Also,
I've simplified the logic for function parameters: if we're declaring
a function and we need the function parameters to live longer, we just
push them back into the local instantiation scope where we need them.

Fixes PR6990.

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

14 years agoMove include installation steps to better location, inside each include dir instead...
Daniel Dunbar [Fri, 30 Apr 2010 17:59:38 +0000 (17:59 +0000)]
Move include installation steps to better location, inside each include dir instead of at the top-level.

Also, don't set NO_INSTALL=1 for c-index-test.

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

14 years agoFixed incorrect type of alloca (GNU runtime).
David Chisnall [Fri, 30 Apr 2010 13:36:12 +0000 (13:36 +0000)]
Fixed incorrect type of alloca (GNU runtime).

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

14 years agoAdd calling convention related attributes to related declaration. Mark attributes...
Abramo Bagnara [Fri, 30 Apr 2010 13:10:51 +0000 (13:10 +0000)]
Add calling convention related attributes to related declaration. Mark attributes invalid on type related checking so to add them to declarations only when everything is ok.

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

14 years agoAttribute noreturn is now put in declaration attributes. Fixed a double warning gener...
Abramo Bagnara [Fri, 30 Apr 2010 09:13:03 +0000 (09:13 +0000)]
Attribute noreturn is now put in declaration attributes. Fixed a double warning generation.

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

14 years agoAn edge from a call expression to the exit block is only an abnormal edge
John McCall [Fri, 30 Apr 2010 07:10:06 +0000 (07:10 +0000)]
An edge from a call expression to the exit block is only an abnormal edge
if *none* of the successors of the call expression is the exit block.
This matters when a call of bool type is the condition of (say) a while
loop in a function with no statements after the loop.  This *can* happen
in C, but it's much more common in C++ because of overloaded operators.

Suppresses some substantial number of spurious -Wmissing-noreturn warnings.

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

14 years agoFix ADL for types declared in transparent decls, from Alp Toker!
Douglas Gregor [Fri, 30 Apr 2010 07:08:38 +0000 (07:08 +0000)]
Fix ADL for types declared in transparent decls, from Alp Toker!

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

14 years agoIntroduce a sequence number into class template partial
Douglas Gregor [Fri, 30 Apr 2010 05:56:50 +0000 (05:56 +0000)]
Introduce a sequence number into class template partial
specializations, which keeps track of the order in which they were
originally declared. We use this number so that we can always walk the
list of partial specializations in a predictable order during matching
or template instantiation. This also fixes a failure in Boost.Proto,
where SourceManager::isBeforeInTranslationUnit was behaving
poorly in inconsistent ways.

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

14 years agoAccount for the VTT argument when making an implicit copy constructor for
John McCall [Fri, 30 Apr 2010 05:56:45 +0000 (05:56 +0000)]
Account for the VTT argument when making an implicit copy constructor for
a class with virtual bases.  Just a patch until Sema starts (correctly) doing
most of this analysis.

Fixes PR 6622.

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

14 years agoWhen we start the definition of a class template, set the
Douglas Gregor [Fri, 30 Apr 2010 04:39:27 +0000 (04:39 +0000)]
When we start the definition of a class template, set the
InjectedClassNameType's Decl to point at the definition. It's a little
messy, but we do the same thing with classes and their record types,
since much of Clang expects that the TagDecl* one gets out of a type
is the definition. Fixes several Boost.Proto failures.

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

14 years agoRemove unused trait.
Zhongxing Xu [Fri, 30 Apr 2010 04:17:33 +0000 (04:17 +0000)]
Remove unused trait.

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

14 years agoRefactor the AnalysisConsumer to analyze functions after the whole
Zhongxing Xu [Fri, 30 Apr 2010 04:14:20 +0000 (04:14 +0000)]
Refactor the AnalysisConsumer to analyze functions after the whole
translation unit is parsed. This enables us to inline some calls when still
analyzing one function at a time.

Actions are classified into Function, CXXMethod, ObjCMethod,
ObjCImplementation.

This does not hurt performance much. The analysis time for sqlite3.c:

before:
real    17m52.440s
user    17m49.460s
sys    0m2.010s

after:
real    18m0.500s
user    17m56.900s
sys    0m2.330s

DisplayProgress option is broken now. -inine-call action is removed. It
will be reenabled in another form, perhaps as an indenpendant option.

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

14 years agoFix a tentative-parse error with unqualified template ids in cast expressions.
John McCall [Fri, 30 Apr 2010 03:11:01 +0000 (03:11 +0000)]
Fix a tentative-parse error with unqualified template ids in cast expressions.
Also resolve a long-working FIXME in the test case I modified.

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

14 years agoFix pasto in this test
Douglas Gregor [Fri, 30 Apr 2010 03:07:23 +0000 (03:07 +0000)]
Fix pasto in this test

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

14 years agoAdd Clang version inspection macros. Fixes PR6681.
Douglas Gregor [Fri, 30 Apr 2010 02:51:06 +0000 (02:51 +0000)]
Add Clang version inspection macros. Fixes PR6681.

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

14 years agoFix -fno-rtti -fexceptions by forcing the emission of (non-"builtin") RTTI
John McCall [Fri, 30 Apr 2010 01:15:21 +0000 (01:15 +0000)]
Fix -fno-rtti -fexceptions by forcing the emission of (non-"builtin") RTTI
when used by the exceptions routines.  Fixes PR 6974.

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

14 years agological ops, unary ops, pairwise ops
Nate Begeman [Fri, 30 Apr 2010 00:46:57 +0000 (00:46 +0000)]
logical ops, unary ops, pairwise ops

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

14 years agoTeach EHCleanupBlock to deal appropriately with the possibility that there
John McCall [Fri, 30 Apr 2010 00:06:43 +0000 (00:06 +0000)]
Teach EHCleanupBlock to deal appropriately with the possibility that there
might not have been an insertion block set at start.  Fixes PR6975.

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