Skip to content

Commit a3a7edb

Browse files
committed
Add docs for --export-file-local-symbols
1 parent 8c30146 commit a3a7edb

File tree

5 files changed

+18
-8
lines changed

5 files changed

+18
-8
lines changed

doc/architectural/static-functions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ For performance reasons, it might be desirable to analyze the API
5959
function independently of the static function. We can analyze the API
6060
function by "stubbing out" the static function, replacing it with a
6161
function that does nothing apart from asserting that its inputs satisfy
62-
the function's contract. Add the following to `harness.c`:
62+
the function's contract. ("Stubbing out" a function is sometimes known
63+
as "modelling" or "abstracting it out".) Add the following to
64+
`harness.c`:
6365

6466
\code{.c}
6567
static void private_function(const int *a, int *b)

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)