@@ -724,7 +724,7 @@ createStatsReporter(const llvm::opt::InputArgList *ArgList,
724
724
if (Inputs.size () == 1 ) {
725
725
InputName = Inputs[0 ].second ->getSpelling ();
726
726
}
727
- StringRef OutputType = file_types::getTypeTempSuffix (OI.CompilerOutputType );
727
+ StringRef OutputType = file_types::getExtension (OI.CompilerOutputType );
728
728
return llvm::make_unique<UnifiedStatsReporter>(" swift-driver" ,
729
729
OI.ModuleName ,
730
730
InputName,
@@ -2054,7 +2054,7 @@ static StringRef assignOutputName(Compilation &C, const JobAction *JA,
2054
2054
// We should output to a temporary file, since we're not at the top level
2055
2055
// (or are generating a bridging PCH, which is currently always a temp).
2056
2056
StringRef Stem = llvm::sys::path::stem (BaseName);
2057
- StringRef Suffix = file_types::getTypeTempSuffix (JA->getType ());
2057
+ StringRef Suffix = file_types::getExtension (JA->getType ());
2058
2058
std::error_code EC = llvm::sys::fs::createTemporaryFile (Stem, Suffix, Buffer);
2059
2059
if (EC) {
2060
2060
Diags.diagnose (SourceLoc (), diag::error_unable_to_make_temporary_file,
@@ -2128,7 +2128,7 @@ static StringRef getOutputFilename(Compilation &C,
2128
2128
if (isa<GenerateDSYMJobAction>(JA)) {
2129
2129
Buffer = PrimaryInput;
2130
2130
Buffer.push_back (' .' );
2131
- Buffer.append (file_types::getTypeTempSuffix (JA->getType ()));
2131
+ Buffer.append (file_types::getExtension (JA->getType ()));
2132
2132
return Buffer.str ();
2133
2133
}
2134
2134
@@ -2171,7 +2171,7 @@ static StringRef getOutputFilename(Compilation &C,
2171
2171
return Buffer.str ();
2172
2172
}
2173
2173
2174
- StringRef Suffix = file_types::getTypeTempSuffix (JA->getType ());
2174
+ StringRef Suffix = file_types::getExtension (JA->getType ());
2175
2175
assert (Suffix.data () &&
2176
2176
" All types used for output should have a suffix." );
2177
2177
@@ -2241,7 +2241,7 @@ static void addAuxiliaryOutput(
2241
2241
2242
2242
bool isTempFile = C.isTemporaryFile (path);
2243
2243
llvm::sys::path::replace_extension (
2244
- path, file_types::getTypeTempSuffix (outputType));
2244
+ path, file_types::getExtension (outputType));
2245
2245
output.setAdditionalOutputForType (outputType, path);
2246
2246
if (isTempFile)
2247
2247
C.addTemporaryFile (path);
@@ -2264,7 +2264,7 @@ static void addDiagFileOutputForPersistentPCHAction(
2264
2264
StringRef headerPath = output.getBaseInput (JA->getInputIndex ());
2265
2265
StringRef stem = llvm::sys::path::stem (headerPath);
2266
2266
StringRef suffix =
2267
- file_types::getTypeTempSuffix (file_types::TY_SerializedDiagnostics);
2267
+ file_types::getExtension (file_types::TY_SerializedDiagnostics);
2268
2268
SmallString<256 > outPathBuf;
2269
2269
2270
2270
if (const Arg *A = C.getArgs ().getLastArg (options::OPT_emit_module_path)) {
@@ -2724,7 +2724,8 @@ void Driver::chooseRemappingOutputPath(Compilation &C,
2724
2724
} else {
2725
2725
llvm::SmallString<128 > Path (Output->getPrimaryOutputFilenames ()[0 ]);
2726
2726
bool isTempFile = C.isTemporaryFile (Path);
2727
- llvm::sys::path::replace_extension (Path, " remap" );
2727
+ llvm::sys::path::replace_extension (Path,
2728
+ file_types::getExtension (file_types::ID::TY_Remapping));
2728
2729
Output->setAdditionalOutputForType (file_types::ID::TY_Remapping, Path);
2729
2730
if (isTempFile)
2730
2731
C.addTemporaryFile (Path);
0 commit comments