Skip to content

Commit e1a61e1

Browse files
committed
Keep intermediate .o file only under -keep-tmp option.
Summary: We use intermediate .o file for debugging purposes, but there's no reason to generate it by default. Only do it if "-keep-tmp" is specified. (cherry picked from FBD2912098)
1 parent d152608 commit e1a61e1

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bolt/RewriteInstance.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ PrintReordered("print-reordered",
153153
cl::desc("print functions after layout optimization"),
154154
cl::Hidden);
155155

156+
static cl::opt<bool>
157+
KeepTmp("keep-tmp",
158+
cl::desc("preserve intermediate .o file"),
159+
cl::Hidden);
156160

157161
// Check against lists of functions from options if we should
158162
// optimize the function with a given name.
@@ -1172,7 +1176,9 @@ void RewriteInstance::emitFunctions() {
11721176
}
11731177

11741178
OLT.emitAndFinalize(ObjectsHandle);
1175-
TempOut->keep();
1179+
1180+
if (opts::KeepTmp)
1181+
TempOut->keep();
11761182
}
11771183

11781184
bool RewriteInstance::splitLargeFunctions() {

0 commit comments

Comments
 (0)