Commit Graph

56988 Commits

Author SHA1 Message Date
Sebastian Redl f69a94aace Hopefully fix the rval regressions. Thanks to Chris for pointing out that valgrind complains.
llvm-svn: 68021
2009-03-29 22:46:24 +00:00
Daniel Dunbar 53b406f40a Driver: Track which original arguments an arg is derived from, so that
we can properly claim arguments, even if they have been translated by
the tool chain.

llvm-svn: 68020
2009-03-29 22:29:05 +00:00
Daniel Dunbar f64f5307dc Driver: Add test case for darwin::Preprocess and darwin::Compile
tools, and enable them.

llvm-svn: 68019
2009-03-29 22:27:40 +00:00
Daniel Dunbar 58399aecc1 Driver: Make sure to claim -### before emitting "unused argument"
warnings.

llvm-svn: 68018
2009-03-29 22:24:54 +00:00
Daniel Dunbar e2ad1c2159 Fix typo in diagnostic.
llvm-svn: 68017
2009-03-29 22:23:49 +00:00
Misha Brukman d326656d9c Updated the comment for isArithmeticShift() to match reality.
llvm-svn: 68016
2009-03-29 20:41:38 +00:00
Eli Friedman 32ca82a450 Fix the default for intptr_t on *BSD x86-32 and Windows. Slight cleanup
by moving the general case to the generic x86-32 target.

llvm-svn: 68015
2009-03-29 20:31:09 +00:00
Bill Wendling 8fde3036bf Constify check. This fixes PR3900.
llvm-svn: 68013
2009-03-29 20:08:56 +00:00
Daniel Dunbar afec1f58e9 Driver: Finish porting Darwin::Preprocess and Compile port (still
unused, and lacking a test case).
 - ccc is now on death row, pending some more testing and bug fixes.

llvm-svn: 68012
2009-03-29 18:40:18 +00:00
Chris Lattner be36eb0570 minor simplification
llvm-svn: 68011
2009-03-29 17:29:28 +00:00
Chris Lattner 32dc41c445 hoist some code for handling objc foreach construct out of Declaration processing
into ParseForStatement.  Merge two tests into one.

llvm-svn: 68010
2009-03-29 17:27:48 +00:00
Chris Lattner efb0f111f1 hoist checks for ; and in out of ParseInitDeclaratorListAfterFirstDeclarator
into ParseSimpleDeclaration, and improve a diagnostic.

llvm-svn: 68009
2009-03-29 17:18:04 +00:00
Anton Korobeynikov f3cf04f900 Testcase for recent ro/relocs stuff
llvm-svn: 68008
2009-03-29 17:14:57 +00:00
Anton Korobeynikov bea241a5f5 IA64 is as weird as Alpha wrt r/o relocs :)
llvm-svn: 68007
2009-03-29 17:14:35 +00:00
Anton Korobeynikov 014a86f216 Alpha always requires global relocations to be r/w regardless of PIC.
llvm-svn: 68006
2009-03-29 17:14:14 +00:00
Anton Korobeynikov 088ebede53 Honour relocation behaviour stuff for ro objects
llvm-svn: 68005
2009-03-29 17:13:49 +00:00
Anton Korobeynikov 7437b59caf Extend the relocation tracker handler, so we can filter on different 'kinds' of relocations required.
llvm-svn: 68004
2009-03-29 17:13:18 +00:00
Daniel Dunbar e6adeeece3 Driver: Start porting Darwin::Preprocess and Compile implementations
(currently unused).

llvm-svn: 68003
2009-03-29 17:08:39 +00:00
Chris Lattner 5bbb3c8ad9 Push DeclGroup much farther throughout the compiler. Now the various
productions (except the already broken ObjC cases like @class X,Y;) in 
the parser that can produce more than one Decl return a DeclGroup instead
of a Decl, etc.

This allows elimination of the Decl::NextDeclarator field, and exposes
various clients that should look at all decls in a group, but which were
only looking at one (such as the dumper, printer, etc).  These have been
fixed.

Still TODO:

1) there are some FIXME's in the code about potentially using
DeclGroup for better location info.
2) ParseObjCAtDirectives should return a DeclGroup due to @class etc.
3) I'm not sure what is going on with StmtIterator.cpp, or if it can
   be radically simplified now.
4) I put a truly horrible hack in ParseTemplate.cpp.

I plan to bring up #3/4 on the mailing list, but don't plan to tackle
#1/2 in the short term.

llvm-svn: 68002
2009-03-29 16:50:03 +00:00
Chris Lattner 6c84a5a394 DeclRefExpr refers to one decl, not all the declarators in a declaration.
Ted, please check this, this change causes no regression tests to fail.

llvm-svn: 68001
2009-03-29 16:35:09 +00:00
Chris Lattner 3d954d5d0e simplify
llvm-svn: 68000
2009-03-29 16:04:50 +00:00
Sebastian Redl 4c0cd856b1 Reintroduce r67870 (rval ref overloading), since I can't reproduce any test failures on i386 or x86_64. If this fails for someone, please contact me.
llvm-svn: 67999
2009-03-29 15:27:50 +00:00
Chris Lattner 41b1601bdd Implement PointerLikeTypeTraits for DeclGroupRef.
Make OpaquePtr work with things that are pointer-like but not
necessarily pointers.

llvm-svn: 67998
2009-03-29 14:23:52 +00:00
Chris Lattner 4de55aa4f2 reduce indentation with an early exit.
llvm-svn: 67997
2009-03-29 14:02:43 +00:00
Duncan Sands d21581eaa1 Fix PR3899: add support for extracting floats from vectors
when using -soft-float.
Based on a patch by Jakob Stoklund Olesen.

llvm-svn: 67996
2009-03-29 13:51:06 +00:00
Chris Lattner 6694cdf215 add missing space.
llvm-svn: 67995
2009-03-29 13:26:05 +00:00
Chris Lattner 87576f3639 remove unused #include
llvm-svn: 67994
2009-03-29 07:05:59 +00:00
Chris Lattner 63595ddcb5 switch TemplateOrInstantiation to be a PointerUnion, which
simplifies some code.

llvm-svn: 67993
2009-03-29 07:03:59 +00:00
Chris Lattner 5b52baeeef add some comments, add a dyn_cast method.
llvm-svn: 67992
2009-03-29 07:03:30 +00:00
Chris Lattner 51ce02d264 change another PointerIntPair into a PointerUnion.
llvm-svn: 67991
2009-03-29 06:43:22 +00:00
Chris Lattner e50f47971b When forming sentinels for empty/tombstone, make sure to respect the
pointer's expected number of zero low-bits.

This should fix the breakage I introduced recently.

llvm-svn: 67990
2009-03-29 06:33:22 +00:00
Chris Lattner 3a6dc751ac add helper method.
llvm-svn: 67989
2009-03-29 06:32:46 +00:00
Chris Lattner b81eb052f2 switch DeclBase::DeclCtx to the new happy and type-safe
llvm::PointerUnion class.

llvm-svn: 67988
2009-03-29 06:06:59 +00:00
Chris Lattner a9c6de15fb Add a simple type-safe bit-mangling pointer union class. This allows
you to do things like:

  ///    PointerUnion<int*, float*> P;
  ///    P = (int*)0;
  ///    printf("%d %d", P.is<int*>(), P.is<float*>()); // prints "1 0"
  ///    X = P.get<int*>();     // ok.
  ///    Y = P.get<float*>();   // runtime assertion failure.
  ///    Z = P.get<double*>();  // does not compile.
  ///    P = (float*)0;
  ///    Y = P.get<float*>();   // ok.
  ///    X = P.get<int*>();     // runtime assertion failure.

llvm-svn: 67987
2009-03-29 06:06:02 +00:00
Chris Lattner 35c0232cb0 Allow a specific PointerIntPair instance to use a specific Pointer trait:
some pointer instances have properties that not all of a type have.

llvm-svn: 67986
2009-03-29 06:02:20 +00:00
Chris Lattner d4ff5fce81 Add a PointerLikeTypeTraits specialization for uintptr_t
llvm-svn: 67985
2009-03-29 06:00:21 +00:00
Chris Lattner 9bb25a192a Value* only has 2 bits free as well.
llvm-svn: 67984
2009-03-29 05:45:43 +00:00
Chris Lattner 57ce399326 Make the ActionResult optimization work for non-void*'s and switch DeclPtrTy to use it.
llvm-svn: 67983
2009-03-29 05:08:48 +00:00
Chris Lattner cd8bb18624 genericize the ActionResult optimization for holding the "ininvalid" bit
in the low bit position a little bit (haha).

llvm-svn: 67982
2009-03-29 05:04:26 +00:00
Chris Lattner 85e2e141db various cleanups
llvm-svn: 67981
2009-03-29 05:01:10 +00:00
Chris Lattner 20d79aa1c2 adjust to llvm mainline changes.
llvm-svn: 67980
2009-03-29 04:32:54 +00:00
Chris Lattner eb71b17705 Replace the PointerLikeTypeTraits::getNumLowBitsAvailable
function with a new NumLowBitsAvailable enum, which makes the
value available as an integer constant expression.

Add PointerLikeTypeTraits specializations for Instruction* and
Use** since they are only guaranteed 4-byte aligned.

Enhance PointerIntPair to know about (and enforce) the alignment
specified by PointerLikeTypeTraits.  This should allow things 
like PointerIntPair<PointerIntPair<void*, 1,bool>, 1, bool> 
because the inner one knows that 2 low bits are free.

llvm-svn: 67979
2009-03-29 04:32:37 +00:00
Chris Lattner 114597d69b tighten this up, the decl *must* be a declcontext, no need for the dynamic check.
llvm-svn: 67978
2009-03-29 04:30:19 +00:00
Chris Lattner 59f1a41f2e add fixme
llvm-svn: 67977
2009-03-29 01:03:29 +00:00
Ted Kremenek 42361b3eb5 Update checker build.
llvm-svn: 67976
2009-03-29 00:43:39 +00:00
Chris Lattner ed6b4b0598 add getNumLowBitsAvailable for OpaquePtr and QualType.
llvm-svn: 67975
2009-03-29 00:41:20 +00:00
Chris Lattner 22d059dbde follow llvm mainline, where PointerLikeTypeInfo got renamed
to PointerLikeTypeTraits.

llvm-svn: 67974
2009-03-29 00:39:47 +00:00
Chris Lattner a00f0d7e4c rename PointerLikeTypeInto to PointerLikeTypeTraits, add trait for
# low bits free, and move to its own header.

llvm-svn: 67973
2009-03-29 00:39:30 +00:00
Ted Kremenek 554b5370e4 scan-build: Also look for clang-cc in ../libexec
llvm-svn: 67972
2009-03-29 00:31:32 +00:00
Chris Lattner 8eda11bd9d now that you can put a PointerIntPair in a SmallPtrSet, remove some
hackish workarounds from memdep

llvm-svn: 67971
2009-03-29 00:24:04 +00:00