[llvm] 3d71592 - [gn build] semi-automatically ort 4f06d46f465c (LogicalView input files)

Nico Weber via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 27 05:53:06 PDT 2022


Author: Nico Weber
Date: 2022-10-27T08:52:35-04:00
New Revision: 3d71592c49ea1901908757e63382961e14d07117

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

LOG: [gn build] semi-automatically ort 4f06d46f465c (LogicalView input files)

Added: 
    

Modified: 
    llvm/utils/gn/secondary/llvm/lib/DebugInfo/LogicalView/BUILD.gn
    llvm/utils/gn/secondary/llvm/unittests/DebugInfo/LogicalView/BUILD.gn
    llvm/utils/gn/secondary/llvm/unittests/DebugInfo/PDB/BUILD.gn

Removed: 
    


################################################################################
diff  --git a/llvm/utils/gn/secondary/llvm/lib/DebugInfo/LogicalView/BUILD.gn b/llvm/utils/gn/secondary/llvm/lib/DebugInfo/LogicalView/BUILD.gn
index f19b3660891b7..95853567b8b9f 100644
--- a/llvm/utils/gn/secondary/llvm/lib/DebugInfo/LogicalView/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/lib/DebugInfo/LogicalView/BUILD.gn
@@ -24,5 +24,8 @@ static_library("LogicalView") {
     "Core/LVSupport.cpp",
     "Core/LVSymbol.cpp",
     "Core/LVType.cpp",
+    "LVReaderHandler.cpp",
+    "Readers/LVBinaryReader.cpp",
+    "Readers/LVELFReader.cpp",
   ]
 }

diff  --git a/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/LogicalView/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/LogicalView/BUILD.gn
index c8111a81d211b..579e7c75c9196 100644
--- a/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/LogicalView/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/LogicalView/BUILD.gn
@@ -3,15 +3,36 @@ import("//llvm/utils/unittest/unittest.gni")
 unittest("DebugInfoLogicalViewTests") {
   deps = [
     "//llvm/lib/DebugInfo/LogicalView",
+    "//llvm/lib/MC/MCDisassembler",
     "//llvm/lib/Testing/Support",
+    "//llvm/lib/Target:AllTargetsDescs",
+    "//llvm/lib/Target:AllTargetsDisassemblers",
+    "//llvm/lib/Target:AllTargetsInfos",
   ]
   sources = [
     "CommandLineOptionsTest.cpp",
     "CompareElementsTest.cpp",
+    "ELFReaderTest.cpp",
     "LocationRangesTest.cpp",
     "LogicalElementsTest.cpp",
     "SelectElementsTest.cpp",
     "StringPoolTest.cpp",
     "WarningInternalTest.cpp",
   ]
+
+  # DebugInfoLogicalViewTests uses llvm::getInputFileDirectory(), which expects
+  # a file called llvm.srcdir.txt next to the test executable that contains
+  # the path of the source directory (which contains this file).
+  # lit doesn't change the cwd while running googletests, so the cwd isn't
+  # well-defined. This means this has to be an absolute path.
+  # FIXME: This doesn't work with swarming. This should really be a data
+  # dependency, and the cwd while tests requiring input files run should
+  # be required to be some fixed directory.
+  # FIXME: Also, the GN way is to write this file at build time. But since
+  # there's only two uses of this, and since this is a pattern that hopefully
+  # will disappear again, and since it doesn't have any measurable performance
+  # hit, write the file at GN time.
+  # Note: This line here implicitly depends on unittest() setting output_dir to
+  # target_out_dir.
+  write_file("$target_out_dir/llvm.srcdir.txt", rebase_path("."))
 }

diff  --git a/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/PDB/BUILD.gn b/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/PDB/BUILD.gn
index 16a5461494d55..50979695e6f72 100644
--- a/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/PDB/BUILD.gn
+++ b/llvm/utils/gn/secondary/llvm/unittests/DebugInfo/PDB/BUILD.gn
@@ -24,7 +24,7 @@ unittest("DebugInfoPDBTests") {
   # dependency, and the cwd while tests requiring input files run should
   # be required to be some fixed directory.
   # FIXME: Also, the GN way is to write this file at build time. But since
-  # there's only one use of this, and since this is a pattern that hopefully
+  # there's only two uses of this, and since this is a pattern that hopefully
   # will disappear again, and since it doesn't have any measurable performance
   # hit, write the file at GN time.
   # Note: This line here implicitly depends on unittest() setting output_dir to


        


More information about the llvm-commits mailing list