From a9f0dc35d3168c499d4017c123720d33e4ac1632 Mon Sep 17 00:00:00 2001 From: Chandler Carruth Date: Thu, 15 Mar 2012 00:55:51 +0000 Subject: [PATCH] Make the swap code here a bit more obvious what its doing... We're essentially sorting the pair's arguments. I'd love to actually call sort here, but I'm just not that crazy. ;] llvm-svn: 152764 --- lib/Analysis/InlineCost.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp index 37aa729552b..3754e923ceb 100644 --- a/lib/Analysis/InlineCost.cpp +++ b/lib/Analysis/InlineCost.cpp @@ -435,7 +435,7 @@ void InlineCostAnalyzer::FunctionInfo::countCodeReductionForPointerPair( if (ArgIt == PointerArgs.end()) continue; std::pair ArgPair(ArgIt->second, ArgIdx); - if (ArgIt->second > ArgIdx) + if (ArgPair.first > ArgPair.second) std::swap(ArgPair.first, ArgPair.second); PointerArgPairWeights[ArgPair]