File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -167,12 +167,11 @@ int llvm::TableGenMain(const char *argv0,
167167
168168 // Write output to memory.
169169 Timer.startBackendTimer (" Backend overall" );
170- SmallString<128 > FilenamePrefix (OutputFilename);
171- sys::path::replace_extension (FilenamePrefix, " " );
172170 TableGenOutputFiles OutFiles;
173171 unsigned status = 0 ;
174172 // ApplyCallback will return true if it did not apply any callback. In that
175173 // case, attempt to apply the MainFn.
174+ StringRef FilenamePrefix (sys::path::stem (OutputFilename));
176175 if (TableGen::Emitter::ApplyCallback (Records, OutFiles, FilenamePrefix))
177176 status = MainFn ? MainFn (OutFiles, Records) : 1 ;
178177 Timer.stopBackendTimer ();
@@ -195,7 +194,7 @@ int llvm::TableGenMain(const char *argv0,
195194 SmallString<128 > Filename (OutputFilename);
196195 // TODO: Format using the split-file convention when writing to stdout?
197196 if (Filename != " -" ) {
198- Filename = FilenamePrefix ;
197+ sys::path::replace_extension ( Filename, " " ) ;
199198 Filename.append (Suffix);
200199 }
201200 if (int Ret = WriteOutput (Parser, argv0, Filename, Content))
You can’t perform that action at this time.
0 commit comments