Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions llvm/lib/TableGen/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,11 @@ int llvm::TableGenMain(const char *argv0,

// Write output to memory.
Timer.startBackendTimer("Backend overall");
SmallString<128> FilenamePrefix(OutputFilename);
sys::path::replace_extension(FilenamePrefix, "");
TableGenOutputFiles OutFiles;
unsigned status = 0;
// ApplyCallback will return true if it did not apply any callback. In that
// case, attempt to apply the MainFn.
StringRef FilenamePrefix(sys::path::stem(OutputFilename));
if (TableGen::Emitter::ApplyCallback(Records, OutFiles, FilenamePrefix))
status = MainFn ? MainFn(OutFiles, Records) : 1;
Timer.stopBackendTimer();
Expand All @@ -195,7 +194,7 @@ int llvm::TableGenMain(const char *argv0,
SmallString<128> Filename(OutputFilename);
// TODO: Format using the split-file convention when writing to stdout?
if (Filename != "-") {
Filename = FilenamePrefix;
sys::path::replace_extension(Filename, "");
Filename.append(Suffix);
}
if (int Ret = WriteOutput(Parser, argv0, Filename, Content))
Expand Down
Loading