-qdataimported, -qdatalocal, -qtocdata

Pragma equivalent

None.

Purpose

Marks data as local or imported.

Local variables are statically bound with the functions that use them. You can use the -qdatalocal option to name variables that the compiler can assume to be local. Alternatively, you can use the -qtocdata option to instruct the compiler to assume all variables to be local.

Imported variables are dynamically bound with a shared portion of a library. You can use the -qdataimported option to name variables that the compiler can assume to be imported. Alternatively, you can use the -qnotocdata option to instruct the compiler to assume all variables to be imported.

Syntax

Read syntax diagramSkip visual syntax diagram
          .-notocdata----------------------------------.     
          | .-dataimported-.                           |     
>>- -q--+-+-+--------------+--+----------------------+-+-+-----><
        |                     |    .-:-------------. |   |   
        |                     |    V               | |   |   
        |                     '-=----variable_name-+-'   |   
        '-+-tocdata-----------------------------+--------'   
          '-datalocal--+----------------------+-'            
                       |    .-:-------------. |              
                       |    V               | |              
                       '-=----variable_name-+-'              

Defaults

-qdataimported or -qnotocdata: The compiler assumes all variables are imported.

Parameters

variable_name
The name of a variable that the compiler should assume to be local or imported (depending on the option specified).

C++ only Names must be specified using their mangled names. To obtain C++ mangled names, compile your source to object files only, using the -c compiler option, and use the nm operating system command on the resulting object file.

Specifying -qdataimported without any variable_name is equivalent to -qnotocdata: all variables are assumed to be imported. Specifying -qdatalocal without any variable_name is equivalent to -qtocdata: all variables are assumed to be local.

Usage

If any variables that are marked as local are actually imported, incorrect code may be generated and performance may decrease.

If you specify any of these options with no variables, the last option specified is used. If you specify the same variable name on more than one option specification, the last one is used.

Predefined macros

None.



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us