]> granicus.if.org Git - clang/log
clang
15 years agoFix operator precedence in Doug's most recent commit.
Sebastian Redl [Fri, 23 Oct 2009 19:38:17 +0000 (19:38 +0000)]
Fix operator precedence in Doug's most recent commit.

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

15 years agoApply the special enum restrictions from [over.match.oper]p3b2 in argument-dependent...
Sebastian Redl [Fri, 23 Oct 2009 19:23:15 +0000 (19:23 +0000)]
Apply the special enum restrictions from [over.match.oper]p3b2 in argument-dependent lookup too. This fixes PR5244.

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

15 years agoEliminate QualifiedDeclRefExpr, which captured the notion of a
Douglas Gregor [Fri, 23 Oct 2009 18:54:35 +0000 (18:54 +0000)]
Eliminate QualifiedDeclRefExpr, which captured the notion of a
qualified reference to a declaration that is not a non-static data
member or non-static member function, e.g.,

  namespace N { int i; }
  int j = N::i;

Instead, extend DeclRefExpr to optionally store the qualifier. Most
clients won't see or care about the difference (since
QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the
number of top-level expression types that clients need to cope with,
brings the implementation of DeclRefExpr into line with MemberExpr,
and simplifies and unifies our handling of declaration references.

Extended DeclRefExpr to (optionally) store explicitly-specified
template arguments. This occurs when naming a declaration via a
template-id (which will be stored in a TemplateIdRefExpr) that,
following template argument deduction and (possibly) overload
resolution, is replaced with a DeclRefExpr that refers to a template
specialization but maintains the template arguments as written.

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

15 years agoFixed a code gen bug (by fixing the AST) involving user-defined
Fariborz Jahanian [Fri, 23 Oct 2009 18:08:22 +0000 (18:08 +0000)]
Fixed a code gen bug (by fixing the AST) involving user-defined
pointer-to-member type conversion follwed by a pointer-to-member
standard conversion.

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

15 years agoRebuild dependently-sized ext vectors if either the element type or the size
John McCall [Fri, 23 Oct 2009 17:55:45 +0000 (17:55 +0000)]
Rebuild dependently-sized ext vectors if either the element type or the size
changed under the transform.

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

15 years agoSilence GCC 4.3 warning.
Benjamin Kramer [Fri, 23 Oct 2009 10:48:09 +0000 (10:48 +0000)]
Silence GCC 4.3 warning.

TreeTransform.h:2333: warning: suggest parentheses around && within ||

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

15 years agoEmit calls using the canonical prototype of the called function.
John McCall [Fri, 23 Oct 2009 08:22:42 +0000 (08:22 +0000)]
Emit calls using the canonical prototype of the called function.

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

15 years agoAdd comment.
Ted Kremenek [Fri, 23 Oct 2009 04:45:31 +0000 (04:45 +0000)]
Add comment.

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

15 years agoFix integer overflow in PCHReader when reading the length of an
Ted Kremenek [Fri, 23 Oct 2009 03:57:22 +0000 (03:57 +0000)]
Fix integer overflow in PCHReader when reading the length of an
identifier.  This caused a crash when reading PCH files that contained
long identifier names.

The issue is that 'StrLenPtr' was previously a 'const char *', meaning
the byte loaded from it would be interpretted as a signed integer.  If
the topmost bit was set, conversion to 'unsigned' would extend that
bit, causing an overflow.

The solution is to make 'StrLenPtr' an 'unsigned char *', always
treating the value as an unsigned integer.

This fixes: <rdar://problem/7328900>

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

15 years agoFixed undefined behavior in pushMappings when the stack has to resize.
John Thompson [Fri, 23 Oct 2009 02:21:17 +0000 (02:21 +0000)]
Fixed undefined behavior in pushMappings when the stack has to resize.

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

15 years agoAdd radar number.
Mike Stump [Fri, 23 Oct 2009 02:13:20 +0000 (02:13 +0000)]
Add radar number.

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

15 years agoFixup the return type of functions.
Mike Stump [Fri, 23 Oct 2009 01:52:13 +0000 (01:52 +0000)]
Fixup the return type of functions.

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

15 years agoFunctionTypeLocs don't necessarily provide ParmVarDecls, so don't crash if
John McCall [Fri, 23 Oct 2009 01:28:53 +0000 (01:28 +0000)]
FunctionTypeLocs don't necessarily provide ParmVarDecls, so don't crash if
one was PCH'ed without any.

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

15 years agoPreserve type source information when substituting into FieldDecls.
John McCall [Thu, 22 Oct 2009 23:33:21 +0000 (23:33 +0000)]
Preserve type source information when substituting into FieldDecls.
Just r84734 now that some fundamental work has been completed.

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

15 years agoPreserve source information for anonymous struct/union declarations.
John McCall [Thu, 22 Oct 2009 23:31:08 +0000 (23:31 +0000)]
Preserve source information for anonymous struct/union declarations.

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

15 years agoComplete code gen for '.*' binary expression for
Fariborz Jahanian [Thu, 22 Oct 2009 22:57:31 +0000 (22:57 +0000)]
Complete code gen for '.*' binary expression for
both scalar and aggregates.

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

15 years agoFixes a warning.
Fariborz Jahanian [Thu, 22 Oct 2009 22:49:47 +0000 (22:49 +0000)]
Fixes a warning.

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

15 years agoWhen building types from declarators, instead of building two types (one for
John McCall [Thu, 22 Oct 2009 22:37:11 +0000 (22:37 +0000)]
When building types from declarators, instead of building two types (one for
the DeclaratorInfo, one for semantic analysis), just build a single type whose
canonical type will reflect the semantic analysis (assuming the type is
well-formed, of course).

To make that work, make a few changes to the type system:
* allow the nominal pointee type of a reference type to be a (possibly sugared)
  reference type.  Also, preserve the original spelling of the reference type.
  Both of these can be ignored on canonical reference types.
* Remove ObjCProtocolListType and preserve the associated source information on
  the various ObjC TypeLocs.  Preserve the spelling of protocol lists except in
  the canonical form.
* Preserve some level of source type structure on parameter types, but
  canonicalize on the canonical function type.  This is still a WIP.

Drops code size, makes strides towards accurate source location representation,
slight (~1.7%) progression on Cocoa.h because of complexity drop.

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

15 years agoAlways emit error diagnostics when an error occurs within clang_createTranslationUnit...
Ted Kremenek [Thu, 22 Oct 2009 22:19:00 +0000 (22:19 +0000)]
Always emit error diagnostics when an error occurs within clang_createTranslationUnit() and clang_createTranslationUnitFromSource().  These kind of errors are ones that shouldn't be missed.

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

15 years agoDisable Microsoft extensions to fix failure on Windows.
John Thompson [Thu, 22 Oct 2009 20:34:27 +0000 (20:34 +0000)]
Disable Microsoft extensions to fix failure on Windows.

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

15 years agoCanonicality is a property of qualified types, not unqualified types.
John McCall [Thu, 22 Oct 2009 20:10:53 +0000 (20:10 +0000)]
Canonicality is a property of qualified types, not unqualified types.

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

15 years agofix #2 :)
Chris Lattner [Thu, 22 Oct 2009 19:56:49 +0000 (19:56 +0000)]
fix #2 :)

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

15 years agofix testcase, thanks Daniel.
Chris Lattner [Thu, 22 Oct 2009 19:56:26 +0000 (19:56 +0000)]
fix testcase, thanks Daniel.

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

15 years agoWhen replacing a template-id expression with a declaration reference expression after...
Douglas Gregor [Thu, 22 Oct 2009 18:02:20 +0000 (18:02 +0000)]
When replacing a template-id expression with a declaration reference expression after overloading completes, make sure to keep the qualifier. Still not ready with that test-case...

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

15 years agoSplit clang_getCursor() into clang_getCursor() and clang_getCursorWithHint().
Ted Kremenek [Thu, 22 Oct 2009 17:22:53 +0000 (17:22 +0000)]
Split clang_getCursor() into clang_getCursor() and clang_getCursorWithHint().

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

15 years agoWhen building and instantiating a template-id reference expression, such as
Douglas Gregor [Thu, 22 Oct 2009 17:20:55 +0000 (17:20 +0000)]
When building and instantiating a template-id reference expression, such as

  N::f<int>

keep track of the full nested-name-specifier. This is mainly QoI and
relatively hard to test; will try to come up with a printing-based
test once we also retain the explicit template arguments past overload
resolution.

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

15 years agoUpdate test; the driver can find a different gcc tool chain directory when
Daniel Dunbar [Thu, 22 Oct 2009 16:05:11 +0000 (16:05 +0000)]
Update test; the driver can find a different gcc tool chain directory when
simulating running on a different system.

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

15 years agoTry to instantiate templates before doing hierarchy checks in static_cast. Fixes...
Sebastian Redl [Thu, 22 Oct 2009 15:07:22 +0000 (15:07 +0000)]
Try to instantiate templates before doing hierarchy checks in static_cast. Fixes PR5261.

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

15 years agoWhen a template-id expression refers to a member function template, turn it into...
Douglas Gregor [Thu, 22 Oct 2009 07:19:14 +0000 (07:19 +0000)]
When a template-id expression refers to a member function template, turn it into an (implicit) member access expression. Fixes PR5220

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

15 years agoRefactor our handling of implicit member reference expressions to get most of the...
Douglas Gregor [Thu, 22 Oct 2009 07:08:30 +0000 (07:08 +0000)]
Refactor our handling of implicit member reference expressions to get most of the logic out of BuildDeclarationNameExpr

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

15 years agofix PR5265: the size of a float3 should be rounded up to its alignment.
Chris Lattner [Thu, 22 Oct 2009 05:17:15 +0000 (05:17 +0000)]
fix PR5265: the size of a float3 should be rounded up to its alignment.
This ensures that arrays of float3 are correctly padded.

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

15 years agoAdd some explanatory diagnostics when clang_createTranslationUnitFromSource fails.
Ted Kremenek [Thu, 22 Oct 2009 03:24:01 +0000 (03:24 +0000)]
Add some explanatory diagnostics when clang_createTranslationUnitFromSource fails.

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

15 years agoRename: CheckBadDiv->CheckDivZero.
Zhongxing Xu [Thu, 22 Oct 2009 01:58:10 +0000 (01:58 +0000)]
Rename: CheckBadDiv->CheckDivZero.

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

15 years agoRemove some misguided code.
Mike Stump [Thu, 22 Oct 2009 01:31:24 +0000 (01:31 +0000)]
Remove some misguided code.

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

15 years agoExtend out the block descriptor structure for debug information with
Mike Stump [Thu, 22 Oct 2009 00:49:09 +0000 (00:49 +0000)]
Extend out the block descriptor structure for debug information with
the copy/dispose helpers as appropriate.

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

15 years agoDriver: Fix thinko in logic for finding gcc's tool chain directory.
Daniel Dunbar [Thu, 22 Oct 2009 00:12:00 +0000 (00:12 +0000)]
Driver: Fix thinko in logic for finding gcc's tool chain directory.

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

15 years agoEnhance 'clang_createTranslationUnitFromSourceFile()' in two ways:
Ted Kremenek [Thu, 22 Oct 2009 00:03:57 +0000 (00:03 +0000)]
Enhance 'clang_createTranslationUnitFromSourceFile()' in two ways:

(1) Allow the source file to be specified in the actual command line arguments by allowing the
    caller to set 'source_filename' to NULL.

(2) Automatically strip off the arguments '-emit-ast', '-fsyntax-only', and '-c'.

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

15 years agoCode gen for '.*' binary expressions - WIP.
Fariborz Jahanian [Wed, 21 Oct 2009 23:45:42 +0000 (23:45 +0000)]
Code gen for '.*' binary expressions - WIP.

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

15 years agoDon't (directly) call RequireCompleteType with an invalid source location.
Douglas Gregor [Wed, 21 Oct 2009 23:19:44 +0000 (23:19 +0000)]
Don't (directly) call RequireCompleteType with an invalid source location.

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

15 years agoTurn on the preallocation of all BlockDeclRefExprs.
Mike Stump [Wed, 21 Oct 2009 22:02:08 +0000 (22:02 +0000)]
Turn on the preallocation of all BlockDeclRefExprs.

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

15 years agoDon't generate pointer types for void or base classes when finding
Douglas Gregor [Wed, 21 Oct 2009 22:01:30 +0000 (22:01 +0000)]
Don't generate pointer types for void or base classes when finding
conversion types for builtin overloaded operator candidates; I misread
this section in the standard the first time around.

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

15 years agoRefine collection of BlockDeclRefExprs. WIP.
Mike Stump [Wed, 21 Oct 2009 22:01:24 +0000 (22:01 +0000)]
Refine collection of BlockDeclRefExprs.  WIP.

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

15 years agoDriver: don't produce bogus osx version numbers if no version (aka 0) was specified.
Benjamin Kramer [Wed, 21 Oct 2009 21:05:07 +0000 (21:05 +0000)]
Driver: don't produce bogus osx version numbers if no version (aka 0) was specified.

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

15 years agoExpand on code gen. for pointer to data members so it works
Fariborz Jahanian [Wed, 21 Oct 2009 21:01:47 +0000 (21:01 +0000)]
Expand on code gen. for pointer to data members so it works
for base classe members as well. Test case enhanced for this.

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

15 years agoForce triple; this test was failing on non-darwin platforms due to different
Benjamin Kramer [Wed, 21 Oct 2009 19:59:43 +0000 (19:59 +0000)]
Force triple; this test was failing on non-darwin platforms due to different
asm comment styles (## vs #).

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

15 years agoCode gen for pointer-to-datamember - WIP.
Fariborz Jahanian [Wed, 21 Oct 2009 18:38:00 +0000 (18:38 +0000)]
Code gen for pointer-to-datamember - WIP.

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

15 years agoFix typo.
Mike Stump [Wed, 21 Oct 2009 18:24:18 +0000 (18:24 +0000)]
Fix typo.

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

15 years agoRefactor.
Mike Stump [Wed, 21 Oct 2009 18:23:01 +0000 (18:23 +0000)]
Refactor.

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

15 years agoComplete out debug info generation for captured __block variables. WIP.
Mike Stump [Wed, 21 Oct 2009 18:16:27 +0000 (18:16 +0000)]
Complete out debug info generation for captured __block variables.  WIP.

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

15 years agoChange FixOverloadedFunctionReference to return a (possibly new) expression. Substitu...
Anders Carlsson [Wed, 21 Oct 2009 17:16:23 +0000 (17:16 +0000)]
Change FixOverloadedFunctionReference to return a (possibly new) expression. Substitute TemplateIdRefExprs with DeclRefExprs. Doug, plz review :)

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

15 years agoDowngrade "function declared 'noreturn' should not return" from an
Douglas Gregor [Wed, 21 Oct 2009 15:46:01 +0000 (15:46 +0000)]
Downgrade "function declared 'noreturn' should not return" from an
error (by default) to a warning, per C++0x [dcl.attr.noreturn]. Patch
from Sean Hunt!

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

15 years agoExtend clang_getCursor() to take a 'relativeDecl' argument (so speed up searching...
Steve Naroff [Wed, 21 Oct 2009 13:56:23 +0000 (13:56 +0000)]
Extend clang_getCursor() to take a 'relativeDecl' argument (so speed up searching). Without a 'relativeDecl', the algorithm is n-squared. For example, running the following command on 'Large.m' takes hours without a 'relatvieDecl'.

snaroff% time ../../Debug/bin/c-index-test Large.ast all > Large.out
snaroff% cat Large.m
#import <Cocoa/Cocoa.h>
#import <QuickTime/QuickTime.h>
#import <OpenGL/OpenGL.h>

With a 'relativeDecl', it takes <30 seconds:-)

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

15 years agoAdd AuroraUX ABI Triple in correct place.
Edward O'Callaghan [Wed, 21 Oct 2009 11:58:24 +0000 (11:58 +0000)]
Add AuroraUX ABI Triple in correct place.

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

15 years agoSimplify some code. No functionality change.
Zhongxing Xu [Wed, 21 Oct 2009 11:42:22 +0000 (11:42 +0000)]
Simplify some code. No functionality change.

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

15 years agoUpdate checker build.
Ted Kremenek [Wed, 21 Oct 2009 08:00:24 +0000 (08:00 +0000)]
Update checker build.

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

15 years agoadd helpful methods to TargetInfo for querying builtin integer type properties,
Chris Lattner [Wed, 21 Oct 2009 06:24:21 +0000 (06:24 +0000)]
add helpful methods to TargetInfo for querying builtin integer type properties,
patch by Ken Dyck!

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

15 years agoImprove diagnostics and template instantiation behavior when calling
Douglas Gregor [Wed, 21 Oct 2009 06:18:39 +0000 (06:18 +0000)]
Improve diagnostics and template instantiation behavior when calling
an overloaded function call operator.

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

15 years agohookize wint_t's definition, patch by Edward O'Callaghan (from PR5233).
Chris Lattner [Wed, 21 Oct 2009 04:59:34 +0000 (04:59 +0000)]
hookize wint_t's definition, patch by Edward O'Callaghan (from PR5233).

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

15 years agoPrep work to always preallocate BlockDeclRefExprs so that we can
Mike Stump [Wed, 21 Oct 2009 03:49:08 +0000 (03:49 +0000)]
Prep work to always preallocate BlockDeclRefExprs so that we can
generate the debug information for the first parameter to the block
invoke functions.  WIP.

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

15 years agoRevert those last two commits. Beware the treacherous semicolon.
John McCall [Wed, 21 Oct 2009 03:40:01 +0000 (03:40 +0000)]
Revert those last two commits.  Beware the treacherous semicolon.

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

15 years agoPreserve type source information when substituting into ParmVarDecls.
John McCall [Wed, 21 Oct 2009 02:50:40 +0000 (02:50 +0000)]
Preserve type source information when substituting into ParmVarDecls.

Apparently I'm grinding my commit count.

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

15 years agoPreserve type source information when substituting into FieldDecls.
John McCall [Wed, 21 Oct 2009 02:42:37 +0000 (02:42 +0000)]
Preserve type source information when substituting into FieldDecls.

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

15 years agoPreserve source information when substituting into VarDecls.
John McCall [Wed, 21 Oct 2009 02:39:02 +0000 (02:39 +0000)]
Preserve source information when substituting into VarDecls.

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

15 years agoClone Sema::SubstType for DeclaratorInfos.
John McCall [Wed, 21 Oct 2009 00:58:09 +0000 (00:58 +0000)]
Clone Sema::SubstType for DeclaratorInfos.

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

15 years agoInitialize using the base location provided by the derived implementation,
John McCall [Wed, 21 Oct 2009 00:44:26 +0000 (00:44 +0000)]
Initialize using the base location provided by the derived implementation,
not the default one (which is always empty).

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

15 years agoFix 80-col violation.
Mike Stump [Wed, 21 Oct 2009 00:42:55 +0000 (00:42 +0000)]
Fix 80-col violation.

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

15 years agoRewrite TreeTransform to transform types as DeclaratorInfos rather than as bare
John McCall [Wed, 21 Oct 2009 00:40:46 +0000 (00:40 +0000)]
Rewrite TreeTransform to transform types as DeclaratorInfos rather than as bare
QualTypes.  Don't actually exploit this yet.

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

15 years agoAdd TypeLocBuilder, an API for incrementally creating TypeLocs. Change
John McCall [Wed, 21 Oct 2009 00:23:54 +0000 (00:23 +0000)]
Add TypeLocBuilder, an API for incrementally creating TypeLocs.  Change
the API for creating DeclaratorInfos to allow callers to provide an exact
size.

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

15 years agoPublicize getSigilLoc / setSigilLoc for better metaprogramming.
John McCall [Wed, 21 Oct 2009 00:21:09 +0000 (00:21 +0000)]
Publicize getSigilLoc / setSigilLoc for better metaprogramming.

Fix the ReferenceTypeLoc hierarchy.

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

15 years agoRemove stale comment and tighten code.
Ted Kremenek [Tue, 20 Oct 2009 23:59:28 +0000 (23:59 +0000)]
Remove stale comment and tighten code.

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

15 years agoAdd FIXME.
Ted Kremenek [Tue, 20 Oct 2009 23:48:29 +0000 (23:48 +0000)]
Add FIXME.

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

15 years agoUse llvm::OwningPtr in CFGBuilder, fixing a leak on an error path.
Ted Kremenek [Tue, 20 Oct 2009 23:46:25 +0000 (23:46 +0000)]
Use llvm::OwningPtr in CFGBuilder, fixing a leak on an error path.

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

15 years agoCode-gen for CXXZeroInitValueExpr AST passed
Fariborz Jahanian [Tue, 20 Oct 2009 23:29:04 +0000 (23:29 +0000)]
Code-gen for CXXZeroInitValueExpr AST passed
as argument to a function call. Removes a FIXME.

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

15 years agoChange ResolveAddressOfOverloadedFunction to support TemplateIdRefExpr. No testcase...
Anders Carlsson [Tue, 20 Oct 2009 22:53:47 +0000 (22:53 +0000)]
Change ResolveAddressOfOverloadedFunction to support TemplateIdRefExpr. No testcase yet because FixOverloadedFunctionReference needs to be updated too. Doug, plz review.

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

15 years agoFix the 32-bit ABI to return structures with non-trivial copy ctors or dtors indirectly.
Anders Carlsson [Tue, 20 Oct 2009 22:07:59 +0000 (22:07 +0000)]
Fix the 32-bit ABI to return structures with non-trivial copy ctors or dtors indirectly.

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

15 years agoAdd destructor and cleanup code to LocationContext (fixing some leaks). Along the...
Ted Kremenek [Tue, 20 Oct 2009 21:39:41 +0000 (21:39 +0000)]
Add destructor and cleanup code to LocationContext (fixing some leaks). Along the way, have
AnalysisManager periodically cleanup its AnalysisContextManager and LocationContextManager objects,
as they don't need to forever retain all the CFGs ever created when analyzing a file.

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

15 years agoUpdated, we support == and != builtins for member pointers.
Fariborz Jahanian [Tue, 20 Oct 2009 21:10:15 +0000 (21:10 +0000)]
Updated, we support == and != builtins for member pointers.

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

15 years agoChanges to reflect more pointer-to-member support.
Fariborz Jahanian [Tue, 20 Oct 2009 20:31:50 +0000 (20:31 +0000)]
Changes to reflect more pointer-to-member support.

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

15 years agoFor now, we need to have the llvm type of the block pointer remain as
Mike Stump [Tue, 20 Oct 2009 20:30:01 +0000 (20:30 +0000)]
For now, we need to have the llvm type of the block pointer remain as
it was.  Fixes codegen bug introduced yesterday.

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

15 years agoMoved comment to its proper place in my last patch.
Fariborz Jahanian [Tue, 20 Oct 2009 20:07:35 +0000 (20:07 +0000)]
Moved comment to its proper place in my last patch.

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

15 years agoPatch implements ranking conversions between member pointers [over.ics.rank]
Fariborz Jahanian [Tue, 20 Oct 2009 20:04:46 +0000 (20:04 +0000)]
Patch implements ranking conversions between member pointers [over.ics.rank]

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

15 years agoDo not eagerly cache DITypes because it allows real struct type to be shadowed by...
Devang Patel [Tue, 20 Oct 2009 19:55:01 +0000 (19:55 +0000)]
Do not eagerly cache DITypes because it allows real struct type to be shadowed by forward declared struct type.

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

15 years agoDriver: If unable to find the gcc tool chain, try the next OS rev.
Daniel Dunbar [Tue, 20 Oct 2009 19:25:43 +0000 (19:25 +0000)]
Driver: If unable to find the gcc tool chain, try the next OS rev.

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

15 years agoEncode global variable name in debug info.
Devang Patel [Tue, 20 Oct 2009 18:26:30 +0000 (18:26 +0000)]
Encode global variable name in debug info.

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

15 years agoAdd missing semi-colon.
Daniel Dunbar [Tue, 20 Oct 2009 18:07:06 +0000 (18:07 +0000)]
Add missing semi-colon.

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

15 years agoChanged text of warning in my last patch.
Fariborz Jahanian [Tue, 20 Oct 2009 17:24:11 +0000 (17:24 +0000)]
Changed text of warning in my last patch.
Related to radar:
<rdar://problem/7308503> clang should disallow the trailing semicolon in method definitions

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

15 years agoBring Darwin into the switch-case statement instead of its own if for readability.
Edward O'Callaghan [Tue, 20 Oct 2009 17:22:50 +0000 (17:22 +0000)]
Bring Darwin into the switch-case statement instead of its own if for readability.

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

15 years agoIssue warning if method body starts with a semicolon.
Fariborz Jahanian [Tue, 20 Oct 2009 16:39:13 +0000 (16:39 +0000)]
Issue warning if method body starts with a semicolon.
Fixes
<rdar://problem/7308503> clang should disallow the trailing semicolon in method definitions

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

15 years agoAdd an example to help claify the process/assumptions...
Steve Naroff [Tue, 20 Oct 2009 16:36:34 +0000 (16:36 +0000)]
Add an example to help claify the process/assumptions...

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

15 years ago- Extend clang_createIndex() to support PCH and diagnostic 'filtering'. This seems...
Steve Naroff [Tue, 20 Oct 2009 14:46:24 +0000 (14:46 +0000)]
- Extend clang_createIndex() to support PCH and diagnostic 'filtering'. This seems cleaner to me without sacrificing much flexibility.

- Remove clang_wantOnlyLocalDeclarations().

- Remove 'displayDiagnostics' arguments to clang_createTranslationUnitFromSourceFile() and clang_createTranslationUnit().

- Have clang_createTranslationUnitFromSourceFile() strip the '-o <outfile>' command line arguments if they exist. Document this semantic in the header. Also verify we have a valid ASTUnit before telling it to 'unlinkTemporaryFile()'.

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

15 years agoRemove default argument for ImpCastExprToType. Add appropriate argument
Eli Friedman [Tue, 20 Oct 2009 08:27:19 +0000 (08:27 +0000)]
Remove default argument for ImpCastExprToType.  Add appropriate argument
to all callers.  Switch a few other users of CK_Unknown to proper cast
kinds.

Note that there are still some situations where we end up with
CK_Unknown; they're pretty easy to find with grep. There
are still a few missing conversion kinds, specifically
pointer/int/float->bool and the various combinations of real/complex
float/int->real/complex float/int.

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

15 years agoCall 'clear()' in ~RopePieceBTreeLeaf(), decrementing the reference
Ted Kremenek [Tue, 20 Oct 2009 06:31:34 +0000 (06:31 +0000)]
Call 'clear()' in ~RopePieceBTreeLeaf(), decrementing the reference
counts of the bufffers referened by the RopePieces in
RopePieceBTreeLeaf.  This (I believe) corrently fixes the leak I meant
to fix in r84601 (which ended up causing an overrelease).

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

15 years agoHandle substitutions into the "first qualifier in scope" of a
Douglas Gregor [Tue, 20 Oct 2009 05:58:46 +0000 (05:58 +0000)]
Handle substitutions into the "first qualifier in scope" of a
qualified member access expression (e.g., t->U::member) when that
first qualifier refers to a template parameters.

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

15 years agoRevert 84601. Looks like it was causing failures on some systems.
Ted Kremenek [Tue, 20 Oct 2009 05:53:05 +0000 (05:53 +0000)]
Revert 84601.  Looks like it was causing failures on some systems.

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

15 years agoBumpVectorContext: Use 'unsigned' integer type with PointerIntUnion instead of bool...
Ted Kremenek [Tue, 20 Oct 2009 05:49:17 +0000 (05:49 +0000)]
BumpVectorContext: Use 'unsigned' integer type with PointerIntUnion instead of bool to keep it clear that we are reasoning about an unsigned integer with a single bit.

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

15 years agoImplement PR5242: don't desugar a type more than once in a diagnostic. This
Chris Lattner [Tue, 20 Oct 2009 05:36:05 +0000 (05:36 +0000)]
Implement PR5242: don't desugar a type more than once in a diagnostic.  This
implements a framework that allows us to use information about previously
substituted values to simplify subsequent ones.  Maybe this would be useful
for C++'y stuff, who knows.  We now get:

t.c:4:21: error: invalid operands to binary expression ('size_t' (aka 'unsigned long *') and 'size_t')
  return (size_t) 0 + (size_t) 0;
         ~~~~~~~~~~ ^ ~~~~~~~~~~

on the testcase.  Note that size_t is only aka'd once.

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

15 years agoteach FormatDiagnostic to aggregate previously formatted arguments and
Chris Lattner [Tue, 20 Oct 2009 05:25:22 +0000 (05:25 +0000)]
teach FormatDiagnostic to aggregate previously formatted arguments and
pass them down into the ArgToStringFn implementation.  This allows
redundancy across operands to a diagnostic to be eliminated.

This isn't used yet, so no functionality change.

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

15 years agoFix a reference count imbalance in RewriteRope::MakeRopeString().
Ted Kremenek [Tue, 20 Oct 2009 05:25:11 +0000 (05:25 +0000)]
Fix a reference count imbalance in RewriteRope::MakeRopeString().
This was causing a ton of memory to be leaked when using HTML
diagnostics with the static analyzer (on large files with many errors).

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

15 years agocode cleanup, convert if tree to switch etc.
Chris Lattner [Tue, 20 Oct 2009 05:12:36 +0000 (05:12 +0000)]
code cleanup, convert if tree to switch etc.

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

15 years agoRefine the type of the first parameter to block invoke functions.
Mike Stump [Tue, 20 Oct 2009 02:12:22 +0000 (02:12 +0000)]
Refine the type of the first parameter to block invoke functions.
WIP.  I have yet to find the magic incantation to get the structure
type to be defined.  If someone has a pointer, love to hear it.

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