[llvm] r253953 - Add findFunctionInfoList() accessor to FunctionInfoIndex.

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 22:07:42 PST 2015


Author: mehdi_amini
Date: Tue Nov 24 00:07:42 2015
New Revision: 253953

URL: http://llvm.org/viewvc/llvm-project?rev=253953&view=rev
Log:
Add findFunctionInfoList() accessor to FunctionInfoIndex.

Summary:
This allows to query for a function in the map without creating an
entry, allowing to use a const FunctionInfoIndex.

Reviewers: tejohnson

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D14912

From: Mehdi Amini <mehdi.amini at apple.com>

Modified:
    llvm/trunk/include/llvm/IR/FunctionInfo.h

Modified: llvm/trunk/include/llvm/IR/FunctionInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/FunctionInfo.h?rev=253953&r1=253952&r2=253953&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/FunctionInfo.h (original)
+++ llvm/trunk/include/llvm/IR/FunctionInfo.h Tue Nov 24 00:07:42 2015
@@ -194,6 +194,11 @@ public:
     return FunctionMap[FuncName];
   }
 
+  /// Get the list of function info objects for a given function.
+  const const_funcinfo_iterator findFunctionInfoList(StringRef FuncName) const {
+    return FunctionMap.find(FuncName);
+  }
+
   /// Add a function info for a function of the given name.
   void addFunctionInfo(StringRef FuncName, std::unique_ptr<FunctionInfo> Info) {
     // Update the HasExportedFunctions flag, but only if we had a function




More information about the llvm-commits mailing list