Skip to content

Commit

Permalink
-fembed-bitcode options is always off for declang
Browse files Browse the repository at this point in the history
  • Loading branch information
funa-tk committed Oct 25, 2023
1 parent b1b49ae commit 4a8306f
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions clang/lib/Driver/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1369,21 +1369,24 @@ Compilation *Driver::BuildCompilation(ArrayRef<const char *> ArgList) {

setLTOMode(Args);

//DECLANG CODES BEGIN
// Process -fembed-bitcode= flags.
if (Arg *A = Args.getLastArg(options::OPT_fembed_bitcode_EQ)) {
StringRef Name = A->getValue();
unsigned Model = llvm::StringSwitch<unsigned>(Name)
.Case("off", EmbedNone)
.Case("all", EmbedBitcode)
.Case("bitcode", EmbedBitcode)
.Case("marker", EmbedMarker)
.Default(~0U);
if (Model == ~0U) {
Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args)
<< Name;
} else
BitcodeEmbed = static_cast<BitcodeEmbedMode>(Model);
}
//if (Arg *A = Args.getLastArg(options::OPT_fembed_bitcode_EQ)) {
// StringRef Name = A->getValue();
// unsigned Model = llvm::StringSwitch<unsigned>(Name)
// .Case("off", EmbedNone)
// .Case("all", EmbedBitcode)
// .Case("bitcode", EmbedBitcode)
// .Case("marker", EmbedMarker)
// .Default(~0U);

// if (Model == ~0U) {
// Diags.Report(diag::err_drv_invalid_value) << A->getAsString(Args)
// << Name;
// } else
// BitcodeEmbed = static_cast<BitcodeEmbedMode>(Model);
//}
//DECLANG CODES END

// Remove existing compilation database so that each job can append to it.
if (Arg *A = Args.getLastArg(options::OPT_MJ))
Expand Down

0 comments on commit 4a8306f

Please sign in to comment.