Skip to content

LLVM笔记(2):LLVM的语言(中)

(本文是 http://llvm.org/releases/2.9/docs/LangRef.html 的阅读笔记,前作为《LLVM笔记(1):LLVM的语言(上)》。)

  • Type System
    • Type Classifications
      • integer: i1, i2, i3, … i8, … i16, … i32, … i64
      • floating point: float, double, x86_fp80, fp128, ppc_fp128
      • first class: integer, floating point, pointer, vector, structure, array, label, metadata.
      • primitive: label, void, integer, floating point, x86mmx, metadata.
      • derived: array, function, pointer, structure, packed structure, vector, opaque.
    • Array type
      • [<# elements> x <elementtype>]
    • Function Type
      • <returntype> (<parameter list>)
    • Structure Type
      • { <type list> }
    • Packed Structure Type
      • < { <type list> } >
    • Pointer Type
      • <type> *
    • Vector Type
      • < <# elements> x <elementtype> >
    • Opaque Type: represents unknown type
    • Type Up-references
      • needed by the asmprinter for printing out cyclic types
  • Constants
    • Simple Constants
      • Boolean(true, false)
      • Integer(e.g. 42)
      • Floating point(3.14 or 6.02E+23 or double 0x432ff973cafa8000 (IEEE))
      • Null pointer (null)
    • Complex Constants
      • Structure constants
        • { i32 4, float 17.0, i32* @G }
        • @G = external global i32
      • Array constants
        • [ i32 42, i32 11, i32 74 ]
      • Vector constants
        • [ i32 42, i32 11, i32 74 ]
      • Zero initialization
        • zeroinitializer
      • Metadata node
        • metadata !{ i32 0, metadata !”test” }
    • Global Variable and Function Addresses
    • Undefined Values
      • The string ‘undef’ can be used anywhere a constant is expected, and indicates that the user of the value may receive an unspecified bit-pattern.
    • Trap Values
    • Addresses of Basic Blocks
      • blockaddress(@function, %block)
    • Constant Expressions
      • trunc, zext, sext, fptrunc, fpext, fptoui, fptosi, uitofp, sitofp, ptrtoint, inttoptr, bitcast
      • getelementptr, select, icmp, fcmp, extractelement, insertelement, shufflevector, extractvalue, insertvalue
      • OPCODE
  • Other Values
    • Inline Assembler Expressions
      • Inline Asm Metadata
      • Metadata Nodes and Metadata Strings
  • Intrinsic Global Variables
    • The ‘llvm.used’ Global Variable
      • The @llvm.used global is an array with i8* element type which has appending linkage.
    • The ‘llvm.compiler.used’ Global Variable
    • The ‘llvm.global_ctors’ Global Variable
    • The ‘llvm.global_dtors’ Global Variable

One Trackback/Pingback

  1. [...] (本文是 http://llvm.org/releases/2.9/docs/LangRef.html 的阅读笔记,前作为《LLVM笔记(2):LLVM的语言(中)》。) [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*