[PATCH] Change representation of dllexport/dllimport

Stephen Lin swlin at post.harvard.edu
Fri Jul 5 19:49:11 PDT 2013


Hi Nico,

I'm somewhat new to this, so I might be mistaken about how attributes
work, but since this new attribute only has meaningful semantics for
Windows targets, wouldn't it make more sense to use a string-based
target-dependent attribute (as described on
"http://llvm.org/docs/HowToUseAttributes.html"?)

Stephen

On Fri, Jul 5, 2013 at 6:38 PM, Nico Rieck <nico.rieck at gmail.com> wrote:
> Representing dllexport/dllimport as distinct linkage types prevents using these attributes on templates and inline functions.
>
> Instead of introducing further mixed linkage types to include linkonce and weak ODR, the old import/export linkage types are replaced with new function attributes (DLLExport, DLLImport) and an extension to global variables:
>
>       @Exp = global i32 1, align 4, dllexport
>       @Imp = external global i32, dllimport
>
> Linkage for dllexported globals and functions is now equal to their linkage without dllexport. Imported globals and functions must be either declarations, or definitions with AvailableExternallyLinkage. An alias is exported if the aliasee is exported.
>
> http://llvm-reviews.chandlerc.com/D1110
>
> Files:
>   docs/LangRef.rst
>   include/llvm-c/Core.h
>   include/llvm/IR/Attributes.h
>   include/llvm/IR/GlobalValue.h
>   include/llvm/IR/GlobalVariable.h
>   lib/AsmParser/LLParser.cpp
>   lib/Bitcode/Reader/BitcodeReader.cpp
>   lib/Bitcode/Writer/BitcodeWriter.cpp
>   lib/CodeGen/AsmPrinter/AsmPrinter.cpp
>   lib/ExecutionEngine/ExecutionEngine.cpp
>   lib/IR/AsmWriter.cpp
>   lib/IR/Attributes.cpp
>   lib/IR/Core.cpp
>   lib/IR/Globals.cpp
>   lib/IR/Verifier.cpp
>   lib/Linker/LinkModules.cpp
>   lib/Target/CppBackend/CPPBackend.cpp
>   lib/Target/Mangler.cpp
>   lib/Target/X86/X86AsmPrinter.cpp
>   lib/Target/X86/X86FastISel.cpp
>   lib/Target/X86/X86ISelLowering.cpp
>   lib/Target/X86/X86Subtarget.cpp
>   lib/Target/XCore/XCoreAsmPrinter.cpp
>   test/CodeGen/X86/dll-linkage.ll
>   test/CodeGen/X86/dllexport-x86_64.ll
>   test/CodeGen/X86/dllexport.ll
>   test/CodeGen/X86/dllimport-x86_64.ll
>   test/CodeGen/X86/dllimport.ll
>   test/MC/COFF/linker-options.ll
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



More information about the llvm-commits mailing list