Commit Graph

48853 Commits

Author SHA1 Message Date
Chris Lattner da9fb15b90 refactor a bunch of code:
Check for @end in ParseObjCInterfaceDeclList instead of in each caller
Handle @required and @optional with the same code

Add some fixmes about some apparently objc2 code that is being accepted
in objc1.

llvm-svn: 57803
2008-10-20 06:10:06 +00:00
Chris Lattner bb8cc18788 fix some minor error recovery bugs in ParseObjCInterfaceDeclList
where it would reject @required in non-protocols, but then go
ahead and tag methods with required anyway.  Instead, if we see
this in something other than a protocol, just ignore the request.

Also, improve error recovery a bit when we see something bogus 
inside an interface.

llvm-svn: 57798
2008-10-20 05:57:40 +00:00
Chris Lattner 038a3e349d restructure the body of the ParseObjCInterfaceDeclList loop
to make it easier to understand.  No functionality change.

llvm-svn: 57797
2008-10-20 05:46:22 +00:00
Chris Lattner 2a9d9897b7 Fix rdar://6257721 by tightening up the block "snapshot" check, and
move it to its own predicate to make it more clear.

llvm-svn: 57796
2008-10-20 05:16:36 +00:00
Chris Lattner 29e6f2b674 Support attributes in *yet another* place. Is there any place you
can't stick an attributes?

llvm-svn: 57795
2008-10-20 04:57:38 +00:00
Chris Lattner 8ff2c6c9f0 Fix a parser bug where we let attributes interfere with our disambiguation
of whether a '(' was a grouping paren or the start of a function declarator.
This is PR2796.

Now we eat the attribute before deciding whether the paren is grouping or
not, then apply it to the resultant decl or to the first argument as needed.

One somewhat surprising aspect of this is that attributes interact with
implicit int in cases like this:

void a(x, y) // k&r style function
void b(__attribute__(()) x, y); // function with two implicit int arguments
void c(x, __attribute__(()) y); // error, can't have attr in identifier list.

Fun stuff.

llvm-svn: 57790
2008-10-20 02:05:46 +00:00
Chris Lattner 4b13d3f2f2 fix indentation
llvm-svn: 57789
2008-10-20 02:01:50 +00:00
Chris Lattner fcc390a9df fix indentation
llvm-svn: 57788
2008-10-20 02:01:34 +00:00
Chris Lattner 409bf7d03a Remove an implemented fixme, only treat < as a type specifier
when ObjC is turned on.

llvm-svn: 57787
2008-10-20 00:25:30 +00:00
Bill Wendling 8ec2a4a96c Set N->OperandList to 0 after deletion. Otherwise, it's possible that it will
be either deleted or referenced afterwards.

llvm-svn: 57786
2008-10-19 20:51:12 +00:00
Bill Wendling 6c87bfc6fd Fix comment. Other formatting changes. No functionality changes.
llvm-svn: 57785
2008-10-19 20:34:04 +00:00
Duncan Sands 8d11adca4c Vector shuffle mask elements may be "undef". Handle
this everywhere in LegalizeTypes.

llvm-svn: 57783
2008-10-19 15:00:25 +00:00
Duncan Sands c6d12bd665 Use a legal integer type for vector shuffle mask
elements.  Otherwise LegalizeTypes will, reasonably
enough, legalize the mask, which may result in it
no longer being a BUILD_VECTOR node (LegalizeDAG
simply ignores the legality or not of vector masks).

llvm-svn: 57782
2008-10-19 14:58:05 +00:00
Argyrios Kyrtzidis 455b973d33 Change a couple of cast<> to reinterpret_cast<>.
The casts<> require that "Decl.h" is included before "Type.h", use reinterpret_cast<> to remove that kind of dependency.

llvm-svn: 57781
2008-10-19 12:05:48 +00:00
Ted Kremenek ad4a57d757 Add "argument key" processing similar to ccc.
llvm-svn: 57780
2008-10-19 06:42:38 +00:00
Daniel Dunbar 969e35610d ccc: Pass '-g' through to clang. Handle -weak_framework.
llvm-svn: 57779
2008-10-19 02:41:16 +00:00
Daniel Dunbar 70e3ebafdb Improve attribute parsing & tests.
- Support noreturn on function-typed variables.

 - Extend isFunctionOrMethod to return true for K&R functions and
   provide hasFunctionProto to check if a decl has information about
   its arguments. This code needs some serious cleaning, but works.

 - Add/improve test cases for noreturn and unused.

llvm-svn: 57778
2008-10-19 02:04:16 +00:00
Ted Kremenek f8d65a30d6 Add support in GRExprEngine for UnaryOperator::AlignOf. This fixes one crash report in PR 2796.
llvm-svn: 57777
2008-10-18 22:20:20 +00:00
Ted Kremenek cfb049c832 Updated checker build
llvm-svn: 57775
2008-10-18 21:03:40 +00:00
Ted Kremenek d36e552245 Fix incorrect release of Decl* array referenced by DeclGroup.
Patch by Timo Sirainen!

llvm-svn: 57772
2008-10-18 19:20:54 +00:00
Chris Lattner 160e8abd77 Reapply r57699 with a fix to not crash on asms with multiple results. Unlike
the previous patch this one actually passes make check.

"Fix PR2356 on PowerPC: if we have an input and output that are tied together
that have different sizes (e.g. i32 and i64) make sure to reserve registers for
the bigger operand."

llvm-svn: 57771
2008-10-18 18:49:30 +00:00
Dan Gohman 727a94063c Don't truncate GlobalAddress offsets to int in debug output.
llvm-svn: 57770
2008-10-18 18:22:42 +00:00
Daniel Dunbar 354d278518 Debug info bug fix, function start wasn't getting generated correctly
for Obj-C methods.

llvm-svn: 57769
2008-10-18 18:22:23 +00:00
Evan Cheng 2dadd3bbc6 By min, I mean max.
llvm-svn: 57766
2008-10-18 05:21:37 +00:00
Evan Cheng ac4e70d946 When creating intervals, leave min(1, numdefs) holes after each instruction.
llvm-svn: 57765
2008-10-18 05:18:55 +00:00
Ted Kremenek 43a9d7f3f0 Updated checker build.
llvm-svn: 57764
2008-10-18 05:12:17 +00:00
Ted Kremenek 850422e5d2 Generalize VisitLValue: not only can CallExprs and ObjCMessageExprs return aggregate temporaries, so can many other expressions.
llvm-svn: 57761
2008-10-18 04:15:35 +00:00
Ted Kremenek 8f5dc295ce Function calls and ObjC message expressions can be used in a lvalue context if they return a structure. E.g foo().x == 1. We don't really support, however, such temporaries yet in the environment or the store.
llvm-svn: 57760
2008-10-18 04:08:49 +00:00
Ted Kremenek e86755e14f retain/release checker: Check if a tracked value escapes if we also try binding it to the store and the store doesn't support that binding (i.e., it cannot track it). This has the nice feature that the checker will automatically get more powerful if we use a more powerful store model.
llvm-svn: 57755
2008-10-18 03:49:51 +00:00
Ted Kremenek fef1f30ea2 Use "VisitLValue" when processing the base for "x.f" field accesses, and "Visit" when processing the base for "x->f" field accesses.
llvm-svn: 57754
2008-10-18 03:28:48 +00:00
Mon P Wang 8f477106a4 Make llvm memory barrier available as an intrinsic
llvm-svn: 57751
2008-10-18 02:49:28 +00:00
Mon P Wang 446218462b Make llvm memory barrier available as an intrinsic
llvm-svn: 57750
2008-10-18 02:48:13 +00:00
Mon P Wang 179a72f000 Added vec_set intrinsics
llvm-svn: 57749
2008-10-18 02:43:25 +00:00
Dan Gohman 2fe6bee5b6 Teach DAGCombine to fold constant offsets into GlobalAddress nodes,
and add a TargetLowering hook for it to use to determine when this
is legal (i.e. not in PIC mode, etc.)

This allows instruction selection to emit folded constant offsets
in more cases, such as the included testcase, eliminating the need
for explicit arithmetic instructions.

This eliminates the need for the C++ code in X86ISelDAGToDAG.cpp
that attempted to achieve the same effect, but wasn't as effective.

Also, fix handling of offsets in GlobalAddressSDNodes in several
places, including changing GlobalAddressSDNode's offset from
int to int64_t.

The Mips, Alpha, Sparc, and CellSPU targets appear to be
unaware of GlobalAddress offsets currently, so set the hook to
false on those targets.

llvm-svn: 57748
2008-10-18 02:06:02 +00:00
Dan Gohman 6de2556205 Revert r57699. It's causing regressions in
test/CodeGen/X86/2008-09-17-inline-asm-1.ll
and a few others, and it breaks the llvm-gcc build.

llvm-svn: 57747
2008-10-18 01:03:45 +00:00
Argyrios Kyrtzidis 3a0558af9a Just do a diagIfAmbiguous -> warnIfAmbiguous rename.
No functionality change.

llvm-svn: 57746
2008-10-17 23:23:35 +00:00
Daniel Dunbar 1ea1aa2cc1 Emit more descriptive unsupported error message on dot-syntax use of super.
llvm-svn: 57745
2008-10-17 23:05:02 +00:00
Daniel Dunbar 6ccea71c64 Add some uses of PredefinedExpr to language coverage includes.
llvm-svn: 57744
2008-10-17 23:04:32 +00:00
Daniel Dunbar cf56c2b7bd Add FIXME about potential problem in how property ref lvalues are handled.
llvm-svn: 57743
2008-10-17 23:02:24 +00:00
Ted Kremenek 0b09ea54ba This test now passes again.
llvm-svn: 57742
2008-10-17 22:53:09 +00:00
Ted Kremenek db5ae0aa1c Hack: have BasicStore::getLValueElement return the "Base" lvalue. This restores null dereference checking with array accesses.
BasicStore::RemoveDeadBindings: handle regions besides VarRegions (we now have FieldRegions).

llvm-svn: 57741
2008-10-17 22:52:40 +00:00
Ted Kremenek 213873232d When conjuring symbols to recover path-sensitivity, don't conjure symbols that represent an entire struct. We need to implement struct temporaries as an actual "region", and then bind symbols to the FieldRegion of those temporaries.
llvm-svn: 57739
2008-10-17 22:23:12 +00:00
Daniel Dunbar b35174727f Lift CodeGenFunction::EmitPredefinedFunctioName out of EmitPredefinedLValue.
- Shouldn't assume predefined expr is a function printing one.
 - Uses CGM functionality to cache function names per module.

llvm-svn: 57737
2008-10-17 21:58:32 +00:00
Daniel Dunbar dfcf599dfa Add option argument to GetAddrOfConstantString to use for name of
(first) global holding the string.
 - No functionality change.

llvm-svn: 57736
2008-10-17 21:56:50 +00:00
Dan Gohman 83876cd9b0 Use the opcode predicates, instead of duplicating the code.
llvm-svn: 57735
2008-10-17 21:42:45 +00:00
Dan Gohman 209fc26462 This is now partly done.
llvm-svn: 57734
2008-10-17 21:39:27 +00:00
Dan Gohman b1d8d6ecff This is done.
llvm-svn: 57733
2008-10-17 21:38:40 +00:00
Chris Lattner f0a5f84c42 fix rdar://6288301: custom warnings don't respect -Werror.
llvm-svn: 57731
2008-10-17 21:24:47 +00:00
Ted Kremenek 1416a521b5 Enhance "Assumption" logic in BasicConstraintManager when reasoning about regions and symbolic regions. When assuming whether or not a location is non-null, walk up the region hierarchy until we hit a symbolic region (and test it for null). This may not be the end all solution, as the notion of what a "symbolic region" is really belongs in the specific subclass of StoreManager.
llvm-svn: 57730
2008-10-17 21:22:20 +00:00
Dan Gohman d01ddb51ee Factor out the code for mapping LLVM IR condition opcodes to
ISD condition opcodes into helper functions.

llvm-svn: 57726
2008-10-17 21:16:08 +00:00