$ clang --version
clang version 5.0.1-4 (tags/RELEASE_501/final)
clangでは、定義されている変数を以下のように分類できる。
file | function | CODE | Linkage | isStaticLocal | isFileVarDecl | isLocalVarDecl |
---|---|---|---|---|---|---|
header | none | int global_h = 0 | Linkage:6=clang::ExternalLinkage | 0 | 1 | 0 |
header | none | static int static_h = 0 | Linkage:1=clang::InternalLinkage | 0 | 1 | 0 |
header | none | thread_local int thread_h = 9 | Linkage:6=clang::ExternalLinkage | 0 | 1 | 0 |
source | none | extern int ext_global2 | Linkage:6=clang::ExternalLinkage | 0 | 1 | 0 |
source | none | struct _str st_global = {1, &global, global, 0} | Linkage:6=clang::ExternalLinkage | 0 | 1 | 0 |
source | none | union _uni u_global ={0} | Linkage:6=clang::ExternalLinkage | 0 | 1 | 0 |
source | none | static int static_module = 2 | Linkage:1=clang::InternalLinkage | 0 | 1 | 0 |
source | function | int (*func)() = local_func | Linkage:0=clang::NoLinkage | 0 | 0 | 1 |
source | function | int local = TWO | Linkage:0=clang::NoLinkage | 0 | 0 | 1 |
source | function | static int static_var = argc | Linkage:0=clang::NoLinkage | 1 | 0 | 1 |