|
@@ -575,8 +575,14 @@ static bool ParseCodeGenArgs(CodeGenOptions &Opts, ArgList &Args, InputKind IK,
|
|
NeedLocTracking = true;
|
|
NeedLocTracking = true;
|
|
}
|
|
}
|
|
|
|
|
|
- // If the user requested one of the flags in the -Rpass family, make sure
|
|
|
|
- // that the backend tracks source location information.
|
|
|
|
|
|
+ // If the user requested to use a sample profile for PGO, then the
|
|
|
|
+ // backend will need to track source location information so the profile
|
|
|
|
+ // can be incorporated into the IR.
|
|
|
|
+ if (!Opts.SampleProfileFile.empty())
|
|
|
|
+ NeedLocTracking = true;
|
|
|
|
+
|
|
|
|
+ // If the user requested a flag that requires source locations available in
|
|
|
|
+ // the backend, make sure that the backend tracks source location information.
|
|
if (NeedLocTracking && Opts.getDebugInfo() == CodeGenOptions::NoDebugInfo)
|
|
if (NeedLocTracking && Opts.getDebugInfo() == CodeGenOptions::NoDebugInfo)
|
|
Opts.setDebugInfo(CodeGenOptions::LocTrackingOnly);
|
|
Opts.setDebugInfo(CodeGenOptions::LocTrackingOnly);
|
|
|
|
|