diff options
author | Ben Dunbobbin <Ben.Dunbobbin@sony.com> | 2020-11-03 18:54:57 +0000 |
---|---|---|
committer | Ben Dunbobbin <Ben.Dunbobbin@sony.com> | 2020-11-03 19:13:54 +0000 |
commit | 7ad6010f58eac498896e601857ff7eda84466064 (patch) | |
tree | b63333476b6be773da6825de82828cc274610b19 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 6e80318eecde2639faa1e72be045c78b8b8aedad (diff) | |
download | llvm-7ad6010f58eac498896e601857ff7eda84466064.zip llvm-7ad6010f58eac498896e601857ff7eda84466064.tar.gz llvm-7ad6010f58eac498896e601857ff7eda84466064.tar.bz2 |
Fix - [Clang] Add the ability to map DLL storage class to visibility
415f7ee883 had a silly typo introduced when I inlined some
code into a loop from its own function.
Original commit message:
For PlayStation we offer source code compatibility with
Microsoft's dllimport/export annotations; however, our file
format is based on ELF.
To support this we translate from DLL storage class to ELF
visibility at the end of codegen in Clang.
Other toolchains have used similar strategies (e.g. see the
documentation for this ARM toolchain:
https://developer.arm.com/documentation/dui0530/i/migrating-from-rvct-v3-1-to-rvct-v4-0/changes-to-symbol-visibility-between-rvct-v3-1-and-rvct-v4-0)
This patch adds the ability to perform this translation. Options
are provided to support customizing the mapping behaviour.
Differential Revision: https://reviews.llvm.org/D89970
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 1efc39b..24c0675 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -418,7 +418,7 @@ static void setVisibilityFromDLLStorageClass(const clang::LangOptions &LO, for (llvm::GlobalValue &GV : M.global_values()) { if (GV.hasAppendingLinkage() || GV.hasLocalLinkage()) - return; + continue; if (GV.isDeclarationForLinker()) { GV.setVisibility(GV.getDLLStorageClass() == @@ -724,7 +724,7 @@ void CodeGenModule::Release() { EmitBackendOptionsMetadata(getCodeGenOpts()); - // Set visibility from DLL export class + // Set visibility from DLL storage class // We do this at the end of LLVM IR generation; after any operation // that might affect the DLL storage class or the visibility, and // before anything that might act on these. |