Skip to content

Conversation

Prabhuk
Copy link
Contributor

@Prabhuk Prabhuk commented Jul 30, 2025

No description provided.

Created using spr 1.3.6-beta.1
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels Jul 30, 2025
@Prabhuk Prabhuk marked this pull request as draft July 30, 2025 21:57
@llvmbot
Copy link
Member

llvmbot commented Jul 30, 2025

@llvm/pr-subscribers-clang-driver

@llvm/pr-subscribers-clang

Author: Prabhu Rajasekaran (Prabhuk)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/151402.diff

8 Files Affected:

  • (modified) clang/include/clang/Driver/Options.td (+3-3)
  • (modified) clang/lib/Driver/ToolChains/Clang.cpp (+3-3)
  • (modified) clang/lib/Driver/ToolChains/CommonArgs.cpp (+2-2)
  • (modified) clang/test/CodeGen/call-graph-section-templates.cpp (+1-1)
  • (modified) clang/test/CodeGen/call-graph-section-virtual-methods.cpp (+1-1)
  • (modified) clang/test/CodeGen/call-graph-section.c (+2-2)
  • (modified) clang/test/CodeGen/call-graph-section.cpp (+1-1)
  • (modified) clang/test/Driver/call-graph-section.c (+4-4)
diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td
index 3882019b34aa4..6aed20667c8d7 100644
--- a/clang/include/clang/Driver/Options.td
+++ b/clang/include/clang/Driver/Options.td
@@ -4440,9 +4440,9 @@ defm data_sections : BoolFOption<"data-sections",
   PosFlag<SetTrue, [], [ClangOption, CC1Option],
           "Place each data in its own section">,
   NegFlag<SetFalse>>;
-defm call_graph_section
-    : BoolFOption<"call-graph-section", CodeGenOpts<"CallGraphSection">,
-                  DefaultFalse,
+defm experimental_call_graph_section
+    : BoolFOption<"experimental-call-graph-section",
+                  CodeGenOpts<"CallGraphSection">, DefaultFalse,
                   PosFlag<SetTrue, [], [ClangOption, CC1Option],
                           "Emit a call graph section">,
                   NegFlag<SetFalse>>;
diff --git a/clang/lib/Driver/ToolChains/Clang.cpp b/clang/lib/Driver/ToolChains/Clang.cpp
index e15ea509d7f8a..174425f3d90c4 100644
--- a/clang/lib/Driver/ToolChains/Clang.cpp
+++ b/clang/lib/Driver/ToolChains/Clang.cpp
@@ -6476,9 +6476,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
     CmdArgs.push_back(A->getValue());
   }
 
-  if (Args.hasFlag(options::OPT_fcall_graph_section,
-                   options::OPT_fno_call_graph_section, false))
-    CmdArgs.push_back("-fcall-graph-section");
+  if (Args.hasFlag(options::OPT_fexperimental_call_graph_section,
+                   options::OPT_fno_experimental_call_graph_section, false))
+    CmdArgs.push_back("-fexperimental-call-graph-section");
 
   Args.addOptInFlag(CmdArgs, options::OPT_fstack_size_section,
                     options::OPT_fno_stack_size_section);
diff --git a/clang/lib/Driver/ToolChains/CommonArgs.cpp b/clang/lib/Driver/ToolChains/CommonArgs.cpp
index cf67e0903c345..bfd88434d8363 100644
--- a/clang/lib/Driver/ToolChains/CommonArgs.cpp
+++ b/clang/lib/Driver/ToolChains/CommonArgs.cpp
@@ -1269,8 +1269,8 @@ void tools::addLTOOptions(const ToolChain &ToolChain, const ArgList &Args,
     CmdArgs.push_back(
         Args.MakeArgString(Twine(PluginOptPrefix) + "-stack-size-section"));
 
-  if (Args.hasFlag(options::OPT_fcall_graph_section,
-                   options::OPT_fno_call_graph_section, false))
+  if (Args.hasFlag(options::OPT_fexperimental_call_graph_section,
+                   options::OPT_fno_experimental_call_graph_section, false))
     CmdArgs.push_back(
         Args.MakeArgString(Twine(PluginOptPrefix) + "-call-graph-section"));
 
diff --git a/clang/test/CodeGen/call-graph-section-templates.cpp b/clang/test/CodeGen/call-graph-section-templates.cpp
index 3fe109fc75c8b..43be48e94125b 100644
--- a/clang/test/CodeGen/call-graph-section-templates.cpp
+++ b/clang/test/CodeGen/call-graph-section-templates.cpp
@@ -1,7 +1,7 @@
 // Tests that we assign appropriate identifiers to indirect calls and targets
 // specifically for C++ templates.
 
-// RUN: %clang_cc1 -triple x86_64-unknown-linux -fcall-graph-section \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -fexperimental-call-graph-section \
 // RUN: -emit-llvm -o %t %s
 // RUN: FileCheck --check-prefix=FT    %s < %t
 // RUN: FileCheck --check-prefix=CST   %s < %t
diff --git a/clang/test/CodeGen/call-graph-section-virtual-methods.cpp b/clang/test/CodeGen/call-graph-section-virtual-methods.cpp
index 55e1d6a4646fd..aacd274dadbed 100644
--- a/clang/test/CodeGen/call-graph-section-virtual-methods.cpp
+++ b/clang/test/CodeGen/call-graph-section-virtual-methods.cpp
@@ -1,7 +1,7 @@
 // Tests that we assign appropriate identifiers to indirect calls and targets
 // specifically for virtual methods.
 
-// RUN: %clang_cc1 -triple x86_64-unknown-linux -fcall-graph-section \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -fexperimental-call-graph-section \
 // RUN: -emit-llvm -o %t %s
 // RUN: FileCheck --check-prefix=FT %s < %t
 // RUN: FileCheck --check-prefix=CST %s < %t
diff --git a/clang/test/CodeGen/call-graph-section.c b/clang/test/CodeGen/call-graph-section.c
index 21d03944153e7..3579b5551bdf8 100644
--- a/clang/test/CodeGen/call-graph-section.c
+++ b/clang/test/CodeGen/call-graph-section.c
@@ -1,9 +1,9 @@
 // Tests that we assign appropriate identifiers to indirect calls and targets.
 
-// RUN: %clang_cc1 -triple x86_64-unknown-linux -fcall-graph-section \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -fexperimental-call-graph-section \
 // RUN: -emit-llvm -o - %s | FileCheck --check-prefixes=CHECK,ITANIUM %s
 
-// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -fcall-graph-section \
+// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -fexperimental-call-graph-section \
 // RUN: -emit-llvm -o - %s | FileCheck --check-prefixes=CHECK,MS %s
 
 // CHECK-DAG: define {{(dso_local)?}} void @foo({{.*}} !type [[F_TVOID:![0-9]+]]
diff --git a/clang/test/CodeGen/call-graph-section.cpp b/clang/test/CodeGen/call-graph-section.cpp
index 317ee7665b7c9..467fdd111b71d 100644
--- a/clang/test/CodeGen/call-graph-section.cpp
+++ b/clang/test/CodeGen/call-graph-section.cpp
@@ -1,7 +1,7 @@
 // Tests that we assign appropriate identifiers to indirect calls and targets
 // specifically for C++ class and instance methods.
 
-// RUN: %clang_cc1 -triple x86_64-unknown-linux -fcall-graph-section \
+// RUN: %clang_cc1 -triple x86_64-unknown-linux -fexperimental-call-graph-section \
 // RUN: -emit-llvm -o %t %s
 // RUN: FileCheck --check-prefix=FT %s < %t
 // RUN: FileCheck --check-prefix=CST %s < %t
diff --git a/clang/test/Driver/call-graph-section.c b/clang/test/Driver/call-graph-section.c
index 563f36de4119e..00fa896dffb87 100644
--- a/clang/test/Driver/call-graph-section.c
+++ b/clang/test/Driver/call-graph-section.c
@@ -1,5 +1,5 @@
-// RUN: %clang -### -fcall-graph-section %s 2>&1 | FileCheck --check-prefix=CALL-GRAPH-SECTION %s
-// RUN: %clang -### -fcall-graph-section -fno-call-graph-section %s 2>&1 | FileCheck --check-prefix=NO-CALL-GRAPH-SECTION %s
+// RUN: %clang -### -fexperimental-call-graph-section %s 2>&1 | FileCheck --check-prefix=CALL-GRAPH-SECTION %s
+// RUN: %clang -### -fexperimental-call-graph-section -fno-experimental-call-graph-section %s 2>&1 | FileCheck --check-prefix=NO-CALL-GRAPH-SECTION %s
 
-// CALL-GRAPH-SECTION: "-fcall-graph-section"
-// NO-CALL-GRAPH-SECTION-NOT: "-fcall-graph-section"
+// CALL-GRAPH-SECTION: "-fexperimental-call-graph-section"
+// NO-CALL-GRAPH-SECTION-NOT: "-fexperimental-call-graph-section"

Prabhuk added 3 commits July 31, 2025 16:23
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
Created using spr 1.3.6-beta.1
@Prabhuk Prabhuk closed this Jul 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants