summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-09-02 08:14:03 +0000
committerDuncan Sands <baldrick@free.fr>2010-09-02 08:14:03 +0000
commitfc6e29d4ab52b7d3efd83846ed495a9ca7e51e49 (patch)
tree2c7b45b801ac9fe4f25bc94ce67befd03d605726 /include
parent4315093eb76b8806fed72273f0909d68645f12d3 (diff)
downloadllvm-fc6e29d4ab52b7d3efd83846ed495a9ca7e51e49.tar.gz
llvm-fc6e29d4ab52b7d3efd83846ed495a9ca7e51e49.tar.bz2
llvm-fc6e29d4ab52b7d3efd83846ed495a9ca7e51e49.tar.xz
Reapply commit 112699, speculatively reverted by echristo, since
I'm sure it is harmless. Original commit message: If PrototypeValue is erased in the middle of using the SSAUpdator then the SSAUpdator may access freed memory. Instead, simply pass in the type and name explicitly, which is all that was used anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112810 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Transforms/Utils/SSAUpdater.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/include/llvm/Transforms/Utils/SSAUpdater.h b/include/llvm/Transforms/Utils/SSAUpdater.h
index 86ecb73df6..e50a6b15df 100644
--- a/include/llvm/Transforms/Utils/SSAUpdater.h
+++ b/include/llvm/Transforms/Utils/SSAUpdater.h
@@ -36,9 +36,11 @@ private:
//typedef DenseMap<BasicBlock*, Value*> AvailableValsTy;
void *AV;
- /// PrototypeValue is an arbitrary representative value, which we derive names
- /// and a type for PHI nodes.
- Value *PrototypeValue;
+ /// ProtoType holds the type of the values being rewritten.
+ const Type *ProtoType;
+
+ // PHI nodes are given a name based on ProtoName.
+ std::string ProtoName;
/// InsertedPHIs - If this is non-null, the SSAUpdater adds all PHI nodes that
/// it creates to the vector.
@@ -51,8 +53,8 @@ public:
~SSAUpdater();
/// Initialize - Reset this object to get ready for a new set of SSA
- /// updates. ProtoValue is the value used to name PHI nodes.
- void Initialize(Value *ProtoValue);
+ /// updates with type 'Ty'. PHI nodes get a name based on 'Name'.
+ void Initialize(const Type *Ty, StringRef Name);
/// AddAvailableValue - Indicate that a rewritten value is available at the
/// end of the specified block with the specified value.