Skip to content

Commit 310c337

Browse files
authored
[Comgr] Pass -no-disable-free to Clang (llvm#2417)
Thanks !
2 parents b302d05 + 3a6cc61 commit 310c337

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

amd/comgr/src/comgr-compiler.cpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -649,12 +649,6 @@ amd_comgr_status_t executeCommand(const Command &Job, raw_ostream &LogS,
649649
Argv.append(Arguments.begin(), Arguments.end());
650650
Argv.push_back(nullptr);
651651

652-
// By default clang driver will ask CC1 to leak memory.
653-
auto *IT = find(Argv, StringRef("-disable-free"));
654-
if (IT != Argv.end()) {
655-
Argv.erase(IT);
656-
}
657-
658652
clearLLVMOptions();
659653

660654
if (Argv[1] == StringRef("-cc1")) {
@@ -900,6 +894,10 @@ amd_comgr_status_t AMDGPUCompiler::processFile(DataObject *Input,
900894
Argv.push_back(Flag);
901895
}
902896

897+
// By default clang driver will ask CC1 to leak memory.
898+
Argv.push_back("-Xclang");
899+
Argv.push_back("-no-disable-free");
900+
903901
Argv.push_back(InputFilePath);
904902

905903
Argv.push_back("-o");

0 commit comments

Comments
 (0)