1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Don't commit addresses of aggregate values. This avoids problems with

an aggregate store overlapping a different aggregate store, despite
the stores having distinct addresses.

llvm-svn: 81164
This commit is contained in:
Dan Gohman 2009-09-07 22:42:05 +00:00
parent f1dd8d2a5b
commit b8c9d1974c

View File

@ -2024,6 +2024,11 @@ static Constant *getVal(DenseMap<Value*, Constant*> &ComputedValues,
/// we punt. We basically just support direct accesses to globals and GEP's of
/// globals. This should be kept up to date with CommitValueTo.
static bool isSimpleEnoughPointerToCommit(Constant *C, LLVMContext &Context) {
// Conservatively, avoid aggregate types. This is because we don't
// want to worry about them partially overlapping other stores.
if (!cast<PointerType>(C->getType())->getElementType()->isSingleValueType())
return false;
if (GlobalVariable *GV = dyn_cast<GlobalVariable>(C))
// Do not allow weak/linkonce/dllimport/dllexport linkage or
// external globals.