Commit Graph

48776 Commits

Author SHA1 Message Date
Daniel Dunbar 472175e545 Exercise #pragma pack(pop, <width>) in test case.
llvm-svn: 57683
2008-10-17 16:05:47 +00:00
Gabor Greif ca01496e59 remove spurious space in link
llvm-svn: 57677
2008-10-17 14:43:58 +00:00
Gabor Greif 97966407d0 Add comment on how tagged pointers are
distinguished from normal (untagged) ones
as per review comment.

I am sufficiently unaquainted with doxygen to
defer the markup to someone with more experience.

llvm-svn: 57676
2008-10-17 08:31:36 +00:00
Daniel Dunbar 3cd9a29c64 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.

llvm-svn: 57675
2008-10-17 07:30:50 +00:00
Daniel Dunbar 40cac777b9 Anonymous structures print as '?=' in Obj-C type encoding.
llvm-svn: 57674
2008-10-17 06:22:57 +00:00
Evan Cheng 08acb24225 Fix a very subtle spiller bug: UpdateKills should not forget to track defs of aliases.
llvm-svn: 57673
2008-10-17 06:16:07 +00:00
Chris Lattner 7e9e3b3d4b add some simple hacky long double support for the CBE. This
should work for intel long double, but ppc long double aborts
in convert.

llvm-svn: 57672
2008-10-17 06:11:48 +00:00
Zhongxing Xu 27f174214d This patch did the following renaming. There should be no functional changes.
RVal => SVal
LVal => Loc
NonLVal => NonLoc
lval => loc
nonlval => nonloc

llvm-svn: 57671
2008-10-17 05:57:07 +00:00
Zhongxing Xu 0dd213f8f5 Add test case for array and struct variable lvalue evaluation.
llvm-svn: 57670
2008-10-17 05:19:52 +00:00
Dan Gohman 10549c29a8 Use INT64_C to emit constant values, to avoid problems with
constants that don't fit in an int. This fixes
"this decimal constant is unsigned only in ISO C90"
warnings.

llvm-svn: 57668
2008-10-17 04:40:39 +00:00
Daniel Dunbar 3c683f5bf2 NeXT: Use objc_msgSend_fpret for calling functions which return
floating point. This is only correct for x86-32 at the moment.

llvm-svn: 57667
2008-10-17 03:24:53 +00:00
Zhongxing Xu 252fe5c9f1 Get array's lvalue through standard interface.
llvm-svn: 57666
2008-10-17 02:20:14 +00:00
Zhongxing Xu 9fe408057a Return the corresponding MemRegionVal for both rvalue and lvalue of array of
type T.

llvm-svn: 57665
2008-10-17 02:14:42 +00:00
Zhongxing Xu 4e500455c9 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.

llvm-svn: 57664
2008-10-17 01:51:27 +00:00
Dan Gohman ca0546facc Fun x86 encoding tricks: when adding an immediate value of 128,
use a SUB instruction instead of an ADD, because -128 can be
encoded in an 8-bit signed immediate field, while +128 can't be.
This avoids the need for a 32-bit immediate field in this case.

A similar optimization applies to 64-bit adds with 0x80000000,
with the 32-bit signed immediate field.

To support this, teach tablegen how to handle 64-bit constants.

llvm-svn: 57663
2008-10-17 01:33:43 +00:00
Dan Gohman a39b0a1f05 Define patterns for shld and shrd that match immediate
shift counts, and patterns that match dynamic shift counts
when the subtract is obscured by a truncate node.

Add DAGCombiner support for recognizing rotate patterns
when the shift counts are defined by truncate nodes.

Fix and simplify the code for commuting shld and shrd
instructions to work even when the given instruction doesn't
have a parent, and when the caller needs a new instruction.

These changes allow LLVM to use the shld, shrd, rol, and ror
instructions on x86 to replace equivalent code using two
shifts and an or in many more cases.

llvm-svn: 57662
2008-10-17 01:23:35 +00:00
Daniel Dunbar 380827cfa1 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.

llvm-svn: 57661
2008-10-17 01:07:56 +00:00
Dan Gohman 215742a966 Use 0 instead of false to return a null pointer.
llvm-svn: 57660
2008-10-17 00:56:52 +00:00
Ted Kremenek 357c63ab37 Remove an untrue assertion: lval::FuncVals can be returned in both rvalue and lvalue contexts.
llvm-svn: 57659
2008-10-17 00:55:33 +00:00
Ted Kremenek 7ff153c9cb Mark these tests XFAIL. We need to add back assumption logic when doing array and field accesses.
llvm-svn: 57658
2008-10-17 00:51:39 +00:00
Ted Kremenek 3ad391d800 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?

llvm-svn: 57657
2008-10-17 00:51:01 +00:00
Ted Kremenek 12dd55b23d Add transfer function support for ObjCIvarRefExpr.
llvm-svn: 57654
2008-10-17 00:03:18 +00:00
Dan Gohman 016f16daf1 Fix this test so it actually runs the grep lines.
llvm-svn: 57653
2008-10-16 23:57:54 +00:00
Dan Gohman e33afda4fa Trim #includes.
llvm-svn: 57649
2008-10-16 20:18:31 +00:00
Argyrios Kyrtzidis 2c021aa573 In C++, an empty parameter list indicates a function that takes no parameters.
llvm-svn: 57646
2008-10-16 17:31:08 +00:00
Chris Lattner 3c3e2cc77f Add basic FreeBSD target support, patch by Roman Divacky!
llvm-svn: 57645
2008-10-16 17:04:31 +00:00
Chris Lattner ba88d86a65 fix typo noticed by sdt
llvm-svn: 57644
2008-10-16 17:02:50 +00:00
Daniel Dunbar 33d29b3eae 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.

llvm-svn: 57643
2008-10-16 16:54:18 +00:00
Argyrios Kyrtzidis 89656d2298 Using dyn_cast_or_null here is redundant, use dyn_cast instead.
llvm-svn: 57642
2008-10-16 16:50:47 +00:00
Gabor Greif 0bd120e817 Introduce a typing refinenement on tagged data
using the 'volatile' qualifier. This should not have any operational consequences
on code, because tags should always be stripped off (giving a non-volatile pointer)
before dereferencing. The new qualification is there to catch some attempts to use
tagged pointers in a context where an untagged pointer is appropriate.

Notably this approach does not catch dereferencing of tagged pointers, but helps
in separating the two concepts a bit.

llvm-svn: 57641
2008-10-16 15:33:02 +00:00
Steve Naroff 9546eee50a 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

llvm-svn: 57640
2008-10-16 14:59:30 +00:00
Mikhail Glushenkov 35945b6af2 Re-apply Makefile changes. Fix build with srcdir != objdir.
llvm-svn: 57636
2008-10-16 14:02:29 +00:00
Duncan Sands dc84511146 Fix warnings about mb/me being potentially used
uninitialized in these functions with gcc-4.3.

llvm-svn: 57635
2008-10-16 13:02:33 +00:00
Duncan Sands 1c7f8901c6 Fix "large integer implicitly truncated to unsigned type"
warning on x86-64 with gcc-4.3.

llvm-svn: 57634
2008-10-16 09:14:58 +00:00
Duncan Sands 7451f87273 Testcase for PR2762.
llvm-svn: 57633
2008-10-16 08:56:46 +00:00
Daniel Dunbar be947083d2 Speed up NumericLiteralParser::GetIntegerValue.
- Implement fast path when value easily fits in a uint64.
 - ~6x faster, translates to 1-2% on Cocoa.h

llvm-svn: 57632
2008-10-16 07:32:01 +00:00
Chris Lattner 305fb0a7ba add some notes
llvm-svn: 57631
2008-10-16 07:04:06 +00:00
Chris Lattner 29628cc5da add some notes and a file to collect unimplemented features in the
x86 backend.  These will all be answered with "patches welcome", so
a PR doesn't help drive them along.

llvm-svn: 57630
2008-10-16 06:46:12 +00:00
Daniel Dunbar b1f64426a0 Simplify overflow-on-add check in NumericLiteralParser::GetIntegerValue.
llvm-svn: 57629
2008-10-16 06:39:30 +00:00
Chris Lattner 122c9b1b22 mark some targets as experimental. Andrew, if you think that Alpha is
basically working, feel free to remove the tag.  The other targets have
really basic things that break them.

llvm-svn: 57628
2008-10-16 06:16:50 +00:00
Zhongxing Xu 232c7929a2 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.  

llvm-svn: 57627
2008-10-16 06:09:51 +00:00
Chris Lattner 229f765dbe Verify prefetch arguments, PR2576.
llvm-svn: 57626
2008-10-16 06:00:36 +00:00
Chris Lattner 1baace07c4 apply Eli's patch for PR2165 and provide a testcase.
llvm-svn: 57625
2008-10-16 05:26:51 +00:00
Daniel Dunbar c3d79cf6b3 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.

llvm-svn: 57624
2008-10-16 03:51:50 +00:00
Daniel Dunbar 4290d46bd4 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.

llvm-svn: 57623
2008-10-16 02:34:03 +00:00
Dan Gohman 33332bce17 Const-ify several TargetInstrInfo methods.
llvm-svn: 57622
2008-10-16 01:49:15 +00:00
Dan Gohman 4a87660127 Remove an unused variable.
llvm-svn: 57621
2008-10-16 01:47:47 +00:00
Dan Gohman fc27e25a6e Fix Instruction::isIdenticalTo and isSameOperationAs to recognize
additional information in Loads, Stores, Calls, Invokes,
InsertValueInsts, and ExtractValueInsts.

llvm-svn: 57620
2008-10-16 01:24:45 +00:00
Zhongxing Xu 20c1b60178 Fix a calculation error in comments.
llvm-svn: 57619
2008-10-16 01:21:44 +00:00
Dan Gohman 0b3bcee284 Rename AliasSet to SubRegs, to reflect changes in the surrounding code.
llvm-svn: 57618
2008-10-16 01:06:18 +00:00