Rarrum via llvm-dev
2020-May-25 19:16 UTC
[llvm-dev] Implications of Module SourceFileName
In the language I'm working on, a module (which does have a user-defined name in source) may be comprised of several files. I'm considering passing the (user-defined) name to llvm::Module's setModuleIdentifier, then a semicolon separated list of file names to setSourceFileName. Is this going to cause unforeseen problems? https://releases.llvm.org/10.0.0/docs/LangRef.html#source-filename seems to imply that it only needs to be a "consistent unique global identifier", but then also shows a unix-style path as the syntax. I don't see anything crazy being done with it from a quick source of llvm's source. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200525/f9657576/attachment-0001.html>
Adrian McCarthy via llvm-dev
2020-May-26 18:37 UTC
[llvm-dev] Implications of Module SourceFileName
Module is one of those overloaded terms that means different things in different contexts. I'm not sure how module file names are propagated into the debug info. You might want to check in with the lldb folks, too, to see if a list of file names like that will hinder the debugger. On Mon, May 25, 2020 at 3:23 PM Rarrum via llvm-dev <llvm-dev at lists.llvm.org> wrote:> In the language I'm working on, a module (which does have a user-defined > name in source) may be comprised of several files. I'm considering passing > the (user-defined) name to llvm::Module's setModuleIdentifier, then a > semicolon separated list of file names to setSourceFileName. Is this going > to cause unforeseen problems? > > https://releases.llvm.org/10.0.0/docs/LangRef.html#source-filename seems > to imply that it only needs to be a "consistent unique global identifier", > but then also shows a unix-style path as the syntax. I don't see anything > crazy being done with it from a quick source of llvm's source. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200526/47b9ec81/attachment.html>
David Blaikie via llvm-dev
2020-May-26 18:41 UTC
[llvm-dev] Implications of Module SourceFileName
Does your source language's concept of Module have to/have any bearing on the llvm concept of a Module? (ie: do all the source files need to be compiled in one go/together into one file? C++'s concept of a module doesn't have this, for instance... I /think/ at least that each fragment of a module can be compiled separately - which is good for build parallelism, etc) On Mon, May 25, 2020 at 3:23 PM Rarrum via llvm-dev <llvm-dev at lists.llvm.org> wrote:> In the language I'm working on, a module (which does have a user-defined > name in source) may be comprised of several files. I'm considering passing > the (user-defined) name to llvm::Module's setModuleIdentifier, then a > semicolon separated list of file names to setSourceFileName. Is this going > to cause unforeseen problems? > > https://releases.llvm.org/10.0.0/docs/LangRef.html#source-filename seems > to imply that it only needs to be a "consistent unique global identifier", > but then also shows a unix-style path as the syntax. I don't see anything > crazy being done with it from a quick source of llvm's source. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200526/a8ce3108/attachment.html>
Rarrum via llvm-dev
2020-May-26 19:14 UTC
[llvm-dev] Implications of Module SourceFileName
There's currently a 1-1 mapping between my language's concept of a module and an llvm module. This language doesn't have a concept of forward declarations or header files. One of the early steps of the compiler is to search across all of the module files and figure out what types are available, so that we can resolve them later without depending on declaration order. This does mean that all of the files that make up a language module do need to be compiled together. The end result is an llvm module where almost everything has internal linkage, except for a few things that are specifically defined to be exported. On Tue, May 26, 2020 at 11:42 AM David Blaikie <dblaikie at gmail.com> wrote:> Does your source language's concept of Module have to/have any bearing on > the llvm concept of a Module? (ie: do all the source files need to be > compiled in one go/together into one file? C++'s concept of a module > doesn't have this, for instance... I /think/ at least that each fragment of > a module can be compiled separately - which is good for build parallelism, > etc) > > On Mon, May 25, 2020 at 3:23 PM Rarrum via llvm-dev < > llvm-dev at lists.llvm.org> wrote: > >> In the language I'm working on, a module (which does have a user-defined >> name in source) may be comprised of several files. I'm considering passing >> the (user-defined) name to llvm::Module's setModuleIdentifier, then a >> semicolon separated list of file names to setSourceFileName. Is this going >> to cause unforeseen problems? >> >> https://releases.llvm.org/10.0.0/docs/LangRef.html#source-filename seems >> to imply that it only needs to be a "consistent unique global identifier", >> but then also shows a unix-style path as the syntax. I don't see anything >> crazy being done with it from a quick source of llvm's source. >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >> >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200526/05a27b41/attachment.html>