]> granicus.if.org Git - clang/log
clang
16 years agoFix long double test case
Daniel Dunbar [Fri, 25 Jul 2008 20:54:30 +0000 (20:54 +0000)]
Fix long double test case
 - Had wrong sizeof(long double) encoded into test case
 - Results now agree with llvm-gcc

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

16 years agoIn c99 mode, comma does do function/array promotion even though
Chris Lattner [Fri, 25 Jul 2008 20:54:07 +0000 (20:54 +0000)]
In c99 mode, comma does do function/array promotion even though
it does not do unary promotions (like short->int).

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

16 years agoRefine ObjCPropertyImplDecl:
Ted Kremenek [Fri, 25 Jul 2008 20:43:38 +0000 (20:43 +0000)]
Refine ObjCPropertyImplDecl:

- Remove a bunch of setXXX methods until we actually need them. This cleans up the
interface, and makes the object immutable until we have a reason to be mutable.

- Remove enum value OBJC_PR_IMPL_None since it was never used.

- Remove instance variable 'PropertyImplKind PropertyImplementation;'. This is
  not needed because we can tell if ObjCPropertyImplDecl represents @synthesize
  if 'ObjCPropertyDecl *PropertyDecl' is not null.

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

16 years agoEnabled 'unused ivars' check by default.
Ted Kremenek [Fri, 25 Jul 2008 20:35:01 +0000 (20:35 +0000)]
Enabled 'unused ivars' check by default.

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

16 years agoRemove '.' in expected warning
Ted Kremenek [Fri, 25 Jul 2008 20:30:34 +0000 (20:30 +0000)]
Remove '.' in expected warning

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

16 years agoHave the UnusedIvar check skip ivars with setters/getters created by @synthesize.
Ted Kremenek [Fri, 25 Jul 2008 20:28:02 +0000 (20:28 +0000)]
Have the UnusedIvar check skip ivars with setters/getters created by @synthesize.

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

16 years agoX86 builtin fixes
Nate Begeman [Fri, 25 Jul 2008 20:17:24 +0000 (20:17 +0000)]
X86 builtin fixes

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

16 years agoGenerate vector compares in codegen
Nate Begeman [Fri, 25 Jul 2008 20:16:05 +0000 (20:16 +0000)]
Generate vector compares in codegen

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

16 years agoMove comment to match style
Nate Begeman [Fri, 25 Jul 2008 20:15:41 +0000 (20:15 +0000)]
Move comment to match style

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

16 years agoDe-tabify
Nate Begeman [Fri, 25 Jul 2008 20:15:14 +0000 (20:15 +0000)]
De-tabify

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

16 years agoComma does not perform unary promotions, rdar://6095180
Chris Lattner [Fri, 25 Jul 2008 20:02:29 +0000 (20:02 +0000)]
Comma does not perform unary promotions, rdar://6095180

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

16 years agogcc requires a semicolon at the end of an interface, unlike its extension for structs.
Chris Lattner [Fri, 25 Jul 2008 19:54:55 +0000 (19:54 +0000)]
gcc requires a semicolon at the end of an interface, unlike its extension for structs.
rdar://6095245.

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

16 years agoCleaunup Sema::ActOnClassMessage(). This commit:
Steve Naroff [Fri, 25 Jul 2008 19:39:00 +0000 (19:39 +0000)]
Cleaunup Sema::ActOnClassMessage(). This commit:
(a) removes a bogus warning.
(b) removes an undesirable usage of the ObjCMessageExpr constructor that takes an IdentifierInfo * (which I will abolish).

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

16 years agoReject typedef redefinitions when the underlying types are not identical,
Chris Lattner [Fri, 25 Jul 2008 18:44:27 +0000 (18:44 +0000)]
Reject typedef redefinitions when the underlying types are not identical,
even if in a system header etc.  rdar://6079937

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

16 years agoupdate this testcase.
Chris Lattner [Fri, 25 Jul 2008 18:42:46 +0000 (18:42 +0000)]
update this testcase.

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

16 years agoAdd test case for hex floating point constants in < C99 mode
Daniel Dunbar [Fri, 25 Jul 2008 18:41:57 +0000 (18:41 +0000)]
Add test case for hex floating point constants in < C99 mode
 - For: rdar://6096838

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

16 years agoIn c89 mode accept hex fp constants as an extension:
Chris Lattner [Fri, 25 Jul 2008 18:18:34 +0000 (18:18 +0000)]
In c89 mode accept hex fp constants as an extension:

t2.c:1:17: warning: hexadecimal floating constants are a C99 feature
long double d = 0x0.0000003ffffffff00000p-16357L;
                ^

instead of emitting a weird error message that doesn't make sense:

t2.c:1:41: error: hexadecimal floating constants require an exponent
long double d = 0x0.0000003ffffffff00000p-16357L;
                                        ^

rdar://6096838

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

16 years agoRemove call to isSEL and isSEL itself since the call is dead (isObjCObjectPointerType...
Ted Kremenek [Fri, 25 Jul 2008 18:17:35 +0000 (18:17 +0000)]
Remove call to isSEL and isSEL itself since the call is dead (isObjCObjectPointerType() will never return true for selectors).

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

16 years agoAdd support for __extension__ as an lvalue. rdar://6097308
Chris Lattner [Fri, 25 Jul 2008 18:07:19 +0000 (18:07 +0000)]
Add support for __extension__ as an lvalue.  rdar://6097308

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

16 years agoMove fix in r54013 from the parser to sema.
Steve Naroff [Fri, 25 Jul 2008 17:57:26 +0000 (17:57 +0000)]
Move fix in r54013 from the parser to sema.

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

16 years agoOnly warn about missing/incomplete -dealloc implementations when a class contains...
Ted Kremenek [Fri, 25 Jul 2008 17:04:49 +0000 (17:04 +0000)]
Only warn about missing/incomplete -dealloc implementations when a class contains a non-SEL, non-IBOutlet ivar that references an ObjC object.

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

16 years agocomment out #pragma mark and #warning directives.
Chris Lattner [Fri, 25 Jul 2008 16:37:06 +0000 (16:37 +0000)]
comment out #pragma mark and #warning directives.

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

16 years agorewrite handling of the raw token stream in -rewrite-macros to lex
Chris Lattner [Fri, 25 Jul 2008 16:29:12 +0000 (16:29 +0000)]
rewrite handling of the raw token stream in -rewrite-macros to lex
everything up front into a vector.  This makes it easier to scan around
the stream when needed.

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

16 years agoalphabeticalize
Chris Lattner [Fri, 25 Jul 2008 16:06:51 +0000 (16:06 +0000)]
alphabeticalize

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

16 years agoFix RewriteObjC::RewriteObjCThrowStmt() to respect whitespace between the @ and throw.
Steve Naroff [Fri, 25 Jul 2008 15:41:30 +0000 (15:41 +0000)]
Fix RewriteObjC::RewriteObjCThrowStmt() to respect whitespace between the @ and throw.
This fixes <rdar://problem/5988388> clang ObjC rewriter: mystery 'w' inserted in exception throw.

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

16 years agoFix Parser::ParseObjCMethodDefinition(). Only call the actions module for valid MDecl's.
Steve Naroff [Fri, 25 Jul 2008 14:30:25 +0000 (14:30 +0000)]
Fix Parser::ParseObjCMethodDefinition(). Only call the actions module for valid MDecl's.

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

16 years agoUpdated checker build.
Ted Kremenek [Fri, 25 Jul 2008 05:21:03 +0000 (05:21 +0000)]
Updated checker build.

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

16 years agoDon't emit 'dead initialization' warnings for variables marked 'unused'.
Ted Kremenek [Fri, 25 Jul 2008 04:47:34 +0000 (04:47 +0000)]
Don't emit 'dead initialization' warnings for variables marked 'unused'.
This fixes PR 2573: http://llvm.org/bugs/show_bug.cgi?id=2573

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

16 years agoImplemented Sema support for attribute "unused".
Ted Kremenek [Fri, 25 Jul 2008 04:39:19 +0000 (04:39 +0000)]
Implemented Sema support for attribute "unused".

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

16 years agoRework codegen of case ranges
Daniel Dunbar [Fri, 25 Jul 2008 01:11:38 +0000 (01:11 +0000)]
Rework codegen of case ranges
 - Fix multiple issues with the way case ranges were emitted, see test
   cases details about the specific issues.

 - The root issue was not being careful about how basic blocks were
   emitted which led to them being chained together incorrectly,
   resulting in improper control flow.

 - Fixes <rdar://problem/6098585>

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

16 years agoAllow CLANG env variable to override "clang" command in TestRunner.sh
Daniel Dunbar [Fri, 25 Jul 2008 01:05:44 +0000 (01:05 +0000)]
Allow CLANG env variable to override "clang" command in TestRunner.sh

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

16 years agoUse ASTContext::isObjCObjectPointerType() to check if an ivar is a reference to an...
Ted Kremenek [Thu, 24 Jul 2008 23:59:07 +0000 (23:59 +0000)]
Use ASTContext::isObjCObjectPointerType() to check if an ivar is a reference to an Objective-C object.

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

16 years agoMove isObjCObjectPointerType() from Sema to ASTContext.
Ted Kremenek [Thu, 24 Jul 2008 23:58:27 +0000 (23:58 +0000)]
Move isObjCObjectPointerType() from Sema to ASTContext.

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

16 years agoUpdate VS project.
Ted Kremenek [Thu, 24 Jul 2008 22:20:01 +0000 (22:20 +0000)]
Update VS project.

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

16 years agoFix Sema::ActOnClassMessage() to pass through the identifier for "super".
Steve Naroff [Thu, 24 Jul 2008 19:44:33 +0000 (19:44 +0000)]
Fix Sema::ActOnClassMessage() to pass through the identifier for "super".
This fixes a critical rewriter bug (<rdar://problem/6096760> clang ObjC rewriter: 'self' not expected value in class method called with 'super').

Also added a couple FIXME's since I'm not happy with my fix to Sema. It would be nicer if the super handling for class/instance messages was the same (based on PreDefinedExpr).

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

16 years agoCorrectly handle NSAssertionHandle -handleFailureInMethod:object:file:lineNumber...
Ted Kremenek [Thu, 24 Jul 2008 18:47:16 +0000 (18:47 +0000)]
Correctly handle NSAssertionHandle -handleFailureInMethod:object:file:lineNumber:description:
This fixes: http://llvm.org/bugs/show_bug.cgi?id=2593

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

16 years agoUpdated checker build.
Ted Kremenek [Thu, 24 Jul 2008 18:15:01 +0000 (18:15 +0000)]
Updated checker build.

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

16 years agoDon't issue a missing +dealloc warning for classes that just contain SEL ivars.
Ted Kremenek [Thu, 24 Jul 2008 17:45:56 +0000 (17:45 +0000)]
Don't issue a missing +dealloc warning for classes that just contain SEL ivars.
This fixes PR 2592: http://llvm.org/bugs/show_bug.cgi?id=2592

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

16 years agoFix comment
Daniel Dunbar [Thu, 24 Jul 2008 17:38:50 +0000 (17:38 +0000)]
Fix comment

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

16 years agoRename test case file.
Ted Kremenek [Thu, 24 Jul 2008 17:02:18 +0000 (17:02 +0000)]
Rename test case file.

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

16 years agoIssue dead store warnings for preincrements involved in a subexpression.
Ted Kremenek [Thu, 24 Jul 2008 17:01:17 +0000 (17:01 +0000)]
Issue dead store warnings for preincrements involved in a subexpression.

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

16 years agoIgnore -MT and -MF.
Ted Kremenek [Thu, 24 Jul 2008 03:52:21 +0000 (03:52 +0000)]
Ignore -MT and -MF.

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

16 years ago"This patch adds paths for Fedora 9 in clang.cpp and support for two preprocessor...
Ted Kremenek [Thu, 24 Jul 2008 03:49:15 +0000 (03:49 +0000)]
"This patch adds paths for Fedora 9 in clang.cpp and support for two preprocessor options in ccc."

Patch by Zhongxing Xu!

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

16 years agoFix EmitCaseStmtRange to ignore empty ranges
Daniel Dunbar [Thu, 24 Jul 2008 01:18:41 +0000 (01:18 +0000)]
Fix EmitCaseStmtRange to ignore empty ranges
 - Also cleaned up emission slightly
 - Inspection of the code revealed several other bugs, however. Case
   ranges are not properly wired and can result in switch cases being
   dropped or even infinite loops. See: <rdar://problem/6098585>

Completes: <rdar://problem/6094119>

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

16 years agoAdd Expr::getIntegerConstantExprValue helper method
Daniel Dunbar [Thu, 24 Jul 2008 01:08:37 +0000 (01:08 +0000)]
Add Expr::getIntegerConstantExprValue helper method
 - For getting an APSInt from a known integer constant Expr.
 - TODO: Many users of Expr::isIntegerConstantExpr in codegen should
   probably be using this instead...

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

16 years agoUpdated checker build.
Ted Kremenek [Wed, 23 Jul 2008 23:39:06 +0000 (23:39 +0000)]
Updated checker build.

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

16 years agoAdded dead stores test case.
Ted Kremenek [Wed, 23 Jul 2008 23:18:43 +0000 (23:18 +0000)]
Added dead stores test case.

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

16 years agoModified HTMLDiagnostics to also perform syntax highlighting for errors in header...
Ted Kremenek [Wed, 23 Jul 2008 23:18:15 +0000 (23:18 +0000)]
Modified HTMLDiagnostics to also perform syntax highlighting for errors in header files.

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

16 years agoDon't flag dead stores when the result of a preincrement/predecrement is used in...
Ted Kremenek [Wed, 23 Jul 2008 22:19:56 +0000 (22:19 +0000)]
Don't flag dead stores when the result of a preincrement/predecrement is used in an enclosing expression.

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

16 years agoAdded UnaryOperator::isPrefix().
Ted Kremenek [Wed, 23 Jul 2008 22:18:43 +0000 (22:18 +0000)]
Added UnaryOperator::isPrefix().

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

16 years agoUse typedef range_iterator instead of SourceRange* in PathDiagnosticPiece.
Ted Kremenek [Wed, 23 Jul 2008 21:51:42 +0000 (21:51 +0000)]
Use typedef range_iterator instead of SourceRange* in PathDiagnosticPiece.

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

16 years agoFurther refine dead store checking to distinguish between dead stores and dead increm...
Ted Kremenek [Wed, 23 Jul 2008 21:16:38 +0000 (21:16 +0000)]
Further refine dead store checking to distinguish between dead stores and dead increments.

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

16 years agoProperly skip IBOutlets when checking for unused ivars.
Ted Kremenek [Wed, 23 Jul 2008 18:21:36 +0000 (18:21 +0000)]
Properly skip IBOutlets when checking for unused ivars.
Refine the error message of unused ivars.
Added test case.

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

16 years agoInitialize instance variable DeclAccess in ctor for ObjCIvarDecl.
Ted Kremenek [Wed, 23 Jul 2008 18:12:25 +0000 (18:12 +0000)]
Initialize instance variable DeclAccess in ctor for ObjCIvarDecl.

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

16 years agoWhen constructing an ObjCIvarDecl object in Sema, provide its visibility up front...
Ted Kremenek [Wed, 23 Jul 2008 18:04:17 +0000 (18:04 +0000)]
When constructing an ObjCIvarDecl object in Sema, provide its visibility up front instead of setting it afterwards.
This change also fixes a subtle bug where the access control of an ivar would be initialized to garbage if we didn't have an explicit visibility specifier (e.g., @private).

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

16 years agoUpdated comment for class ObjCIvarDecl: it turns out the default access control
Ted Kremenek [Wed, 23 Jul 2008 17:44:44 +0000 (17:44 +0000)]
Updated comment for class ObjCIvarDecl: it turns out the default access control
is protected, not private.

Added ObjCIvarDecl::getCanonicalAccessControl() to report the visible access
control of an ivar, whereas getAccessControl() returns the access control
relating to how the ivar was actually declared.

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

16 years agoIvar access mode ObjCIvarDecl::None == ObjCIvarDecl::Protected, not private.
Ted Kremenek [Wed, 23 Jul 2008 17:14:39 +0000 (17:14 +0000)]
Ivar access mode ObjCIvarDecl::None == ObjCIvarDecl::Protected, not private.

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

16 years agoUpdate Xcode project.
Ted Kremenek [Wed, 23 Jul 2008 17:13:09 +0000 (17:13 +0000)]
Update Xcode project.

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

16 years agodon't depend on the result of CreateNeg to be a binop
Chris Lattner [Wed, 23 Jul 2008 06:53:34 +0000 (06:53 +0000)]
don't depend on the result of CreateNeg to be a binop

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

16 years agoFix rdar://6094010 various asserts happening with wide strings in inline asm.
Chris Lattner [Wed, 23 Jul 2008 06:46:56 +0000 (06:46 +0000)]
Fix rdar://6094010 various asserts happening with wide strings in inline asm.

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

16 years agoFix a codegen crash on:
Chris Lattner [Wed, 23 Jul 2008 06:31:27 +0000 (06:31 +0000)]
Fix a codegen crash on:

int foo(void) {
  float x[2];
  return x;
}

rdar://6093986

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

16 years agoAdd prototype implementation of unused ivar check.
Ted Kremenek [Wed, 23 Jul 2008 00:45:26 +0000 (00:45 +0000)]
Add prototype implementation of unused ivar check.

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

16 years agoUpdated checker build.
Ted Kremenek [Tue, 22 Jul 2008 22:45:52 +0000 (22:45 +0000)]
Updated checker build.

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

16 years agoFix compilation error on GCC 4.3.0 ('memcpy' was not declared in this scope).
Argyrios Kyrtzidis [Tue, 22 Jul 2008 21:56:45 +0000 (21:56 +0000)]
Fix compilation error on GCC 4.3.0 ('memcpy' was not declared in this scope).

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

16 years agoAdd note to check what __alignof__ a function type should be.
Daniel Dunbar [Tue, 22 Jul 2008 19:44:18 +0000 (19:44 +0000)]
Add note to check what __alignof__ a function type should be.

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

16 years agoAlways define __SIZE_TYPE__ as long unsigned int.
Anders Carlsson [Tue, 22 Jul 2008 17:16:13 +0000 (17:16 +0000)]
Always define __SIZE_TYPE__ as long unsigned int.

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

16 years agoUpdate VS project.
Ted Kremenek [Tue, 22 Jul 2008 17:13:59 +0000 (17:13 +0000)]
Update VS project.

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

16 years agoUse llvm::utostr_32 instead of ostringstream.
Ted Kremenek [Tue, 22 Jul 2008 16:56:21 +0000 (16:56 +0000)]
Use llvm::utostr_32 instead of ostringstream.

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

16 years agoUpdate VS project.
Ted Kremenek [Tue, 22 Jul 2008 16:47:06 +0000 (16:47 +0000)]
Update VS project.

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

16 years agoUpdate Xcode project.
Ted Kremenek [Tue, 22 Jul 2008 16:22:19 +0000 (16:22 +0000)]
Update Xcode project.

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

16 years agoMoved registration of basic path-sensitive checks from GRSimpleVals.cpp to GRExprEngi...
Ted Kremenek [Tue, 22 Jul 2008 16:21:24 +0000 (16:21 +0000)]
Moved registration of basic path-sensitive checks from GRSimpleVals.cpp to GRExprEngineInternalChecks.cpp.

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

16 years agoRename file.
Ted Kremenek [Tue, 22 Jul 2008 14:41:47 +0000 (14:41 +0000)]
Rename file.

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

16 years agoPrevent codegen crash on sizeof(<function type>), a gcc extension.
Daniel Dunbar [Tue, 22 Jul 2008 01:35:47 +0000 (01:35 +0000)]
Prevent codegen crash on sizeof(<function type>), a gcc extension.

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

16 years agoAdd svn:ignore for cscope.{out,files} in top level clang dir
Daniel Dunbar [Tue, 22 Jul 2008 01:03:06 +0000 (01:03 +0000)]
Add svn:ignore for cscope.{out,files} in top level clang dir

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

16 years agoAdded path-sensitive checking for null pointer values passed to function arguments...
Ted Kremenek [Tue, 22 Jul 2008 00:46:16 +0000 (00:46 +0000)]
Added path-sensitive checking for null pointer values passed to function arguments marked nonnull.
This implements <rdar://problem/6069935>

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

16 years agoImplement bzero, memset, memmove builtins.
Daniel Dunbar [Tue, 22 Jul 2008 00:26:45 +0000 (00:26 +0000)]
Implement bzero, memset, memmove builtins.

This subsumes Nico Weber's patch and implements bzero in terms
of llvm.memset to match llvm-gcc.

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

16 years agoImplement nans, prefetch, and trap builtins.
Daniel Dunbar [Mon, 21 Jul 2008 22:59:13 +0000 (22:59 +0000)]
Implement nans, prefetch, and trap builtins.

This closes <rdar://problem/6080720>, support for __builtin_constant_p
has been filed separately.

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

16 years agominor cleanup to the actions interface to pass around SmallVectorImpl instead
Chris Lattner [Mon, 21 Jul 2008 22:17:28 +0000 (22:17 +0000)]
minor cleanup to the actions interface to pass around SmallVectorImpl instead
of a specific smallvector size.

Fix protocol lists to pass down proper location info, so we get diagnostics
like this:

t.m:3:35: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
                                  ^

instead of this:

t.m:3:44: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
                                           ^

Add a new IdentifierLocPair typedef which is just a pair<IdentifierInfo*, SourceLocation>

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

16 years agoAdd test case for nonnull attribute.
Ted Kremenek [Mon, 21 Jul 2008 22:09:15 +0000 (22:09 +0000)]
Add test case for nonnull attribute.
Fix indexing bug.

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

16 years agoAdded sema support for the nonnull attribute. Will add test cases soon.
Ted Kremenek [Mon, 21 Jul 2008 21:53:04 +0000 (21:53 +0000)]
Added sema support for the nonnull attribute.  Will add test cases soon.

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

16 years agoKill an unused variable warning
Daniel Dunbar [Mon, 21 Jul 2008 21:43:28 +0000 (21:43 +0000)]
Kill an unused variable warning

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

16 years agounindent this function by using an early exit, not functionality change.
Chris Lattner [Mon, 21 Jul 2008 21:33:21 +0000 (21:33 +0000)]
unindent this function by using an early exit, not functionality change.

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

16 years agomove two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,
Chris Lattner [Mon, 21 Jul 2008 21:32:27 +0000 (21:32 +0000)]
move two more lists of protocols over to use ObjCList<ObjCProtocolDecl>,
simplifying code along the way and fixing a problem and memory leak or two.

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

16 years agoAdd svn:ignore property for test Output directories
Daniel Dunbar [Mon, 21 Jul 2008 18:45:49 +0000 (18:45 +0000)]
Add svn:ignore property for test Output directories

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

16 years agoAdd __builtin_powi[fl] support
Daniel Dunbar [Mon, 21 Jul 2008 18:44:41 +0000 (18:44 +0000)]
Add __builtin_powi[fl] support

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

16 years agoFix a test RUN line to not generate '=-' in test directory
Daniel Dunbar [Mon, 21 Jul 2008 18:42:27 +0000 (18:42 +0000)]
Fix a test RUN line to not generate '=-' in test directory

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

16 years agoadd forward definition protocols to the protocol list for a class.
Chris Lattner [Mon, 21 Jul 2008 18:35:17 +0000 (18:35 +0000)]
add forward definition protocols to the protocol list for a class.

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

16 years agoreferences to completely undeclared protocols should be errors.
Chris Lattner [Mon, 21 Jul 2008 18:34:02 +0000 (18:34 +0000)]
references to completely undeclared protocols should be errors.
References to forward definitions should be warnings.

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

16 years agoRewriteObjC::RewriteObjCForCollectionStmt() needs to handle bodies with a single...
Steve Naroff [Mon, 21 Jul 2008 18:26:02 +0000 (18:26 +0000)]
RewriteObjC::RewriteObjCForCollectionStmt() needs to handle bodies with a single statement.
Fixes <rdar://problem/6084870> clang ObjC rewriter: for-in enumeration in 1 line produces output with error.

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

16 years agointroduce a new ObjCList templated class and start moving
Chris Lattner [Mon, 21 Jul 2008 18:19:38 +0000 (18:19 +0000)]
introduce a new ObjCList templated class and start moving
various objc lists over to it.  First up, the protocol list
on ObjCInterfaceDecl.

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

16 years agoUpdate checker build.
Ted Kremenek [Mon, 21 Jul 2008 17:53:09 +0000 (17:53 +0000)]
Update checker build.

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

16 years agorename setReferencedProtocolList -> addReferencedProtocols to
Chris Lattner [Mon, 21 Jul 2008 17:23:15 +0000 (17:23 +0000)]
rename setReferencedProtocolList -> addReferencedProtocols to
be consistent with ObjCInterfaceDecl.

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

16 years agoImplement ffs, parity, and popcount builtins.
Daniel Dunbar [Mon, 21 Jul 2008 17:19:41 +0000 (17:19 +0000)]
Implement ffs, parity, and popcount builtins.
 + test case

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

16 years agoChange 'MDecl' to 'MD' to fix redefinition compiler error in MSVC++.
Argyrios Kyrtzidis [Mon, 21 Jul 2008 09:18:38 +0000 (09:18 +0000)]
Change 'MDecl' to 'MD' to fix redefinition compiler error in MSVC++.

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

16 years agofix typo
Chris Lattner [Mon, 21 Jul 2008 07:13:18 +0000 (07:13 +0000)]
fix typo

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

16 years agoSwitch initialization of the protocol list for an interface decl to use
Chris Lattner [Mon, 21 Jul 2008 07:06:49 +0000 (07:06 +0000)]
Switch initialization of the protocol list for an interface decl to use
the standard "set these as the list of protocols" interface instead of a
strange "set this as the size and then set each one to the value" interface.
The problem with the later is that it a) is completely different from
everything else, b) is awkward, and c) doesn't handle the case when a
referenced protocol is invalid: it set it to null.

This meant that all clients downstream would have to handle null protocols
in the protocol list, and empirically they didn't.  Fix this by not setting
invalid protocols in the referenced protocol list, fixing the crash on
test/Sema/objc-interface-1.m

While I'm at it, clean up some locations so that we produce:

t.m:1:25: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
~~~~~~~~~~~~~~~~~~~~~   ^

instead of:

t.m:1:1: error: cannot find interface declaration for 'NSObject', superclass of 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
^

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

16 years agowhen in the context of an @implementation, look for private methods in the
Chris Lattner [Mon, 21 Jul 2008 06:44:27 +0000 (06:44 +0000)]
when in the context of an @implementation, look for private methods in the
@implementation to resolve nullary selector references.

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

16 years agodon't pass in null as the Name for GenerateClassStructure,
Chris Lattner [Mon, 21 Jul 2008 06:31:05 +0000 (06:31 +0000)]
don't pass in null as the Name for GenerateClassStructure,
it goes and makes std::strings out of them, which is not
defined.

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

16 years agoimprove diagnostics about problems with receivers to highlight the receiver.
Chris Lattner [Mon, 21 Jul 2008 06:16:07 +0000 (06:16 +0000)]
improve diagnostics about problems with receivers to highlight the receiver.

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

16 years agocontinue cleaning up code, and disable sending a message directly to an
Chris Lattner [Mon, 21 Jul 2008 06:12:56 +0000 (06:12 +0000)]
continue cleaning up code, and disable sending a message directly to an
interface.  This fixes a bug where we used to accept:

void test2(NSNumber x) {
[x METH];
}

which doesn't make sense and GCC rejects.

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