Go to file
Chandler Carruth 8a99373812 Switch how the datalayout availability test is handled in this code to
make much more sense and in theory be more correct.

If you trace the code alllll the way back to when it was first
introduced, the comments make it slightly more clear what was going on
here. At that time, the only way Base != V was if DL (then TD) was
non-null. As a consequence, if DL *was* null, that meant we were loading
directly from the alloca or global found above the test. After
refactoring, this has become at least terribly subtle and potentially
incorrect. There are many forms of pointer manipulation that can be
traversed without DataLayout, and some of them would in fact change the
size of object being loaded vs. allocated.

Rather than this subtlety, I've hoisted the actual 'return true' bits
into the code which actually found an alloca or global and based them on
the loaded pointer being that alloca or global. This is both more clear
and safer. I've also added comments about exactly why this set of
predicates is used.

I've also corrected a misleading comment about globals -- if overridden
they may not just have a different size, they may be null and completely
unsafe to load from!

Hopefully this confuses the next reader a bit less. I don't have any
test cases or anything, the patch is motivated strictly to improve the
readability of the code.

llvm-svn: 220156
2014-10-19 00:42:16 +00:00
clang CodeGen: ConstStructBuilder must verify packed constraints after padding 2014-10-19 00:03:10 +00:00
clang-tools-extra [clang-tidy] Minor fixes for the NamespaceCommentCheck. 2014-10-16 15:11:54 +00:00
compiler-rt [asan] the run-time part of intra-object-overflow detector (-fsanitize-address-field-padding=1). Note that all of this is still experimental; don't use unless you are brave. 2014-10-17 01:22:37 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc r600: Use llvm intrinsic to read work dimension information 2014-10-15 15:08:06 +00:00
libcxx Fix unused variables in tests to placate scan-build. Patch from Steve MacKenzie. 2014-10-19 00:10:15 +00:00
libcxxabi Add an .arcconfig for libc++abi. 2014-10-17 16:48:56 +00:00
lld Fix display of files processed by the linker. 2014-10-18 20:36:35 +00:00
lldb Fixed python API event test cases. 2014-10-17 23:58:27 +00:00
llvm Switch how the datalayout availability test is handled in this code to 2014-10-19 00:42:16 +00:00
openmp I apologise in advance for the size of this check-in. At Intel we do 2014-10-07 16:25:50 +00:00
polly [Refactor][NfC] ReportLevel should be used as a bool not an int 2014-10-15 23:24:28 +00:00