Consistently get extensions from swift/Frontend/FileTypes.h

...instead of sometimes hardcoding them and sometimes using Strings.h.
The exceptions are the libraries that sit below Frontend; these can
continue using strings.
This commit is contained in:
Jordan Rose
2018-07-25 19:41:16 -07:00
parent 6e5aefc0b5
commit 798496c488
10 changed files with 78 additions and 54 deletions

View File

@@ -26,6 +26,7 @@
#include "swift/Demangling/Demangle.h"
#include "swift/Demangling/ManglingMacros.h"
#include "swift/Frontend/DiagnosticVerifier.h"
#include "swift/Frontend/FileTypes.h"
#include "swift/Frontend/Frontend.h"
#include "swift/Frontend/PrintingDiagnosticConsumer.h"
#include "swift/SIL/SILBuilder.h"
@@ -347,10 +348,12 @@ int main(int argc, char **argv) {
OutputFile = OutputFilename;
} else if (ModuleName.size()) {
OutputFile = ModuleName;
llvm::sys::path::replace_extension(OutputFile, SIB_EXTENSION);
llvm::sys::path::replace_extension(
OutputFile, file_types::getExtension(file_types::TY_SIB));
} else {
OutputFile = CI.getMainModule()->getName().str();
llvm::sys::path::replace_extension(OutputFile, SIB_EXTENSION);
llvm::sys::path::replace_extension(
OutputFile, file_types::getExtension(file_types::TY_SIB));
}
SerializationOptions serializationOpts;