]> granicus.if.org Git - clang/log
clang
16 years agoFix several issues in checking of address-of expressions.
Daniel Dunbar [Mon, 4 Aug 2008 20:02:37 +0000 (20:02 +0000)]
Fix several issues in checking of address-of expressions.
 - clang was erroneously accepting address-of applied to lvalue
   expressions involving pointer arithmetic.
 - clang was erroneously rejecting address-of applied to deref
   expressions of pointer-typed variables.
 - Improved existing test case.
 - Fixes: <rdar://problem/6113867>, <rdar://problem/6080158>

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

16 years agoMisc cleanups.
Ted Kremenek [Mon, 4 Aug 2008 18:15:26 +0000 (18:15 +0000)]
Misc cleanups.

When results go to a auto-generated dir in /tmp, don't use randomized file names.  Just output /tmp/scan-build-DATE-counter, where counter is an auto-incremented counter for runs produced that day.

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

16 years agoUpdated latest checker build.
Ted Kremenek [Mon, 4 Aug 2008 17:36:34 +0000 (17:36 +0000)]
Updated latest checker build.

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

16 years agoConvert remaining "open" calls to use three-argument form (thanks to Sam Bishop for...
Ted Kremenek [Mon, 4 Aug 2008 17:34:06 +0000 (17:34 +0000)]
Convert remaining "open" calls to use three-argument form (thanks to Sam Bishop for the tip!).

Recognize 'ccc-analyzer' as a build command some users may use.  Treat it just like calling gcc.

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

16 years agoAvoid creating dummy block when no indirect gotos are present.
Daniel Dunbar [Mon, 4 Aug 2008 17:24:44 +0000 (17:24 +0000)]
Avoid creating dummy block when no indirect gotos are present.

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

16 years agoFix regression when invoking the MissingDealloc analysis: disable this check when...
Ted Kremenek [Mon, 4 Aug 2008 17:14:10 +0000 (17:14 +0000)]
Fix regression when invoking the MissingDealloc analysis: disable this check when in -fobjc-gc-only mode.

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

16 years agoAdd CodeGen support for indirect goto.
Daniel Dunbar [Mon, 4 Aug 2008 16:51:22 +0000 (16:51 +0000)]
Add CodeGen support for indirect goto.
 - Follows emission scheme used by llvm-gcc, i.e. invent an id for
   each label whose address is taken and replace each indirect goto by
   a switch to each possible target.
 - Currently we emit a switch for each indirect goto instead of
   merging them as llvm-gcc does.

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

16 years agoFinally fix PR2189. This makes a fairly invasive but important change to
Chris Lattner [Mon, 4 Aug 2008 07:31:14 +0000 (07:31 +0000)]
Finally fix PR2189.  This makes a fairly invasive but important change to
move getAsArrayType into ASTContext instead of being a method on type.
This is required because getAsArrayType(const AT), where AT is a typedef
for "int[10]" needs to return ArrayType(const int, 10).

Fixing this greatly simplifies getArrayDecayedType, which is a good sign.

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

16 years agoUpdated latest checker build.
Ted Kremenek [Sun, 3 Aug 2008 03:14:03 +0000 (03:14 +0000)]
Updated latest checker build.

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

16 years agoChange 'dead store (++/--)' to 'dead increment'
Ted Kremenek [Sat, 2 Aug 2008 18:19:48 +0000 (18:19 +0000)]
Change 'dead store (++/--)' to 'dead increment'

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

16 years agoWherever a type is used/returned from the Action module, use TypeTy instead of DeclTy...
Argyrios Kyrtzidis [Fri, 1 Aug 2008 10:35:27 +0000 (10:35 +0000)]
Wherever a type is used/returned from the Action module, use TypeTy instead of DeclTy or void.
No functionality change.

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

16 years agoMake the default constructor of IdentifierResolver::iterator public.
Argyrios Kyrtzidis [Fri, 1 Aug 2008 10:20:48 +0000 (10:20 +0000)]
Make the default constructor of IdentifierResolver::iterator public.

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

16 years agoAdd more output to clang -parse-print-callbacks
Daniel Dunbar [Fri, 1 Aug 2008 00:41:12 +0000 (00:41 +0000)]
Add more output to clang -parse-print-callbacks

 - Just added prints for all the action functions. Ideally this would
   be extended to print all the information for the actions.

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

16 years agoSupport constructor and destructor attributes in CodeGen
Daniel Dunbar [Fri, 1 Aug 2008 00:01:51 +0000 (00:01 +0000)]
Support constructor and destructor attributes in CodeGen

 - There is an miscompilation issue remaining due to a poor
   interaction between the delayed emission of static functions and
   the emission of constructors, but that already existed prior to
   this change.

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

16 years agoSupport __attribute__(({con,de}structor)) in Parse & Sema
Daniel Dunbar [Thu, 31 Jul 2008 22:40:48 +0000 (22:40 +0000)]
Support __attribute__(({con,de}structor)) in Parse & Sema
 - Including possible priority argument
 - In other news, the attribute parsing code really needs a cleanup

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

16 years agoEnhanced path-sensitive return-of-stack-address check to print out the name of the...
Ted Kremenek [Thu, 31 Jul 2008 20:31:27 +0000 (20:31 +0000)]
Enhanced path-sensitive return-of-stack-address check to print out the name of the variable whose address was returned.

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

16 years agoRemove getCodeBody() from Decl, and hoist getBody() into Decl as a virtual function.
Ted Kremenek [Thu, 31 Jul 2008 17:32:12 +0000 (17:32 +0000)]
Remove getCodeBody() from Decl, and hoist getBody() into Decl as a virtual function.

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

16 years agoimprove order
Chris Lattner [Thu, 31 Jul 2008 06:48:13 +0000 (06:48 +0000)]
improve order

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

16 years agoFix a regression I introduced in r54107:
Chris Lattner [Thu, 31 Jul 2008 04:58:58 +0000 (04:58 +0000)]
Fix a regression I introduced in r54107:
http://llvm.org/viewvc/llvm-project?view=rev&revision=54107

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

16 years agoUpdated to match new atomic names (to enable overloading for pointers to
Mon P Wang [Thu, 31 Jul 2008 03:28:23 +0000 (03:28 +0000)]
Updated to match new atomic names (to enable overloading for pointers to
different address spaces) for llvm r54195.

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

16 years agoFix implicit initialization of structures.
Daniel Dunbar [Wed, 30 Jul 2008 21:00:24 +0000 (21:00 +0000)]
Fix implicit initialization of structures.

<rdar://problem/6113085>

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

16 years agoUse stable sort.
Ted Kremenek [Wed, 30 Jul 2008 18:03:31 +0000 (18:03 +0000)]
Use stable sort.

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

16 years ago"Escape" bug names with quotes for selecting/deselecting from the bug table.
Ted Kremenek [Wed, 30 Jul 2008 17:58:08 +0000 (17:58 +0000)]
"Escape" bug names with quotes for selecting/deselecting from the bug table.

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

16 years agoAdd range highlighting for path-sensitive return-of-stack-address check.
Ted Kremenek [Wed, 30 Jul 2008 17:49:12 +0000 (17:49 +0000)]
Add range highlighting for path-sensitive return-of-stack-address check.

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

16 years agoChange CodeGenModule GlobalDeclMap to directly reference globals
Daniel Dunbar [Wed, 30 Jul 2008 16:32:24 +0000 (16:32 +0000)]
Change CodeGenModule GlobalDeclMap to directly reference globals
instead of mapping the decl to a bitcast of the global to the correct
type.

 - GetAddrOf{Function,GlobalVar} introduce the bitcast on every use now.

 - This solves a problem where a dangling pointer could be introduced
   by the RAUW done when replacing a forward or tentative
   definition. See testcase for more details.

 - Fixes <rdar://problem/6108358>

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

16 years agoFix regression in range highlighting in HTML output.
Ted Kremenek [Tue, 29 Jul 2008 23:35:38 +0000 (23:35 +0000)]
Fix regression in range highlighting in HTML output.

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

16 years agoRework codegen emission of globals
Daniel Dunbar [Tue, 29 Jul 2008 23:18:29 +0000 (23:18 +0000)]
Rework codegen emission of globals
 - No (intended) functionality change.

 - Primary purpose is to clearly separate (lazy) construction of
   globals that are a forward declaration or tentative definition from
   those that are the final definition.

 - Lazy construction is now encapsulated in
   GetAddrOf{Function,GlobalVar} while final definitions are
   constructed in EmitGlobal{Function,Var}Definition.

 - External interface for dealing with globals is now limited to
   EmitGlobal and GetAddrOf{Function,GlobalVar}.

 - Also updated helper functions dealing with statics, annotations,
   and ctors to be private.

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

16 years agoFix incomplete implementation for rewriting protocol refs.
Steve Naroff [Tue, 29 Jul 2008 18:15:38 +0000 (18:15 +0000)]
Fix incomplete implementation for rewriting protocol refs.

<rdar://problem/6108127> clang ObjC rewriter: no translation of id <proto>

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

16 years agoFix codegen of chained declarations
Daniel Dunbar [Tue, 29 Jul 2008 17:47:36 +0000 (17:47 +0000)]
Fix codegen of chained declarations
 - Killed useless CodeGenModule::EmitGlobalVarDeclarator, instead just
   recurse on any ScopedDecl.
 - Fix for <rdar://problem/6093838>

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

16 years agoadd a crazy idea
Chris Lattner [Tue, 29 Jul 2008 03:46:33 +0000 (03:46 +0000)]
add a crazy idea

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

16 years agofix tag
Chris Lattner [Sun, 27 Jul 2008 06:13:09 +0000 (06:13 +0000)]
fix tag

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

16 years agolist delta and distcc.
Chris Lattner [Sun, 27 Jul 2008 06:10:19 +0000 (06:10 +0000)]
list delta and distcc.

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

16 years agoMinor tweak plus a couple of FIXMEs.
Eli Friedman [Sun, 27 Jul 2008 05:46:18 +0000 (05:46 +0000)]
Minor tweak plus a couple of FIXMEs.

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

16 years agoRemove bashism; sh != bash on Ubuntu.
Eli Friedman [Sun, 27 Jul 2008 05:05:07 +0000 (05:05 +0000)]
Remove bashism; sh != bash on Ubuntu.

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

16 years agoFix serialization for TypedefType by allowing TypedefType to access the internal...
Ted Kremenek [Sun, 27 Jul 2008 03:47:53 +0000 (03:47 +0000)]
Fix serialization for TypedefType by allowing TypedefType to access the internal CanonicalType stored in Type.
The test case Serialization/stmt_exprs.c now passes.

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

16 years agomake "call foo.dump()" and "call foo->dump()" work in GDB,
Chris Lattner [Sun, 27 Jul 2008 00:48:22 +0000 (00:48 +0000)]
make "call foo.dump()" and "call foo->dump()" work in GDB,
with QualTypes and Types.

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

16 years agoremove QualType::getCanonicalType. Also make
Chris Lattner [Sun, 27 Jul 2008 00:06:09 +0000 (00:06 +0000)]
remove QualType::getCanonicalType.  Also make
QualType::ReadBackpatch public so that FieldDecl doesn't need
to be a friend of QualType.

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

16 years agoremove two uses of getCanonicalType I missed.
Chris Lattner [Sun, 27 Jul 2008 00:05:05 +0000 (00:05 +0000)]
remove two uses of getCanonicalType I missed.

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

16 years agoclean up the footer a bit more.
Chris Lattner [Sat, 26 Jul 2008 23:54:49 +0000 (23:54 +0000)]
clean up the footer a bit more.

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

16 years agoremove SSIs.
Chris Lattner [Sat, 26 Jul 2008 23:52:26 +0000 (23:52 +0000)]
remove SSIs.

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

16 years agoAdd the right path to the lines image.
Chris Lattner [Sat, 26 Jul 2008 23:51:08 +0000 (23:51 +0000)]
Add the right path to the lines image.

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

16 years agolink to doxygen dox
Chris Lattner [Sat, 26 Jul 2008 23:45:57 +0000 (23:45 +0000)]
link to doxygen dox

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

16 years agoComment out the last call to QualType::getCanonicalType. This *breaks*
Chris Lattner [Sat, 26 Jul 2008 22:40:28 +0000 (22:40 +0000)]
Comment out the last call to QualType::getCanonicalType.  This *breaks*
Serialization/stmt_exprs.c, but I don't know the right solution.  Will fix
when I get a chance to talk to Ted about it.

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

16 years agoFix a bug in my previous patch, CGF is not valid for constants outside a function
Chris Lattner [Sat, 26 Jul 2008 22:39:33 +0000 (22:39 +0000)]
Fix a bug in my previous patch, CGF is not valid for constants outside a function

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

16 years agoremove uses of QualType::getCanonicalType() from codegen for PR2189
Chris Lattner [Sat, 26 Jul 2008 22:37:01 +0000 (22:37 +0000)]
remove uses of QualType::getCanonicalType() from codegen for PR2189

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

16 years agoremove some unneeded calls to getCanonicalType
Chris Lattner [Sat, 26 Jul 2008 22:36:27 +0000 (22:36 +0000)]
remove some unneeded calls to getCanonicalType

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

16 years agochange more instances of QualType::getCanonicalType to call
Chris Lattner [Sat, 26 Jul 2008 22:17:49 +0000 (22:17 +0000)]
change more instances of QualType::getCanonicalType to call
ASTContext::getCanonicalType instead (PR2189)

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

16 years agoalphabeticalize a bit better.
Chris Lattner [Sat, 26 Jul 2008 22:09:09 +0000 (22:09 +0000)]
alphabeticalize a bit better.

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

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