[llvm] r370284 - [Attributor][NFC] Add const to map key

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 18:28:30 PDT 2019


Author: jdoerfert
Date: Wed Aug 28 18:28:30 2019
New Revision: 370284

URL: http://llvm.org/viewvc/llvm-project?rev=370284&view=rev
Log:
[Attributor][NFC] Add const to map key

Modified:
    llvm/trunk/include/llvm/Transforms/IPO/Attributor.h

Modified: llvm/trunk/include/llvm/Transforms/IPO/Attributor.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/IPO/Attributor.h?rev=370284&r1=370283&r2=370284&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/IPO/Attributor.h (original)
+++ llvm/trunk/include/llvm/Transforms/IPO/Attributor.h Wed Aug 28 18:28:30 2019
@@ -643,8 +643,7 @@ struct Attributor {
   /// `getAAFor` to explicitly record true dependences through this method.
   void recordDependence(const AbstractAttribute &FromAA,
                         const AbstractAttribute &ToAA) {
-    QueryMap[const_cast<AbstractAttribute *>(&FromAA)].insert(
-        const_cast<AbstractAttribute *>(&ToAA));
+    QueryMap[&FromAA].insert(const_cast<AbstractAttribute *>(&ToAA));
   }
 
   /// Introduce a new abstract attribute into the fixpoint analysis.
@@ -776,7 +775,7 @@ private:
   /// to the getAAFor<...>(...) method.
   ///{
   using QueryMapTy =
-      MapVector<AbstractAttribute *, SetVector<AbstractAttribute *>>;
+      MapVector<const AbstractAttribute *, SetVector<AbstractAttribute *>>;
   QueryMapTy QueryMap;
   ///}
 




More information about the llvm-commits mailing list