Changeset View
Changeset View
Standalone View
Standalone View
clang/lib/Driver/ToolChains/Clang.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 520 Lines • ▼ Show 20 Lines | case llvm::Triple::thumb: | ||||
// ARM Darwin targets require a frame pointer to be always present to aid | // ARM Darwin targets require a frame pointer to be always present to aid | ||||
// offline debugging via backtraces. | // offline debugging via backtraces. | ||||
return Triple.isOSDarwin(); | return Triple.isOSDarwin(); | ||||
} | } | ||||
} | } | ||||
static bool useFramePointerForTargetByDefault(const ArgList &Args, | static bool useFramePointerForTargetByDefault(const ArgList &Args, | ||||
const llvm::Triple &Triple) { | const llvm::Triple &Triple) { | ||||
if (Args.hasArg(options::OPT_pg)) | if (Args.hasArg(options::OPT_pg) && !Args.hasArg(options::OPT_mfentry)) | ||||
return true; | return true; | ||||
switch (Triple.getArch()) { | switch (Triple.getArch()) { | ||||
case llvm::Triple::xcore: | case llvm::Triple::xcore: | ||||
case llvm::Triple::wasm32: | case llvm::Triple::wasm32: | ||||
case llvm::Triple::wasm64: | case llvm::Triple::wasm64: | ||||
case llvm::Triple::msp430: | case llvm::Triple::msp430: | ||||
// XCore never wants frame pointers, regardless of OS. | // XCore never wants frame pointers, regardless of OS. | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | default: | ||||
// All other supported Windows ISAs use xdata unwind information, so frame | // All other supported Windows ISAs use xdata unwind information, so frame | ||||
// pointers are not generally useful. | // pointers are not generally useful. | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
return true; | return true; | ||||
} | } | ||||
nickdesaulniers: This hunk does nothing and can be removed. I'll retitle the diff with a better explanation. | |||||
static CodeGenOptions::FramePointerKind | static CodeGenOptions::FramePointerKind | ||||
getFramePointerKind(const ArgList &Args, const llvm::Triple &Triple) { | getFramePointerKind(const ArgList &Args, const llvm::Triple &Triple) { | ||||
// We have 4 states: | // We have 4 states: | ||||
// | // | ||||
// 00) leaf retained, non-leaf retained | // 00) leaf retained, non-leaf retained | ||||
// 01) leaf retained, non-leaf omitted (this is invalid) | // 01) leaf retained, non-leaf omitted (this is invalid) | ||||
// 10) leaf omitted, non-leaf retained | // 10) leaf omitted, non-leaf retained | ||||
// (what -momit-leaf-frame-pointer was designed for) | // (what -momit-leaf-frame-pointer was designed for) | ||||
▲ Show 20 Lines • Show All 5,544 Lines • ▼ Show 20 Lines | |||||
// Make the compile command echo its inputs for /showFilenames. | // Make the compile command echo its inputs for /showFilenames. | ||||
if (Output.getType() == types::TY_Object && | if (Output.getType() == types::TY_Object && | ||||
Args.hasFlag(options::OPT__SLASH_showFilenames, | Args.hasFlag(options::OPT__SLASH_showFilenames, | ||||
options::OPT__SLASH_showFilenames_, false)) { | options::OPT__SLASH_showFilenames_, false)) { | ||||
C.getJobs().getJobs().back()->PrintInputFilenames = true; | C.getJobs().getJobs().back()->PrintInputFilenames = true; | ||||
} | } | ||||
if (Arg *A = Args.getLastArg(options::OPT_pg)) | if (Arg *A = Args.getLastArg(options::OPT_pg)) | ||||
if (FPKeepKind == CodeGenOptions::FramePointerKind::None) | if (FPKeepKind == CodeGenOptions::FramePointerKind::None && | ||||
!Args.hasArg(options::OPT_mfentry)) | |||||
D.Diag(diag::err_drv_argument_not_allowed_with) << "-fomit-frame-pointer" | D.Diag(diag::err_drv_argument_not_allowed_with) << "-fomit-frame-pointer" | ||||
<< A->getAsString(Args); | << A->getAsString(Args); | ||||
// Claim some arguments which clang supports automatically. | // Claim some arguments which clang supports automatically. | ||||
// -fpch-preprocess is used with gcc to add a special marker in the output to | // -fpch-preprocess is used with gcc to add a special marker in the output to | ||||
// include the PCH file. | // include the PCH file. | ||||
Args.ClaimAllArgs(options::OPT_fpch_preprocess); | Args.ClaimAllArgs(options::OPT_fpch_preprocess); | ||||
▲ Show 20 Lines • Show All 889 Lines • Show Last 20 Lines |
This hunk does nothing and can be removed. I'll retitle the diff with a better explanation.