1. Sep 02, 2012
    • Jordan Rose's avatar
      [analyzer] Disallow creation of int vals with explicit bit width / signedness. · 21580c2f
      Jordan Rose authored
      All clients of BasicValueFactory should be using QualTypes instead, and
      indeed it seems they are. This caught the (fortunately harmless) bug
      fixed in the previous commit.
      
      No intended functionality change.
      
      llvm-svn: 163069
      21580c2f
    • Jordan Rose's avatar
      [analyzer] Don't attempt to create a floating-point value of "1" for ++/--. · a44ad1b3
      Jordan Rose authored
      The current logic would actually create a float- or double-sized signed
      integer value of 1, which is not at all the same.
      
      No test because the value would be swallowed by an Unknown as soon as it
      gets added or subtracted to the original value, but it enables the cleanup
      in the next patch.
      
      llvm-svn: 163068
      a44ad1b3
    • Jordan Rose's avatar
      [analyzer] Future-proofing r163012 (nameless functions and RetainCountChecker) · ccf192e4
      Jordan Rose authored
      Any future exceptions need to go INSIDE the test that checks if the
      IdentifierInfo is non-null!
      
      No functionality change. Thanks for the review, Ted.
      
      llvm-svn: 163067
      ccf192e4
    • Jordan Rose's avatar
      [analyzer] Treat all struct values as regions (even rvalues). · 82ae9898
      Jordan Rose authored
      This allows us to correctly symbolicate the fields of structs returned by
      value, as well as get the proper 'this' value for when methods are called
      on structs returned by value.
      
      This does require a moderately ugly hack in the StoreManager: if we assign
      a "struct value" to a struct region, that now appears as a Loc value being
      bound to a region of struct type. We handle this by simply "dereferencing"
      the struct value region, which should create a LazyCompoundVal.
      
      This should fix recent crashes analyzing LLVM and on our internal buildbot.
      
      <rdar://problem/12137950>
      
      llvm-svn: 163066
      82ae9898
    • Jordan Rose's avatar
      [analyzer] Always derive a CallEvent's return type from its origin expr. · 2da56438
      Jordan Rose authored
      Previously, we preferred to get a result type by looking at the callee's
      declared result type. This allowed us to handlereferences, which are
      represented in the AST as lvalues of their pointee type. (That is, a call
      to a function returning 'int &' has type 'int' and value kind 'lvalue'.)
      
      However, this results in us preferring the original type of a function
      over a casted type. This is a problem when a function  pointer is casted
      to another type, because the conjured result value will have the wrong
      type. AdjustedReturnValueChecker is supposed to handle this, but still
      doesn't handle the case where there is no "original function" at all,
      i.e. where the callee is unknown.
      
      Now, we instead look at the call expression's value kind (lvalue, xvalue,
      or prvalue), and adjust the expr's type accordingly. This will have no
      effect when the function is inlined, and will conjure the value that will
      actually be used when it is not.
      
      This makes AdjustedReturnValueChecker /nearly/ unnecessary; unfortunately,
      the cases where it would still be useful are where we need to cast the
      result of an inlined function or a checker-evaluated function, and in these
      cases we don't know what we're casting /from/ by the time we can do post-
      call checks. In light of that, remove AdjustedReturnValueChecker, which
      was already not checking quite a few calls.
      
      llvm-svn: 163065
      2da56438
    • Pete Cooper's avatar
      Revert "Take account of boolean vector contents when promoting a build vector... · 2117ac40
      Pete Cooper authored
      Revert "Take account of boolean vector contents when promoting a build vector from i1 to some other type.  rdar://problem/12210060"
      
      This reverts commit 5dd9e214fb92847e947f9edab170f9b4e52b908f.
      
      Thanks to Duncan for explaining how this should have been done.
      
      Conflicts:
      
      	test/CodeGen/X86/vec_select.ll
      
      llvm-svn: 163064
      2117ac40
  2. Sep 01, 2012