OSDN Git Service

[llvm-exegesis][NFC] Fix a few warnings.
authorClement Courbet <courbet@google.com>
Wed, 4 Apr 2018 12:01:38 +0000 (12:01 +0000)
committerClement Courbet <courbet@google.com>
Wed, 4 Apr 2018 12:01:38 +0000 (12:01 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@329174 91177308-0d34-0410-b5e6-96231b3b80d8

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

index b28b81c..770b928 100644 (file)
@@ -89,7 +89,7 @@ LatencyBenchmarkRunner::runMeasurements(const LLVMState &State,
     if (Value < MinLatency)
       MinLatency = Value;
   }
-  return {{"latency", static_cast<double>(MinLatency) / NumRepetitions}};
+  return {{"latency", static_cast<double>(MinLatency) / NumRepetitions, ""}};
 }
 
 } // namespace exegesis
index 22da206..8c3f13e 100644 (file)
@@ -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.
index 577b956..5b3277d 100644 (file)
@@ -31,7 +31,7 @@ TEST(BenchmarkResultTest, WriteToAndReadFromDisk) {
   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");