Skip to content

Commit 88d258f

Browse files
committed
Address review comments
1 parent bb486c5 commit 88d258f

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

flang/include/flang/Tools/CrossToolHelpers.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ struct MLIRToLLVMPassPipelineConfig : public FlangEPCallBacks {
103103
mathOpts.getReciprocalMath() && NoSignedZerosFPMath &&
104104
ApproxFuncFPMath && mathOpts.getFPContractEnabled();
105105
if (opts.InstrumentFunctions) {
106-
InstrumentFunctionsEntry = "__cyg_profile_func_enter";
107-
InstrumentFunctionsExit = "__cyg_profile_func_exit";
106+
InstrumentFunctionEntry = "__cyg_profile_func_enter";
107+
InstrumentFunctionExit = "__cyg_profile_func_exit";
108108
}
109109
}
110110

@@ -128,8 +128,12 @@ struct MLIRToLLVMPassPipelineConfig : public FlangEPCallBacks {
128128
bool UnsafeFPMath = false; ///< Set unsafe-fp-math attribute for functions.
129129
bool NSWOnLoopVarInc = true; ///< Add nsw flag to loop variable increments.
130130
bool EnableOpenMP = false; ///< Enable OpenMP lowering.
131-
std::string InstrumentFunctionsEntry = "";
132-
std::string InstrumentFunctionsExit = "";
131+
std::string InstrumentFunctionEntry =
132+
""; ///< Name of the instrument-function that is called on each
133+
///< function-entry
134+
std::string InstrumentFunctionExit =
135+
""; ///< Name of the instrument-function that is called on each
136+
///< function-exit
133137
};
134138

135139
struct OffloadModuleOpts {

flang/lib/Frontend/CompilerInvocation.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,8 +310,7 @@ static void parseCodeGenArgs(Fortran::frontend::CodeGenOptions &opts,
310310
args.filtered(clang::driver::options::OPT_fembed_offload_object_EQ))
311311
opts.OffloadObjects.push_back(a->getValue());
312312

313-
if (args.hasFlag(clang::driver::options::OPT_finstrument_functions,
314-
clang::driver::options::OPT_finstrument_functions, false))
313+
if (args.hasArg(clang::driver::options::OPT_finstrument_functions))
315314
opts.InstrumentFunctions = true;
316315

317316
// -flto=full/thin option.

flang/lib/Optimizer/Passes/Pipelines.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,8 +349,8 @@ void createDefaultFIRCodeGenPassPipeline(mlir::PassManager &pm,
349349
framePointerKind = mlir::LLVM::framePointerKind::FramePointerKind::None;
350350

351351
pm.addPass(fir::createFunctionAttr(
352-
{framePointerKind, config.InstrumentFunctionsEntry,
353-
config.InstrumentFunctionsExit, config.NoInfsFPMath, config.NoNaNsFPMath,
352+
{framePointerKind, config.InstrumentFunctionEntry,
353+
config.InstrumentFunctionExit, config.NoInfsFPMath, config.NoNaNsFPMath,
354354
config.ApproxFuncFPMath, config.NoSignedZerosFPMath, config.UnsafeFPMath,
355355
""}));
356356

0 commit comments

Comments
 (0)