]> granicus.if.org Git - clang/log
clang
14 years agoTweak test so that it does not require <typeinfo>
Douglas Gregor [Fri, 14 May 2010 21:50:50 +0000 (21:50 +0000)]
Tweak test so that it does not require <typeinfo>

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

14 years agoPatch to fix a crash on incomplete class declaration.
Fariborz Jahanian [Fri, 14 May 2010 21:35:02 +0000 (21:35 +0000)]
Patch to fix a crash on incomplete class declaration.
Radar 7923673.

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

14 years agoEmit an lvalue dynamic_cast even if the result is not used. Another
Douglas Gregor [Fri, 14 May 2010 21:31:02 +0000 (21:31 +0000)]
Emit an lvalue dynamic_cast even if the result is not used. Another
part (or possibly all) of PR7132.

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

14 years agoAdd CXType and an initial set of supporting functions to libclang. This exposes...
Ted Kremenek [Fri, 14 May 2010 21:29:26 +0000 (21:29 +0000)]
Add CXType and an initial set of supporting functions to libclang.  This exposes details of
Clang's representation of the C type system to clients.  It is nowhere near complete, and will
be expanded on demand.

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

14 years agoWhen a failed dynamic_cast<T&> (which is an lvalue) results in a
Douglas Gregor [Fri, 14 May 2010 21:14:41 +0000 (21:14 +0000)]
When a failed dynamic_cast<T&> (which is an lvalue) results in a
throw, it should use invoke when needed. The fixes the
Boost.Statechrt failures that motivated PR7132, but there are a few
side issues to tackle as well.

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

14 years agoRemove an unused function.
Anders Carlsson [Fri, 14 May 2010 19:48:27 +0000 (19:48 +0000)]
Remove an unused function.

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

14 years agoMove ContainsPointerToDataMember to CodeGenTypes. No functionality change.
Anders Carlsson [Fri, 14 May 2010 19:41:56 +0000 (19:41 +0000)]
Move ContainsPointerToDataMember to CodeGenTypes. No functionality change.

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

14 years agoImplement new default property synthesis rules. Essentially, no longer
Fariborz Jahanian [Fri, 14 May 2010 18:35:57 +0000 (18:35 +0000)]
Implement new default property synthesis rules. Essentially, no longer
user directive is needed to force a property implementation.
It is decided based on those propeties which are declared in
the class (or in its protocols) but not those which must be
default implemented by one of its super classes. Implements radar 7923851.

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

14 years agoAdd documention on ns_returns_not_retained and cf_returns_not_retained attributes.
Ted Kremenek [Fri, 14 May 2010 18:13:43 +0000 (18:13 +0000)]
Add documention on ns_returns_not_retained and cf_returns_not_retained attributes.

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

14 years agoImprove error recovery in C/ObjC when the first argument of a function
Chris Lattner [Fri, 14 May 2010 17:44:56 +0000 (17:44 +0000)]
Improve error recovery in C/ObjC when the first argument of a function
declarator is incorrect.  Not being a typename causes the parser to
dive down into the K&R identifier list handling stuff, which is almost
never the right thing to do.

Before:

r.c:3:17: error: expected ')'
void bar(intptr y);
                ^
r.c:3:9: note: to match this '('
void bar(intptr y);
        ^
r.c:3:10: error: a parameter list without types is only allowed in a function definition
void bar(intptr y);
         ^

After:

r.c:3:10: error: unknown type name 'intptr'; did you mean 'intptr_t'?
void bar(intptr y);
         ^~~~~~
         intptr_t
r.c:1:13: note: 'intptr_t' declared here
typedef int intptr_t;
            ^

This fixes rdar://7980651 - poor recovery for bad type in the first arg of a C function

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

14 years agofit in 80 cols, remove prototypes for handling #assert since apparently noone cares.
Chris Lattner [Fri, 14 May 2010 17:35:07 +0000 (17:35 +0000)]
fit in 80 cols, remove prototypes for handling #assert since apparently noone cares.

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

14 years agoRefactor ParseFunctionDeclaratorIdentifierList to have the first
Chris Lattner [Fri, 14 May 2010 17:23:36 +0000 (17:23 +0000)]
Refactor ParseFunctionDeclaratorIdentifierList to have the first
identifier in the identifier list consumed before it is called.
No functionality change.

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

14 years agoAdded Expr::EvaluateAsAnyLValue.
Abramo Bagnara [Fri, 14 May 2010 17:07:14 +0000 (17:07 +0000)]
Added Expr::EvaluateAsAnyLValue.

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

14 years agoFix thinko in yesterday's fix.
Devang Patel [Fri, 14 May 2010 16:55:25 +0000 (16:55 +0000)]
Fix thinko in yesterday's fix.
Providing linkage name for function static variable confuses gdb, so don't do that.

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

14 years agoRevert r103770, "Added basic source locations to Elaborated and DependentName
Daniel Dunbar [Fri, 14 May 2010 16:34:09 +0000 (16:34 +0000)]
Revert r103770, "Added basic source locations to Elaborated and DependentName
types.", it is breaking Clang bootstrap.

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

14 years agoMake sure that value-initialized pointers to data members are initialized correctly.
Anders Carlsson [Fri, 14 May 2010 15:05:19 +0000 (15:05 +0000)]
Make sure that value-initialized pointers to data members are initialized correctly.

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

14 years agoAdded basic source locations to Elaborated and DependentName types.
Abramo Bagnara [Fri, 14 May 2010 14:14:23 +0000 (14:14 +0000)]
Added basic source locations to Elaborated and DependentName types.

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

14 years agoNamespaces can only be defined at global or namespace scope. Fixes PR6596.
Douglas Gregor [Fri, 14 May 2010 05:08:22 +0000 (05:08 +0000)]
Namespaces can only be defined at global or namespace scope. Fixes PR6596.

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

14 years agoMake sure to search semantic scopes and appropriate template-parameter
Douglas Gregor [Fri, 14 May 2010 04:53:42 +0000 (04:53 +0000)]
Make sure to search semantic scopes and appropriate template-parameter
scopes during unqualified name lookup that has fallen out to namespace
scope. Fixes PR7133.

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

14 years agoA vtable is used if the key function is defined... even if that key
Douglas Gregor [Fri, 14 May 2010 04:08:48 +0000 (04:08 +0000)]
A vtable is used if the key function is defined... even if that key
function's definition is an out-of-class definition marked
"inline". Fixes an assertion in WebKit.

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

14 years agoXFAIL a test on Win32.
Daniel Dunbar [Fri, 14 May 2010 03:54:53 +0000 (03:54 +0000)]
XFAIL a test on Win32.

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

14 years agoC++/Darwin/x86: Teach IRgen it can pass reference types in registers.
Daniel Dunbar [Fri, 14 May 2010 03:40:53 +0000 (03:40 +0000)]
C++/Darwin/x86: Teach IRgen it can pass reference types in registers.

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

14 years agoDriver: Enable -integrated-as by default, at least for Darwin/x86 without -static.
Daniel Dunbar [Fri, 14 May 2010 02:03:00 +0000 (02:03 +0000)]
Driver: Enable -integrated-as by default, at least for Darwin/x86 without -static.
 - How else will we figure out what is broken, eh?

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

14 years agoForce -no-integrated-as in this test.
Daniel Dunbar [Fri, 14 May 2010 02:02:13 +0000 (02:02 +0000)]
Force -no-integrated-as in this test.

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

14 years agoFix context in class static variable's debugging information entry.
Devang Patel [Thu, 13 May 2010 23:52:37 +0000 (23:52 +0000)]
Fix context in class static variable's debugging information entry.
This fixes bunch of failures in gdb testsuite.

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

14 years agoDisable the available_externally optimization for inline virtual
Douglas Gregor [Thu, 13 May 2010 21:36:56 +0000 (21:36 +0000)]
Disable the available_externally optimization for inline virtual
methods for which the key function is guaranteed to be in another
translation unit. Unfortunately, this guarantee isn't the case when
dealing with shared libraries that fail to export these virtual method
definitions.

I'm reopening PR6747 so we can consider this again at a later point in
time.

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

14 years agoObjective-C++ Sema. Fix a bug in instantiation of receivers.
Fariborz Jahanian [Thu, 13 May 2010 17:19:25 +0000 (17:19 +0000)]
Objective-C++ Sema. Fix a bug in instantiation of receivers.
Completes radar 7963410.

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

14 years agoRework when and how vtables are emitted, by tracking where vtables are
Douglas Gregor [Thu, 13 May 2010 16:44:06 +0000 (16:44 +0000)]
Rework when and how vtables are emitted, by tracking where vtables are
"used" (e.g., we will refer to the vtable in the generated code) and
when they are defined (i.e., because we've seen the key function
definition). Previously, we were effectively tracking "potential
definitions" rather than uses, so we were a bit too eager about emitting
vtables for classes without key functions.

The new scheme:
  - For every use of a vtable, Sema calls MarkVTableUsed() to indicate
  the use. For example, this occurs when calling a virtual member
  function of the class, defining a constructor of that class type,
  dynamic_cast'ing from that type to a derived class, casting
  to/through a virtual base class, etc.
  - For every definition of a vtable, Sema calls MarkVTableUsed() to
  indicate the definition. This happens at the end of the translation
  unit for classes whose key function has been defined (so we can
  delay computation of the key function; see PR6564), and will also
  occur with explicit template instantiation definitions.
 - For every vtable defined/used, we mark all of the virtual member
 functions of that vtable as defined/used, unless we know that the key
 function is in another translation unit. This instantiates virtual
 member functions when needed.
  - At the end of the translation unit, Sema tells CodeGen (via the
  ASTConsumer) which vtables must be defined (CodeGen will define
  them) and which may be used (for which CodeGen will define the
  vtables lazily).

From a language perspective, both the old and the new schemes are
permissible: we're allowed to instantiate virtual member functions
whenever we want per the standard. However, all other C++ compilers
were more lazy than we were, and our eagerness was both a performance
issue (we instantiated too much) and a portability problem (we broke
Boost test cases, which now pass).

Notes:
  (1) There's a ton of churn in the tests, because the order in which
  vtables get emitted to IR has changed. I've tried to isolate some of
  the larger tests from these issues.
  (2) Some diagnostics related to
  implicitly-instantiated/implicitly-defined virtual member functions
  have moved to the point of first use/definition. It's better this
  way.
  (3) I could use a review of the places where we MarkVTableUsed, to
  see if I missed any place where the language effectively requires a
  vtable.

Fixes PR7114 and PR6564.

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

14 years agoDon't add a null successor to a CFGBlock when the contents of an @synchronized statem...
Ted Kremenek [Thu, 13 May 2010 16:38:08 +0000 (16:38 +0000)]
Don't add a null successor to a CFGBlock when the contents of an @synchronized statement is empty.
Fixes <rdar://problem/7979430>.

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

14 years agoFold assertion into condition, as it does not hold all the time.
Ted Kremenek [Thu, 13 May 2010 15:38:38 +0000 (15:38 +0000)]
Fold assertion into condition, as it does not hold all the time.

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

14 years agoTestcase for r103712.
Chandler Carruth [Thu, 13 May 2010 12:04:17 +0000 (12:04 +0000)]
Testcase for r103712.

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

14 years agoTeach the AKA calculation to look at sugar on the pointee type for pointers and
Chandler Carruth [Thu, 13 May 2010 11:37:24 +0000 (11:37 +0000)]
Teach the AKA calculation to look at sugar on the pointee type for pointers and
references. This is a WIP as we should handle function pointers, etc. Reshuffle
the code to do this to facilitate recursing in this manner, and to check for
the type already being printed first rather than last.

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

14 years agoRebuild builtin_id * as an ObjCObjectPointerType, where builtin_id is the
John McCall [Thu, 13 May 2010 08:39:13 +0000 (08:39 +0000)]
Rebuild builtin_id * as an ObjCObjectPointerType, where builtin_id is the
magic type that 'id' is a pointer to.

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

14 years agoRelax an assertion. Various cases could lead to non-symbol values.
Zhongxing Xu [Thu, 13 May 2010 08:26:32 +0000 (08:26 +0000)]
Relax an assertion. Various cases could lead to non-symbol values.

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

14 years agoWhen performing template argument deduction, match Objective C pointers
John McCall [Thu, 13 May 2010 07:48:05 +0000 (07:48 +0000)]
When performing template argument deduction, match Objective C pointers
against pointer patterns.

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

14 years agoDelete a dead function at sabre's request.
Chandler Carruth [Thu, 13 May 2010 07:47:58 +0000 (07:47 +0000)]
Delete a dead function at sabre's request.

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

14 years agoUpdate the types for warning option subgroup arrays to 'short', we have more
Chandler Carruth [Thu, 13 May 2010 07:43:05 +0000 (07:43 +0000)]
Update the types for warning option subgroup arrays to 'short', we have more
than 127 groups so this was already failing given -fsigned-char. A subsequent
to commit to TableGen will generate shorts for the arrays themselves.

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

14 years agoAdd test case for <rdar://problem/7880658>.
Ted Kremenek [Thu, 13 May 2010 06:58:45 +0000 (06:58 +0000)]
Add test case for <rdar://problem/7880658>.

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

14 years agoRemove stale comment.
Ted Kremenek [Thu, 13 May 2010 03:40:51 +0000 (03:40 +0000)]
Remove stale comment.

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

14 years agoadd a couple of key functions for classes without them.
Chris Lattner [Thu, 13 May 2010 01:02:19 +0000 (01:02 +0000)]
add a couple of key functions for classes without them.

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

14 years agoSpecially handle CaseStmts in CursorVisitor because they can be nested and walking...
Ted Kremenek [Thu, 13 May 2010 00:25:00 +0000 (00:25 +0000)]
Specially handle CaseStmts in CursorVisitor because they can be nested and walking them
can blow out the stack.

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

14 years agoIf given location is invalid then use current location.
Devang Patel [Wed, 12 May 2010 23:46:38 +0000 (23:46 +0000)]
If given location is invalid then use current location.
This fixes recent regressions reported by gdb testsuite.
Tighter verification of debug info generated by FE found these regressions.

Refactor code to extract line number and column number from SourceLocation.

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

14 years agoObjective-C++ Sema. Support for conversion of a C++
Fariborz Jahanian [Wed, 12 May 2010 23:29:11 +0000 (23:29 +0000)]
Objective-C++ Sema. Support for conversion of a C++
class object used as a receiver to an objective-c
pointer via a converwsion function. wip.

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

14 years ago"this patch properly addresses escaping < and > which might appear
Chris Lattner [Wed, 12 May 2010 23:27:11 +0000 (23:27 +0000)]
"this patch properly addresses escaping < and > which might appear
(e.g. for C++ operators) in the xml dump.

I also re-enabled the unit test for ast-print-xml (or so I think)
at least, make test didn't fail..."

patch by Sebastien Binet!

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

14 years agoimprove comments.
Chris Lattner [Wed, 12 May 2010 23:26:21 +0000 (23:26 +0000)]
improve comments.

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

14 years agoRevert "Move macro definitions for IBOutlet and IBAction into the source
Daniel Dunbar [Wed, 12 May 2010 21:54:41 +0000 (21:54 +0000)]
Revert "Move macro definitions for IBOutlet and IBAction into the source
code. ...", this was a lit bug which should be fixed in r103652.

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

14 years agoMove macro definitions for IBOutlet and IBAction into the source code. This hopefully
Ted Kremenek [Wed, 12 May 2010 21:44:56 +0000 (21:44 +0000)]
Move macro definitions for IBOutlet and IBAction into the source code.  This hopefully
unbreaks the test with lit+Windows.

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

14 years agoDriver/Darwin/i386: Don't allow compiling C++ with -fapple-kext, we don't support...
Daniel Dunbar [Wed, 12 May 2010 18:19:58 +0000 (18:19 +0000)]
Driver/Darwin/i386: Don't allow compiling C++ with -fapple-kext, we don't support the necessary ABI yet.

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

14 years agoSimplify.
Daniel Dunbar [Wed, 12 May 2010 18:19:55 +0000 (18:19 +0000)]
Simplify.

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

14 years agoObjective-C++ Sema - Allow static_cast of one objc pointer to
Fariborz Jahanian [Wed, 12 May 2010 18:16:59 +0000 (18:16 +0000)]
Objective-C++ Sema - Allow static_cast of one objc pointer to
another.

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

14 years agoWhenever we instantiate a function definition or class, enter a new
Douglas Gregor [Wed, 12 May 2010 17:27:19 +0000 (17:27 +0000)]
Whenever we instantiate a function definition or class, enter a new
potentially-evaluated expression context, to ensure that used
declarations get properly marked. Fixes PR7123.

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

14 years agoWhen we emit an error during the implicit definition of a special
Douglas Gregor [Wed, 12 May 2010 16:39:35 +0000 (16:39 +0000)]
When we emit an error during the implicit definition of a special
member function (default constructor, copy constructor, copy
assignment operator, destructor), emit a note showing where that
implicit definition was required.

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

14 years agoYes another annotate-tokens tweak.
Daniel Dunbar [Wed, 12 May 2010 15:10:09 +0000 (15:10 +0000)]
Yes another annotate-tokens tweak.

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

14 years agoIncrease test portability.
Daniel Dunbar [Wed, 12 May 2010 14:46:02 +0000 (14:46 +0000)]
Increase test portability.

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

14 years agoMake test portable.
Ted Kremenek [Wed, 12 May 2010 07:24:45 +0000 (07:24 +0000)]
Make test portable.

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

14 years agoMake test case invariant to macro definition location.
Ted Kremenek [Wed, 12 May 2010 07:21:07 +0000 (07:21 +0000)]
Make test case invariant to macro definition location.

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

14 years agoRe-apply r103581 with updated tests. It turns out we were computing bogus locations for
Ted Kremenek [Wed, 12 May 2010 06:16:13 +0000 (06:16 +0000)]
Re-apply r103581 with updated tests.  It turns out we were computing bogus locations for
many things.

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

14 years agoTemporarily revert r103581 so I can fix the failing tests.
Ted Kremenek [Wed, 12 May 2010 06:03:33 +0000 (06:03 +0000)]
Temporarily revert r103581 so I can fix the failing tests.

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

14 years agoCorrectly check if a cursor is a declaration before returning its location/range...
Ted Kremenek [Wed, 12 May 2010 06:00:25 +0000 (06:00 +0000)]
Correctly check if a cursor is a declaration before returning its location/range in clang_getCursorLocation()/clang_getCursorExtent().  This fixes a horrible bug reported in
<rdar://problem/7961995> and <rdar://problem/7967123> where declarations with attributes
would get grossly annotated with the wrong tokens because the attribute would be interpreted
as if it was a Decl*.

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

14 years agoRemove debugging aids I did not intend to commit.
Ted Kremenek [Wed, 12 May 2010 05:30:50 +0000 (05:30 +0000)]
Remove debugging aids I did not intend to commit.

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

14 years agoAdjust clang_annotateTokens() to correctly account for the TypeSourceInfo for Declara...
Ted Kremenek [Wed, 12 May 2010 05:29:33 +0000 (05:29 +0000)]
Adjust clang_annotateTokens() to correctly account for the TypeSourceInfo for DeclaratorDecls
when annotating tokens.  Fixes <rdar://problem/7971430>.

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

14 years agodon't force 16 threads.
Chris Lattner [Wed, 12 May 2010 02:47:23 +0000 (02:47 +0000)]
don't force 16 threads.

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

14 years agoImprove commentary on the indirect-goto jump scope checker and extract
John McCall [Wed, 12 May 2010 02:37:54 +0000 (02:37 +0000)]
Improve commentary on the indirect-goto jump scope checker and extract
a convenience routine to find the innermost common ancestor of two scopes.

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

14 years agoCorrect spelling of expected error message. Apparently I forgot to re-run
John McCall [Wed, 12 May 2010 01:15:36 +0000 (01:15 +0000)]
Correct spelling of expected error message.  Apparently I forgot to re-run
the test suite after modifying this diagnostic.

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

14 years agoWhen checking scopes for indirect goto, be more permissive (but still safe)
John McCall [Wed, 12 May 2010 00:58:13 +0000 (00:58 +0000)]
When checking scopes for indirect goto, be more permissive (but still safe)
about the permitted scopes.  Specifically:
  1) Permit labels and gotos to appear after a prologue of variable initializations.
  2) Permit indirect gotos to jump out of scopes that don't require cleanup.
  3) Diagnose possible attempts to indirect-jump out of scopes that do require
     cleanup.
This requires a substantial reinvention of the algorithm for checking indirect
goto.  The current algorithm is Omega(M*N), with M = the number of unique
scopes being jumped from and N = the number of unique scopes being jumped to,
with an additional factor that is probably (worst-case) linear in the depth
of scopes.  Thus the entire thing is likely cubic given some truly bizarre
ill-formed code;  on well-formed code the additional factor collapses to
an amortized constant (when amortized over the entire function) and so
the algorithm is quadratic.  Even this requires every label to appear in
its own scope, which would be very unusual for indirect-goto code (and
extremely unlikely for well-formed code);  it is far more likely that
all labels will be in the same scope and so the algorithm becomes linear.
For such a marginal feature, I am fairly happy with this result.

(this is using JumpDiagnostic's definition of scope, where successive
variables in a block appear in their own scope)

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

14 years agoUse end location of DeclStmt to mark stop point.
Devang Patel [Wed, 12 May 2010 00:39:34 +0000 (00:39 +0000)]
Use end location of DeclStmt to mark stop point.
This is meaningful for blocks. This patch fixes bunch of test failures in gdb testsuite.

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

14 years agoBoostCon tutorial notes, temporary
Douglas Gregor [Tue, 11 May 2010 22:09:20 +0000 (22:09 +0000)]
BoostCon tutorial notes, temporary

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

14 years agoMerged Elaborated and QualifiedName types.
Abramo Bagnara [Tue, 11 May 2010 21:36:43 +0000 (21:36 +0000)]
Merged Elaborated and QualifiedName types.

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

14 years agoSpeculatively revert r103497, "Do not mark the virtual members of an
Daniel Dunbar [Tue, 11 May 2010 21:32:35 +0000 (21:32 +0000)]
Speculatively revert r103497, "Do not mark the virtual members of an
implicitly-instantiated class as ...", which seems to have broken bootstrap.

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

14 years agoIRgen/i386/C++: Fix isSingleElementStruct computation for C++ record decls.
Daniel Dunbar [Tue, 11 May 2010 21:15:36 +0000 (21:15 +0000)]
IRgen/i386/C++: Fix isSingleElementStruct computation for C++ record decls.
 - Fixes PR7098.

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

14 years agoDo not mark the virtual members of an implicitly-instantiated class as
Douglas Gregor [Tue, 11 May 2010 20:24:17 +0000 (20:24 +0000)]
Do not mark the virtual members of an implicitly-instantiated class as
referenced unless we see one of them defined (or the key function
defined, if it as one) or if we need the vtable for something. Fixes
PR7114.

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

14 years agoVISIBILITY_HIDDEN was renamed LLVM_LIBRARY_VISIBILITY.
Duncan Sands [Tue, 11 May 2010 20:16:05 +0000 (20:16 +0000)]
VISIBILITY_HIDDEN was renamed LLVM_LIBRARY_VISIBILITY.

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

14 years agoFix test.
Fariborz Jahanian [Tue, 11 May 2010 18:48:13 +0000 (18:48 +0000)]
Fix test.

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

14 years agoIt's bad form to create VarDecl's without DeclContexts
Douglas Gregor [Tue, 11 May 2010 18:17:16 +0000 (18:17 +0000)]
It's bad form to create VarDecl's without DeclContexts

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

14 years agoThe C++98/03 standard is disturbingly silent about out-of-scope
Douglas Gregor [Tue, 11 May 2010 17:39:34 +0000 (17:39 +0000)]
The C++98/03 standard is disturbingly silent about out-of-scope
explicit instantiations of template. C++0x clarifies the intent
(they're ill-formed in some cases; see [temp.explicit] for
details). However, one could squint at the C++98/03 standard and
conclude they are permitted, so reduce the error to a warning
(controlled by -Wc++0x-compat) in C++98/03 mode.

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

14 years agoStatic data members intialized in-class that have constant values are
Douglas Gregor [Tue, 11 May 2010 16:41:27 +0000 (16:41 +0000)]
Static data members intialized in-class that have constant values are
value-dependent if their initializers are value-dependent; my recent
tweak to these dependent rules overstepped by taking away this
value-dependents. Fixes a Boost.GIL regression.

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

14 years agoMinor refactoring of my last patch.
Fariborz Jahanian [Tue, 11 May 2010 16:31:10 +0000 (16:31 +0000)]
Minor refactoring of my last patch.

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

14 years agoFix indentation
Douglas Gregor [Tue, 11 May 2010 08:44:04 +0000 (08:44 +0000)]
Fix indentation

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

14 years agoA DeclRefExpr that refers to a member function or a static data member
Douglas Gregor [Tue, 11 May 2010 08:41:30 +0000 (08:41 +0000)]
A DeclRefExpr that refers to a member function or a static data member
of the current instantiation is value-dependent. The C++ standard
fails to enumerate this case and, therefore, we missed it. Chandler
did all of the hard work of reducing the last remaining
Boost.PtrContainer failure (which had to do with static initialization
in the Serialization library) down to this simple little test.

While I'm at it, clean up the dependence rules for template arguments
that are declarations, and implement the dependence rules for template
argument packs.

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

14 years agoAdd a test for a subtle instantiation pattern that showed up within a Boost
Chandler Carruth [Tue, 11 May 2010 08:02:08 +0000 (08:02 +0000)]
Add a test for a subtle instantiation pattern that showed up within a Boost
miscompile reduction. Clang already handles this correctly, but let's make sure
it stays that way.

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

14 years agoFixes for compilation with Microsoft Visual Studio 2010, from Steven Watanabe!
Douglas Gregor [Tue, 11 May 2010 06:18:17 +0000 (06:18 +0000)]
Fixes for compilation with Microsoft Visual Studio 2010, from Steven Watanabe!

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

14 years agoInitialize Column.
Devang Patel [Mon, 10 May 2010 23:48:38 +0000 (23:48 +0000)]
Initialize Column.

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

14 years agoAllow static_cast to objective-c pointers.
Fariborz Jahanian [Mon, 10 May 2010 23:46:53 +0000 (23:46 +0000)]
Allow static_cast to objective-c pointers.
Fixes radar 7952457.

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

14 years agotests: Avoid spurious use of /dev/null.
Daniel Dunbar [Mon, 10 May 2010 23:31:31 +0000 (23:31 +0000)]
tests: Avoid spurious use of /dev/null.

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

14 years agoRefactor the constant-evaluator so that it only supports a single form
John McCall [Mon, 10 May 2010 23:27:23 +0000 (23:27 +0000)]
Refactor the constant-evaluator so that it only supports a single form
of constant-evaluation.  Formerly you could control whether it accepted
local l-values or not;  now it always evaluates local l-values in the core
routines, but filters them out where consumed by the top-level routines.
This will make it much easier to cache evaluability.

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

14 years agoObjective-C++ Code gen. Handle code gen. for property
Fariborz Jahanian [Mon, 10 May 2010 22:57:35 +0000 (22:57 +0000)]
Objective-C++ Code gen. Handle code gen. for property
reference dot-syntax notation in a varierty of cases.
Fixes radar 7964490.

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

14 years agoAllocate most of DeclarationNamesTable using ASTContext's allcocator. The only thing...
Ted Kremenek [Mon, 10 May 2010 20:56:10 +0000 (20:56 +0000)]
Allocate most of DeclarationNamesTable using ASTContext's allcocator.  The only things that
aren't allocated this way are the internal FoldingSets.

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

14 years agoStart converting pieces of DeclarationNameTable to be allocated using ASTContext...
Ted Kremenek [Mon, 10 May 2010 20:40:08 +0000 (20:40 +0000)]
Start converting pieces of DeclarationNameTable to be allocated using ASTContext's allocator.
While DeclarationNameTable doesn't leak, it uses 'malloc' too often.  Start with having
'CXXLiteralOperatorNames' allocated using ASTContext's allocator and add a 'DoDestroy()' method
to DeclarationNameTable that is called by ~ASTContext.

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

14 years agoConvert CXXTempory[] in CXXExprWithTemporaries to be allocated using ASTContext's...
Ted Kremenek [Mon, 10 May 2010 20:06:30 +0000 (20:06 +0000)]
Convert CXXTempory[] in CXXExprWithTemporaries to be allocated using ASTContext's allocator.  Fixes <rdar://problem/7961605>.

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

14 years agoImproved -ast-print-xml for C++, from Sebastien Binet!
Douglas Gregor [Mon, 10 May 2010 17:43:18 +0000 (17:43 +0000)]
Improved -ast-print-xml for C++, from Sebastien Binet!

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

14 years agoAlternative workaround for MSVC compilation failure, from Dimitry Andric
Douglas Gregor [Mon, 10 May 2010 17:28:19 +0000 (17:28 +0000)]
Alternative workaround for MSVC compilation failure, from Dimitry Andric

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

14 years agoIf variable location is invalid then use current location.
Devang Patel [Mon, 10 May 2010 17:24:58 +0000 (17:24 +0000)]
If variable location is invalid then use current location.
This fixes radar 7959934.

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

14 years agoFix refacto in r103387, noticed by Christopher Jefferson.
Daniel Dunbar [Mon, 10 May 2010 15:59:37 +0000 (15:59 +0000)]
Fix refacto in r103387, noticed by Christopher Jefferson.

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

14 years agoAdd an UpdateVBases parameter to UpdateEmptyClassOffsets. Not used just yet.
Anders Carlsson [Mon, 10 May 2010 15:28:59 +0000 (15:28 +0000)]
Add an UpdateVBases parameter to UpdateEmptyClassOffsets. Not used just yet.

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

14 years agoMore work on handling empty classes.
Anders Carlsson [Mon, 10 May 2010 15:26:14 +0000 (15:26 +0000)]
More work on handling empty classes.

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

14 years agopch'ify CXXNewExpr and CXXZeroInitValueExpr
Chris Lattner [Mon, 10 May 2010 01:22:27 +0000 (01:22 +0000)]
pch'ify CXXNewExpr and CXXZeroInitValueExpr

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

14 years agoDoxygen-ify a comment and add an example of when this AST node is required.
Chandler Carruth [Mon, 10 May 2010 00:56:18 +0000 (00:56 +0000)]
Doxygen-ify a comment and add an example of when this AST node is required.

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

14 years agofix refactor-o
Chris Lattner [Mon, 10 May 2010 00:45:12 +0000 (00:45 +0000)]
fix refactor-o

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

14 years agopchify CXXTemporary, CXXBindTemporaryExpr, and
Chris Lattner [Mon, 10 May 2010 00:25:06 +0000 (00:25 +0000)]
pchify CXXTemporary, CXXBindTemporaryExpr, and
CXXExprWithTemporaries.

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

14 years agoFix typo.
Chandler Carruth [Sun, 9 May 2010 12:16:11 +0000 (12:16 +0000)]
Fix typo.

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