Skip to content

Commit 554954a

Browse files
Tzvetan Mikovmeta-codesync[bot]
authored andcommitted
EASY: Remove dependency on -g3 for emitting line directives
Summary: Change emitLineDirectives to depend only on the explicit -Xline-directives flag, removing the condition that checked for DebugInfoLevel >= g3. Since g3 is deprecated and maps to g2, the condition DebugInfoLevel >= g3 can never be true, making that part of the check dead code. This change makes the code accurately reflect the actual behavior: line directives are only emitted when explicitly requested via -Xline-directives. Reviewed By: avp Differential Revision: D87034836 fbshipit-source-id: 5197223d35114ee19afaf2f4d3f111795a822cce Co-authored-by: Claude (Anthropic AI Assistant) for AI-driven
1 parent 273f190 commit 554954a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

tools/shermes/shermes.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,6 @@ std::shared_ptr<Context> createContext() {
689689
} else if (cli::DebugInfoLevel == DebugLevel::g2) {
690690
context->setDebugInfoSetting(DebugInfoSetting::SOURCE_MAP);
691691
} else if (cli::DebugInfoLevel == DebugLevel::g1) {
692-
// -g1 or -g0. If -g0, we'll strip debug info later.
693692
context->setDebugInfoSetting(DebugInfoSetting::THROWING);
694693
} else {
695694
context->setDebugInfoSetting(DebugInfoSetting::NONE);
@@ -1015,10 +1014,8 @@ bool compileFromCommandLineOptions() {
10151014
genOptions.emitSourceLocations =
10161015
cli::DumpSourceLocation != LocationDumpMode::None;
10171016

1018-
// Emit line directives if we have full debug info enabled or it was
1019-
// explicitly requested.
1020-
genOptions.emitLineDirectives =
1021-
cli::DebugInfoLevel >= DebugLevel::g3 || cli::ForceLineDirectives;
1017+
// Emit line directives if explicitly requested.
1018+
genOptions.emitLineDirectives = cli::ForceLineDirectives;
10221019

10231020
ShermesCompileParams params(genOptions);
10241021
// Populate all fields of ShermesCompileParams.

0 commit comments

Comments
 (0)