]> granicus.if.org Git - llvm/commitdiff
[Attributor][Fix] Add const qualifier
authorJohannes Doerfert <jdoerfert@anl.gov>
Tue, 6 Aug 2019 00:46:02 +0000 (00:46 +0000)
committerJohannes Doerfert <jdoerfert@anl.gov>
Tue, 6 Aug 2019 00:46:02 +0000 (00:46 +0000)
I forgot to add this as part of the last commit.

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

include/llvm/Transforms/IPO/Attributor.h

index 1b6b711d2b92549fbb324249f4abecb2fd06a26e..52c9507a8bbdbd3fb0cf24d96a4a7fb75864c97c 100644 (file)
@@ -333,7 +333,7 @@ struct InformationCache {
 
   /// Return the map that relates "interesting" opcodes with all instructions
   /// with that opcode in \p F.
-  OpcodeInstMapTy &getOpcodeInstMapForFunction(Function &F) {
+  OpcodeInstMapTy &getOpcodeInstMapForFunction(const Function &F) {
     return FuncInstOpcodeMap[&F];
   }
 
@@ -341,16 +341,16 @@ struct InformationCache {
   using InstructionVectorTy = std::vector<Instruction *>;
 
   /// Return the instructions in \p F that may read or write memory.
-  InstructionVectorTy &getReadOrWriteInstsForFunction(Function &F) {
+  InstructionVectorTy &getReadOrWriteInstsForFunction(const Function &F) {
     return FuncRWInstsMap[&F];
   }
 
 private:
   /// A map type from functions to opcode to instruction maps.
-  using FuncInstOpcodeMapTy = DenseMap<Function *, OpcodeInstMapTy>;
+  using FuncInstOpcodeMapTy = DenseMap<const Function *, OpcodeInstMapTy>;
 
   /// A map type from functions to their read or write instructions.
-  using FuncRWInstsMapTy = DenseMap<Function *, InstructionVectorTy>;
+  using FuncRWInstsMapTy = DenseMap<const Function *, InstructionVectorTy>;
 
   /// A nested map that remembers all instructions in a function with a certain
   /// instruction opcode (Instruction::getOpcode()).