Matthijs Kooijman
8dab3eec81
Let LLVMCodeGenWriter forward all the methods defined in ASTConsumer, to
...
prevent unexpected surprises later on.
llvm-svn: 54469
2008-08-07 16:04:15 +00:00
Steve Naroff
f960c0bb9e
Sema::ActOnEnumBody(): handle nested enum redefinitions.
...
Fixes <rdar://problem/6093889> Nested enum redefinition crashes sema.
llvm-svn: 54463
2008-08-07 14:08:16 +00:00
Ted Kremenek
955516e6c7
attribute "unused" also applies to functions.
...
llvm-svn: 54440
2008-08-07 01:02:05 +00:00
Ted Kremenek
c3b4c52a4d
Fix <rdar://problem/6125909>.
...
Unify logic in return-of-stack-check (Sema) for casts and implicit casts.
llvm-svn: 54439
2008-08-07 00:49:01 +00:00
Ted Kremenek
a4750cb1e5
Updated checker build.
...
llvm-svn: 54437
2008-08-06 23:57:27 +00:00
Ted Kremenek
83180f6e47
Enhanced test case.
...
llvm-svn: 54436
2008-08-06 23:26:31 +00:00
Ted Kremenek
8889bb3ff4
Cleanup some processing with DeclStmt, and gradually start using the internal BumpPtrAllocator to allocator more of CFG's data structures.
...
llvm-svn: 54433
2008-08-06 23:20:50 +00:00
Ted Kremenek
e26ccf3553
Always construct the BumpPtrAllocator used by CFG as an instance variable.
...
llvm-svn: 54429
2008-08-06 22:22:32 +00:00
Ted Kremenek
66db7d66de
Fix serialization of DeclStmt.
...
llvm-svn: 54428
2008-08-06 22:17:30 +00:00
Ted Kremenek
93e9233355
Added VCProj file for libDriver.
...
llvm-svn: 54423
2008-08-06 20:50:20 +00:00
Daniel Dunbar
8d81683554
Replace old bitfield test.
...
- Change hardcoded assembly instructions to a use of 'opt' (still
waiting for someone to yell at me for this).
- Add some cases to cover behavior fixed by previous commit.
llvm-svn: 54413
2008-08-06 16:07:39 +00:00
Steve Naroff
c884aa8e84
Fix for <rdar://problem/6113807> clang ObjC rewriter: crash rewriting attached file
...
While this is a safe rewriter fix, there is still a need for some discussion (see report for more info).
llvm-svn: 54412
2008-08-06 15:58:23 +00:00
Ted Kremenek
8d78a09a56
Reorder serialization methods.
...
When serializing DeclStmt, encode a bit indicating whether or not the DeclStmt owns the Decl. This is an interim solution.
llvm-svn: 54410
2008-08-06 15:50:59 +00:00
Daniel Dunbar
e8bdce441b
Fix EmitNullInitializationToLValue for bitfield lvalues.
...
- PR2643
llvm-svn: 54397
2008-08-06 05:32:55 +00:00
Daniel Dunbar
ead7c91240
Fix bitfield accesses which straddle the boundary of the underlying
...
type.
- This generates somewhat less optimal code than before but this is
not hard to rectify once stable (at the cost of slightly more
complex code).
- This currently always uses little-endian ordering of the bitfield.
- This breaks the CodeGen/bitfield.c test because it was grepping for
hard-coded assembly instructions. Will fix once a better test case
is constructed (hard to do without execution).
- This fixes SingleSource/UnitTests/2006-01-23-InitializedBitField.c
and Regression/C/PR1386.c from the test suite.
- <rdar://problem/6085090>, <rdar://problem/6094169>
llvm-svn: 54395
2008-08-06 05:08:45 +00:00
Ted Kremenek
be160966cd
Update xcode project to new libDriver layout.
...
llvm-svn: 54393
2008-08-06 02:55:08 +00:00
Daniel Dunbar
bfb1cd7454
Fix CodeGen of pointer arithmetic in compound assignment statements.
...
- Changed EmitSub to work on all cases (arithmetic, ptr - int, ptr -
ptr) so that implementation matches that of other operators.
- Modify EmitCompoundAssign to compute and perform the appropriate
casts of left, right, and result types for the assorted pointer
arithmetic cases.
- Fix EmitSub (ptr - int) case to negate the rhs *after*
extension. This is critical when the rhs is unsigned (and needs
extension).
- This fixes cfrac.
- <rdr://6115726>
llvm-svn: 54392
2008-08-06 02:00:38 +00:00
Daniel Dunbar
ffc29be83f
Implement GNU asm-label extension support in CodeGen. This fixes
...
scimark2 on Darwin.
- Added Sema support for asm-label on variables, which I forgot before.
- Update CodeGen to use GlobalDeclMap to determine if static Decls
require emission (instead of LLVM module name lookup). Important
since the Decl name and the LLVM module name can differ.
- <rdar://problem/6116729>
llvm-svn: 54388
2008-08-06 00:03:29 +00:00
Nico Weber
b5fc3c300a
add a libDriver, for now only move the text diangostics stuff from Driver to there
...
llvm-svn: 54383
2008-08-05 23:33:20 +00:00
Daniel Dunbar
829e988899
Change CodeGen of global decls to key off of the name (instead of
...
having multiple bindings from all the possible decls which
conceptually map to the same global).
- This eliminates CodeGen depending on the LLVM module for name
lookup.
- This also eliminates the need for ReplaceMapValuesWith (hurrah).
- This handles lookups for FunctionDecls correctly in the presence of
aliases, this was previously broken.
- WIP: Can still clean up & unify variable and function emission.
llvm-svn: 54382
2008-08-05 23:31:02 +00:00
Nico Weber
de565e3bc9
remove spaces at eol to test commit access
...
llvm-svn: 54381
2008-08-05 23:15:29 +00:00
Ted Kremenek
182ab758a3
Add missing "classof" methods to NonNullAttr, fixing a heisencrash.
...
llvm-svn: 54373
2008-08-05 21:29:52 +00:00
Ted Kremenek
4f8792b616
Added decl_iterator to DeclStmt to provide an abstract interface to iterate over the ScopedDecls of a DeclStmt.
...
Updated a few clients of DeclStmt::getNextDeclarator() to use decl_iterator instead. Will update other clients after additional testing.
llvm-svn: 54368
2008-08-05 20:46:55 +00:00
Steve Naroff
dd514e01f2
Finish fixing <rdar://problem/5929344> clang ObjC rewriter: "extern int __CFConstantStringClassReference[];" should be extern "C"
...
llvm-svn: 54367
2008-08-05 20:04:48 +00:00
Ted Kremenek
9f6112c4e6
Remove excess #include.
...
llvm-svn: 54366
2008-08-05 19:56:24 +00:00
Nuno Lopes
d86aa9340d
fix crash when printing diagnostics with tokens that span through more than one line
...
llvm-svn: 54365
2008-08-05 19:40:20 +00:00
Ted Kremenek
2c674f6dbb
Refactored driver logic for CodeGen into LLVMCodeGenWriter. This ASTConsumer layers on top of LLVMCodeGen (another existing ASTConsumer) to emit bitcode files to disk. This layering takes this logic out of clang.cpp and puts it directly into the ASTConsumer interface. The benefit is that now --emit-llvm works with both serialized ASTs and regular source files.
...
llvm-svn: 54364
2008-08-05 18:50:11 +00:00
Steve Naroff
568bbf73b2
Fix <rdar://problem/6108119> clang ObjC rewriter: if no newline at end of input file, rewriter inserts #define on same line as closing brace
...
llvm-svn: 54363
2008-08-05 18:47:23 +00:00
Daniel Dunbar
1ff1d1fd51
Move AsmLabel into Declarator instead of just a parameter to
...
ActOnDeclarator.
llvm-svn: 54353
2008-08-05 16:28:08 +00:00
Daniel Dunbar
eca183bad2
Add test case for PR2001.
...
llvm-svn: 54352
2008-08-05 16:15:29 +00:00
Daniel Dunbar
d548c79eaf
Fix const-init test case
...
- Use -verify and added expected warnings for EXTWARN change.
llvm-svn: 54342
2008-08-05 06:30:41 +00:00
Chris Lattner
197a301669
Fix rdar://6124613 a crash on invalid code.
...
llvm-svn: 54340
2008-08-05 06:19:09 +00:00
Daniel Dunbar
4983df37a7
Add more Parser/Sema support for GCC asm-label extension.
...
- ActOnDeclarator now takes an additional parameter which is the
AsmLabel if used. Its unfortunate that this bubbles up this high,
but we cannot just lump it in as an attribute without mistakenly
*accepting* it as an attribute.
- The actual asm-label itself is, however, encoded as an AsmLabelAttr
on the FunctionDecl.
- Slightly improved parser error recovery on malformed asm-labels.
- CodeGen support still missing...
llvm-svn: 54339
2008-08-05 01:35:17 +00:00
Daniel Dunbar
5aa55d51ca
Bug fix, CodeGen of (void*) - (void*) was broken.
...
- <rdar://problem/6122967>
llvm-svn: 54338
2008-08-05 00:47:03 +00:00
Daniel Dunbar
81f7f2904c
Add EXTWARN Diagnostic class.
...
- Like EXTENSION but always generates a warning (even without
-pedantic).
- Updated ptr -> int, int -> ptr, and incompatible cast warnings to
be EXTWARN.
- Other EXTENSION level diagnostics should be audited for upgrade.
- Updated several test cases to fix code which produced unanticipated
warnings.
llvm-svn: 54335
2008-08-05 00:07:51 +00:00
Ted Kremenek
be9b33bf0f
Nico Weber:
...
"the attached patch fixes some typos, 80 cols violations, etc. in comments."
llvm-svn: 54328
2008-08-04 22:51:42 +00:00
Daniel Dunbar
b692ef405b
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>
llvm-svn: 54326
2008-08-04 20:02:37 +00:00
Ted Kremenek
7ae17ce6b4
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.
llvm-svn: 54325
2008-08-04 18:15:26 +00:00
Ted Kremenek
11911c2940
Updated latest checker build.
...
llvm-svn: 54324
2008-08-04 17:36:34 +00:00
Ted Kremenek
5a3803c076
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.
llvm-svn: 54323
2008-08-04 17:34:06 +00:00
Daniel Dunbar
d27262f369
Avoid creating dummy block when no indirect gotos are present.
...
llvm-svn: 54322
2008-08-04 17:24:44 +00:00
Ted Kremenek
9898028742
Fix regression when invoking the MissingDealloc analysis: disable this check when in -fobjc-gc-only mode.
...
llvm-svn: 54319
2008-08-04 17:14:10 +00:00
Daniel Dunbar
88402ce8d0
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.
llvm-svn: 54318
2008-08-04 16:51:22 +00:00
Chris Lattner
7adf076088
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.
llvm-svn: 54317
2008-08-04 07:31:14 +00:00
Ted Kremenek
dea68f4cbe
Updated latest checker build.
...
llvm-svn: 54276
2008-08-03 03:14:03 +00:00
Ted Kremenek
9512c122fa
Change 'dead store (++/--)' to 'dead increment'
...
llvm-svn: 54268
2008-08-02 18:19:48 +00:00
Argyrios Kyrtzidis
25d05e88a5
Wherever a type is used/returned from the Action module, use TypeTy instead of DeclTy or void.
...
No functionality change.
llvm-svn: 54265
2008-08-01 10:35:27 +00:00
Argyrios Kyrtzidis
85324837ce
Make the default constructor of IdentifierResolver::iterator public.
...
llvm-svn: 54264
2008-08-01 10:20:48 +00:00
Daniel Dunbar
f4693e289a
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.
llvm-svn: 54259
2008-08-01 00:41:12 +00:00
Daniel Dunbar
74aa7e1eae
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.
llvm-svn: 54258
2008-08-01 00:01:51 +00:00
Daniel Dunbar
032db47f0f
Support __attribute__(({con,de}structor)) in Parse & Sema
...
- Including possible priority argument
- In other news, the attribute parsing code really needs a cleanup
llvm-svn: 54257
2008-07-31 22:40:48 +00:00
Ted Kremenek
a7045d663d
Enhanced path-sensitive return-of-stack-address check to print out the name of the variable whose address was returned.
...
llvm-svn: 54253
2008-07-31 20:31:27 +00:00
Ted Kremenek
e5b40a9112
Remove getCodeBody() from Decl, and hoist getBody() into Decl as a virtual function.
...
llvm-svn: 54247
2008-07-31 17:32:12 +00:00
Chris Lattner
b4ec8de163
improve order
...
llvm-svn: 54244
2008-07-31 06:48:13 +00:00
Chris Lattner
330f0f2567
Fix a regression I introduced in r54107:
...
http://llvm.org/viewvc/llvm-project?view=rev&revision=54107
llvm-svn: 54242
2008-07-31 04:58:58 +00:00
Mon P Wang
b160a0d78d
Updated to match new atomic names (to enable overloading for pointers to
...
different address spaces) for llvm r54195.
llvm-svn: 54241
2008-07-31 03:28:23 +00:00
Daniel Dunbar
b39b1cd7c3
Fix implicit initialization of structures.
...
<rdar://problem/6113085>
llvm-svn: 54237
2008-07-30 21:00:24 +00:00
Ted Kremenek
6a77d42a4d
Use stable sort.
...
llvm-svn: 54222
2008-07-30 18:03:31 +00:00
Ted Kremenek
e8fce56cd1
"Escape" bug names with quotes for selecting/deselecting from the bug table.
...
llvm-svn: 54220
2008-07-30 17:58:08 +00:00
Ted Kremenek
a8b8ce499a
Add range highlighting for path-sensitive return-of-stack-address check.
...
llvm-svn: 54219
2008-07-30 17:49:12 +00:00
Daniel Dunbar
e49df9b58f
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>
llvm-svn: 54211
2008-07-30 16:32:24 +00:00
Ted Kremenek
8cf5045012
Fix regression in range highlighting in HTML output.
...
llvm-svn: 54181
2008-07-29 23:35:38 +00:00
Daniel Dunbar
9c426524f8
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.
llvm-svn: 54179
2008-07-29 23:18:29 +00:00
Steve Naroff
873bd8497a
Fix incomplete implementation for rewriting protocol refs.
...
<rdar://problem/6108127> clang ObjC rewriter: no translation of id <proto>
llvm-svn: 54163
2008-07-29 18:15:38 +00:00
Daniel Dunbar
837fd272f8
Fix codegen of chained declarations
...
- Killed useless CodeGenModule::EmitGlobalVarDeclarator, instead just
recurse on any ScopedDecl.
- Fix for <rdar://problem/6093838>
llvm-svn: 54162
2008-07-29 17:47:36 +00:00
Chris Lattner
373351725f
add a crazy idea
...
llvm-svn: 54151
2008-07-29 03:46:33 +00:00
Chris Lattner
03bc8c0ab8
fix tag
...
llvm-svn: 54121
2008-07-27 06:13:09 +00:00
Chris Lattner
e8c687f05a
list delta and distcc.
...
llvm-svn: 54120
2008-07-27 06:10:19 +00:00
Eli Friedman
bd84059cdb
Minor tweak plus a couple of FIXMEs.
...
llvm-svn: 54119
2008-07-27 05:46:18 +00:00
Eli Friedman
d7a9a46cb5
Remove bashism; sh != bash on Ubuntu.
...
llvm-svn: 54118
2008-07-27 05:05:07 +00:00
Ted Kremenek
192510920e
Fix serialization for TypedefType by allowing TypedefType to access the internal CanonicalType stored in Type.
...
The test case Serialization/stmt_exprs.c now passes.
llvm-svn: 54117
2008-07-27 03:47:53 +00:00
Chris Lattner
872eb55f5e
make "call foo.dump()" and "call foo->dump()" work in GDB,
...
with QualTypes and Types.
llvm-svn: 54116
2008-07-27 00:48:22 +00:00
Chris Lattner
e80159da05
remove QualType::getCanonicalType. Also make
...
QualType::ReadBackpatch public so that FieldDecl doesn't need
to be a friend of QualType.
llvm-svn: 54115
2008-07-27 00:06:09 +00:00
Chris Lattner
35ffe331b9
remove two uses of getCanonicalType I missed.
...
llvm-svn: 54114
2008-07-27 00:05:05 +00:00
Chris Lattner
613fdff902
clean up the footer a bit more.
...
llvm-svn: 54113
2008-07-26 23:54:49 +00:00
Chris Lattner
e3bbfffa5b
remove SSIs.
...
llvm-svn: 54112
2008-07-26 23:52:26 +00:00
Chris Lattner
9213f5d947
Add the right path to the lines image.
...
llvm-svn: 54111
2008-07-26 23:51:08 +00:00
Chris Lattner
7cb2da9d0b
link to doxygen dox
...
llvm-svn: 54110
2008-07-26 23:45:57 +00:00
Chris Lattner
401cc23c4d
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.
llvm-svn: 54109
2008-07-26 22:40:28 +00:00
Chris Lattner
d9fa5d6a23
Fix a bug in my previous patch, CGF is not valid for constants outside a function
...
llvm-svn: 54108
2008-07-26 22:39:33 +00:00
Chris Lattner
0f398c4472
remove uses of QualType::getCanonicalType() from codegen for PR2189
...
llvm-svn: 54107
2008-07-26 22:37:01 +00:00
Chris Lattner
3f6cd0bc76
remove some unneeded calls to getCanonicalType
...
llvm-svn: 54106
2008-07-26 22:36:27 +00:00
Chris Lattner
574dee6cac
change more instances of QualType::getCanonicalType to call
...
ASTContext::getCanonicalType instead (PR2189)
llvm-svn: 54105
2008-07-26 22:17:49 +00:00
Chris Lattner
6fc6614c0d
alphabeticalize a bit better.
...
llvm-svn: 54104
2008-07-26 22:09:09 +00:00
Daniel Dunbar
086fe1ac79
Add doxygen support
...
- Stolen from LLVM with minor modifications
llvm-svn: 54103
2008-07-26 21:32:24 +00:00
Chris Lattner
6731544be7
convert more code to use ASTContext to get canonical types instead
...
of doing it directly. This is required for PR2189.
llvm-svn: 54102
2008-07-26 21:30:36 +00:00
Chris Lattner
ac87ef5dcc
remove a helper method.
...
llvm-svn: 54101
2008-07-26 20:50:02 +00:00
Chris Lattner
7e80097f6e
implement codegen support for labels at the end of stmtexprs.
...
llvm-svn: 54100
2008-07-26 20:23:23 +00:00
Chris Lattner
6284378fcd
minor tidying, no functionality change.
...
llvm-svn: 54099
2008-07-26 20:15:14 +00:00
Chris Lattner
944d306371
fix some problems handling stmtexprs with labels (PR2374), and
...
improve 'expression unused' diagnostics for stmtexprs.
llvm-svn: 54098
2008-07-26 19:51:01 +00:00
Chris Lattner
06afbebbdd
fix an extraneous blank line in -ast-dump output.
...
llvm-svn: 54097
2008-07-26 19:24:43 +00:00
Chris Lattner
bcf2e66b3c
testcase for PR2416, which we already handle correctly.
...
llvm-svn: 54096
2008-07-26 19:15:11 +00:00
Ted Kremenek
ef6378cda7
Remove some old text.
...
llvm-svn: 54095
2008-07-26 05:21:44 +00:00
Chris Lattner
df59f5aa3c
Pull protocol resolution of out ActOnStartClassInterface, this is also the
...
last client of the old ParseObjCProtocolReferences, so it also removes it.
llvm-svn: 54094
2008-07-26 04:13:19 +00:00
Chris Lattner
b1f3c948ee
refactor protocol resolution out of ActOnStartCategoryInterface
...
llvm-svn: 54093
2008-07-26 04:07:02 +00:00
Chris Lattner
3bbae00f50
pull protocol resolution out into ActOnStartProtocolInterface.
...
This temporarily duplicates ParseObjCProtocolReferences, but it
will be removed in the future.
llvm-svn: 54092
2008-07-26 04:03:38 +00:00
Chris Lattner
9c1842b612
simplify some code.
...
llvm-svn: 54091
2008-07-26 03:47:43 +00:00
Chris Lattner
908d39e45e
remove duplicate error message.
...
llvm-svn: 54090
2008-07-26 03:40:25 +00:00
Chris Lattner
8b2ec166b8
< only starts a declspec in objc mode.
...
llvm-svn: 54089
2008-07-26 03:38:44 +00:00
Chris Lattner
12fd035d6f
remove fixed fixme
...
llvm-svn: 54088
2008-07-26 01:56:46 +00:00
Chris Lattner
bc76297674
make DeclSpec manage its own protocol qualifier list memory instead of having
...
clients allocate the memory and it delete it.
llvm-svn: 54087
2008-07-26 01:53:50 +00:00
Chris Lattner
16fac4f2ad
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.
llvm-svn: 54086
2008-07-26 01:18:38 +00:00
Chris Lattner
31236f8744
remove objc prefixes from these tests.
...
llvm-svn: 54085
2008-07-26 01:04:40 +00:00
Chris Lattner
89026888ef
move all objc sema tests into a new SemaObjC directory. Next step is to
...
remove the objc- prefix from the tests that use it.
llvm-svn: 54084
2008-07-26 00:57:24 +00:00
Chris Lattner
a075e63bbc
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
llvm-svn: 54083
2008-07-26 00:46:50 +00:00
Chris Lattner
0974b2380f
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.
llvm-svn: 54082
2008-07-26 00:20:22 +00:00
Chris Lattner
9acd2f1cd2
add a new diag helper that takes a range.
...
llvm-svn: 54081
2008-07-26 00:16:04 +00:00
Chris Lattner
0d70761cad
GCC supports the complex conjugate operator (an extension) on complex int
...
as well as complex float. rdar://6097730
llvm-svn: 54080
2008-07-25 23:52:49 +00:00
Chris Lattner
8c217a81ac
fix diagnostics.
...
llvm-svn: 54079
2008-07-25 23:41:08 +00:00
Chris Lattner
4591fd0aac
Fix rdar://6103124, the only dummy blocks are ones without names. Named blocks
...
are important part of control flow structures.
llvm-svn: 54078
2008-07-25 23:40:10 +00:00
Ted Kremenek
0478105f7c
Added project idea for a doxygen-like tool built using clang
...
llvm-svn: 54076
2008-07-25 23:34:29 +00:00
Chris Lattner
2841fc0e7b
fix 80 col violation.
...
llvm-svn: 54075
2008-07-25 23:30:42 +00:00
Chris Lattner
903eb518e6
Fix rdar://6095136, various crashes with incomplete enum types.
...
llvm-svn: 54074
2008-07-25 23:18:17 +00:00
Chris Lattner
6bf59d82c8
minor cleanup
...
llvm-svn: 54073
2008-07-25 23:07:18 +00:00
Daniel Dunbar
c9809a9d68
Remove unused ASTConsumer::HandleTopLevelDeclaration
...
llvm-svn: 54071
2008-07-25 22:39:30 +00:00
Chris Lattner
2ce500ffbe
move a method.
...
llvm-svn: 54069
2008-07-25 22:25:12 +00:00
Chris Lattner
bea82ff6ed
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.
llvm-svn: 54068
2008-07-25 22:06:10 +00:00
Ted Kremenek
870f750434
Format string errors should underling the format string, not the function name.
...
llvm-svn: 54067
2008-07-25 22:03:03 +00:00
Chris Lattner
3f375d055e
make sizeof/alignof diagnostics highlight their operand with a sourcerange.
...
llvm-svn: 54066
2008-07-25 21:45:37 +00:00
Chris Lattner
61f60a05b2
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.
llvm-svn: 54064
2008-07-25 21:33:13 +00:00
Chris Lattner
513165ecf3
move some code, no other change.
...
llvm-svn: 54063
2008-07-25 21:10:04 +00:00
Ted Kremenek
e8f7bdc5cf
Updated latest checker build.
...
llvm-svn: 54060
2008-07-25 21:05:04 +00:00
Daniel Dunbar
b5586dad97
Fix long double test case
...
- Had wrong sizeof(long double) encoded into test case
- Results now agree with llvm-gcc
llvm-svn: 54059
2008-07-25 20:54:30 +00:00
Chris Lattner
f6e1e309c7
In c99 mode, comma does do function/array promotion even though
...
it does not do unary promotions (like short->int).
llvm-svn: 54058
2008-07-25 20:54:07 +00:00
Ted Kremenek
04350ebe4a
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.
llvm-svn: 54055
2008-07-25 20:43:38 +00:00
Ted Kremenek
7fb92dbf47
Enabled 'unused ivars' check by default.
...
llvm-svn: 54052
2008-07-25 20:35:01 +00:00
Ted Kremenek
e17c037f4f
Remove '.' in expected warning
...
llvm-svn: 54051
2008-07-25 20:30:34 +00:00
Ted Kremenek
d074ce47b6
Have the UnusedIvar check skip ivars with setters/getters created by @synthesize.
...
llvm-svn: 54050
2008-07-25 20:28:02 +00:00
Nate Begeman
448b0cb033
X86 builtin fixes
...
llvm-svn: 54049
2008-07-25 20:17:24 +00:00
Nate Begeman
fe79ca2ab9
Generate vector compares in codegen
...
llvm-svn: 54048
2008-07-25 20:16:05 +00:00
Nate Begeman
e7f45b2977
Move comment to match style
...
llvm-svn: 54047
2008-07-25 20:15:41 +00:00
Nate Begeman
8d161830d1
De-tabify
...
llvm-svn: 54046
2008-07-25 20:15:14 +00:00
Chris Lattner
e174acc910
Comma does not perform unary promotions, rdar://6095180
...
llvm-svn: 54045
2008-07-25 20:02:29 +00:00
Chris Lattner
e08e47ab2f
gcc requires a semicolon at the end of an interface, unlike its extension for structs.
...
rdar://6095245.
llvm-svn: 54044
2008-07-25 19:54:55 +00:00
Steve Naroff
e2177fbfdc
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).
llvm-svn: 54042
2008-07-25 19:39:00 +00:00
Chris Lattner
f9c49e5d27
Reject typedef redefinitions when the underlying types are not identical,
...
even if in a system header etc. rdar://6079937
llvm-svn: 54038
2008-07-25 18:44:27 +00:00
Chris Lattner
31614aeb0a
update this testcase.
...
llvm-svn: 54037
2008-07-25 18:42:46 +00:00
Daniel Dunbar
c481f72857
Add test case for hex floating point constants in < C99 mode
...
- For: rdar://6096838
llvm-svn: 54036
2008-07-25 18:41:57 +00:00
Chris Lattner
c94ad4abcb
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
llvm-svn: 54035
2008-07-25 18:18:34 +00:00
Ted Kremenek
83ec24501e
Remove call to isSEL and isSEL itself since the call is dead (isObjCObjectPointerType() will never return true for selectors).
...
llvm-svn: 54034
2008-07-25 18:17:35 +00:00
Chris Lattner
ec8996d771
Add support for __extension__ as an lvalue. rdar://6097308
...
llvm-svn: 54033
2008-07-25 18:07:19 +00:00
Steve Naroff
542cd5d3f9
Move fix in r54013 from the parser to sema.
...
llvm-svn: 54032
2008-07-25 17:57:26 +00:00
Ted Kremenek
2483730e3f
Only warn about missing/incomplete -dealloc implementations when a class contains a non-SEL, non-IBOutlet ivar that references an ObjC object.
...
llvm-svn: 54024
2008-07-25 17:04:49 +00:00
Chris Lattner
f08932928c
comment out #pragma mark and #warning directives.
...
llvm-svn: 54020
2008-07-25 16:37:06 +00:00
Chris Lattner
b9c34de5c4
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.
llvm-svn: 54019
2008-07-25 16:29:12 +00:00
Chris Lattner
3e3ff3e538
alphabeticalize
...
llvm-svn: 54018
2008-07-25 16:06:51 +00:00
Steve Naroff
29788347b2
Fix RewriteObjC::RewriteObjCThrowStmt() to respect whitespace between the @ and throw.
...
This fixes <rdar://problem/5988388> clang ObjC rewriter: mystery 'w' inserted in exception throw.
llvm-svn: 54017
2008-07-25 15:41:30 +00:00
Steve Naroff
ce5206b4f2
Fix Parser::ParseObjCMethodDefinition(). Only call the actions module for valid MDecl's.
...
llvm-svn: 54013
2008-07-25 14:30:25 +00:00
Ted Kremenek
177bc93165
Updated checker build.
...
llvm-svn: 54012
2008-07-25 05:21:03 +00:00
Ted Kremenek
092ec76923
Don't emit 'dead initialization' warnings for variables marked 'unused'.
...
This fixes PR 2573: http://llvm.org/bugs/show_bug.cgi?id=2573
llvm-svn: 54009
2008-07-25 04:47:34 +00:00
Ted Kremenek
39c59a8887
Implemented Sema support for attribute "unused".
...
llvm-svn: 54008
2008-07-25 04:39:19 +00:00
Daniel Dunbar
0e5845c13a
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>
llvm-svn: 54006
2008-07-25 01:11:38 +00:00
Daniel Dunbar
dd49a04d18
Allow CLANG env variable to override "clang" command in TestRunner.sh
...
llvm-svn: 54005
2008-07-25 01:05:44 +00:00
Ted Kremenek
5eb536b74c
Use ASTContext::isObjCObjectPointerType() to check if an ivar is a reference to an Objective-C object.
...
llvm-svn: 53999
2008-07-24 23:59:07 +00:00
Ted Kremenek
77c51b2aa3
Move isObjCObjectPointerType() from Sema to ASTContext.
...
llvm-svn: 53998
2008-07-24 23:58:27 +00:00
Ted Kremenek
a23b9f0e90
Update VS project.
...
llvm-svn: 53995
2008-07-24 22:20:01 +00:00
Steve Naroff
6c79f97037
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).
llvm-svn: 53994
2008-07-24 19:44:33 +00:00
Ted Kremenek
9e9afb552c
Correctly handle NSAssertionHandle -handleFailureInMethod:object:file:lineNumber:description:
...
This fixes: http://llvm.org/bugs/show_bug.cgi?id=2593
llvm-svn: 53993
2008-07-24 18:47:16 +00:00
Ted Kremenek
365f21c8db
Updated checker build.
...
llvm-svn: 53992
2008-07-24 18:15:01 +00:00
Ted Kremenek
0e60b7588a
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
llvm-svn: 53987
2008-07-24 17:45:56 +00:00
Daniel Dunbar
66cd9a32d2
Fix comment
...
llvm-svn: 53986
2008-07-24 17:38:50 +00:00
Ted Kremenek
53b29025f1
Rename test case file.
...
llvm-svn: 53984
2008-07-24 17:02:18 +00:00
Ted Kremenek
87b16f4258
Issue dead store warnings for preincrements involved in a subexpression.
...
llvm-svn: 53983
2008-07-24 17:01:17 +00:00
Ted Kremenek
4a154b2857
Ignore -MT and -MF.
...
llvm-svn: 53977
2008-07-24 03:52:21 +00:00
Ted Kremenek
1c0c06bb9c
"This patch adds paths for Fedora 9 in clang.cpp and support for two preprocessor options in ccc."
...
Patch by Zhongxing Xu!
llvm-svn: 53976
2008-07-24 03:49:15 +00:00
Daniel Dunbar
2e0f1cd00c
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>
llvm-svn: 53975
2008-07-24 01:18:41 +00:00
Daniel Dunbar
908fccc6ea
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...
llvm-svn: 53974
2008-07-24 01:08:37 +00:00
Ted Kremenek
25177f5e53
Updated checker build.
...
llvm-svn: 53969
2008-07-23 23:39:06 +00:00
Ted Kremenek
0b5eb1ac87
Added dead stores test case.
...
llvm-svn: 53966
2008-07-23 23:18:43 +00:00
Ted Kremenek
c99332c5a6
Modified HTMLDiagnostics to also perform syntax highlighting for errors in header files.
...
llvm-svn: 53965
2008-07-23 23:18:15 +00:00
Ted Kremenek
9572cae92b
Don't flag dead stores when the result of a preincrement/predecrement is used in an enclosing expression.
...
llvm-svn: 53964
2008-07-23 22:19:56 +00:00
Ted Kremenek
1692342e58
Added UnaryOperator::isPrefix().
...
llvm-svn: 53963
2008-07-23 22:18:43 +00:00
Ted Kremenek
b9e10c02d2
Use typedef range_iterator instead of SourceRange* in PathDiagnosticPiece.
...
llvm-svn: 53962
2008-07-23 21:51:42 +00:00
Ted Kremenek
ecc851bb6e
Further refine dead store checking to distinguish between dead stores and dead increments.
...
llvm-svn: 53960
2008-07-23 21:16:38 +00:00
Ted Kremenek
46abc7db6b
Properly skip IBOutlets when checking for unused ivars.
...
Refine the error message of unused ivars.
Added test case.
llvm-svn: 53957
2008-07-23 18:21:36 +00:00
Ted Kremenek
0cdba6b43e
Initialize instance variable DeclAccess in ctor for ObjCIvarDecl.
...
llvm-svn: 53956
2008-07-23 18:12:25 +00:00
Ted Kremenek
73295fab89
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 ).
llvm-svn: 53955
2008-07-23 18:04:17 +00:00
Ted Kremenek
7de7fd0305
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.
llvm-svn: 53954
2008-07-23 17:44:44 +00:00
Ted Kremenek
6b6a4b6446
Ivar access mode ObjCIvarDecl::None == ObjCIvarDecl::Protected, not private.
...
llvm-svn: 53953
2008-07-23 17:14:39 +00:00
Ted Kremenek
19f4e16f3e
Update Xcode project.
...
llvm-svn: 53952
2008-07-23 17:13:09 +00:00
Chris Lattner
28ee5b3d29
don't depend on the result of CreateNeg to be a binop
...
llvm-svn: 53948
2008-07-23 06:53:34 +00:00
Chris Lattner
070968957e
Fix rdar://6094010 various asserts happening with wide strings in inline asm.
...
llvm-svn: 53947
2008-07-23 06:46:56 +00:00
Chris Lattner
d258325c2b
Fix a codegen crash on:
...
int foo(void) {
float x[2];
return x;
}
rdar://6093986
llvm-svn: 53946
2008-07-23 06:31:27 +00:00
Ted Kremenek
3b28f4911c
Add prototype implementation of unused ivar check.
...
llvm-svn: 53942
2008-07-23 00:45:26 +00:00
Ted Kremenek
0b39845f93
Updated checker build.
...
llvm-svn: 53936
2008-07-22 22:45:52 +00:00
Argyrios Kyrtzidis
cbece36b22
Fix compilation error on GCC 4.3.0 ('memcpy' was not declared in this scope).
...
llvm-svn: 53934
2008-07-22 21:56:45 +00:00
Daniel Dunbar
a2fbefc159
Add note to check what __alignof__ a function type should be.
...
llvm-svn: 53928
2008-07-22 19:44:18 +00:00
Anders Carlsson
35a56368be
Always define __SIZE_TYPE__ as long unsigned int.
...
llvm-svn: 53922
2008-07-22 17:16:13 +00:00
Ted Kremenek
5dd9c0eaf6
Update VS project.
...
llvm-svn: 53921
2008-07-22 17:13:59 +00:00
Ted Kremenek
85b898e1de
Use llvm::utostr_32 instead of ostringstream.
...
llvm-svn: 53914
2008-07-22 16:56:21 +00:00
Ted Kremenek
59a4d909e1
Update VS project.
...
llvm-svn: 53913
2008-07-22 16:47:06 +00:00
Ted Kremenek
a8efcf58a2
Update Xcode project.
...
llvm-svn: 53910
2008-07-22 16:22:19 +00:00
Ted Kremenek
1f352db96a
Moved registration of basic path-sensitive checks from GRSimpleVals.cpp to GRExprEngineInternalChecks.cpp.
...
llvm-svn: 53909
2008-07-22 16:21:24 +00:00
Ted Kremenek
6bb53303e1
Rename file.
...
llvm-svn: 53906
2008-07-22 14:41:47 +00:00
Daniel Dunbar
ee8bbb3ccc
Prevent codegen crash on sizeof(<function type>), a gcc extension.
...
llvm-svn: 53899
2008-07-22 01:35:47 +00:00
Ted Kremenek
98f6e582f2
Added path-sensitive checking for null pointer values passed to function arguments marked nonnull.
...
This implements <rdar://problem/6069935>
llvm-svn: 53891
2008-07-22 00:46:16 +00:00
Daniel Dunbar
327acd7a6c
Implement bzero, memset, memmove builtins.
...
This subsumes Nico Weber's patch and implements bzero in terms
of llvm.memset to match llvm-gcc.
llvm-svn: 53888
2008-07-22 00:26:45 +00:00
Daniel Dunbar
b725726c29
Implement nans, prefetch, and trap builtins.
...
This closes <rdar://problem/6080720>, support for __builtin_constant_p
has been filed separately.
llvm-svn: 53885
2008-07-21 22:59:13 +00:00
Chris Lattner
d7352d6801
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>
llvm-svn: 53883
2008-07-21 22:17:28 +00:00
Ted Kremenek
5224e6a81d
Add test case for nonnull attribute.
...
Fix indexing bug.
llvm-svn: 53882
2008-07-21 22:09:15 +00:00
Ted Kremenek
2d63bc1e99
Added sema support for the nonnull attribute. Will add test cases soon.
...
llvm-svn: 53881
2008-07-21 21:53:04 +00:00
Daniel Dunbar
7ed03c4cdd
Kill an unused variable warning
...
llvm-svn: 53878
2008-07-21 21:43:28 +00:00
Chris Lattner
388f6e97e1
unindent this function by using an early exit, not functionality change.
...
llvm-svn: 53877
2008-07-21 21:33:21 +00:00
Chris Lattner
390d39ac7e
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.
llvm-svn: 53876
2008-07-21 21:32:27 +00:00
Daniel Dunbar
c2f67966f4
Add __builtin_powi[fl] support
...
llvm-svn: 53866
2008-07-21 18:44:41 +00:00
Daniel Dunbar
5b288788b3
Fix a test RUN line to not generate '=-' in test directory
...
llvm-svn: 53865
2008-07-21 18:42:27 +00:00
Chris Lattner
102ccc4f8c
add forward definition protocols to the protocol list for a class.
...
llvm-svn: 53864
2008-07-21 18:35:17 +00:00
Chris Lattner
461d3f8eb8
references to completely undeclared protocols should be errors.
...
References to forward definitions should be warnings.
llvm-svn: 53863
2008-07-21 18:34:02 +00:00
Steve Naroff
f0ff879881
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.
llvm-svn: 53858
2008-07-21 18:26:02 +00:00
Chris Lattner
d004505b74
introduce a new ObjCList templated class and start moving
...
various objc lists over to it. First up, the protocol list
on ObjCInterfaceDecl.
llvm-svn: 53856
2008-07-21 18:19:38 +00:00
Ted Kremenek
b47772535b
Update checker build.
...
llvm-svn: 53855
2008-07-21 17:53:09 +00:00
Chris Lattner
65056c48a7
rename setReferencedProtocolList -> addReferencedProtocols to
...
be consistent with ObjCInterfaceDecl.
llvm-svn: 53852
2008-07-21 17:23:15 +00:00
Daniel Dunbar
d93abc3bb0
Implement ffs, parity, and popcount builtins.
...
+ test case
llvm-svn: 53851
2008-07-21 17:19:41 +00:00
Argyrios Kyrtzidis
b3fa8639e1
Change 'MDecl' to 'MD' to fix redefinition compiler error in MSVC++.
...
llvm-svn: 53849
2008-07-21 09:18:38 +00:00
Chris Lattner
046485640d
fix typo
...
llvm-svn: 53848
2008-07-21 07:13:18 +00:00
Chris Lattner
ca1e848588
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>
^
llvm-svn: 53846
2008-07-21 07:06:49 +00:00
Chris Lattner
87899be4cc
when in the context of an @implementation, look for private methods in the
...
@implementation to resolve nullary selector references.
llvm-svn: 53845
2008-07-21 06:44:27 +00:00
Chris Lattner
f1c149db9f
don't pass in null as the Name for GenerateClassStructure,
...
it goes and makes std::strings out of them, which is not
defined.
llvm-svn: 53843
2008-07-21 06:31:05 +00:00
Chris Lattner
12bf571fa8
improve diagnostics about problems with receivers to highlight the receiver.
...
llvm-svn: 53842
2008-07-21 06:16:07 +00:00
Chris Lattner
bd2d634424
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.
llvm-svn: 53841
2008-07-21 06:12:56 +00:00
Chris Lattner
6b946cc788
simplify control flow a bit, reducing indentation. No functionality change.
...
llvm-svn: 53837
2008-07-21 05:57:44 +00:00
Chris Lattner
79f14789d8
tighten up some checks, don't allow sending a message to NSString****
...
llvm-svn: 53836
2008-07-21 05:54:02 +00:00
Chris Lattner
393f4ae047
update diagnostic to include string
...
llvm-svn: 53835
2008-07-21 05:38:58 +00:00
Chris Lattner
0c373078e2
improve invalid member reference diagnostics to print the type and
...
have better source ranges. Before:
t.m:11:53: error: member reference is not to a structure or union
CGFloat maxOffsetY = [_outlineLayer contentSize].height - [_outlineLayer frame].size.height;
^~~~~~~
after:
t.m:11:54: error: member reference base type ('id') is not a structure or union
CGFloat maxOffsetY = [_outlineLayer contentSize].height - [_outlineLayer frame].size.height;
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
llvm-svn: 53834
2008-07-21 05:35:34 +00:00
Chris Lattner
3f44d70771
merge a bunch of code that is now common between qual interfaces and interfaces.
...
llvm-svn: 53833
2008-07-21 05:27:51 +00:00
Chris Lattner
d7983b472e
rename getProtocols -> getProtocol, as it only returns a single
...
protocol. Simplify some code to use unconditional form of the
protocol access list.
llvm-svn: 53832
2008-07-21 05:20:01 +00:00
Chris Lattner
419f699b55
use iterators instead of direct access to protocol list.
...
llvm-svn: 53831
2008-07-21 05:19:23 +00:00
Chris Lattner
13b2ace8df
improve documentation of ObjCInterfaceType significantly. Also,
...
make the qual_* iterators and getNumProtocols() lists be accessible through
ObjCInterfaceType (returning an empty range if not a
ObjCQualifiedInterfaceType). This eliminates special checks in clients.
llvm-svn: 53830
2008-07-21 05:13:51 +00:00
Chris Lattner
dc420f4866
Fix a bunch of crashes that occur in (attempted) handling of objc properties.
...
This code would previously crash on x.y where x is 'id'.
llvm-svn: 53827
2008-07-21 04:59:05 +00:00
Chris Lattner
f8f5682998
right, the error is when the itf *doesn't* have the member.
...
llvm-svn: 53826
2008-07-21 04:54:33 +00:00
Chris Lattner
bf58ba78df
use the simplified form of lookupInstanceVariable for callers who
...
don't care which class actually defines it.
llvm-svn: 53825
2008-07-21 04:44:44 +00:00
Chris Lattner
8bb52cb5a2
improve the diagnostic for an erroneous objc ivar reference
...
from:
t.m:8:7: error: member reference is not to a structure or union
pool->farm = 0;
^ ~~~~
to:
t.m:8:7: error: 'NSAutoreleasePool' has member named 'farm'
pool->farm = 0;
~~~~^ ~~~~
llvm-svn: 53824
2008-07-21 04:42:08 +00:00
Chris Lattner
4befd736b2
simplify a bunch of code, no functionality change.
...
llvm-svn: 53823
2008-07-21 04:36:39 +00:00
Chris Lattner
b63a745331
rearrange some code, no functionality change.
...
llvm-svn: 53822
2008-07-21 04:28:12 +00:00
Chris Lattner
530315fe89
improve comments yet again, now I know what this does :)
...
llvm-svn: 53821
2008-07-21 04:16:33 +00:00
Chris Lattner
6886f38369
minor rename, also, reject pointer to qualified id.
...
id<NSCopyable>* is not an "objc pointer type", id<NSCopyable> is.
llvm-svn: 53820
2008-07-21 04:13:58 +00:00
Chris Lattner
c47d930448
Fix a crash that can happen when you have typedefs for pointers to
...
interfaces. Just because they x->isPointerType() doesn't mean it is
valid to just cast to a pointertype. We have to handle typedefs etc
as well.
llvm-svn: 53819
2008-07-21 04:09:54 +00:00
Chris Lattner
15727f69fa
improve comments.
...
llvm-svn: 53818
2008-07-21 04:07:11 +00:00
Chris Lattner
2a47fa7372
simplify this predicate, only checking isObjCQualifiedIdType once.
...
llvm-svn: 53817
2008-07-21 04:03:34 +00:00
Chris Lattner
9099474130
Add a space, ted apparently has philosophical problems with spaces ;-)
...
llvm-svn: 53808
2008-07-20 04:22:06 +00:00
Nuno Lopes
8a48c2f7d9
fix test
...
llvm-svn: 53802
2008-07-19 22:11:43 +00:00
Ted Kremenek
4f2fb96d18
Updated latest checker build.
...
llvm-svn: 53800
2008-07-19 19:50:00 +00:00
Ted Kremenek
f487548c17
Patch by Kovarththanan Rajaratnam:
...
"When dumping the tokens (-dumptokens output type), the column numbers are not
correctly shown. This patch fixes that issue."
llvm-svn: 53797
2008-07-19 19:10:40 +00:00
Ted Kremenek
0fff6d3c06
Patch by
...
"When dumping the tokens (-dumptokens output type), the column numbers are not
correctly shown. This patch fixes that issue."
llvm-svn: 53796
2008-07-19 19:10:04 +00:00
Ted Kremenek
f7ffd66551
Reimplement ccc-analyzer in a language I actually know, and implement some obvious optimizations when processing command line arguments.
...
llvm-svn: 53783
2008-07-19 06:11:04 +00:00
Ted Kremenek
d2d122961d
Remove typo.
...
llvm-svn: 53776
2008-07-18 23:13:03 +00:00
Ted Kremenek
2a6b0b5d5e
Quote invocation of clang in pipe to handle paths with spaces.
...
llvm-svn: 53775
2008-07-18 23:11:33 +00:00
Ted Kremenek
8857703b57
Added test case.
...
llvm-svn: 53770
2008-07-18 20:48:10 +00:00
Ted Kremenek
6f2c46a275
Update checker build.
...
llvm-svn: 53769
2008-07-18 20:22:22 +00:00
Ted Kremenek
f41b1c45fa
"currentHandler" is a nullary selector
...
llvm-svn: 53763
2008-07-18 18:14:26 +00:00