diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index beeffeb2e81df7..9784f0c9067c52 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -965,6 +965,12 @@ the COMDAT key's section is the largest: ret void } +In a COFF object file, this will create a COMDAT section with selection kind +``IMAGE_COMDAT_SELECT_LARGEST`` containing the contents of the ``@foo`` symbol +and another COMDAT section with selection kind +``IMAGE_COMDAT_SELECT_ASSOCIATIVE`` which is associated with the first COMDAT +section and contains the contents of the ``@bar`` symbol. + As a syntactic sugar the ``$name`` can be omitted if the name is the same as the global name: @@ -974,12 +980,6 @@ the global name: @foo = global i32 2, comdat @bar = global i32 3, comdat($foo) -In a COFF object file, this will create a COMDAT section with selection kind -``IMAGE_COMDAT_SELECT_LARGEST`` containing the contents of the ``@foo`` symbol -and another COMDAT section with selection kind -``IMAGE_COMDAT_SELECT_ASSOCIATIVE`` which is associated with the first COMDAT -section and contains the contents of the ``@bar`` symbol. - There are some restrictions on the properties of the global object. It, or an alias to it, must have the same name as the COMDAT group when targeting COFF.