Commit Graph

69689 Commits

Author SHA1 Message Date
Ted Kremenek 3abc41f45d Per an astute observation from Zhongxing Xu, remove a "special case" logic in
RegionStoreManager::Retrieve() that was intended to handle conflated uses of pointers as integers.
It turns out this isn't needed, and resulted in inconsistent behavior when creating symbolic values on the following test case in 'tests/Analysis/misc-ps.m':

  typedef struct _BStruct { void *grue; } BStruct;
  void testB_aux(void *ptr);
  void testB(BStruct *b) {
    {
      int *__gruep__ = ((int *)&((b)->grue));
      int __gruev__ = *__gruep__;
      testB_aux(__gruep__);
    }
    {
      int *__gruep__ = ((int *)&((b)->grue));
      int __gruev__ = *__gruep__;
      if (~0 != __gruev__) {}
    }
  }

When the code was analyzed with '-arch x86_64', the value assigned to '__gruev__' be would be a
symbolic integer, but for '-arch i386' the value assigned to '__gruev__' would be a symbolic region
(a blob of memory). With this change the value created is always a symbolic integer.

Since the code being removed was added to support analysis of code calling
OSAtomicCompareAndSwapXXX(), I also modified 'test/Analysis/NSString.m' to analyze the code in both
'-arch i386' and '-arch x86_64', and also added some complementary test cases to test the presence
of leaks when using OSAtomicCompareAndSwap32Barrier()/OSAtomicCompareAndSwap64Barrier() instead of
just their absence. This code change reveals that previously both RegionStore and BasicStore were
handling these cases wrong, and would never cause the analyzer to emit a leak in these cases (false
negatives). Now RegionStore gets it right, but BasicStore still gets it wrong (and hence it has been
disabled temporarily for this test case).

llvm-svn: 84163
2009-10-15 01:40:34 +00:00
Anders Carlsson 66413c29d3 Handle
struct A { };
struct B : A { };

void f() {
  const A& a = B();
}

correctly. (This now does the offset conversion if necessary and calls the destructor when a goes out of scope).

llvm-svn: 84162
2009-10-15 00:51:46 +00:00
Anders Carlsson 63dce02544 Check the return type when calling pointer to member functions.
llvm-svn: 84161
2009-10-15 00:41:48 +00:00
John Thompson 3254182bfa Removed math.h include, as Windows math.h has a compile error.
llvm-svn: 84160
2009-10-15 00:39:58 +00:00
Nick Lewycky fcb27ad54c Take advantage of TargetData when available; we know that the atomic intrinsics
only dereference the element they point to directly with no pointer arithmetic.

llvm-svn: 84159
2009-10-15 00:36:35 +00:00
Dan Gohman c9af381df8 Make CodePlacementOpt align loops, rather than loop headers. The
header is just the entry block to the loop, and it needn't be at
the top of the loop in the code layout.

Remove the code that suppressed loop alignment for outer loops,
so that outer loops are aligned.

llvm-svn: 84158
2009-10-15 00:36:22 +00:00
Ted Kremenek 8070b82d91 Remove stale comment.
llvm-svn: 84157
2009-10-14 23:58:34 +00:00
Douglas Gregor ba8e1ac3a1 CheckTemplateSpecializationScope isn't going to be used for explicit
instantiations, since the requirements are too different from those
for template specializations. Simplify it slightly.

llvm-svn: 84156
2009-10-14 23:50:59 +00:00
Douglas Gregor e47f5a76cc Additional semantic checking for explicit template instantiations,
focusing on the scope- and qualifier-related semantic requirements in
C++ [temp.explicit]p2.

llvm-svn: 84154
2009-10-14 23:41:34 +00:00
Evan Cheng 2f61e0946a When LiveVariables is adding implicit-def to model "partial dead", add the earlyclobber marker if the superreg def has it.
llvm-svn: 84153
2009-10-14 23:39:27 +00:00
Evan Cheng 70b1fa5a24 Print earlyclobber for implicit-defs as well.
llvm-svn: 84152
2009-10-14 23:37:31 +00:00
Eric Christopher ef40bd1533 One more iteration here and a yet better way to solve it.
llvm-svn: 84150
2009-10-14 22:14:18 +00:00
Douglas Gregor e266cc218a Our C++ support is far enough along now that we shouldn't be recommending the use of Elsa
llvm-svn: 84149
2009-10-14 21:54:48 +00:00
Douglas Gregor 5d85197edf Reuse some code for checking the scope of an explicit instantiation
llvm-svn: 84148
2009-10-14 21:46:58 +00:00
Eric Christopher 4abb36b946 Fix the unused argument problem here a different way - cast to void.
llvm-svn: 84147
2009-10-14 21:45:49 +00:00
Bob Wilson cfcf6bc70d Fix instruction encoding bits for NEON VPADAL.
Patch by Johnny Chen.

llvm-svn: 84146
2009-10-14 21:43:17 +00:00
Bob Wilson ad03cf02f6 Remove unused variables to fix build warning.
llvm-svn: 84144
2009-10-14 21:40:45 +00:00
Douglas Gregor 819c3ddda8 Fix a thinko that John pointed out
llvm-svn: 84142
2009-10-14 21:36:34 +00:00
Douglas Gregor b81005dffc Check the implicit instantiation of a static data member of a class
template that has no out-of-line definition.

llvm-svn: 84141
2009-10-14 21:33:19 +00:00
Douglas Gregor 3cc3cdeea9 Give explicit and implicit instantiations of static data members of
class templates the proper linkage. 

Daniel, please look over the CodeGenModule bits.

llvm-svn: 84140
2009-10-14 21:29:40 +00:00
Jim Grosbach b1d6fde13e Make loop not recalc getNumOperands() each time around
llvm-svn: 84138
2009-10-14 21:22:39 +00:00
Devang Patel 6875c5ebe4 Add support to record DbgScope as inlined scope.
llvm-svn: 84134
2009-10-14 21:08:09 +00:00
Jim Grosbach 02f5588f62 quiet compiler warning
llvm-svn: 84133
2009-10-14 21:07:11 +00:00
Dan Gohman 1396b3f368 Delete bogus semicolons.
llvm-svn: 84132
2009-10-14 20:39:01 +00:00
Jim Grosbach 94068707e1 Inst{11-8} for vshl should be 0b0101, not 0b1111.
Refs: A7-17 & A8-750.

Patch by Johnny Chen.

llvm-svn: 84131
2009-10-14 20:31:01 +00:00
Eric Christopher b980933c37 Remove a bunch of unused arguments from functions, silencing a
warning.

llvm-svn: 84130
2009-10-14 20:28:33 +00:00
Douglas Gregor 3c74d41d27 Testing and some minor fixes for explicit template instantiation.
llvm-svn: 84129
2009-10-14 20:14:33 +00:00
Nick Lewycky a39f121155 The ARM and PowerPC jits are broken in this regard.
llvm-svn: 84128
2009-10-14 20:04:41 +00:00
Duncan Sands 6f2ffcef20 There seems to be no reason for opt's -S option to be hidden.
Make it visible.

llvm-svn: 84127
2009-10-14 20:01:39 +00:00
Nick Lewycky f01ba005a7 Make use of the result of the loads even though that means adding -instcombine.
llvm-svn: 84125
2009-10-14 19:02:13 +00:00
Bob Wilson 1a791eedbf Set instruction encoding bits 4 and 7 for ARM register-register and
register-shifted-register instructions.  Patch by Johnny Chen.

llvm-svn: 84124
2009-10-14 19:00:24 +00:00
Mike Stump 84bc8bda49 Testcase for recent checkin. WIP.
llvm-svn: 84123
2009-10-14 18:38:01 +00:00
Bob Wilson c350cdf3b3 Refactor code to select NEON VST intrinsics.
llvm-svn: 84122
2009-10-14 18:32:29 +00:00
Mike Stump b21c4eede4 Shift the vcall slots for non-virtual bases of a virtual base, up into
the virtual base so they can be reused properly.  Don't reuse vcall
slots across a virtual boundary.  WIP.  I have a testcase, but there
are still things that need to be fixed before the testcase can go in.

llvm-svn: 84120
2009-10-14 18:14:51 +00:00
Douglas Gregor 568a071dd2 When mapping from an injected-class-name to its corresponding
template, make sure to get the template that corresponds to *this*
declaration of the class template or specialization, rather than the
canonical specialization. Fixes PR5187.

llvm-svn: 84119
2009-10-14 17:30:58 +00:00
Devang Patel 92f8619923 Use isVoidTy()
llvm-svn: 84118
2009-10-14 17:29:00 +00:00
Bob Wilson 12b4799787 Refactor code to select NEON VLD intrinsics.
llvm-svn: 84117
2009-10-14 17:28:52 +00:00
Rafael Espindola 0a1ac331a3 Add support for having different c++ search dirs with -m32 and -m64. So far
this is only used in darwin10, 64 bit ubuntu 9.10 and 64 bit openSUSE 11.1.

llvm-svn: 84115
2009-10-14 17:09:44 +00:00
Devang Patel f33cfaf760 Copy metadata associated with CI
llvm-svn: 84114
2009-10-14 17:03:29 +00:00
Devang Patel ebaa76ed0d Add copyMD to copy metadata from one instruction to another instruction.
llvm-svn: 84113
2009-10-14 17:02:49 +00:00
Douglas Gregor 4aa2dc41dc Implement support for overloaded operator uses that result to a call
to a member operator template. We missed updating this call site when
adding support for function templates; bug exposed by a test for
PR5072.

llvm-svn: 84111
2009-10-14 16:50:13 +00:00
Bob Wilson 93117bc499 More refactoring. NEON vst lane intrinsics can share almost all the code for
vld lane intrinsics.

llvm-svn: 84110
2009-10-14 16:46:45 +00:00
Bob Wilson 4145e3ac8d Refactor code for selecting NEON load lane intrinsics.
llvm-svn: 84109
2009-10-14 16:19:03 +00:00
Duncan Sands cef56992b0 There is now only one version of eh.selector and eh.typeid.for.
Fix the clang build.

llvm-svn: 84107
2009-10-14 16:13:30 +00:00
Duncan Sands 8e6ccb65df I don't see any point in having both eh.selector.i32 and eh.selector.i64,
so get rid of eh.selector.i64 and rename eh.selector.i32 to eh.selector.
Likewise for eh.typeid.for.  This aligns us with gcc, which always uses a
32 bit value for the selector on all platforms.  My understanding is that
the register allocator used to assert if the selector intrinsic size didn't
match the pointer size, and this was the reason for introducing the two
variants.  However my testing shows that this is no longer the case (I
fixed some bugs in selector lowering yesterday, and some more today in the
fastisel path; these might have caused the original problems).

llvm-svn: 84106
2009-10-14 16:11:37 +00:00
Sebastian Redl a44822fdb6 Have the exception specification checkers take partial diagnostics. Use this to merge two diagnostics.
llvm-svn: 84105
2009-10-14 16:09:29 +00:00
Chris Lattner 6b9044db01 make instcombine's instruction sinking more aggressive in the
presence of PHI nodes.

llvm-svn: 84103
2009-10-14 15:21:58 +00:00
Sanjiv Gupta 84a0287497 Few targets like PIC16 mangle the names of global variables, so retrieve the name
from Var itself rather than the decl for DebugInfo metadata.

llvm-svn: 84102
2009-10-14 15:08:34 +00:00
Sebastian Redl 184edcadbd Use CanQualType in the exception specification verification type sets.
llvm-svn: 84101
2009-10-14 15:06:25 +00:00
Chris Lattner a3d4f16b12 Teach Lexer::MeasureTokenLength to be able to measure the
length of comment tokens.  Patch by Abramo Bagnara!

llvm-svn: 84100
2009-10-14 15:04:18 +00:00