]> granicus.if.org Git - clang/log
clang
16 years agoAdd doxygen support
Daniel Dunbar [Sat, 26 Jul 2008 21:32:24 +0000 (21:32 +0000)]
Add doxygen support
 - Stolen from LLVM with minor modifications

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

16 years agoconvert more code to use ASTContext to get canonical types instead
Chris Lattner [Sat, 26 Jul 2008 21:30:36 +0000 (21:30 +0000)]
convert more code to use ASTContext to get canonical types instead
of doing it directly.  This is required for PR2189.

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

16 years agoremove a helper method.
Chris Lattner [Sat, 26 Jul 2008 20:50:02 +0000 (20:50 +0000)]
remove a helper method.

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

16 years agoimplement codegen support for labels at the end of stmtexprs.
Chris Lattner [Sat, 26 Jul 2008 20:23:23 +0000 (20:23 +0000)]
implement codegen support for labels at the end of stmtexprs.

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

16 years agominor tidying, no functionality change.
Chris Lattner [Sat, 26 Jul 2008 20:15:14 +0000 (20:15 +0000)]
minor tidying, no functionality change.

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

16 years agofix some problems handling stmtexprs with labels (PR2374), and
Chris Lattner [Sat, 26 Jul 2008 19:51:01 +0000 (19:51 +0000)]
fix some problems handling stmtexprs with labels (PR2374), and
improve 'expression unused' diagnostics for stmtexprs.

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

16 years agofix an extraneous blank line in -ast-dump output.
Chris Lattner [Sat, 26 Jul 2008 19:24:43 +0000 (19:24 +0000)]
fix an extraneous blank line in -ast-dump output.

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

16 years agotestcase for PR2416, which we already handle correctly.
Chris Lattner [Sat, 26 Jul 2008 19:15:11 +0000 (19:15 +0000)]
testcase for PR2416, which we already handle correctly.

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

16 years agoRemove some old text.
Ted Kremenek [Sat, 26 Jul 2008 05:21:44 +0000 (05:21 +0000)]
Remove some old text.

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

16 years agoPull protocol resolution of out ActOnStartClassInterface, this is also the
Chris Lattner [Sat, 26 Jul 2008 04:13:19 +0000 (04:13 +0000)]
Pull protocol resolution of out ActOnStartClassInterface, this is also the
last client of the old ParseObjCProtocolReferences, so it also removes it.

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

16 years agorefactor protocol resolution out of ActOnStartCategoryInterface
Chris Lattner [Sat, 26 Jul 2008 04:07:02 +0000 (04:07 +0000)]
refactor protocol resolution out of ActOnStartCategoryInterface

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

16 years agopull protocol resolution out into ActOnStartProtocolInterface.
Chris Lattner [Sat, 26 Jul 2008 04:03:38 +0000 (04:03 +0000)]
pull protocol resolution out into ActOnStartProtocolInterface.
This temporarily duplicates ParseObjCProtocolReferences, but it
will be removed in the future.

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

16 years agosimplify some code.
Chris Lattner [Sat, 26 Jul 2008 03:47:43 +0000 (03:47 +0000)]
simplify some code.

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

16 years agoremove duplicate error message.
Chris Lattner [Sat, 26 Jul 2008 03:40:25 +0000 (03:40 +0000)]
remove duplicate error message.

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

16 years ago< only starts a declspec in objc mode.
Chris Lattner [Sat, 26 Jul 2008 03:38:44 +0000 (03:38 +0000)]
< only starts a declspec in objc mode.

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

16 years agoremove fixed fixme
Chris Lattner [Sat, 26 Jul 2008 01:56:46 +0000 (01:56 +0000)]
remove fixed fixme

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

16 years agomake DeclSpec manage its own protocol qualifier list memory instead of having
Chris Lattner [Sat, 26 Jul 2008 01:53:50 +0000 (01:53 +0000)]
make DeclSpec manage its own protocol qualifier list memory instead of having
clients allocate the memory and it delete it.

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

16 years agoFix hte next wave of problems with protocol qualified ID:
Chris Lattner [Sat, 26 Jul 2008 01:18:38 +0000 (01:18 +0000)]
Fix hte next wave of problems with protocol qualified ID:
1) reject stuff like "id<foo> short" and "<foo> short".  2) set
the declspec range correctly 3) only parse protocol qualifiers
when in objc mode.

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

16 years agoremove objc prefixes from these tests.
Chris Lattner [Sat, 26 Jul 2008 01:04:40 +0000 (01:04 +0000)]
remove objc prefixes from these tests.

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

16 years agomove all objc sema tests into a new SemaObjC directory. Next step is to
Chris Lattner [Sat, 26 Jul 2008 00:57:24 +0000 (00:57 +0000)]
move all objc sema tests into a new SemaObjC directory.  Next step is to
remove the objc- prefix from the tests that use it.

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

16 years agofix several problems with the protocol qualified id handling where id was implicit.
Chris Lattner [Sat, 26 Jul 2008 00:46:50 +0000 (00:46 +0000)]
fix several problems with the protocol qualified id handling where id was implicit.

First, fix canonical type handling of these, since protocol qualified id's are always
canonical.  Next, enhance SemaType to actually make these when used (instead of int)
allowing them to actually be used when appropriate.  Finally remove a bunch of logic
relating to the mishandling of canonical types with protocol-qual id's.  This fixes
rdar://5986251

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

16 years agoimprove handling of the horrible GCC objc extension that treats "<foo>"
Chris Lattner [Sat, 26 Jul 2008 00:20:22 +0000 (00:20 +0000)]
improve handling of the horrible GCC objc extension that treats "<foo>"
like "id<foo>".  This 1) fixes an infinite loop in the parser on things
like "short<foo>" 2) emits a warning about this bogus construct and 3)
changes the testcase to be substantially reduced.

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

16 years agoadd a new diag helper that takes a range.
Chris Lattner [Sat, 26 Jul 2008 00:16:04 +0000 (00:16 +0000)]
add a new diag helper that takes a range.

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

16 years agoGCC supports the complex conjugate operator (an extension) on complex int
Chris Lattner [Fri, 25 Jul 2008 23:52:49 +0000 (23:52 +0000)]
GCC supports the complex conjugate operator (an extension) on complex int
as well as complex float. rdar://6097730

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

16 years agofix diagnostics.
Chris Lattner [Fri, 25 Jul 2008 23:41:08 +0000 (23:41 +0000)]
fix diagnostics.

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

16 years agoFix rdar://6103124, the only dummy blocks are ones without names. Named blocks
Chris Lattner [Fri, 25 Jul 2008 23:40:10 +0000 (23:40 +0000)]
Fix rdar://6103124, the only dummy blocks are ones without names.  Named blocks
are important part of control flow structures.

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

16 years agoAdded project idea for a doxygen-like tool built using clang
Ted Kremenek [Fri, 25 Jul 2008 23:34:29 +0000 (23:34 +0000)]
Added project idea for a doxygen-like tool built using clang

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

16 years agofix 80 col violation.
Chris Lattner [Fri, 25 Jul 2008 23:30:42 +0000 (23:30 +0000)]
fix 80 col violation.

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

16 years agoFix rdar://6095136, various crashes with incomplete enum types.
Chris Lattner [Fri, 25 Jul 2008 23:18:17 +0000 (23:18 +0000)]
Fix rdar://6095136, various crashes with incomplete enum types.

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

16 years agominor cleanup
Chris Lattner [Fri, 25 Jul 2008 23:07:18 +0000 (23:07 +0000)]
minor cleanup

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

16 years agoRemove unused ASTConsumer::HandleTopLevelDeclaration
Daniel Dunbar [Fri, 25 Jul 2008 22:39:30 +0000 (22:39 +0000)]
Remove unused ASTConsumer::HandleTopLevelDeclaration

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

16 years agomove a method.
Chris Lattner [Fri, 25 Jul 2008 22:25:12 +0000 (22:25 +0000)]
move a method.

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

16 years agoFix a couple bugs in aggregate cast processing: 1) fix precedecence
Chris Lattner [Fri, 25 Jul 2008 22:06:10 +0000 (22:06 +0000)]
Fix a couple bugs in aggregate cast processing: 1) fix precedecence
problem with &&/||.  2) use canonical types for comparison instead
of raw types. 3) emit an ext-warn for a gnu extension.

Also simplify the code to make it less nested.

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

16 years agoFormat string errors should underling the format string, not the function name.
Ted Kremenek [Fri, 25 Jul 2008 22:03:03 +0000 (22:03 +0000)]
Format string errors should underling the format string, not the function name.

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

16 years agomake sizeof/alignof diagnostics highlight their operand with a sourcerange.
Chris Lattner [Fri, 25 Jul 2008 21:45:37 +0000 (21:45 +0000)]
make sizeof/alignof diagnostics highlight their operand with a sourcerange.

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

16 years agoc89 does not perform array -> pointer promotion unless the array is an lvalue. This
Chris Lattner [Fri, 25 Jul 2008 21:33:13 +0000 (21:33 +0000)]
c89 does not perform array -> pointer promotion unless the array is an lvalue.  This
is different than C99.  This fixes the rest of rdar://6095180.

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

16 years agomove some code, no other change.
Chris Lattner [Fri, 25 Jul 2008 21:10:04 +0000 (21:10 +0000)]
move some code, no other change.

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

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

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

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