-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[TableGen] Strip directories from filename prefixes. #168355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-tablegen Author: Ivan Kosarev (kosarev) ChangesFixes #167700 to support Full diff: https://github.com/llvm/llvm-project/pull/168355.diff 1 Files Affected:
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
|
|
this doesn't fix the core bazel issue because this also affects the output path, so the assumption is that instead of outputting |
|
something like this would solve that: diff --git a/llvm/utils/TableGen/RegisterInfoEmitter.cpp b/llvm/utils/TableGen/RegisterInfoEmitter.cpp
index ef7b13e8940f..286d5bf637ce 100644
--- a/llvm/utils/TableGen/RegisterInfoEmitter.cpp
+++ b/llvm/utils/TableGen/RegisterInfoEmitter.cpp
@@ -29,6 +29,7 @@
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Format.h"
+#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
@@ -104,7 +105,7 @@ static void emitInclude(StringRef FilenamePrefix, StringRef IncludeFile,
StringRef GuardMacro, raw_ostream &OS) {
OS << "#ifdef " << GuardMacro << '\n';
OS << "#undef " << GuardMacro << '\n';
- OS << "#include \"" << FilenamePrefix << IncludeFile << "\"\n";
+ OS << "#include \"" << sys::path::stem(FilenamePrefix) << IncludeFile << "\"\n";
OS << "#endif\n\n";
} |
|
This PR should have the same effect. It would make most sense to strip the directories from the suffix in the first place. |
|
see my comment above about why that is not the case |
|
the problem is that llvm-project/llvm/lib/TableGen/Main.cpp Lines 197 to 200 in dbd97c8
|
|
fwiw i just validated with my diff above + my bazel PR everything builds again |
Fixes #167700 to support builds where TableGen's output file is specified as full path rather than just filename.
cf78b7a to
ab305c0
Compare
|
Updated. |
keith
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested and it does work with the bazel build, thanks!
|
Thanks. Will merge this as soon as the buildbots show it green. |
🐧 Linux x64 Test Results
|
|
🚢 🎉 |
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/28225 Here is the relevant piece of the build log for the reference |

Fixes #167700 to support
builds where TableGen's output file is specified as full path
rather than just filename.