llvm-6502/lib
Chandler Carruth f84407be32 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220156 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-19 00:42:16 +00:00
..
Analysis Switch how the datalayout availability test is handled in this code to 2014-10-19 00:42:16 +00:00
AsmParser Make CallingConv::ID an alias of "unsigned". 2014-09-10 18:00:17 +00:00
Bitcode correct const-ness with auto and dyn_cast 2014-10-15 17:45:13 +00:00
CodeGen [PBQP] Replace the interference-constraints algorithm with a faster version 2014-10-18 17:26:07 +00:00
DebugInfo Add couple of missing 'override' keyword. NFC. 2014-10-10 17:34:30 +00:00
ExecutionEngine [MCJIT] Replace memcpy with readBytesUnaligned in RuntimeDyldMachOI386. 2014-10-10 23:07:09 +00:00
IR [Stackmaps] Enable invoking the patchpoint intrinsic. 2014-10-17 17:39:00 +00:00
IRReader Pass a && to getLazyBitcodeModule. 2014-09-03 17:31:46 +00:00
LineEditor
Linker Merge alignment of common GlobalValue. 2014-09-09 17:48:18 +00:00
LTO LTO: Document the Boolean argument from r218784 2014-10-02 21:11:04 +00:00
MC Add back commits r219835 and a fixed version of r219829. 2014-10-17 01:48:58 +00:00
Object [llvm-objdump] Fix mach-o binding decompression error 2014-10-18 01:21:02 +00:00
Option Add an overload of getLastArgNoClaim taking two OptSpecifiers. 2014-09-12 19:42:53 +00:00
ProfileData Reduce double set lookups. NFC. 2014-10-10 15:32:50 +00:00
Support Introduce LLVMParseCommandLineOptions C API function. 2014-10-16 22:47:52 +00:00
TableGen Eliminate some deep std::vector copies. NFC. 2014-10-03 18:33:16 +00:00
Target Use triple predicate functions instead of checking values directly. NFC. 2014-10-19 00:39:30 +00:00
Transforms Preserve AA metadata when combining (cast (load (...))) -> (load (cast 2014-10-18 11:00:12 +00:00
CMakeLists.txt
LLVMBuild.txt
Makefile