[llvm] r329174 - [llvm-exegesis][NFC] Fix a few warnings.

Clement Courbet via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 4 05:01:38 PDT 2018


Author: courbet
Date: Wed Apr  4 05:01:38 2018
New Revision: 329174

URL: http://llvm.org/viewvc/llvm-project?rev=329174&view=rev
Log:
[llvm-exegesis][NFC] Fix a few warnings.

Modified:
    llvm/trunk/tools/llvm-exegesis/lib/Latency.cpp
    llvm/trunk/tools/llvm-exegesis/lib/PerfHelper.h
    llvm/trunk/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp

Modified: llvm/trunk/tools/llvm-exegesis/lib/Latency.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-exegesis/lib/Latency.cpp?rev=329174&r1=329173&r2=329174&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/Latency.cpp (original)
+++ llvm/trunk/tools/llvm-exegesis/lib/Latency.cpp Wed Apr  4 05:01:38 2018
@@ -89,7 +89,7 @@ LatencyBenchmarkRunner::runMeasurements(
     if (Value < MinLatency)
       MinLatency = Value;
   }
-  return {{"latency", static_cast<double>(MinLatency) / NumRepetitions}};
+  return {{"latency", static_cast<double>(MinLatency) / NumRepetitions, ""}};
 }
 
 } // namespace exegesis

Modified: llvm/trunk/tools/llvm-exegesis/lib/PerfHelper.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-exegesis/lib/PerfHelper.h?rev=329174&r1=329173&r2=329174&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-exegesis/lib/PerfHelper.h (original)
+++ llvm/trunk/tools/llvm-exegesis/lib/PerfHelper.h Wed Apr  4 05:01:38 2018
@@ -17,6 +17,7 @@
 
 #include "llvm/ADT/ArrayRef.h"
 #include "llvm/ADT/StringRef.h"
+#include "llvm/Config/config.h"
 #include <functional>
 #include <memory>
 
@@ -76,7 +77,9 @@ struct Counter {
   int64_t read() const; // Return the current value of the counter.
 
 private:
+#ifdef HAVE_LIBPFM
   int FileDescriptor = -1;
+#endif
 };
 
 // Helper to measure a list of PerfEvent for a particular function.

Modified: llvm/trunk/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp?rev=329174&r1=329173&r2=329174&view=diff
==============================================================================
--- llvm/trunk/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp (original)
+++ llvm/trunk/unittests/tools/llvm-exegesis/BenchmarkResultTest.cpp Wed Apr  4 05:01:38 2018
@@ -31,7 +31,7 @@ TEST(BenchmarkResultTest, WriteToAndRead
   ToDisk.LLVMTriple = "llvm_triple";
   ToDisk.NumRepetitions = 1;
   ToDisk.Measurements.push_back(BenchmarkMeasure{"a", 1, "debug a"});
-  ToDisk.Measurements.push_back(BenchmarkMeasure{"b", 2});
+  ToDisk.Measurements.push_back(BenchmarkMeasure{"b", 2, ""});
   ToDisk.Error = "error";
 
   const llvm::StringRef Filename("data.yaml");




More information about the llvm-commits mailing list