]> granicus.if.org Git - clang/log
clang
16 years agofix a crash on unnamed properties like:
Chris Lattner [Mon, 20 Oct 2008 06:33:53 +0000 (06:33 +0000)]
fix a crash on unnamed properties like:
@property (readonly) int : 4;

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

16 years agosimplify some code by using ExpectAndConsume. When an error
Chris Lattner [Mon, 20 Oct 2008 06:15:13 +0000 (06:15 +0000)]
simplify some code by using ExpectAndConsume.  When an error
occurs, skip to an @ or ; instead of to a } or ;.  Properties
don't necessarily live in {}'s.

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

16 years agorefactor a bunch of code:
Chris Lattner [Mon, 20 Oct 2008 06:10:06 +0000 (06:10 +0000)]
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.

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

16 years agofix some minor error recovery bugs in ParseObjCInterfaceDeclList
Chris Lattner [Mon, 20 Oct 2008 05:57:40 +0000 (05:57 +0000)]
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.

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

16 years agorestructure the body of the ParseObjCInterfaceDeclList loop
Chris Lattner [Mon, 20 Oct 2008 05:46:22 +0000 (05:46 +0000)]
restructure the body of the ParseObjCInterfaceDeclList loop
to make it easier to understand.  No functionality change.

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

16 years agoFix rdar://6257721 by tightening up the block "snapshot" check, and
Chris Lattner [Mon, 20 Oct 2008 05:16:36 +0000 (05:16 +0000)]
Fix rdar://6257721 by tightening up the block "snapshot" check, and
move it to its own predicate to make it more clear.

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

16 years agoSupport attributes in *yet another* place. Is there any place you
Chris Lattner [Mon, 20 Oct 2008 04:57:38 +0000 (04:57 +0000)]
Support attributes in *yet another* place.  Is there any place you
can't stick an attributes?

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

16 years agoFix a parser bug where we let attributes interfere with our disambiguation
Chris Lattner [Mon, 20 Oct 2008 02:05:46 +0000 (02:05 +0000)]
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.

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

16 years agofix indentation
Chris Lattner [Mon, 20 Oct 2008 02:01:50 +0000 (02:01 +0000)]
fix indentation

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

16 years agofix indentation
Chris Lattner [Mon, 20 Oct 2008 02:01:34 +0000 (02:01 +0000)]
fix indentation

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

16 years agoRemove an implemented fixme, only treat < as a type specifier
Chris Lattner [Mon, 20 Oct 2008 00:25:30 +0000 (00:25 +0000)]
Remove an implemented fixme, only treat < as a type specifier
when ObjC is turned on.

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

16 years agoChange a couple of cast<> to reinterpret_cast<>.
Argyrios Kyrtzidis [Sun, 19 Oct 2008 12:05:48 +0000 (12:05 +0000)]
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.

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

16 years agoAdd "argument key" processing similar to ccc.
Ted Kremenek [Sun, 19 Oct 2008 06:42:38 +0000 (06:42 +0000)]
Add "argument key" processing similar to ccc.

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

16 years agoccc: Pass '-g' through to clang. Handle -weak_framework.
Daniel Dunbar [Sun, 19 Oct 2008 02:41:16 +0000 (02:41 +0000)]
ccc: Pass '-g' through to clang. Handle -weak_framework.

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

16 years agoImprove attribute parsing & tests.
Daniel Dunbar [Sun, 19 Oct 2008 02:04:16 +0000 (02:04 +0000)]
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.

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

16 years agoAdd support in GRExprEngine for UnaryOperator::AlignOf. This fixes one crash report...
Ted Kremenek [Sat, 18 Oct 2008 22:20:20 +0000 (22:20 +0000)]
Add support in GRExprEngine for UnaryOperator::AlignOf.  This fixes one crash report in PR 2796.

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

16 years agoUpdated checker build
Ted Kremenek [Sat, 18 Oct 2008 21:03:40 +0000 (21:03 +0000)]
Updated checker build

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

16 years agoFix incorrect release of Decl* array referenced by DeclGroup.
Ted Kremenek [Sat, 18 Oct 2008 19:20:54 +0000 (19:20 +0000)]
Fix incorrect release of Decl* array referenced by DeclGroup.

Patch by Timo Sirainen!

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

16 years agoDebug info bug fix, function start wasn't getting generated correctly
Daniel Dunbar [Sat, 18 Oct 2008 18:22:23 +0000 (18:22 +0000)]
Debug info bug fix, function start wasn't getting generated correctly
for Obj-C methods.

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

16 years agoUpdated checker build.
Ted Kremenek [Sat, 18 Oct 2008 05:12:17 +0000 (05:12 +0000)]
Updated checker build.

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

16 years agoGeneralize VisitLValue: not only can CallExprs and ObjCMessageExprs return aggregate...
Ted Kremenek [Sat, 18 Oct 2008 04:15:35 +0000 (04:15 +0000)]
Generalize VisitLValue: not only can CallExprs and ObjCMessageExprs return aggregate temporaries, so can many other expressions.

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

16 years agoFunction calls and ObjC message expressions can be used in a lvalue context if they...
Ted Kremenek [Sat, 18 Oct 2008 04:08:49 +0000 (04:08 +0000)]
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.

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

16 years agoretain/release checker: Check if a tracked value escapes if we also try binding it...
Ted Kremenek [Sat, 18 Oct 2008 03:49:51 +0000 (03:49 +0000)]
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.

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

16 years agoUse "VisitLValue" when processing the base for "x.f" field accesses, and "Visit"...
Ted Kremenek [Sat, 18 Oct 2008 03:28:48 +0000 (03:28 +0000)]
Use "VisitLValue" when processing the base for "x.f" field accesses, and "Visit" when processing the base for "x->f" field accesses.

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

16 years agoMake llvm memory barrier available as an intrinsic
Mon P Wang [Sat, 18 Oct 2008 02:49:28 +0000 (02:49 +0000)]
Make llvm memory barrier available as an intrinsic

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

16 years agoAdded vec_set intrinsics
Mon P Wang [Sat, 18 Oct 2008 02:43:25 +0000 (02:43 +0000)]
Added vec_set intrinsics

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

16 years agoJust do a diagIfAmbiguous -> warnIfAmbiguous rename.
Argyrios Kyrtzidis [Fri, 17 Oct 2008 23:23:35 +0000 (23:23 +0000)]
Just do a diagIfAmbiguous -> warnIfAmbiguous rename.
No functionality change.

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

16 years agoEmit more descriptive unsupported error message on dot-syntax use of super.
Daniel Dunbar [Fri, 17 Oct 2008 23:05:02 +0000 (23:05 +0000)]
Emit more descriptive unsupported error message on dot-syntax use of super.

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

16 years agoAdd some uses of PredefinedExpr to language coverage includes.
Daniel Dunbar [Fri, 17 Oct 2008 23:04:32 +0000 (23:04 +0000)]
Add some uses of PredefinedExpr to language coverage includes.

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

16 years agoAdd FIXME about potential problem in how property ref lvalues are handled.
Daniel Dunbar [Fri, 17 Oct 2008 23:02:24 +0000 (23:02 +0000)]
Add FIXME about potential problem in how property ref lvalues are handled.

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

16 years agoThis test now passes again.
Ted Kremenek [Fri, 17 Oct 2008 22:53:09 +0000 (22:53 +0000)]
This test now passes again.

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

16 years agoHack: have BasicStore::getLValueElement return the "Base" lvalue. This restores...
Ted Kremenek [Fri, 17 Oct 2008 22:52:40 +0000 (22:52 +0000)]
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).

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

16 years agoWhen conjuring symbols to recover path-sensitivity, don't conjure symbols that repres...
Ted Kremenek [Fri, 17 Oct 2008 22:23:12 +0000 (22:23 +0000)]
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.

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

16 years agoLift CodeGenFunction::EmitPredefinedFunctioName out of EmitPredefinedLValue.
Daniel Dunbar [Fri, 17 Oct 2008 21:58:32 +0000 (21:58 +0000)]
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.

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

16 years agoAdd option argument to GetAddrOfConstantString to use for name of
Daniel Dunbar [Fri, 17 Oct 2008 21:56:50 +0000 (21:56 +0000)]
Add option argument to GetAddrOfConstantString to use for name of
(first) global holding the string.
 - No functionality change.

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

16 years agofix rdar://6288301: custom warnings don't respect -Werror.
Chris Lattner [Fri, 17 Oct 2008 21:24:47 +0000 (21:24 +0000)]
fix rdar://6288301: custom warnings don't respect -Werror.

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

16 years agoEnhance "Assumption" logic in BasicConstraintManager when reasoning about regions...
Ted Kremenek [Fri, 17 Oct 2008 21:22:20 +0000 (21:22 +0000)]
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.

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

16 years agoAdd pretty-printing support for FieldRegions.
Ted Kremenek [Fri, 17 Oct 2008 21:05:44 +0000 (21:05 +0000)]
Add pretty-printing support for FieldRegions.

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

16 years agoEmit error unsupported when asm string conversion fails instead of
Daniel Dunbar [Fri, 17 Oct 2008 20:58:01 +0000 (20:58 +0000)]
Emit error unsupported when asm string conversion fails instead of
assert.

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

16 years agoFixed an elusive caching bug in ExplodedGraph construction when a PostStmtKind was...
Ted Kremenek [Fri, 17 Oct 2008 20:49:23 +0000 (20:49 +0000)]
Fixed an elusive caching bug in ExplodedGraph construction when a PostStmtKind was used instead of a PostStoreKind.

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

16 years agoTest now passes.
Ted Kremenek [Fri, 17 Oct 2008 20:29:05 +0000 (20:29 +0000)]
Test now passes.

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

16 years ago- constify some uses of MemRegion* (MemRegion should be immutable).
Ted Kremenek [Fri, 17 Oct 2008 20:28:54 +0000 (20:28 +0000)]
- constify some uses of MemRegion* (MemRegion should be immutable).
- Added new region "SymbolicRegion", which maps symbol values to the region domain.
- Enhanced BasicStore::getFieldLValue() to return a FieldRegion (using SymbolicRegion)
- Added some utility methods to GRState for fetch svals from the store.
- Fixed regression in CheckNSError (we weren't getting the value bound to the parameter)

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

16 years agoRemove unneeded EncodingRecordTypes argument to getObjCEncodingForType.
Daniel Dunbar [Fri, 17 Oct 2008 20:21:44 +0000 (20:21 +0000)]
Remove unneeded EncodingRecordTypes argument to getObjCEncodingForType.

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

16 years agoFixed vec_set_v2di signature
Mon P Wang [Fri, 17 Oct 2008 17:39:34 +0000 (17:39 +0000)]
Fixed vec_set_v2di signature

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

16 years ago"Implement" GRExprEngine::VisitLValue for ObjCPropertyRefExpr. This is only a bandid...
Ted Kremenek [Fri, 17 Oct 2008 17:24:14 +0000 (17:24 +0000)]
"Implement" GRExprEngine::VisitLValue for ObjCPropertyRefExpr.  This is only a bandid; we need to properly handle properties by using locv/nonloc objects and specially handling property assignments in the transfer function for BinaryOperator.

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

16 years agoMore Obj-C type encoding improvements.
Daniel Dunbar [Fri, 17 Oct 2008 16:17:37 +0000 (16:17 +0000)]
More Obj-C type encoding improvements.
 - Encode unions and bit-fields correctly.
 - Accept option to name record fields (used for NeXT runtime).

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

16 years agoChange CGDebugInfo::setLocation to just ignore invalid locations. This
Daniel Dunbar [Fri, 17 Oct 2008 16:15:48 +0000 (16:15 +0000)]
Change CGDebugInfo::setLocation to just ignore invalid locations. This
simplifies clients.

Also, add assert that RegionStack is empty when the CGDebugInfo is
destroyed.

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

16 years agoExercise #pragma pack(pop, <width>) in test case.
Daniel Dunbar [Fri, 17 Oct 2008 16:05:47 +0000 (16:05 +0000)]
Exercise #pragma pack(pop, <width>) in test case.

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

16 years agoFix bug in Obj-C type encoding for structures.
Daniel Dunbar [Fri, 17 Oct 2008 07:30:50 +0000 (07:30 +0000)]
Fix bug in Obj-C type encoding for structures.
 - Mechanism for detecting if a structure should be expanded wasn't
   reliable. Simplified by just keeping track of what we should be
   expanding.

 - This fixes a bug in using NSInvocation to invoke a method which
   returned a structure, which in used by Key Value Observing, which
   in the end, caused a miscompile in poor little Sketch.

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

16 years agoAnonymous structures print as '?=' in Obj-C type encoding.
Daniel Dunbar [Fri, 17 Oct 2008 06:22:57 +0000 (06:22 +0000)]
Anonymous structures print as '?=' in Obj-C type encoding.

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

16 years agoThis patch did the following renaming. There should be no functional changes.
Zhongxing Xu [Fri, 17 Oct 2008 05:57:07 +0000 (05:57 +0000)]
This patch did the following renaming. There should be no functional changes.
RVal => SVal
LVal => Loc
NonLVal => NonLoc
lval => loc
nonlval => nonloc

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

16 years agoAdd test case for array and struct variable lvalue evaluation.
Zhongxing Xu [Fri, 17 Oct 2008 05:19:52 +0000 (05:19 +0000)]
Add test case for array and struct variable lvalue evaluation.

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

16 years agoNeXT: Use objc_msgSend_fpret for calling functions which return
Daniel Dunbar [Fri, 17 Oct 2008 03:24:53 +0000 (03:24 +0000)]
NeXT: Use objc_msgSend_fpret for calling functions which return
floating point. This is only correct for x86-32 at the moment.

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

16 years agoGet array's lvalue through standard interface.
Zhongxing Xu [Fri, 17 Oct 2008 02:20:14 +0000 (02:20 +0000)]
Get array's lvalue through standard interface.

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

16 years agoReturn the corresponding MemRegionVal for both rvalue and lvalue of array of
Zhongxing Xu [Fri, 17 Oct 2008 02:14:42 +0000 (02:14 +0000)]
Return the corresponding MemRegionVal for both rvalue and lvalue of array of
type T.

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

16 years agoArray and struct variables do have lvalue. For example,
Zhongxing Xu [Fri, 17 Oct 2008 01:51:27 +0000 (01:51 +0000)]
Array and struct variables do have lvalue. For example,
struct s {};
void f() {
  int a[10];
  int (*p)[10];
  p = &a;
  (*p)[3] =1;

  struct s d;
  struct s *q;
  q = &d;
}

We return the corresponding MemRegionVal for them.

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

16 years agoQuick patch for PR2784, assert genereting debug info for opaque
Daniel Dunbar [Fri, 17 Oct 2008 01:07:56 +0000 (01:07 +0000)]
Quick patch for PR2784, assert genereting debug info for opaque
structure.
 - I'm not sure yet about the behavior, but this at least prevents the
   crash.

Add some asserts on RegionStack usage.

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

16 years agoRemove an untrue assertion: lval::FuncVals can be returned in both rvalue and lvalue...
Ted Kremenek [Fri, 17 Oct 2008 00:55:33 +0000 (00:55 +0000)]
Remove an untrue assertion: lval::FuncVals can be returned in both rvalue and lvalue contexts.

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

16 years agoMark these tests XFAIL. We need to add back assumption logic when doing array and...
Ted Kremenek [Fri, 17 Oct 2008 00:51:39 +0000 (00:51 +0000)]
Mark these tests XFAIL.  We need to add back assumption logic when doing array and field accesses.

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

16 years agoRemove lval::FieldOffset, lval::ArrayOffset. These will be replaced with regions.
Ted Kremenek [Fri, 17 Oct 2008 00:51:01 +0000 (00:51 +0000)]
Remove lval::FieldOffset, lval::ArrayOffset. These will be replaced with regions.
Remove GRExprEngine::getLVal and RValues::MakeVal.
Enhance StoreManager "GetLValue" methods to dispatch for specific kinds of lvalue queries, as opposed to interogating the expression tree (GRExprEngine already does this).

Added FIXMEs.  In particular, we no longer "assume" that a base pointer in a field/array access is null (this logic was removed).  Perhaps we should do this when fetching the lvalue for fields and array elements?

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

16 years agoAdd transfer function support for ObjCIvarRefExpr.
Ted Kremenek [Fri, 17 Oct 2008 00:03:18 +0000 (00:03 +0000)]
Add transfer function support for ObjCIvarRefExpr.

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

16 years agoIn C++, an empty parameter list indicates a function that takes no parameters.
Argyrios Kyrtzidis [Thu, 16 Oct 2008 17:31:08 +0000 (17:31 +0000)]
In C++, an empty parameter list indicates a function that takes no parameters.

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

16 years agoAdd basic FreeBSD target support, patch by Roman Divacky!
Chris Lattner [Thu, 16 Oct 2008 17:04:31 +0000 (17:04 +0000)]
Add basic FreeBSD target support, patch by Roman Divacky!

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

16 years agoAdd --disable-free flag to clang.
Daniel Dunbar [Thu, 16 Oct 2008 16:54:18 +0000 (16:54 +0000)]
Add --disable-free flag to clang.
 - Disables the freeing of the ASTContext and the TranslationUnit
   after parsing & sema.
 - Primarily for timing the impact on -fsyntax-only timings.

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

16 years agoUsing dyn_cast_or_null here is redundant, use dyn_cast instead.
Argyrios Kyrtzidis [Thu, 16 Oct 2008 16:50:47 +0000 (16:50 +0000)]
Using dyn_cast_or_null here is redundant, use dyn_cast instead.

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

16 years agoFix <rdar://problem/6239726> Parser rejects: type of property 'list' does not match...
Steve Naroff [Thu, 16 Oct 2008 14:59:30 +0000 (14:59 +0000)]
Fix <rdar://problem/6239726> Parser rejects: type of property 'list' does not match type of ivar
and
http://llvm.org/bugs/show_bug.cgi?id=2893

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

16 years agoSpeed up NumericLiteralParser::GetIntegerValue.
Daniel Dunbar [Thu, 16 Oct 2008 07:32:01 +0000 (07:32 +0000)]
Speed up NumericLiteralParser::GetIntegerValue.
 - Implement fast path when value easily fits in a uint64.
 - ~6x faster, translates to 1-2% on Cocoa.h

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

16 years agoSimplify overflow-on-add check in NumericLiteralParser::GetIntegerValue.
Daniel Dunbar [Thu, 16 Oct 2008 06:39:30 +0000 (06:39 +0000)]
Simplify overflow-on-add check in NumericLiteralParser::GetIntegerValue.

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

16 years agoThis is the first step to build a better evaluation model for GRExprEngine. A
Zhongxing Xu [Thu, 16 Oct 2008 06:09:51 +0000 (06:09 +0000)]
This is the first step to build a better evaluation model for GRExprEngine.  A
new VisitLValue method is added to replace the old VisitLVal. The semantics
model becomes more explicit to separate rvalue evaluation from lvalue
evaluation.

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

16 years agoTeach tryEvaluate that fabs, copysign, and unary +/- are constants for
Daniel Dunbar [Thu, 16 Oct 2008 03:51:50 +0000 (03:51 +0000)]
Teach tryEvaluate that fabs, copysign, and unary +/- are constants for
floats.
 - With testcase, which also has some other things GCC folds but we
   don't commented out in it.

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

16 years agoImplement #pragma pack use in structure packing. The general approach
Daniel Dunbar [Thu, 16 Oct 2008 02:34:03 +0000 (02:34 +0000)]
Implement #pragma pack use in structure packing. The general approach
is to encode the state of the #pragma pack stack as an attribute when
the structure is declared.

 - Extend PackedAttr to take an alignment (in bits), and reuse for
   both __attribute__((packed)) (which takes no argument, instead
   packing tightly (to "minimize the memory required") and for #pragma
   pack (which allows specification of the maximum alignment in
   bytes). __attribute__((packed)) is just encoded as Alignment=1.

   This conflates two related but different mechanisms, but it didn't
   seem worth another attribute.

 - I have attempted to follow the MSVC semantics as opposed to the gcc
   ones, since if I understand correctly #pragma pack originated with
   MSVC. The semantics are generally equivalent except when the stack
   is altered during the definition of a structure; its not clear if
   anyone does this in practice. See testcase if curious.

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

16 years agoccc: support -Xlinker
Daniel Dunbar [Thu, 16 Oct 2008 00:10:28 +0000 (00:10 +0000)]
ccc: support -Xlinker

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

16 years agoIssue a warning when there's an ambiguous function declarator (that could be a direct...
Argyrios Kyrtzidis [Wed, 15 Oct 2008 23:21:32 +0000 (23:21 +0000)]
Issue a warning when there's an ambiguous function declarator (that could be a direct initializer for a variable defition).
Idea originated from here: http://thread.gmane.org/gmane.comp.gcc.devel/101524

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

16 years agoccc: support -fsyntax-only, add some more darwin options, support
Daniel Dunbar [Wed, 15 Oct 2008 21:52:00 +0000 (21:52 +0000)]
ccc: support -fsyntax-only, add some more darwin options, support
logging of actions.

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

16 years agoFix this bug:
Argyrios Kyrtzidis [Wed, 15 Oct 2008 20:23:22 +0000 (20:23 +0000)]
Fix this bug:

typedef int f();
struct S {
   f *x; // incorrectly assuming this is function decl, leading to failed assertions.
};

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

16 years agoAdd TokenRewriter to VC++ project.
Steve Naroff [Wed, 15 Oct 2008 19:52:33 +0000 (19:52 +0000)]
Add TokenRewriter to VC++ project.

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

16 years agoAdd RewriteTest.cpp to VC++ project.
Steve Naroff [Wed, 15 Oct 2008 19:49:15 +0000 (19:49 +0000)]
Add RewriteTest.cpp to VC++ project.

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

16 years agoTighten up blocks rewriter to handle casts and some other interesting cases.
Steve Naroff [Wed, 15 Oct 2008 18:38:58 +0000 (18:38 +0000)]
Tighten up blocks rewriter to handle casts and some other interesting cases.

This fixes <rdar://problem/6289007> clang block rewriter: ^ in cast is not rewritten.

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

16 years agoUse BatchEmitOwnedPtrs for writing multiple child exprs, per review.
Daniel Dunbar [Wed, 15 Oct 2008 17:52:29 +0000 (17:52 +0000)]
Use BatchEmitOwnedPtrs for writing multiple child exprs, per review.

Also added serialization support to OverloadExpr.

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

16 years agoAdded pinsrd, pinsrq, and some other vector intrinsics
Mon P Wang [Wed, 15 Oct 2008 06:18:34 +0000 (06:18 +0000)]
Added pinsrd, pinsrq, and some other vector intrinsics

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

16 years agoEnhance dead store checker to not flag preincrements to dead variables where the...
Ted Kremenek [Wed, 15 Oct 2008 05:23:41 +0000 (05:23 +0000)]
Enhance dead store checker to not flag preincrements to dead variables where the preincrement is a subexpression, e.g. foo(++x);  This can cause false negatives, but will remove a whole class of false positives.

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

16 years agoSimplify handling of struct/union/class tags.
Argyrios Kyrtzidis [Wed, 15 Oct 2008 00:42:39 +0000 (00:42 +0000)]
Simplify handling of struct/union/class tags.
Instead of using two sets of Decl kinds (Struct/Union/Class and CXXStruct/CXXUnion/CXXClass), use one 'Record' and one 'CXXRecord' Decl kind and make tag kind a property of TagDecl.
Cleans up the code a bit and better reflects that Decl class structure.

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

16 years agoTest commit.
Daniel Dunbar [Wed, 15 Oct 2008 00:26:06 +0000 (00:26 +0000)]
Test commit.

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

16 years agoDowngrade incompatibilities with objc qualified types (e.g. id <P>) to warnings.
Steve Naroff [Tue, 14 Oct 2008 22:18:38 +0000 (22:18 +0000)]
Downgrade incompatibilities with objc qualified types (e.g. id <P>) to warnings.
Note: One day, we should consider moving the actual diags to ObjCQualifiedIdTypesAreCompatible(), since it has more information on the actual problem. GCC currently emits slightly more instructive errors for some cases involving protocols. I added a FIXME to the code.

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

16 years agoFix const qualifiers on ProtocolQualifierListTy.
Daniel Dunbar [Tue, 14 Oct 2008 20:22:44 +0000 (20:22 +0000)]
Fix const qualifiers on ProtocolQualifierListTy.

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

16 years agoRevert my previous change, got stupidly confused with my local changes.
Argyrios Kyrtzidis [Tue, 14 Oct 2008 18:28:48 +0000 (18:28 +0000)]
Revert my previous change, got stupidly confused with my local changes.

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

16 years agoFix a call to Sema::LookupDecl that had incorrect parameters.
Argyrios Kyrtzidis [Tue, 14 Oct 2008 17:28:09 +0000 (17:28 +0000)]
Fix a call to Sema::LookupDecl that had incorrect parameters.

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

16 years agoAdd serialization support in several missing places.
Daniel Dunbar [Tue, 14 Oct 2008 16:57:09 +0000 (16:57 +0000)]
Add serialization support in several missing places.

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

16 years agoMove Type::EmitImpl into header, add FIXME to make abstract.
Daniel Dunbar [Tue, 14 Oct 2008 16:55:17 +0000 (16:55 +0000)]
Move Type::EmitImpl into header, add FIXME to make abstract.

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

16 years agoFix typo in testcase.
Daniel Dunbar [Tue, 14 Oct 2008 16:46:03 +0000 (16:46 +0000)]
Fix typo in testcase.

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

16 years agoadd a testcase.
Chris Lattner [Tue, 14 Oct 2008 06:32:07 +0000 (06:32 +0000)]
add a testcase.

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

16 years agoFix test suite regression, getFloatTypeSemantics shouldn't be called
Daniel Dunbar [Tue, 14 Oct 2008 05:41:12 +0000 (05:41 +0000)]
Fix test suite regression, getFloatTypeSemantics shouldn't be called
on non-float types.

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

16 years agoAdd Sema implementation of #pragma pack stack.
Daniel Dunbar [Tue, 14 Oct 2008 05:35:18 +0000 (05:35 +0000)]
Add Sema implementation of #pragma pack stack.
 - Follows the MSVC (original) implementation, including support of
   pack(show) (useful for testing).
 - Implements support for named pack records which gcc seems to
   ignore (or implements incorrectly).
 - Not currently wired to anything, only functionality change is the
   type checking of the pragma.

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

16 years agoUse 'realpath' to resolve the absolute path to clang and ccc-analyzer.
Ted Kremenek [Mon, 13 Oct 2008 21:46:42 +0000 (21:46 +0000)]
Use 'realpath' to resolve the absolute path to clang and ccc-analyzer.
Add "-analyze-headers" option to scan-build that passes the option -analyzer-opt-analyze-headers to clang.

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

16 years agoLift out ABIInfo abstract base class.
Daniel Dunbar [Mon, 13 Oct 2008 17:02:26 +0000 (17:02 +0000)]
Lift out ABIInfo abstract base class.
 - Currently still lives in CGCall.cpp but is intended to be the
   target specific place for hooking ABI information.
 - Select ABIInfo to use based on Target's prefix and pointer width.

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

16 years agoMore const-ness goodness.
Argyrios Kyrtzidis [Sun, 12 Oct 2008 18:45:56 +0000 (18:45 +0000)]
More const-ness goodness.

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

16 years agoImprove the const-ness of a few methods.
Argyrios Kyrtzidis [Sun, 12 Oct 2008 18:40:01 +0000 (18:40 +0000)]
Improve the const-ness of a few methods.
No functionality change.

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

16 years agoImplement more efficient Decl <-> DeclContext conversions.
Argyrios Kyrtzidis [Sun, 12 Oct 2008 16:14:48 +0000 (16:14 +0000)]
Implement more efficient Decl <-> DeclContext conversions.
When the static type on the Decl side is a subclass of DeclContext the compiler will use a "inlinable" static_cast, instead of always using an out-of-line function call.

Note, though, that the isa<> check still uses an out-of-line function call.

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

16 years agomake the -rewrite-test a bit more interesting: it now
Chris Lattner [Sun, 12 Oct 2008 06:09:52 +0000 (06:09 +0000)]
make the -rewrite-test a bit more interesting: it now
wraps comments in <i> tags.  Extend rewrite tokens to support
this minimal functionality.

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

16 years agostart implementing a token rewriter. At this point, it just reads in a file
Chris Lattner [Sun, 12 Oct 2008 05:44:03 +0000 (05:44 +0000)]
start implementing a token rewriter.  At this point, it just reads in a file
and lets a client iterate over it.

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