]> granicus.if.org Git - clang/log
clang
13 years agoAdd a couple of helper methods in the SourceManager API, isAtStartOfMacroInstantiatio...
Argyrios Kyrtzidis [Sat, 28 May 2011 03:56:11 +0000 (03:56 +0000)]
Add a couple of helper methods in the SourceManager API, isAtStartOfMacroInstantiation/isAtEndOfMacroInstantiation
useful only for source locations that point at a macro token.

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

13 years agoClean up a C++0x/C++03 conditional check.
Douglas Gregor [Fri, 27 May 2011 23:15:17 +0000 (23:15 +0000)]
Clean up a C++0x/C++03 conditional check.

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

13 years agoAdd unnamed_addr to internal globals which are only used as an operand to memcpy...
Eli Friedman [Fri, 27 May 2011 22:32:55 +0000 (22:32 +0000)]
Add unnamed_addr to internal globals which are only used as an operand to memcpy. (Spotted by looking at IR.)

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

13 years agoMatch llvm-gcc's string literals alignment by forcing alignment on string literals...
Eli Friedman [Fri, 27 May 2011 22:13:20 +0000 (22:13 +0000)]
Match llvm-gcc's string literals alignment by forcing alignment on string literals to 1.  This can significantly impact the size of the string data, and as far as I know, the alignment doesn't help performance.  rdar://9078969 .

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

13 years agoBack out r132209; it's breaking nightly tests.
Eli Friedman [Fri, 27 May 2011 21:32:17 +0000 (21:32 +0000)]
Back out r132209; it's breaking nightly tests.

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

13 years agoClean up my changes to jump-diagnostic handling for local variables of
Douglas Gregor [Fri, 27 May 2011 21:28:00 +0000 (21:28 +0000)]
Clean up my changes to jump-diagnostic handling for local variables of
class type (or array thereof), eliminating some redundant checks
(thanks Eli!) and adding some tests where the behavior differs in
C++98/03 vs. C++0x.

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

13 years agoImplement a new, much improved version of the cleanup hack. We just need
John McCall [Fri, 27 May 2011 20:01:14 +0000 (20:01 +0000)]
Implement a new, much improved version of the cleanup hack.  We just need
to be careful to emit landing pads that are always prepared to handle a
cleanup path.  This is correct mostly because of the fix to the LLVM
inliner, r132200.

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

13 years agoAdd assertions to verify that we are not trying to instantiate a
Sean Hunt [Fri, 27 May 2011 20:00:14 +0000 (20:00 +0000)]
Add assertions to verify that we are not trying to instantiate a
nontemplate in Sema::InstantiateTemplateDecl.

This should make the issue in PR10026 more visible, although it's not
going to fix it because something is violating this precondition.

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

13 years agoUpdate the jump-scope checker for local variables with initializers,
Douglas Gregor [Fri, 27 May 2011 16:05:29 +0000 (16:05 +0000)]
Update the jump-scope checker for local variables with initializers,
so that it looks at the initializer of a local variable of class type
(or array thereof) to determine whether it's just an implicit
invocation of the trivial default constructor. Fixes PR10034.

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

13 years agoAdd an additional check for null pointer before accessing PatternDecl.
Richard Trieu [Fri, 27 May 2011 02:08:53 +0000 (02:08 +0000)]
Add an additional check for null pointer before accessing PatternDecl.

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

13 years agoEnhance Clang to start instantiating static data member definitions
Chandler Carruth [Fri, 27 May 2011 01:33:31 +0000 (01:33 +0000)]
Enhance Clang to start instantiating static data member definitions
within class templates when they are necessary to complete the type of
the member. The canonical example is code like:

  template <typename T> struct S {
    static const int arr[];
    static const int x;
    static int f();
  };

  template <typename T> const int S<T>::arr[] = { 1, 2, 3 };
  template <typename T> const int S<T>::x = sizeof(arr) / sizeof(arr[0]);
  template <typename T> int S<T>::f() { return x; }

  int x = S<int>::f();

We need to instantiate S<T>::arr's definition to pick up its initializer
and complete the array type. This involves new code to specially handle
completing the type of an expression where the type alone is
insufficient. It also requires *updating* the expression with the newly
completed type. Fortunately, all the other infrastructure is already in
Clang to do the instantiation, do the completion, and prune out the
unused bits of code that result from this instantiation.

This addresses the initial bug in PR10001, and will be a step to
fleshing out other cases where we need to work harder to complete an
expression's type. Who knew we still had missing C++03 "features"?

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

13 years agoObjective-C doesn't consider the use of incomplete types as method
Douglas Gregor [Fri, 27 May 2011 01:19:52 +0000 (01:19 +0000)]
Objective-C doesn't consider the use of incomplete types as method
parameter types to be ill-formed. However, it relies on the
completeness of method parameter types when producing metadata, e.g.,
for a protocol, leading IR generating to crash in such cases.

Since there's no real way to tighten down the semantics of Objective-C
here without breaking existing code, do something safe but lame:
suppress the generation of metadata when this happens.

Fixes <rdar://problem/9123036>.

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

13 years agoSilence sign compare warning.
Benjamin Kramer [Thu, 26 May 2011 21:32:30 +0000 (21:32 +0000)]
Silence sign compare warning.

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

13 years agoChange the include stack of "instantiated from" notes to fall under the control of...
Richard Trieu [Thu, 26 May 2011 20:49:16 +0000 (20:49 +0000)]
Change the include stack of "instantiated from" notes to fall under the control of f/fno-diagnostics-show-note-include-stack flags.  This should help with reducing diagnostic spew from macros instantiations.

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

13 years agoAdd a fix-it and better error recovery for improperly nested namespaces. This will...
Richard Trieu [Thu, 26 May 2011 20:11:09 +0000 (20:11 +0000)]
Add a fix-it and better error recovery for improperly nested namespaces.  This will give a better error message for cases such as "namespace foo::bar::baz {}" and a suggested fix-it of "namespace foo { namespace bar { namespace baz {} } }"

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

13 years agoTighen analyzer diagnostics w.r.t ObjC/CF leaks.
Ted Kremenek [Thu, 26 May 2011 18:45:44 +0000 (18:45 +0000)]
Tighen analyzer diagnostics w.r.t ObjC/CF leaks.

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

13 years agoExtract two more methods from the unary type trait checking. These
Chandler Carruth [Thu, 26 May 2011 08:53:16 +0000 (08:53 +0000)]
Extract two more methods from the unary type trait checking. These
provide re-usable forms of the rest of the custom validation done here.
Still no functionality changed here.

With this it should be possible to have an expression-centric code path
and a type-centric code path which don't duplicate logic.

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

13 years agoRemove a no longer relevant comment. It was just repeating the
Chandler Carruth [Thu, 26 May 2011 08:53:14 +0000 (08:53 +0000)]
Remove a no longer relevant comment. It was just repeating the
information in the previous comment which was preserved and moved with
the vec_step implementation code.

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

13 years agoExtract the vec_step trait operand checking to a stand alone function.
Chandler Carruth [Thu, 26 May 2011 08:53:12 +0000 (08:53 +0000)]
Extract the vec_step trait operand checking to a stand alone function.
It has little overlap with other traits' requirements, so the resulting
code is actually simpler.

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

13 years agoAdd a convenience interface for checking expression arguments to unary
Chandler Carruth [Thu, 26 May 2011 08:53:10 +0000 (08:53 +0000)]
Add a convenience interface for checking expression arguments to unary
traits which uses the information embedded in the expression. Use this
to simplify several interfaces which repeated information embedded in
the expression through explicit arguments. I added an assertion that the
only extra piece of data to come in from the parser matches what is
stored in the expression. No functionality change intended here.

Also cleaned up the doxygen comments for some of these methods and some
formatting oddities.

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

13 years agoImplement a new warning for when adding a default argument to a method
Sean Hunt [Thu, 26 May 2011 01:26:05 +0000 (01:26 +0000)]
Implement a new warning for when adding a default argument to a method
makes it into a special member function. This is very bad and can lead
to all sorts of nastiness including implicit member functions violating
the One Definition Rule. This should probably be made ill-formed in a
later version of the standard, but for now we'll just warn.

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

13 years agoSkip extra copy from aggregate where it isn't necessary; rdar://problem/8139919 ...
Eli Friedman [Thu, 26 May 2011 00:10:27 +0000 (00:10 +0000)]
Skip extra copy from aggregate where it isn't necessary; rdar://problem/8139919 .  This shouldn't make much of a difference at -O3, but should substantially reduce the number of generated memcpy's at -O0.

Originally r130717, but was backed out due to an ObjC regression.

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

13 years agostatic analyzer: when conservatively evaluating functions, don't invalidate the value...
Ted Kremenek [Wed, 25 May 2011 23:57:29 +0000 (23:57 +0000)]
static analyzer: when conservatively evaluating functions, don't invalidate the values of globals when the called function is strlen.

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

13 years agoUpdate our diagnostics to properly account for move operations.
Sean Hunt [Wed, 25 May 2011 23:16:36 +0000 (23:16 +0000)]
Update our diagnostics to properly account for move operations.

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

13 years agoFix a minor thinko that leads to a crash if PatternDecl is null but
Sean Hunt [Wed, 25 May 2011 22:02:25 +0000 (22:02 +0000)]
Fix a minor thinko that leads to a crash if PatternDecl is null but
Pattern is not. Thanks Nick for catching this!

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

13 years agoImplement a little bit of cleanup and a lot more of the base work
Sean Hunt [Wed, 25 May 2011 20:50:04 +0000 (20:50 +0000)]
Implement a little bit of cleanup and a lot more of the base work
behind implicit moves. We now correctly identify move constructors and
assignment operators and update bits on the record correctly. Generation
of implicit moves (declarations or definitions) is not yet supported.

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

13 years agoRemove bitcast to incorrect type.
David Chisnall [Wed, 25 May 2011 20:33:17 +0000 (20:33 +0000)]
Remove bitcast to incorrect type.

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

13 years agoProperly align UnaryTransformType when allocating it
Douglas Gregor [Wed, 25 May 2011 17:51:54 +0000 (17:51 +0000)]
Properly align UnaryTransformType when allocating it

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

13 years agoUpdate checker build to checker-257.
Ted Kremenek [Wed, 25 May 2011 16:30:14 +0000 (16:30 +0000)]
Update checker build to checker-257.

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

13 years agoDisable MSVC warning about runtime stack overflow for DebugOverflowStack.
Francois Pichet [Wed, 25 May 2011 16:15:03 +0000 (16:15 +0000)]
Disable MSVC warning about runtime stack overflow for DebugOverflowStack.

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

13 years agoFix MSVC warning: <unsafe use of type 'bool' in operation>
Francois Pichet [Wed, 25 May 2011 16:07:10 +0000 (16:07 +0000)]
Fix MSVC warning: <unsafe use of type 'bool' in operation>

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

13 years agoAdd support for Microsoft __if_exists, __if_not_exists extension at class scope.
Francois Pichet [Wed, 25 May 2011 10:19:49 +0000 (10:19 +0000)]
Add support for Microsoft __if_exists, __if_not_exists extension at class scope.

Example:

typedef int TYPE;
class C {
  __if_exists(TYPE) {
     TYPE a;
  }
  __if_not_exists(TYPE) {
     this will never be parsed.
  }
};

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

13 years agoTeach analyzer about cf_returns_not_retained for C functions.
Ted Kremenek [Wed, 25 May 2011 06:29:39 +0000 (06:29 +0000)]
Teach analyzer about cf_returns_not_retained for C functions.

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

13 years agoEnhance retain/release checker to flag warnings when functions returning CG types...
Ted Kremenek [Wed, 25 May 2011 06:19:45 +0000 (06:19 +0000)]
Enhance retain/release checker to flag warnings when functions returning CG types do not follow the Core Foundation naming conventions.

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

13 years agoA StringRef-ication of the DiagnosticIDs API and internals.
Argyrios Kyrtzidis [Wed, 25 May 2011 05:05:01 +0000 (05:05 +0000)]
A StringRef-ication of the DiagnosticIDs API and internals.

Patch by Matthieu Monrocq with tweaks by me to avoid StringRefs in the static
diagnostic data structures, which resulted in a huge global-var-init function.

Depends on llvm commit r132046.

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

13 years agoUpdate for llvm api change.
Rafael Espindola [Wed, 25 May 2011 03:44:55 +0000 (03:44 +0000)]
Update for llvm api change.

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

13 years agoDriver: Don't warn about unused PIE arguments.
Daniel Dunbar [Tue, 24 May 2011 23:05:49 +0000 (23:05 +0000)]
Driver: Don't warn about unused PIE arguments.

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

13 years agoImplement a new type node, UnaryTransformType, designed to represent a
Sean Hunt [Tue, 24 May 2011 22:41:36 +0000 (22:41 +0000)]
Implement a new type node, UnaryTransformType, designed to represent a
type that turns one type into another. This is used as the basis to
implement __underlying_type properly - with TypeSourceInfo and proper
behavior in the face of templates.

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

13 years agoFix Darwin test for r132006.
Nick Lewycky [Tue, 24 May 2011 22:18:08 +0000 (22:18 +0000)]
Fix Darwin test for r132006.

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

13 years agoWhen given one of the applicable coverage flags, try to link against
Nick Lewycky [Tue, 24 May 2011 21:54:59 +0000 (21:54 +0000)]
When given one of the applicable coverage flags, try to link against
libprofile_rt.a. On Darwin, don't try to link -lgcov.

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

13 years agoAdd explicit CFG support for ignoring static_asserts.
Ted Kremenek [Tue, 24 May 2011 20:41:31 +0000 (20:41 +0000)]
Add explicit CFG support for ignoring static_asserts.

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

13 years agoLet amd64 be used in target triple instead of x86_64 on FreeBSD.
Roman Divacky [Tue, 24 May 2011 19:54:09 +0000 (19:54 +0000)]
Let amd64 be used in target triple instead of x86_64 on FreeBSD.

Patch by Dimitry Andric!

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

13 years agoAdd new warning that warns when invoking 'delete' on a polymorphic, non-final, class...
Argyrios Kyrtzidis [Tue, 24 May 2011 19:53:26 +0000 (19:53 +0000)]
Add new warning that warns when invoking 'delete' on a polymorphic, non-final, class without a virtual destructor.

Patch by Matthieu Monrocq!

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

13 years agoImplement the initial part of C++0x [expr.const]p2, which specifies
Douglas Gregor [Tue, 24 May 2011 16:02:01 +0000 (16:02 +0000)]
Implement the initial part of C++0x [expr.const]p2, which specifies
that the unevaluated subexpressions of &&, ||, and ? : are not
considered when determining whether the expression is a constant
expression. Also, turn the "used in its own initializer" warning into
a runtime-behavior warning, so that it doesn't fire when a variable is
used as part of an unevaluated subexpression of its own initializer.

Fixes PR9999.

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

13 years agoFor non-Darwin, a plain 'char' type is unsigned.
Jim Grosbach [Tue, 24 May 2011 15:40:46 +0000 (15:40 +0000)]
For non-Darwin, a plain 'char' type is unsigned.

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

13 years agoFix a bug in the most recent openSUSE support patch.
Chandler Carruth [Tue, 24 May 2011 07:51:17 +0000 (07:51 +0000)]
Fix a bug in the most recent openSUSE support patch.

This patch also by Ismail Donmez.

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

13 years agoFix a bug in -Wundefined-reinterpret-cast where we failed to look
Chandler Carruth [Tue, 24 May 2011 07:43:19 +0000 (07:43 +0000)]
Fix a bug in -Wundefined-reinterpret-cast where we failed to look
through sugared types when testing for TagTypes. This was the actual
cause of the only false positive in Clang+LLVM.

Next evaluation will be over a much larger selection of code including
large amounts of open source code.

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

13 years agoMake it possible for external tools to distinguish between paths that come from ...
Nico Weber [Tue, 24 May 2011 04:31:14 +0000 (04:31 +0000)]
Make it possible for external tools to distinguish between paths that come from -I and paths that come from -system. Patch from Paul Holden!

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

13 years agoMSVC doesn't do any validation regarding exception specification.
Francois Pichet [Tue, 24 May 2011 02:11:43 +0000 (02:11 +0000)]
MSVC doesn't do any validation regarding exception specification.

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

13 years agoTest case for r131940.
Devang Patel [Tue, 24 May 2011 00:22:40 +0000 (00:22 +0000)]
Test case for r131940.

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

13 years agoDelete the extraneous return statement that was causing my earlier
Sean Hunt [Mon, 23 May 2011 23:56:01 +0000 (23:56 +0000)]
Delete the extraneous return statement that was causing my earlier
issues and also add a test.

We should now handle defaulted members of templates properly. No
comment as to whether or not this also holds for templated functions,
but defaulting those is kind of insane.

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

13 years agoFix bug introduced with r131930.
David Chisnall [Mon, 23 May 2011 23:15:11 +0000 (23:15 +0000)]
Fix bug introduced with r131930.

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

13 years agoImplement explicit specialization of explicitly-defaulted constructors.
Sean Hunt [Mon, 23 May 2011 23:14:04 +0000 (23:14 +0000)]
Implement explicit specialization of explicitly-defaulted constructors.
The general out-of-line case (including explicit instantiation mostly
works except that the definition is being lost somewhere between the AST
and CodeGen, so the definition is never emitted.

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

13 years agoDon't omit retain / release / autorelease message sends in hybrid GC mode.
David Chisnall [Mon, 23 May 2011 23:13:25 +0000 (23:13 +0000)]
Don't omit retain / release / autorelease message sends in hybrid GC mode.

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

13 years agoFix some problems where functions must be bitcast but we're expecting a llvm::Functio...
David Chisnall [Mon, 23 May 2011 22:33:28 +0000 (22:33 +0000)]
Fix some problems where functions must be bitcast but we're expecting a llvm::Function of the right type.

PR9994.

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

13 years agoCorrectly propagate defaultedness across template instantiation. This
Sean Hunt [Mon, 23 May 2011 21:07:59 +0000 (21:07 +0000)]
Correctly propagate defaultedness across template instantiation. This
fixes PR9965, but we're not out of the water yet, as we do not
successfully handle out-of-line definitions, due to my utter
misunderstanding of how we manage templates.

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

13 years agoFix examples compile break due to rewrite of isa.
Manuel Klimek [Mon, 23 May 2011 18:25:41 +0000 (18:25 +0000)]
Fix examples compile break due to rewrite of isa.

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

13 years agoEmulate a MSVC bug where if during an using declaration name lookup, the declaration...
Francois Pichet [Mon, 23 May 2011 03:43:44 +0000 (03:43 +0000)]
Emulate a MSVC bug where if during an using declaration name lookup, the declaration found is unaccessible (private) and that declaration was bring into scope via another using declaration whose target declaration is accessible (public) then no error is generated.

Example:
class A { public: int f();  };
class B : public A { private: using A::f; };
class C : public B { private: using B::f; };

Here, B::f is private so this should fail in Standard C++, but because B::f refers to A::f which is public MSVC accepts it.

This fixes 1 error when parsing MFC code with clang.

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

13 years agoattempt to fix windows testers, which generate #line by default.
Chris Lattner [Sun, 22 May 2011 23:47:57 +0000 (23:47 +0000)]
attempt to fix windows testers, which generate #line by default.

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

13 years agomake the x86-32 backend specify a byval alignment, even when the
Chris Lattner [Sun, 22 May 2011 23:35:00 +0000 (23:35 +0000)]
make the x86-32 backend specify a byval alignment, even when the
code generator will do it.  With this patch, clang compiles the example
in PR9794 to not have an alloca temporary.

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

13 years agoFix x86-64 byval passing to specify the alignment even when the code
Chris Lattner [Sun, 22 May 2011 23:21:23 +0000 (23:21 +0000)]
Fix x86-64 byval passing to specify the alignment even when the code
generator will give it something sufficient.  This is important because
the mid-level optimizer doesn't know what alignment is required otherwise.

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

13 years agoProvide the runtime with information about the GC compile options (GNU runtimes)
David Chisnall [Sun, 22 May 2011 22:37:08 +0000 (22:37 +0000)]
Provide the runtime with information about the GC compile options (GNU runtimes)

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

13 years agoInvoke the FileChanged callback before pushing the linemarker for a system
Chris Lattner [Sun, 22 May 2011 22:10:16 +0000 (22:10 +0000)]
Invoke the FileChanged callback before pushing the linemarker for a system
header.  Getting it in the wrong order generated incorrect line markers in -E
mode.  In the testcase from PR9861 we used to generate:

# 1 "test.c" 2
# 1 "./foobar.h" 1
# 0 "./foobar.h"
# 0 "./foobar.h" 3
# 2 "test.c" 2

now we properly produce:

# 1 "test.c" 2
# 1 "./foobar.h" 1
# 1 "./foobar.h" 3
# 2 "test.c" 2

This fixes PR9861.

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

13 years agofix 80 col violation
Chris Lattner [Sun, 22 May 2011 22:09:06 +0000 (22:09 +0000)]
fix 80 col violation

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

13 years agoadd opensuse toolchain support, patch by Ismail Donmez!
Chris Lattner [Sun, 22 May 2011 16:45:07 +0000 (16:45 +0000)]
add opensuse toolchain support, patch by Ismail Donmez!

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

13 years agoChange the default for supporting ObjC GC to true. This shouldn't really be in ToolC...
David Chisnall [Sun, 22 May 2011 16:26:21 +0000 (16:26 +0000)]
Change the default for supporting ObjC GC to true.  This shouldn't really be in ToolChain at all, since it's a property of the objc runtime library.

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

13 years agoFix fallout from r131838.
Nick Lewycky [Sun, 22 May 2011 06:50:05 +0000 (06:50 +0000)]
Fix fallout from r131838.

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

13 years agoAdd Redhat Enterprise Linux to the Linux toolchain, PR9769,
Chris Lattner [Sun, 22 May 2011 05:36:06 +0000 (05:36 +0000)]
Add Redhat Enterprise Linux to the Linux toolchain, PR9769,
patch by Bryce Lelbach

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

13 years agoAdd an assertion to tell us when we're going off the deep end trying
Douglas Gregor [Sun, 22 May 2011 00:21:10 +0000 (00:21 +0000)]
Add an assertion to tell us when we're going off the deep end trying
to determine outer template arguments lists for template
parameters. This is actually the problem behind PR9643, which I have
yet to figure out how to fix.

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

13 years agoadjust to mainline api change.
Chris Lattner [Sat, 21 May 2011 23:50:44 +0000 (23:50 +0000)]
adjust to mainline api change.

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

13 years agoAudit and finish the implementation of C++0x nullptr, fixing two
Douglas Gregor [Sat, 21 May 2011 23:15:46 +0000 (23:15 +0000)]
Audit and finish the implementation of C++0x nullptr, fixing two
minor issues along the way:
  - Non-type template parameters of type 'std::nullptr_t' were not
  permitted.
  - We didn't properly introduce built-in operators for nullptr ==,
  !=, <, <=, >=, or > as candidate functions .

To my knowledge, there's only one (minor but annoying) part of nullptr
that hasn't been implemented: catching a thrown 'nullptr' as a pointer
or pointer-to-member, per C++0x [except.handle]p4.

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

13 years agoIt's considered poor form to create references to the overloaded
Douglas Gregor [Sat, 21 May 2011 22:16:50 +0000 (22:16 +0000)]
It's considered poor form to create references to the overloaded
function type. Educate template argument deduction thusly, fixing
PR9974 / <rdar://problem/9479155>.

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

13 years agoClassify bound member function types are member function types. Fixes
Douglas Gregor [Sat, 21 May 2011 21:04:55 +0000 (21:04 +0000)]
Classify bound member function types are member function types. Fixes
PR9973 / <rdar://problem/9479191>.

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

13 years agoswitch clang off StandardPasses.h onto PassManagerBuilder.h
Chris Lattner [Sat, 21 May 2011 20:40:11 +0000 (20:40 +0000)]
switch clang off StandardPasses.h onto PassManagerBuilder.h

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

13 years agoFix our handling of the warning when one tries to pass a
Douglas Gregor [Sat, 21 May 2011 19:26:31 +0000 (19:26 +0000)]
Fix our handling of the warning when one tries to pass a
non-POD/non-trivial object throuugh a C-style varargs. The warning
itself was default-mapped to error, but can be downgraded, but we were
treating it in Sema like a hard error, silently dropping the call.

Instead, treat this problem like a warning, and do what the warning
says we do: abort at runtime. To do so, we fake up a __builtin_trap()
expression that gets evaluated as part of the argument.

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

13 years agoFix the clang part of PR7952: rewrite the specialization of isa<> in DeclBase,
Eli Friedman [Sat, 21 May 2011 19:15:39 +0000 (19:15 +0000)]
Fix the clang part of PR7952: rewrite the specialization of isa<> in DeclBase,
and stop abusing the multi-level dereference isa<> used to allow.

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

13 years agoDiagnose the presence of storage-class-specifiers on explicit
Douglas Gregor [Sat, 21 May 2011 18:53:30 +0000 (18:53 +0000)]
Diagnose the presence of storage-class-specifiers on explicit
instantiations and specializations. Fixes <rdar://problem/9126453> and PR8700.

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

13 years agoTeach Sema::ActOnUninitializedDecl() not to try to interpret when one
Douglas Gregor [Sat, 21 May 2011 17:52:48 +0000 (17:52 +0000)]
Teach Sema::ActOnUninitializedDecl() not to try to interpret when one
should use a constructor to default-initialize a
variable. InitializationSequence knows the rules for default
initialization, better. Fixes <rdar://problem/8501008>.

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

13 years agoIntroduce the -fdiagnostics-format=xxx option to control how Clang
Douglas Gregor [Sat, 21 May 2011 17:07:29 +0000 (17:07 +0000)]
Introduce the -fdiagnostics-format=xxx option to control how Clang
prints the file, line, and column of a diagnostic. We currently
support Clang's normal format, MSVC, and Vi formats.

Note that we no longer change the diagnostic format based on
-fms-extensions.

Patch by Andrew Fish!

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

13 years agoA few more is(Un)signedIntegerType/is(Un)signedOrEnumerationType cleanups.
Douglas Gregor [Sat, 21 May 2011 16:28:01 +0000 (16:28 +0000)]
A few more is(Un)signedIntegerType/is(Un)signedOrEnumerationType cleanups.

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

13 years agoImplement C++0x semantics for passing non-POD classes through varargs.
Douglas Gregor [Sat, 21 May 2011 16:27:21 +0000 (16:27 +0000)]
Implement C++0x semantics for passing non-POD classes through varargs.

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

13 years agoOnly ignore extra tokens after #else if we skip it, otherwise warn. Fixes rdar:/...
Argyrios Kyrtzidis [Sat, 21 May 2011 04:26:04 +0000 (04:26 +0000)]
Only ignore extra tokens after #else if we skip it, otherwise warn. Fixes rdar://9475098.

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

13 years agoFix regression in static analyzer's handling of prefix '--' operator. It was being...
Ted Kremenek [Fri, 20 May 2011 23:40:06 +0000 (23:40 +0000)]
Fix regression in static analyzer's handling of prefix '--' operator.  It was being treated as postfix '--' in C mode.

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

13 years agoAdd a missing case for default constructor deletion.
Sean Hunt [Fri, 20 May 2011 21:43:47 +0000 (21:43 +0000)]
Add a missing case for default constructor deletion.

This case is tested by the fact that the modified test produces
significatly worse diagnostics. That's on the list.

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

13 years agoIntroduce XFAILed test for braced initializer lists.
Sebastian Redl [Fri, 20 May 2011 21:07:01 +0000 (21:07 +0000)]
Introduce XFAILed test for braced initializer lists.

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

13 years agoIntroduce Type::isSignedIntegerOrEnumerationType() and
Douglas Gregor [Fri, 20 May 2011 16:38:50 +0000 (16:38 +0000)]
Introduce Type::isSignedIntegerOrEnumerationType() and
Type::isUnsignedIntegerOrEnumerationType(), which are like
Type::isSignedIntegerType() and Type::isUnsignedIntegerType() but also
consider the underlying type of a C++0x scoped enumeration type.

Audited all callers to the existing functions, switching those that
need to also handle scoped enumeration types (e.g., those that deal
with constant values) over to the new functions. Fixes PR9923 /
<rdar://problem/9447851>.

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

13 years agoCMake: add support for CLANG_VENDOR. PR9966.
Oscar Fuentes [Fri, 20 May 2011 15:57:59 +0000 (15:57 +0000)]
CMake: add support for CLANG_VENDOR. PR9966.

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

13 years agoDowngrade the error about re-opening an inline namespace as non-inline
Douglas Gregor [Fri, 20 May 2011 15:48:31 +0000 (15:48 +0000)]
Downgrade the error about re-opening an inline namespace as non-inline
to a warning, since apparently libstdc++'s debug mode does this (and
we can recover safely). Add a Fix-It to insert the "inline", just for kicks.

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

13 years agoDiagnose unexpanded parameter packs in return statements. This
Douglas Gregor [Fri, 20 May 2011 15:32:55 +0000 (15:32 +0000)]
Diagnose unexpanded parameter packs in return statements. This
manifested in a crash with blocks in PR9953, but it was a ticking time
bomb for normal functions, too. Fixes PR9953.

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

13 years agosandybridge is now called corei7-avx
Benjamin Kramer [Fri, 20 May 2011 15:11:23 +0000 (15:11 +0000)]
sandybridge is now called corei7-avx

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

13 years agoRemove the clang-test-XXX targets from the CMake builds; they really aren't useful
Douglas Gregor [Fri, 20 May 2011 15:01:17 +0000 (15:01 +0000)]
Remove the clang-test-XXX targets from the CMake builds; they really aren't useful

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

13 years agoClean up two comments
Douglas Gregor [Fri, 20 May 2011 15:00:53 +0000 (15:00 +0000)]
Clean up two comments

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

13 years agoFix PR9941 for out-of-line template destructors too.
Sebastian Redl [Fri, 20 May 2011 05:57:18 +0000 (05:57 +0000)]
Fix PR9941 for out-of-line template destructors too.

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

13 years agoUndo enough of r131143 to make private copy ctor diags say "copy constructor" again
Matt Beaumont-Gay [Thu, 19 May 2011 23:44:42 +0000 (23:44 +0000)]
Undo enough of r131143 to make private copy ctor diags say "copy constructor" again

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

13 years agoTeach RegionStore not to symbolic array values whose indices it cannot reason about.
Ted Kremenek [Thu, 19 May 2011 23:37:58 +0000 (23:37 +0000)]
Teach RegionStore not to symbolic array values whose indices it cannot reason about.

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

13 years agoFix location of setter/getter synthesized for a property.
Devang Patel [Thu, 19 May 2011 23:37:41 +0000 (23:37 +0000)]
Fix location of setter/getter synthesized for a property.

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

13 years agoRevert r131672 until __underlying_type is properly implemented in the
Sean Hunt [Thu, 19 May 2011 22:52:25 +0000 (22:52 +0000)]
Revert r131672 until __underlying_type is properly implemented in the
template case.

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

13 years agoFix test on Windows.
Eli Friedman [Thu, 19 May 2011 22:39:47 +0000 (22:39 +0000)]
Fix test on Windows.

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

13 years agoImplement a __has_feature for __underlying_type
Sean Hunt [Thu, 19 May 2011 20:48:13 +0000 (20:48 +0000)]
Implement a __has_feature for __underlying_type

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

13 years agoCorrection for r131662, the GNU as option is --fatal-warnings.
Joerg Sonnenberger [Thu, 19 May 2011 20:46:39 +0000 (20:46 +0000)]
Correction for r131662, the GNU as option is --fatal-warnings.

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