1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/lib/IR
Adrian Prantl b613a7a943 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
..
AbstractCallSite.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
AsmWriter.cpp Add LLVM IR debug info support for Fortran COMMON blocks 2019-04-08 19:13:55 +00:00
AttributeImpl.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Attributes.cpp IR: Add immarg attribute 2019-03-12 21:02:54 +00:00
AttributesCompatFunc.td
AutoUpgrade.cpp [AArch64] Split the neon.addp intrinsic into integer and fp variants. 2019-03-21 22:31:37 +00:00
BasicBlock.cpp Revert "[INLINER] allow inlining of address taken blocks" 2019-02-14 23:42:21 +00:00
CMakeLists.txt Reland "[Remarks] Refactor remark diagnostic emission in a RemarkStreamer" 2019-03-06 15:20:13 +00:00
Comdat.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ConstantFold.cpp [IR][ARM] Add function pointer alignment to datalayout 2019-03-08 10:44:06 +00:00
ConstantFold.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ConstantRange.cpp [ConstantRange] Delete redundnt {z,s}extOrSelf for multiplication 2019-04-08 07:29:24 +00:00
Constants.cpp Change some StringRef::data() reinterpret_cast to bytes_begin() or arrayRefFromStringRef() 2019-04-07 03:58:42 +00:00
ConstantsContext.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Core.cpp [LLVM-C] Add bindings to insert basic blocks 2019-04-05 20:32:43 +00:00
DataLayout.cpp [IR][ARM] Add function pointer alignment to datalayout 2019-03-08 10:44:06 +00:00
DebugInfo.cpp [LLVM-C] Add bindings to create enumerators 2019-02-17 21:25:47 +00:00
DebugInfoMetadata.cpp Add LLVM IR debug info support for Fortran COMMON blocks 2019-04-08 19:13:55 +00:00
DebugLoc.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DiagnosticHandler.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DiagnosticInfo.cpp Revert "[Remarks] Refactor remark diagnostic emission in a RemarkStreamer" 2019-03-06 14:52:37 +00:00
DiagnosticPrinter.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
DIBuilder.cpp Add LLVM IR debug info support for Fortran COMMON blocks 2019-04-08 19:13:55 +00:00
Dominators.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Function.cpp [opaque pointer types] Add a FunctionCallee wrapper type, and use it. 2019-02-01 02:28:03 +00:00
Globals.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
GVMaterializer.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InlineAsm.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Instruction.cpp Implementation of asm-goto support in LLVM 2019-02-08 20:48:56 +00:00
Instructions.cpp [InstCombine] canonicalize select shuffles by commuting 2019-03-31 15:01:30 +00:00
IntrinsicInst.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IRBuilder.cpp [opaque pointer types] Pass function types to InvokeInst creation. 2019-02-01 20:43:34 +00:00
IRPrintingPasses.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LegacyPassManager.cpp Adds -ftime-trace option to clang that produces Chrome chrome://tracing compatible JSON profiling output dumps. 2019-03-30 08:42:48 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LLVMContext.cpp Reland "[Remarks] Refactor remark diagnostic emission in a RemarkStreamer" 2019-03-06 15:20:13 +00:00
LLVMContextImpl.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LLVMContextImpl.h Add LLVM IR debug info support for Fortran COMMON blocks 2019-04-08 19:13:55 +00:00
Mangler.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MDBuilder.cpp [NFC] Fix unused variable warnings in Release builds 2019-01-19 09:39:57 +00:00
Metadata.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MetadataImpl.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Module.cpp [PGO] Context sensitive PGO (part 2) 2019-02-28 19:55:07 +00:00
ModuleSummaryIndex.cpp [ThinLTO] Restructure AliasSummary to contain ValueInfo of Aliasee 2019-03-15 15:11:38 +00:00
Operator.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
OptBisect.cpp Fix IR/Analysis layering issue with OptBisect 2019-02-28 04:00:55 +00:00
Pass.cpp [IR] Refactor attribute methods in Function class (NFC) 2019-04-04 22:40:06 +00:00
PassInstrumentation.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PassManager.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PassRegistry.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
PassTimingInfo.cpp [Legacy][TimePasses] allow -time-passes reporting into a custom stream 2019-03-22 23:11:08 +00:00
ProfileSummary.cpp [PGO] Context sensitive PGO (part 2) 2019-02-28 19:55:07 +00:00
RemarkStreamer.cpp Reland "[Remarks] Add -foptimization-record-passes to filter remark emission" 2019-03-12 21:22:27 +00:00
SafepointIRVerifier.cpp SafepointIRVerifier port to new Pass Manager 2019-03-31 10:15:39 +00:00
Statepoint.cpp [CallSite removal] Migrate the statepoint GC infrastructure to use the 2019-02-11 07:42:30 +00:00
SymbolTableListTraitsImpl.h [ADT] Notify ilist traits about in-list transfers 2019-01-23 22:59:52 +00:00
Type.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
TypeFinder.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Use.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
User.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Value.cpp [IR][ARM] Add function pointer alignment to datalayout 2019-03-08 10:44:06 +00:00
ValueSymbolTable.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Verifier.cpp Add LLVM IR debug info support for Fortran COMMON blocks 2019-04-08 19:13:55 +00:00