- Jun 20, 2011
-
-
Douglas Gregor authored
llvm-svn: 133438
-
Douglas Gregor authored
llvm-svn: 133437
-
Jay Foad authored
Change PHINodes to store simple pointers to their incoming basic blocks, instead of full-blown Uses. Note that this loses an optimization in SplitCriticalEdge(), because we can no longer walk the use list of a BasicBlock to find phi nodes. See the comment I removed starting "However, the foreach loop is slow for blocks with lots of predecessors". Extend replaceAllUsesWith() on a BasicBlock to also update any phi nodes in the block's successors. This mimics what would have happened when PHINodes were proper Users of their incoming blocks. (Note that this only works if OldBB->replaceAllUsesWith(NewBB) is called when OldBB still has a terminator instruction, so it still has some successors.) llvm-svn: 133435
-
Chandler Carruth authored
pointers I found while working on the NULL arithmetic warning. We here always assuming the LHS was the pointer, instead of using the selected pointer expression. llvm-svn: 133428
-
Chandler Carruth authored
effectively that this abstraction simply doesn't exist. That is highlighted by the fact that by using it we were papering over a more serious error in this warning: the fact that we warned for *invalid* constructs involving member pointers and block pointers. I've fixed the obvious issues with the warning here, but this is confirming an original suspicion that this warning's implementation is flawed. I'm looking into how we can implement this more reasonably. WIP on that front. llvm-svn: 133425
-
Francois Pichet authored
llvm-svn: 133418
-
Chris Lattner authored
ConvertType on InitListExprs as they are being converted. This is needed for a forthcoming patch, and improves the IR generated anyway (see additional type names in testcases). This patch also converts a bunch of std::vector's in CGObjCMac to use C arrays. There are a ton more that should be converted as well. llvm-svn: 133413
-
Jordy Rose authored
llvm-svn: 133410
-
Jordy Rose authored
[analyzer] Re-enable checking for strncpy, along with a new validation of the size argument. strncat is not yet up-to-date, but I'm leaving it enabled for now (there shouldn't be any false positives, at least...) llvm-svn: 133408
-
Jordy Rose authored
[analyzer] Eliminate "byte string function" from CStringChecker's diagnostics, and make it easier to provide custom messages for overflow checking, in preparation for re-enabling strncpy checking. llvm-svn: 133406
-
Chandler Carruth authored
This makes 'isPointerLikeType' a little less confusing, and pulls the decay check into a separate interface that is much more clear and concrete. Also, just implement these as logical wrappers around other predicates. Having a switch based implementation isn't likely to be necessary. We can try to optimize them later if they show up on a profile. llvm-svn: 133405
-
- Jun 19, 2011
-
-
Chandler Carruth authored
Trieu, and fix them by checking for array and function types as well as pointer types. I've added a predicate method on Type to bundle together the logic we're using here: isPointerLikeType(). I'd welcome better names for this predicate, this is the best I came up with. It's implemented as a switch to be a touch lighter weight than all the chained isa<...> casts that would result otherwise. llvm-svn: 133383
-
Francois Pichet authored
Fixes PR10154. Found by parsing MFC 2010 code with clang. llvm-svn: 133380
-
Chris Lattner authored
llvm-svn: 133365
-
- Jun 18, 2011
-
-
Benjamin Kramer authored
llvm-svn: 133346
-
Benjamin Kramer authored
llvm-svn: 133345
-
Chandler Carruth authored
deducing template parameter types. Recently Clang began enforcing the more strict checking that the argument type and the deduced function parameter type (after substitution) match, but that only consideres qualification conversions. One problem with this patch is that we check noreturn conversions and qualification conversions independently. If a valid conversion would require *both*, perhaps interleaved with each other, it will be rejected. If this actually occurs (I'm not yet sure it does) and is in fact a problem (I'm not yet sure it is), there is a FIXME to implement more intelligent conversion checking. However, this step at least allows Clang to resume accepting valid code we're seeing in the wild. llvm-svn: 133327
-
Argyrios Kyrtzidis authored
[arcmt] Fix the ARC migrator. -arcmt-modify requires running before the initialization of SourceManager because it is going to modify the input file. llvm-svn: 133323
-
Argyrios Kyrtzidis authored
llvm-svn: 133322
-
Argyrios Kyrtzidis authored
llvm-svn: 133315
-
-
Douglas Gregor authored
silently dropped ownership qualifiers that were being applied to ownership-qualified, substituted type that was *not* a substituted template type parameter. We now provide a diagnostic in such cases, and recover by dropping the added qualifiers. Document this behavior in the ARC specification. llvm-svn: 133309
-
Douglas Gregor authored
qualifiers, so that an __unsafe_unretained-qualified type T in ARC code will have the same mangling as T in non-ARC code, improving ABI interoperability. This works now because we infer or require a lifetime qualifier everywhere one can appear in an external interface. Another part of <rdar://problem/9595486>. llvm-svn: 133306
-
Douglas Gregor authored
ownership-unqualified retainable object type as __strong. This allows us to write, e.g., std::vector<id> and we'll infer that the vector's element types have __strong ownership semantics, which is far nicer than requiring: std::vector<__strong id> Note that we allow one to override the ownership qualifier of a substituted template type parameter, e.g., given template<typename T> struct X { typedef __weak T type; }; X<id> is treated the same as X<__strong id>. At instantiation type, the __weak in "__weak T" overrides the (inferred or specified) __strong on the template argument type, so that we can still provide metaprogramming transformations. This is part of <rdar://problem/9595486>. llvm-svn: 133303
-
- Jun 17, 2011
-
-
John McCall authored
llvm-svn: 133300
-
John McCall authored
__bridge_retain as a synonym for __bridge_retained. llvm-svn: 133295
-
Eli Friedman authored
Add a minor hack to avoid using isNullPointerConstant on a hot path. Fixes -O0 compile-time regressions from r133196. rdar://9629775 . llvm-svn: 133290
-
-
Douglas Gregor authored
separate aggregate temporary and then memcpy it over to the destination. This fixes a regression I introduced with r133235, where the compound literal on the RHS of an assignment makes use of the structure on the LHS of the assignment. I'm deeply suspicious of AggExprEmitter::VisitBinAssign()'s optimization where it emits the RHS of an aggregate assignment directly into the LHS lvalue without checking whether there is any aliasing between the LHS/RHS. However, I'm not in a position to revisit this now. Big thanks to Eli for finding the regression! llvm-svn: 133261
-
Douglas Gregor authored
llvm-svn: 133257
-
John McCall authored
static initializer check, as required by the Itanium ABI. llvm-svn: 133250
-
John McCall authored
llvm-svn: 133246
-
John McCall authored
they should still be officially __strong for the purposes of errors, block capture, etc. Make a new bit on variables, isARCPseudoStrong(), and set this for 'self' and these enumeration-loop variables. Change the code that was looking for the old patterns to look for this bit, and change IR generation to find this bit and treat the resulting variable as __unsafe_unretained for the purposes of init/destroy in the two places it can come up. llvm-svn: 133243
-
Douglas Gregor authored
[temp.deduct.call]p4 to the deduction performed for 'auto', finishing the fix for PR9233. llvm-svn: 133239
-
Douglas Gregor authored
argument type for C++ [temp.deduct.call]p4 out of Sema::FinishTemplateArgumentDeduction(). No functionality change. llvm-svn: 133237
-
Douglas Gregor authored
storage specifier is different from the storage specifier on the template. If that storage specifier is the same, then we only warn. Thanks to John for the prodding. llvm-svn: 133236
-
Douglas Gregor authored
C++, which means: - binding the temporary as needed in Sema, so that we generate the appropriate call to the destructor, and - emitting the compound literal into the appropriate location for the aggregate, rather than trying to emit it as a temporary and memcpy() it. Fixes PR10138 / <rdar://problem/9615901>. llvm-svn: 133235
-
Douglas Gregor authored
specifier on an explicit specialization to a warning, since neither EDG nor GCC diagnose this code as ill-formed. llvm-svn: 133232
-
Eric Christopher authored
register constraint. Note that we're not checking if the register itself is valid for the constraint. Fixes rdar://9382985 llvm-svn: 133226
-
Eric Christopher authored
Part of rdar://9197685 llvm-svn: 133225
-