From fd4db5331e512d23d2d1c832065acbe226e7616d Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 7 Feb 2018 01:46:46 +0000 Subject: 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/lib/CodeGen/CodeGenModule.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/CodeGen/CodeGenModule.h') diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 42e9e1b..61b97e6 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -1094,6 +1094,8 @@ public: /// value. void AddDependentLib(StringRef Lib); + void AddELFLibDirective(StringRef Lib); + llvm::GlobalVariable::LinkageTypes getFunctionLinkage(GlobalDecl GD); void setFunctionLinkage(GlobalDecl GD, llvm::Function *F) { -- cgit v1.1