Tom Stellard via llvm-dev
2016-Oct-07 15:37 UTC
[llvm-dev] Is extern_weak a legal linkage for function definitions?
Hi, The LLVM language reference doesn't say that extern_weak is illegal for function definitions, but it seems this restriction is enforced in the code in some places: https://github.com/llvm-mirror/llvm/blob/master/lib/AsmParser/LLParser.cpp#L4591 https://github.com/llvm-mirror/llvm/blob/master/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#L327 However it is possible to create a bitcode file where a function definition has extern_weak linkage. Are these restrictions in the code wrong, or do we just need to update the language reference? -Tom
Rafael EspĂndola via llvm-dev
2016-Oct-07 17:47 UTC
[llvm-dev] Is extern_weak a legal linkage for function definitions?
I don't think it should be valid. What are the semantics you would expect an extern_weak definition to have? Cheers, Rafael On 7 October 2016 at 11:37, Tom Stellard via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Hi, > > The LLVM language reference doesn't say that extern_weak is illegal for > function definitions, but it seems this restriction is enforced in the > code in some places: > > https://github.com/llvm-mirror/llvm/blob/master/lib/AsmParser/LLParser.cpp#L4591 > https://github.com/llvm-mirror/llvm/blob/master/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#L327 > > > However it is possible to create a bitcode file where a function > definition has extern_weak linkage. Are these restrictions in > the code wrong, or do we just need to update the language reference? > > -Tom > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Tom Stellard via llvm-dev
2016-Oct-07 20:04 UTC
[llvm-dev] Is extern_weak a legal linkage for function definitions?
On Fri, Oct 07, 2016 at 01:47:12PM -0400, Rafael EspĂndola wrote:> I don't think it should be valid. What are the semantics you would > expect an extern_weak definition to have? >I'm not sure. I just have a test case that uses extern_weak, which crashes the backend, and I'm trying to figure out if the bug is in the backend or in the test. -Tom> Cheers, > Rafael > > > On 7 October 2016 at 11:37, Tom Stellard via llvm-dev > <llvm-dev at lists.llvm.org> wrote: > > Hi, > > > > The LLVM language reference doesn't say that extern_weak is illegal for > > function definitions, but it seems this restriction is enforced in the > > code in some places: > > > > https://github.com/llvm-mirror/llvm/blob/master/lib/AsmParser/LLParser.cpp#L4591 > > https://github.com/llvm-mirror/llvm/blob/master/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#L327 > > > > > > However it is possible to create a bitcode file where a function > > definition has extern_weak linkage. Are these restrictions in > > the code wrong, or do we just need to update the language reference? > > > > -Tom > > _______________________________________________ > > LLVM Developers mailing list > > llvm-dev at lists.llvm.org > > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev