Skip to content

Commit cbc5483

Browse files
committed
Add -save-temps flag to wrapper tools
1 parent 513302a commit cbc5483

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

clang/tools/nec-aurora-build/necaurora-ofld-wrapper.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ int parseCmdline(int argc, char **argv, ToolMode &Mode, std::string &SotocPath,
4848
Mode = ToolMode::Unknown;
4949
bool StaticLinkerFlag = false;
5050
bool SharedFlag = false;
51+
bool SaveTempsFlag = false;
5152
SotocPath = "sotoc";
5253
// TODO make this more flexible
5354
InputFile = argv[1];
@@ -84,6 +85,9 @@ int parseCmdline(int argc, char **argv, ToolMode &Mode, std::string &SotocPath,
8485
} else if (strcmp(argv[i], "-shared") == 0) {
8586
SharedFlag = true;
8687
continue;
88+
} else if (strcmp(argv[i], "-save-temps") == 0) {
89+
SaveTempsFlag = true;
90+
continue;
8791
} else if (strcmp(argv[i] + strlen(argv[i] - 2), ".o") == 0) {
8892
ArgsStream << argv[i] << " ";
8993
ObjectFiles.push_back(argv[i]);
@@ -97,6 +101,10 @@ int parseCmdline(int argc, char **argv, ToolMode &Mode, std::string &SotocPath,
97101
}
98102
}
99103

104+
if (SaveTempsFlag && !KeepTransformedFilesDir) {
105+
KeepTransformedFilesDir = get_current_dir_name();
106+
}
107+
100108
if (Mode == ToolMode::Unknown) {
101109

102110
if (StaticLinkerFlag) {
@@ -114,6 +122,7 @@ int parseCmdline(int argc, char **argv, ToolMode &Mode, std::string &SotocPath,
114122
} else {
115123
Args = ArgsStream.str();
116124
}
125+
117126
return 0;
118127
}
119128

0 commit comments

Comments
 (0)