[PATCH] D134784: [IR] Don't allow DLL storage-class and local linkage

ben via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 20:11:02 PDT 2022


bd1976llvm created this revision.
bd1976llvm added reviewers: MaskRay, mstorsjo, rnk, mati865.
Herald added subscribers: StephenFan, jdoerfert, hiraditya.
Herald added a project: All.
bd1976llvm requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Disallow this meaningless combination. Doing so simplifies analysis of LLVM code w.r.t t DLL storage-class, and prevents mistakes with DLL storage class.

- Change the assembler to reject DLL storage class on symbols with local linkage.
- Change the bitcode reader to clear the DLL Storage class when the linkage is local for auto-upgrading
- Update LangRef.

There is an existing restriction on non-default visibility and local linkage which this is modelled on.


https://reviews.llvm.org/D134784

Files:
  clang/lib/CodeGen/CodeGenModule.cpp
  llvm/docs/LangRef.rst
  llvm/include/llvm/IR/GlobalValue.h
  llvm/lib/AsmParser/LLParser.cpp
  llvm/lib/Bitcode/Reader/BitcodeReader.cpp
  llvm/test/Assembler/internal-dllexport-alias.ll
  llvm/test/Assembler/internal-dllexport-function.ll
  llvm/test/Assembler/internal-dllexport-variable.ll
  llvm/test/Assembler/internal-dllimport-function.ll
  llvm/test/Assembler/private-dllexport-alias.ll
  llvm/test/Assembler/private-dllexport-function.ll
  llvm/test/Assembler/private-dllexport-variable.ll
  llvm/test/Transforms/GlobalOpt/alias-used-section.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134784.463402.patch
Type: text/x-patch
Size: 10285 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220928/ccd04fa4/attachment.bin>


More information about the llvm-commits mailing list