Go to file
Jordan Rose ba101e1b3b Use the new LLVM_LVALUE_FUNCTION to ban two getAs() calls on rvalues.
If 'x' is a temporary, x.getAs<Foo>() may not be safe if the result is
supposed to persist (if its address is stored somewhere). Since getAs()
can return a null value, the result is almost always stored into a
variable, which of course is not safe when the original value dies.

This has caused several bugs with GCC's "Temporaries May Vanish Sooner Than
You Expect" optimization; in C++11 builds, at least, we'll be able to catch
these problems now.

I would suggest applying these to other getAs() and get*As() methods
(castAs is "better" because sometimes the result is used directly, which
means the temporary will still be live), but these two have both caused
trouble in the analyzer in the past.

llvm-svn: 168967
2012-11-30 01:15:32 +00:00
clang Use the new LLVM_LVALUE_FUNCTION to ban two getAs() calls on rvalues. 2012-11-30 01:15:32 +00:00
clang-tools-extra Following the example from loop-convert tests, simplifying the remove-cstr-calls lit script. 2012-11-05 18:28:45 +00:00
compiler-rt ubsan: Disable __int128 tests if the host Clang does not support it. These 2012-11-29 23:03:58 +00:00
debuginfo-tests XTARGET was removed, update debug-info tests. 2012-10-20 01:38:50 +00:00
libclc Implement any() builtin. Patch by Tom Stellard! 2012-10-08 03:39:21 +00:00
libcxx Remove 'noreturn' attribute from friend declaration. This attribute will be 2012-11-29 04:30:50 +00:00
libcxxabi Remove aborts under __dynamic_cast which were under _LIBCXX_DYNAMIC_FALLBACK. Change all type_info comparisons to use an inlined is_equal helper. However no change in functionality for this latter change at this time. This is just to encapsulate the comparison and make it a little easier to switch back and forth for testing/debugging. 2012-11-15 18:00:42 +00:00
lld Populate entry point into ELF executable. 2012-11-21 21:07:36 +00:00
lldb <rdar://problem/12687087> 2012-11-29 22:16:27 +00:00
llvm Modified dump() to provide a little 2012-11-30 00:44:47 +00:00
polly Remove unneeded preservation and restore of ValueMap and ClastVars in GPGPU code 2012-11-30 01:05:05 +00:00