Use a ValueMap not a std::map for the reason indicated
authorDale Johannesen <dalej@apple.com>
Fri, 16 Apr 2010 18:16:08 +0000 (18:16 +0000)
committerDale Johannesen <dalej@apple.com>
Fri, 16 Apr 2010 18:16:08 +0000 (18:16 +0000)
in the comment.  This was causing nondeterministic changes
in inlining decisions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101503 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/InlineCost.h

index 066b94396890972e7d8408872164cde053d2e788..600892db7ebab8b7a373384156296ac3fb80c807 100644 (file)
@@ -19,6 +19,7 @@
 #include <map>
 #include <vector>
 #include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/ValueMap.h"
 
 namespace llvm {
 
@@ -165,7 +166,9 @@ namespace llvm {
       void analyzeFunction(Function *F);
     };
 
-    std::map<const Function *, FunctionInfo> CachedFunctionInfo;
+    // The Function* for a function can be changed (by ArgumentPromotion);
+    // the ValueMap will update itself when this happens.
+    ValueMap<const Function *, FunctionInfo> CachedFunctionInfo;
 
   public: