Zhongxing Xu [Sat, 9 May 2009 13:20:07 +0000 (13:20 +0000)]
Do not layer a TypedViewRegion when casting symbolic or alloca regions.
Modify getLValueElement accordingly. Now we don't require base region
to be a typed region. Do not create TypedViewRegion when base region is
symbolic or alloca region. We can do so because each element region has
its type information.
Ted Kremenek [Sat, 9 May 2009 02:44:38 +0000 (02:44 +0000)]
Add back Parse/Sema support for attributes cf_returns_retained and
ns_returns_retained, but do not include the other ownership attributes
we previously had.
Daniel Dunbar [Fri, 8 May 2009 21:30:11 +0000 (21:30 +0000)]
Darwin x86_32: When coercing a "single element" structure, make sure
to use a wide enough type. This might be wider than the "single
element"'s type in the presence of padding bit-fields.
- Darwin x86_32 now passes the first 1k ABI tests with bit-field
generation enabled.
Daniel Dunbar [Fri, 8 May 2009 20:55:49 +0000 (20:55 +0000)]
Darwin x86_32: Improve bit-field handling for returning records.
- This turns out to be a no-op now that most of the handling for
everything else is in place.
Chris Lattner [Fri, 8 May 2009 15:39:58 +0000 (15:39 +0000)]
"This patch fixes message sends to super in categories for the GNU runtime. This used to work, but I broke it when I modified the code to emit the same thing as GCC for message sends to super in classes."
Chris Lattner [Fri, 8 May 2009 15:36:58 +0000 (15:36 +0000)]
Fix the atomics sema code to convert operands to the argument types
of the underlying _N builtin, not the the type of the pointee of the
actual type. This ensures that atomics involving pointers end up
using the correct integer type when they are resolved, avoiding
aborts in codegen.
Chris Lattner [Fri, 8 May 2009 06:58:22 +0000 (06:58 +0000)]
reimplement __sync_* builtins to be variadic and to follow the same
semantic rules that gcc and icc use. This implements the variadic
and concrete versions as builtins and has sema do the
disambiguation. There are probably a bunch of details to finish up
but this seems like a large monotonic step forward :)
Ted Kremenek [Fri, 8 May 2009 00:32:39 +0000 (00:32 +0000)]
Fix <rdar://problem/6845148>. Signed integers compared against pointers should
implicitly be changed to unsigned values in GRSimpleVals.cpp. This can happen
when the comparison involves logic in specialized transfer functions (e.g.,
OSAtomicCompareAndSwap).
Chris Lattner [Fri, 8 May 2009 00:11:50 +0000 (00:11 +0000)]
initial support for ObjC exceptions with the GNU runtime:
"This patch is a first pass at adding support for exceptions for the GNU runtime. There are a few limitations at present:
- @synchronized() is not yet supported at all. gcc currently emits calls to runtime library functions that don't exist for this directive.
- Only id @catch statements are currently working. This is enough for NS_DURING and friends, but I need to spend more time reading the output from gcc -S to work out how it finds the class pointer to make arbitrary class type catch statements work.
- I've tested it with a few common cases[1] and the clang test suite (which doesn't test exceptions for the GNU runtime, but shows I haven't broken anything else), but there are probably a lot of cases I've missed."
Ted Kremenek [Thu, 7 May 2009 23:40:42 +0000 (23:40 +0000)]
Minor code cleanup in retain/release checker in preparation for some
other changes. Instead of repeatedly checking for GC mode when
getting the return effect, just do this computation once.
a forward class declaration matching a typedef name of a class
refers to the underlying class.
This is radar 6859726. Steve, please read the radar for my rational.
Ted Kremenek [Thu, 7 May 2009 18:27:16 +0000 (18:27 +0000)]
analyzer: Add ProgramPoint 'PostLValue' just to distinguish (for
analysis introspection) when we computed an lvalue. This shouldn't
effect the current analysis results in any way.
Ted Kremenek [Thu, 7 May 2009 00:45:08 +0000 (00:45 +0000)]
Bug fix: Not all ConstraintManagers always return a null state when setting
isFeasible to false. This is something we may wish to do further validation on.
Ted Kremenek [Wed, 6 May 2009 21:39:49 +0000 (21:39 +0000)]
Refactor BugReporter interface to have a new 'BugReporterContext' and
'BugReporterVisitor'. This simplifies callbacks from BugReporter to BugReports
(via VisitNode). It also lays the foundation for arbitrary visitor "call backs"
that can be registered to a BugReporterContext as a PathDiagnostic is
constructed. These call backs can help operate as separate "experts" that can
work on constructed pieces of a PathDiagnostic for which they possess special
knowledge.
Daniel Dunbar [Wed, 6 May 2009 21:07:50 +0000 (21:07 +0000)]
More x86 target feature support.
- Apologies for the extremely gross code duplication, I want to get
this working and then decide how to get this information out of the
back end.
- This replaces -m[no-]sse4[12] by -m[no-]sse4, it appears gcc
doesn't distinguish them?
- -msse, etc. now properly disable/enable related features.
- Don't always define __SSE3__...
- The main missing functionality bit here is that we don't initialize
the features based on the CPU for all -march options.
Ted Kremenek [Wed, 6 May 2009 18:19:24 +0000 (18:19 +0000)]
Fix analyzer regression reported in PR 4164:
- Update the old StoreManager::CastRegion to strip off 'ElementRegions' when
casting to void* (Zhongxing: please validate)
- Pass-by-reference argument invalidation logic in CFRefCount.cpp:
- Strip ElementRegions when the ElementRegion is just a 'raw data' view
on top of the underlying typed region.
Zhongxing Xu [Wed, 6 May 2009 11:51:48 +0000 (11:51 +0000)]
Improve RegionStoreManager::getSizeInElements()
- add a static function getTypeWidth(), which computes the width of a type
with the help of TargetInfo.
- no-outofbounds.c now passes for region store.
Chris Lattner [Wed, 6 May 2009 04:33:31 +0000 (04:33 +0000)]
Fix rdar://6860124 - invalid input constraint 'J' in asm
This recognizes all the target-independent constant constraints
that have target-specific meanings.
Daniel Dunbar [Wed, 6 May 2009 03:16:41 +0000 (03:16 +0000)]
Improve handling of (X86) target features.
- This is a WIP...
- This adds -march= handling to the driver, and fixes the defaulting
of -mcpu on Darwin (which was using the wrong test).
Instead of handling -m{sse, ...} in the driver, pass them to clang-cc as
-target-feature [+-]name
In clang-cc, communicate with the (clang) target to discover the legal
features of a target, and the features which are enabled based on
-mcpu. This is currently hardcoded just enough to not be a feature
regression, we need to get this information from the backend's
TableGen information somehow.
This is used to construct the full list of features which are being
used, which is in turn used to initialize the predefines.
Daniel Dunbar [Wed, 6 May 2009 02:12:32 +0000 (02:12 +0000)]
Add --analyze-auto.
- Currently just an alias for --analyze, eventually we want to refit
--analyze so that it is less automatic (i.e., does not force plist
output and does not hard code the list of checks).