Support `#pragma comment(lib, "name")` in the frontend for ELF
authorSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 7 Feb 2018 01:46:46 +0000 (01:46 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 7 Feb 2018 01:46:46 +0000 (01:46 +0000)
commitfd4db5331e512d23d2d1c832065acbe226e7616d
treef82cc74b81c57e0ea53130d3e4891725d5e667bc
parentfd443e9b6cd0559f2dd6e51ae40eb54542fccbf0
Support `#pragma comment(lib, "name")` in the frontend for ELF

This adds the frontend support required to support the use of the
comment pragma to enable auto linking on ELFish targets. This is a
generic ELF extension supported by LLVM. We need to change the handling
for the "dependentlib" in order to accommodate the previously discussed
encoding for the dependent library descriptor. Without the custom
handling of the PCK_Lib directive, the -l prefixed option would be
encoded into the resulting object (which is treated as a frontend
error).

llvm-svn: 324438
clang/docs/LanguageExtensions.rst
clang/lib/CodeGen/CodeGenModule.cpp
clang/lib/CodeGen/CodeGenModule.h
clang/lib/Parse/ParsePragma.cpp
clang/test/CodeGen/elf-linker-options.c [new file with mode: 0644]
clang/test/CodeGen/pragma-comment.c
clang/test/Preprocessor/pragma-comment-linux.c [new file with mode: 0644]
clang/test/Preprocessor/pragma_microsoft.c