[llvm] r253474 - [llvm-profdata] Use SmallSet rather that std::set for keeping track of profdata merge errors
Nathan Slingerland via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 18 09:10:25 PST 2015
Author: slingn
Date: Wed Nov 18 11:10:24 2015
New Revision: 253474
URL: http://llvm.org/viewvc/llvm-project?rev=253474&view=rev
Log:
[llvm-profdata] Use SmallSet rather that std::set for keeping track of profdata merge errors
Missed bit of feedback from D14720.
Use SmallSet<std::error_code> rather than std::set<...> in order to be more efficient.
Modified:
llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp
Modified: llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp?rev=253474&r1=253473&r2=253474&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp (original)
+++ llvm/trunk/tools/llvm-profdata/llvm-profdata.cpp Wed Nov 18 11:10:24 2015
@@ -11,6 +11,7 @@
//
//===----------------------------------------------------------------------===//
+#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/ProfileData/InstrProfReader.h"
@@ -27,8 +28,6 @@
#include "llvm/Support/Signals.h"
#include "llvm/Support/raw_ostream.h"
-#include <set>
-
using namespace llvm;
static void exitWithError(const Twine &Message,
@@ -103,7 +102,7 @@ static void mergeInstrProfile(const cl::
exitWithErrorCode(EC, OutputFilename);
InstrProfWriter Writer;
- std::set<std::error_code> WriterErrorCodes;
+ SmallSet<std::error_code, 4> WriterErrorCodes;
for (const auto &Filename : Inputs) {
auto ReaderOrErr = InstrProfReader::create(Filename);
if (std::error_code ec = ReaderOrErr.getError())
More information about the llvm-commits
mailing list