From: Chandler Carruth Date: Wed, 22 Jul 2015 22:32:34 +0000 (+0000) Subject: [GMR] Continue my quest to remove linked datastructures from GMR, NFC. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=90b20e96a140e168d2aebfbfe08843fa825627da;p=oota-llvm.git [GMR] Continue my quest to remove linked datastructures from GMR, NFC. This replaces the next-to-last std::map with a DenseMap. While DenseMap doesn't yet make tons of sense (there are 32 bytes or so in the value type), my next change will reduce the value type to a single pointer -- we only need a pointer and 3 bits, and that is exactly what we can have. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242956 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/IPA/GlobalsModRef.cpp b/lib/Analysis/IPA/GlobalsModRef.cpp index cfefa0bd438..3e4b00e6e50 100644 --- a/lib/Analysis/IPA/GlobalsModRef.cpp +++ b/lib/Analysis/IPA/GlobalsModRef.cpp @@ -101,7 +101,7 @@ class GlobalsModRef : public ModulePass, public AliasAnalysis { /// FunctionInfo - For each function, keep track of what globals are /// modified or read. - std::map FunctionInfo; + DenseMap FunctionInfo; /// Handle to clear this analysis on deletion of values. struct DeletionCallbackHandle final : CallbackVH { @@ -227,8 +227,7 @@ private: /// getFunctionInfo - Return the function info for the function, or null if /// we don't have anything useful to say about it. FunctionRecord *getFunctionInfo(const Function *F) { - std::map::iterator I = - FunctionInfo.find(F); + auto I = FunctionInfo.find(F); if (I != FunctionInfo.end()) return &I->second; return nullptr;