Update StackProtector when coloring merges stack slots

StackProtector keeps a ValueMap of alloca instructions to layout kind tags for
use by PEI and other later passes. When stack coloring replaces one alloca with
a bitcast to another one, the key replacement in this map does not work.
Instead, provide an interface to manage this updating directly. This seems like
an improvement over the old behavior, where the layout map would not get
updated at all when the stack slots were merged. In practice, however, there is
likely no observable difference because PEI only did anything special with
'large array' kinds, and if one large array is merged with another, than the
replacement should already have been a large array.

This is an attempt to unbreak the clang-x86_64-darwin11-RA builder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199684 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Hal Finkel
2014-01-20 19:49:14 +00:00
parent 825b93b2df
commit 07b072b24d
3 changed files with 32 additions and 0 deletions

View File

@@ -119,6 +119,7 @@ public:
}
SSPLayoutKind getSSPLayout(const AllocaInst *AI) const;
void adjustForColoring(const AllocaInst *From, const AllocaInst *To);
virtual bool runOnFunction(Function &Fn);
};