This is an archive of the discontinued LLVM Phabricator instance.

Fail early on unknown appending linkage variables
Needs RevisionPublic

Authored by espindola on May 11 2016, 12:13 PM.

Details

Reviewers
dexonsmith
Summary

In practice only a few well known appending linkage variables work.

Currently if codegen sees an unknown appending linkage variable it will just print it as a regular global. That is wrong as the symbol in the produced object file has different semantics as the one provided by the appending linkage.

This just errors early instead of producing a broken .o.

Diff Detail

Event Timeline

rafael retitled this revision from to Fail early on unknown appending linkage variables.
rafael updated this object.
rafael added a reviewer: dexonsmith.
rafael added a subscriber: llvm-commits.
dexonsmith edited edge metadata.May 12 2016, 3:47 PM
dexonsmith added a subscriber: dexonsmith.

The patch LGTM with an update to LangRef. Has this been discussed on
llvm-dev though? It seems like an IR change, since whether or not the
old behaviour was a good idea, it was certainly tested for...

I'm ok with not silently assuming external linkage types from internal-only ones. This has to either be an explicit transformation during code emission or an error. Also, LangRef change. :)

espindola commandeered this revision.Mar 15 2018, 8:57 AM
espindola added a reviewer: rafael.
dexonsmith requested changes to this revision.Oct 17 2020, 6:06 AM

Marking as needing changes pending the LangRef change (and llvm-dev discussion).

This revision now requires changes to proceed.Oct 17 2020, 6:06 AM
lib/CodeGen/AsmPrinter/AsmPrinter.cpp