Go to file
Adrian Prantl 6ed5706a2b Add LLVM IR debug info support for Fortran COMMON blocks
COMMON blocks are a feature of Fortran that has no direct analog in C languages, but they are similar to data sections in assembly language programming. A COMMON block is a named area of memory that holds a collection of variables. Fortran subprograms may map the COMMON block memory area to their own, possibly distinct, non-empty list of variables. A Fortran COMMON block might look like the following example.

    COMMON /ALPHA/ I, J

    For this construct, the compiler generates a new scope-like DI construct (!DICommonBlock) into which variables (see I, J above) can be placed. As the common block implies a range of storage with global lifetime, the !DICommonBlock refers to a !DIGlobalVariable. The Fortran variable that comprise the COMMON block are also linked via metadata to offsets within the global variable that stands for the entire common block.

    @alpha_ = common global %alphabytes_ zeroinitializer, align 64, !dbg !27, !dbg !30, !dbg !33
    !14 = distinct !DISubprogram(…)
    !20 = distinct !DICommonBlock(scope: !14, declaration: !25, name: "alpha")
    !25 = distinct !DIGlobalVariable(scope: !20, name: "common alpha", type: !24)
    !27 = !DIGlobalVariableExpression(var: !25, expr: !DIExpression())
    !29 = distinct !DIGlobalVariable(scope: !20, name: "i", file: !3, type: !28)
    !30 = !DIGlobalVariableExpression(var: !29, expr: !DIExpression())
    !31 = distinct !DIGlobalVariable(scope: !20, name: "j", file: !3, type: !28)
    !32 = !DIExpression(DW_OP_plus_uconst, 4)
    !33 = !DIGlobalVariableExpression(var: !31, expr: !32)

    The DWARF generated for this is as follows.

    DW_TAG_common_block:
    DW_AT_name: alpha
    DW_AT_location: @alpha_+0
    DW_TAG_variable:
    DW_AT_name: common alpha
    DW_AT_type: array of 8 bytes
    DW_AT_location: @alpha_+0
    DW_TAG_variable:
    DW_AT_name: i
    DW_AT_type: integer*4
    DW_AT_location: @Alpha+0
    DW_TAG_variable:
    DW_AT_name: j
    DW_AT_type: integer*4
    DW_AT_location: @Alpha+4

Patch by Eric Schweitz!

Differential Revision: https://reviews.llvm.org/D54327

llvm-svn: 357934
2019-04-08 19:13:55 +00:00
clang [OPENMP] Sync __kmpc_alloc/_kmpc_free function with the runtime. 2019-04-08 19:06:42 +00:00
clang-tools-extra [clangd] Add fallback mode for code completion when compile command or preamble is not ready. 2019-04-08 14:53:16 +00:00
compiler-rt [Sanitizer] Make wcrtomb test posix-only 2019-04-08 09:13:13 +00:00
debuginfo-tests Set config.lit_tools_dir, which is needed by lit.llvm.initialize. 2018-11-06 21:54:27 +00:00
libclc travis: Add LLVM-8 build 2019-03-27 21:28:31 +00:00
libcxx [libc++][CMake] Make sure the benchmarks link against libc++abi 2019-04-05 21:05:32 +00:00
libcxxabi Fix PR41395 - __cxa_vec_new may overflow in allocation size calculation. 2019-04-05 20:38:43 +00:00
libunwind Move the alias definition of unw_getcontext to within !defined(__USING_SJLJ_EXCEPTIONS__) 2019-04-04 17:50:14 +00:00
lld ELF: Move verneed tracking data structures out of VersionNeedSection. 2019-04-08 17:48:05 +00:00
lldb MinidumpParser: parse SystemInfo stream via llvm 2019-04-08 09:53:03 +00:00
llgo IR: Support parsing numeric block ids, and emit them in textual output. 2019-03-22 18:27:13 +00:00
llvm Add LLVM IR debug info support for Fortran COMMON blocks 2019-04-08 19:13:55 +00:00
openmp [OpenMP] Implement 5.0 memory management 2019-04-08 17:59:28 +00:00
parallel-libs Fix typos throughout the license files that somehow I and my reviewers 2019-01-21 09:52:34 +00:00
polly Apply include-what-you-use #include removal suggestions. NFC. 2019-03-28 20:19:49 +00:00
pstl [pstl] Improve the parallel version of std::equal 2019-04-03 17:34:57 +00:00
.arcconfig Update monorepo .arcconfig with new project callsign. 2019-01-31 14:34:59 +00:00
.clang-format Add .clang-tidy and .clang-format files to the toplevel of the 2019-01-29 16:43:16 +00:00
.clang-tidy Disable tidy checks with too many hits 2019-02-01 11:20:13 +00:00
README.md

README.md

The LLVM Compiler Infrastructure

This directory and its subdirectories contain source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and runtime environments.