[compiler-rt] a2ce97c - [memprof] Fix unit test build after refactoring shared header.

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 30 11:38:09 PST 2021


Author: Snehasish Kumar
Date: 2021-11-30T11:35:42-08:00
New Revision: a2ce97cc3f99c8af80b2325acf03a4c171ffb48f

URL: https://github.com/llvm/llvm-project/commit/a2ce97cc3f99c8af80b2325acf03a4c171ffb48f
DIFF: https://github.com/llvm/llvm-project/commit/a2ce97cc3f99c8af80b2325acf03a4c171ffb48f.diff

LOG: [memprof] Fix unit test build after refactoring shared header.

The memprof unittest also needs to include the MemProfData.inc header
directly to have access to MEMPROF_RAW_MAGIC and MEMPROF_RAW_VERSION
globals.

Added: 
    

Modified: 
    compiler-rt/lib/memprof/tests/CMakeLists.txt
    compiler-rt/lib/memprof/tests/rawprofile.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/memprof/tests/CMakeLists.txt b/compiler-rt/lib/memprof/tests/CMakeLists.txt
index 1dfd78399e5c6..ab6c716bba742 100644
--- a/compiler-rt/lib/memprof/tests/CMakeLists.txt
+++ b/compiler-rt/lib/memprof/tests/CMakeLists.txt
@@ -23,6 +23,8 @@ set(MEMPROF_UNITTESTS
   rawprofile.cpp
   driver.cpp)
 
+include_directories(../../../include)
+
 set(MEMPROF_UNIT_TEST_HEADERS
   ${MEMPROF_HEADERS})
 

diff  --git a/compiler-rt/lib/memprof/tests/rawprofile.cpp b/compiler-rt/lib/memprof/tests/rawprofile.cpp
index 4404ab86092ea..29bc3b5f5ba80 100644
--- a/compiler-rt/lib/memprof/tests/rawprofile.cpp
+++ b/compiler-rt/lib/memprof/tests/rawprofile.cpp
@@ -1,6 +1,10 @@
 #include "memprof/memprof_rawprofile.h"
 
+#include <cstdint>
+#include <memory>
+
 #include "memprof/memprof_meminfoblock.h"
+#include "profile/MemProfData.inc"
 #include "sanitizer_common/sanitizer_common.h"
 #include "sanitizer_common/sanitizer_procmaps.h"
 #include "sanitizer_common/sanitizer_stackdepot.h"
@@ -8,8 +12,6 @@
 #include "gmock/gmock.h"
 #include "gtest/gtest.h"
 
-#include <memory>
-
 namespace {
 
 using ::__memprof::MemInfoBlock;


        


More information about the llvm-commits mailing list