Add documentation that explains how to extend clang with new extensions/features.
The guidelines also detail clang's position about the extension pragmas for the new functionality and it is expected the following change to be added first: https://reviews.llvm.org/D97052.
For further clarification around the extension pragma - the most common interpretation of the pragma in clang right now is the diagnostic of the use of types or functions from the extensions:
def err_opencl_requires_extension : Error< "use of %select{type|declaration}0 %1 requires %2 extension to be enabled">;
This forces the developers to use the pragma, but it is not very clear why and it seems to violate the following statement in the spec:
disable - Behave (including issuing errors and warnings) as if the extension extension_name is not part of the language definition.
The diagnostic given indicates that the disabled extension is indeed part of the language.
However, I must admit it doesn't seem that implementing dynamic loading/unloading of the extension functionality implied by the spec would be possible in clang. It is not clear why such flexibility would be needed either - most of the language provide one way of importing/including functionality.
Additionally, many extensions add functionality via the implicitly included headers and for using those no pragmas is required as no diagnostic is given if the pragma is not used.
Based on the above the conclusion is that the functionality provided by clang is neither conformant nor consistent for the user.
Probably easier to keep this section singular (i.e. talk about a adding a single extension), instead of switching between extension and extensions all the time.