[llvm] [TableGen] Strip directories from filename prefixes. (PR #168355)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 17 03:50:16 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-tablegen

Author: Ivan Kosarev (kosarev)

<details>
<summary>Changes</summary>

Fixes https://github.com/llvm/llvm-project/pull/167700 to support
builds where TableGen's output file is specified as full path
rather than just filename.

---
Full diff: https://github.com/llvm/llvm-project/pull/168355.diff


1 Files Affected:

- (modified) llvm/lib/TableGen/Main.cpp (+1-2) 


``````````diff
diff --git a/llvm/lib/TableGen/Main.cpp b/llvm/lib/TableGen/Main.cpp
index c3869c3fb9a5a..165c957fc9977 100644
--- a/llvm/lib/TableGen/Main.cpp
+++ b/llvm/lib/TableGen/Main.cpp
@@ -167,8 +167,7 @@ int llvm::TableGenMain(const char *argv0,
 
   // Write output to memory.
   Timer.startBackendTimer("Backend overall");
-  SmallString<128> FilenamePrefix(OutputFilename);
-  sys::path::replace_extension(FilenamePrefix, "");
+  SmallString<128> FilenamePrefix(sys::path::stem(OutputFilename));
   TableGenOutputFiles OutFiles;
   unsigned status = 0;
   // ApplyCallback will return true if it did not apply any callback. In that

``````````

</details>


https://github.com/llvm/llvm-project/pull/168355


More information about the llvm-commits mailing list