Skip to content

Commit 6b42edd

Browse files
committed
Change goto-cc function-local to file-local
goto-cc had a misleading flag called `--export-function-local-symbols`. This flag exported the declarations of all static functions in a file, and is thus more appropriately named `--export-file-local-symbols`. That was actually the flag's old name, and indeed those functions' mangled name would be prefixed with `__CPROVER_file_local`. Some of the documentation also referred to the flag's old name. This commit makes the documentation and flags consistent with the internal implementation, i.e. the flag is now called `--export-file-local-symbols`. The `function` flag is still accepted because some existing code in the wild relies on this, but goto-cc emits a warning if the user passes that flag.
1 parent 660d556 commit 6b42edd

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

regression/goto-cc-file-local/chain.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ for src in ${SRC}; do
6363

6464
if [[ "${is_windows}" == "true" ]]; then
6565
"${goto_cc}" \
66-
--export-function-local-symbols \
66+
--export-file-local-symbols \
6767
--verbosity 10 \
6868
${wall} \
6969
${suffix} \
@@ -72,7 +72,7 @@ for src in ${SRC}; do
7272

7373
else
7474
"${goto_cc}" \
75-
--export-function-local-symbols \
75+
--export-file-local-symbols \
7676
--verbosity 10 \
7777
${wall} \
7878
${suffix} \
@@ -86,7 +86,7 @@ if is_in final-link "$ALL_ARGS"; then
8686
rm -f ${OUT_FILE}
8787
if [[ "${is_windows}" == "true" ]]; then
8888
"${goto_cc}" \
89-
--export-function-local-symbols \
89+
--export-file-local-symbols \
9090
--verbosity 10 \
9191
${wall} \
9292
${suffix} \
@@ -95,7 +95,7 @@ if is_in final-link "$ALL_ARGS"; then
9595

9696
else
9797
"${goto_cc}" \
98-
--export-function-local-symbols \
98+
--export-file-local-symbols \
9999
--verbosity 10 \
100100
${wall} \
101101
${suffix} \

src/goto-cc/compile.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -626,14 +626,22 @@ compilet::compilet(cmdlinet &_cmdline, message_handlert &mh, bool Werror)
626626
ns(goto_model.symbol_table),
627627
cmdline(_cmdline),
628628
warning_is_fatal(Werror),
629-
keep_file_local(cmdline.isset("export-function-local-symbols")),
629+
keep_file_local(
630+
// function-local is the old name and is still in use, but is misleading
631+
cmdline.isset("export-function-local-symbols") ||
632+
cmdline.isset("export-file-local-symbols")),
630633
file_local_mangle_suffix(
631634
cmdline.isset("mangle-suffix") ? cmdline.get_value("mangle-suffix") : "")
632635
{
633636
mode=COMPILE_LINK_EXECUTABLE;
634637
echo_file_name=false;
635638
wrote_object=false;
636639
working_directory=get_current_working_directory();
640+
641+
if(cmdline.isset("export-function-local-symbols"))
642+
warning() << "The `--export-function-local-symbols` flag is deprecated. "
643+
"Please use `--export-file-local-symbols` instead."
644+
<< eom;
637645
}
638646

639647
/// cleans up temporary files

src/goto-cc/gcc_cmdline.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const char *goto_cc_options_without_argument[]=
5252
"--partial-inlining",
5353
"--validate-goto-model",
5454
"-?",
55-
"--export-function-local-symbols",
55+
"--export-file-local-symbols",
5656
nullptr
5757
};
5858

src/goto-cc/ms_cl_cmdline.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const char *non_ms_cl_options[]=
4646
"--verbosity",
4747
"--function",
4848
"--validate-goto-model",
49-
"--export-function-local-symbols",
49+
"--export-file-local-symbols",
5050
"--mangle-suffix",
5151
nullptr
5252
};

0 commit comments

Comments
 (0)