Please use GitHub pull requests for new patches. Avoid migrating existing patches. Phabricator shutdown timeline
Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Driver/ToolChains/CommonArgs.cpp
Show First 20 Lines • Show All 1,132 Lines • ▼ Show 20 Lines | unsigned tools::ParseFunctionAlignment(const ToolChain &TC, | ||||
unsigned Value = 0; | unsigned Value = 0; | ||||
if (StringRef(A->getValue()).getAsInteger(10, Value) || Value > 65536) | if (StringRef(A->getValue()).getAsInteger(10, Value) || Value > 65536) | ||||
TC.getDriver().Diag(diag::err_drv_invalid_int_value) | TC.getDriver().Diag(diag::err_drv_invalid_int_value) | ||||
<< A->getAsString(Args) << A->getValue(); | << A->getAsString(Args) << A->getValue(); | ||||
return Value ? llvm::Log2_32_Ceil(std::min(Value, 65536u)) : Value; | return Value ? llvm::Log2_32_Ceil(std::min(Value, 65536u)) : Value; | ||||
} | } | ||||
unsigned tools::ParseDwarfDefaultVersion(const ToolChain &TC, | |||||
const ArgList &Args) { | |||||
const Arg *A = Args.getLastArg(options::OPT_fdwarf_default_version); | |||||
if (!A) | |||||
return 0; | |||||
unsigned Value = 0; | |||||
if (StringRef(A->getValue()).getAsInteger(10, Value) | |||||
|| Value > 5 | |||||
|| Value < 2) | |||||
probinson: Clang doesn't support DWARF v1. I expect nobody does at this point (DWARF 2 came out in 1993). | |||||
Not Done ReplyInline ActionsYou'd recommend/request moving this bound up to 2 (to be consistent with the fact that clang supports -gdwarf-2 technically (even though we probably don't produce fully conformant DWARFv2 these days, I would guess))? dblaikie: You'd recommend/request moving this bound up to 2 (to be consistent with the fact that clang… | |||||
Not Done ReplyInline ActionsIt wants to permit the exact same range as the -gdwarf-N options. probinson: It wants to permit the exact same range as the -gdwarf-N options. | |||||
TC.getDriver().Diag(diag::err_drv_invalid_int_value) | |||||
<< A->getAsString(Args) << A->getValue(); | |||||
return Value; | |||||
} | |||||
void tools::AddAssemblerKPIC(const ToolChain &ToolChain, const ArgList &Args, | void tools::AddAssemblerKPIC(const ToolChain &ToolChain, const ArgList &Args, | ||||
ArgStringList &CmdArgs) { | ArgStringList &CmdArgs) { | ||||
llvm::Reloc::Model RelocationModel; | llvm::Reloc::Model RelocationModel; | ||||
unsigned PICLevel; | unsigned PICLevel; | ||||
bool IsPIE; | bool IsPIE; | ||||
std::tie(RelocationModel, PICLevel, IsPIE) = ParsePICArgs(ToolChain, Args); | std::tie(RelocationModel, PICLevel, IsPIE) = ParsePICArgs(ToolChain, Args); | ||||
if (RelocationModel != llvm::Reloc::Static) | if (RelocationModel != llvm::Reloc::Static) | ||||
▲ Show 20 Lines • Show All 354 Lines • Show Last 20 Lines |
Clang doesn't support DWARF v1. I expect nobody does at this point (DWARF 2 came out in 1993).