LoginSignup
1
1

More than 3 years have passed since last update.

clangを使った変数定義の分類

Last updated at Posted at 2020-02-15
$ 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
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1