View source code
Display the source code in dmd/backend/cgobj.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Module dmd.backend.cgobj

Compiler implementation of the D programming language.

Functions

NameDescription
getindex(p) Read index.
getsegment() Allocate a new segment. Return index for the new segment.
instypidx(p, index) Insert a type index number.
objrecord(rectyp, record) Output an object file data record.
OmfObj_alias(n1, n2) Output an alias definition record.
OmfObj_allowZeroSize() Do we allow zero sized objects?
OmfObj_byte(seg, offset, _byte) Output byte to object file.
OmfObj_bytes(seg, offset, nbytes, p) Output bytes to object file.
OmfObj_codeseg(name, suffix) Define a new code segment.
OmfObj_comdatsize(s, symsize) Setup for Symbol s to go into a COMDAT segment. Output (if s is a function): cseg segment index of new current code segment Coffset starting offset in cseg
OmfObj_compiler(p) Embed compiler version in .obj file.
OmfObj_data_readonly(p, len, pseg) Ouput read only data for data.
OmfObj_data_start(sdata, datasize, seg) Update data information about symbol align for output and assign segment if not already specified.
OmfObj_dosseg() Output DOSSEG coment record.
OmfObj_ehtables(sfunc, size, ehsym) Stuff pointer to function in its own segment. Used for static ctor and dtor lists.
OmfObj_exestr(p) Embed string in executable.
OmfObj_export_symbol(s, argsize) Export a function name.
OmfObj_external(s) Output an external definition.
OmfObj_far16thunk(s) Generate far16 thunk.
OmfObj_fardata(name, size, poffset) Define a far data segment.
OmfObj_fltused() Mark object file as using floating point.
OmfObj_func_term(sfunc) Update function info after codgen
OmfObj_import(e) Convert reference to imported name.
OmfObj_includelib(name) Output library name.
OmfObj_init(objbuf, filename, csegname) Perform initialization that applies to all .obj output files.
OmfObj_initfile(filename, csegname, modname) Initialize the start of object output for this particular .obj file.
OmfObj_jmpTableSegment(s)
OmfObj_ledata(seg, offset, data, lcfd, idx1, idx2) Output word of data. (Two words if segment:offset pair.)
OmfObj_lidata(seg, offset, count) Output an iterated data block of 0s. (uninitialized data only)
OmfObj_linkerdirective(name) Output linker directive.
OmfObj_linnum(srcpos, seg, offset) Line number support.
OmfObj_lzext(s1, s2) Output a lazy extern record. s1 is the lazy extern, s2 is its default resolution.
OmfObj_mangle(s, dest) Mangle a name.
OmfObj_moduleinfo(scc) Append pointer to ModuleInfo to "FM" segment. The FM segment is bracketed by the empty FMB and FME segments.
OmfObj_reftocodeseg(seg, offset, val) Refer to address that is in the code segment. Only offsets are output, regardless of the memory model. Used to put values in switch address tables.
OmfObj_reftodatseg(seg, offset, val, targetdatum, flags) Refer to address that is in the data segment.
OmfObj_reftofarseg(seg, offset, val, farseg, flags) Refer to address that is in a far segment.
OmfObj_reftoident(seg, offset, s, val, flags) Refer to an identifier.
OmfObj_segment_group(codesize, datasize, cdatasize, udatasize) Output segment and group definitions.
OmfObj_setcodeseg(seg) Reset code seg to existing seg. Used after a COMDAT for a function is done.
OmfObj_setModuleCtorDtor(s, isCtor) Set up function to be called as static constructor on program startup or static destructor on program shutdown.
OmfObj_startaddress(s) Set start address
OmfObj_staticctor(s, dtor, seg) Symbol is the function that calls the static constructors. Put a pointer to it into a special segment that the startup code looks at.
OmfObj_string_literal_segment(sz) Get segment for readonly string literals. The linker will pool strings in this section.
OmfObj_sym_cdata(ty, p, len) Output read only data and generate a symbol for it.
OmfObj_term(objfilename) Terminate package.
OmfObj_termfile() Fixup and terminate object file.
OmfObj_theadr(modname) Output module name record.
OmfObj_tlsseg_bss() Define segment for Thread Local Storage.
OmfObj_user(p) Embed string in obj.
OmfObj_wkext(s1, s2) Output a weak extern record. s1 is the weak extern, s2 is its default resolution.
OmfObj_write_byte(pseg, _byte) Append byte to segment.
OmfObj_write_bytes(pseg, a) Append bytes to segment.
OmfObj_write_long(seg, offset, data, lcfd, idx1, idx2) Output long word of data.
OmfObj_write_pointerRef(s, soff) write a reference to a mutable pointer into the object file
OmfObj_write_zeros(pseg, count) Append an iterated data block of 0s. (uninitialized data only)
SEG_ATTR(A, C, B, P) For defining segments.
storelength(length, i) Output a common block definition.

Structs

NameDescription
FIXUP Fixup list.
Linnum Line number support.
Objstate State of object file.
PtrRef

Manifest constants

NameTypeDescription
CODECLASS Output header stuff for object files.
LEDATAMAX Ledata records

Authors

Walter Bright

License

Boost License 1.0