geovanisouza92 at gmail.com
2012-Mar-09 14:14 UTC
[LLVMdev] How to avoid include the same source-file more than once?
How can I avoid include the same source-file more than once or the different files with the same content, when all files will be merged in only one binary file? Let me clear this: In my programming language project, two classes with the same names will be merged, not generating a semantic error or whatever. Isn't a bug, is a feature. :o) E.g. ## file1.arc include "base.arc" ## file2.arc include "base.arc" I don't want use C/C++-like style guard or similar. I think about an list of complete path of each file inside the compiler, or an checksum, generated over the bytes of file, like git index does. -- @geovanisouza92 - Geovani de Souza -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120309/28e629aa/attachment.html>
Duncan Sands
2012-Mar-09 14:42 UTC
[LLVMdev] How to avoid include the same source-file more than once?
Hi, On 09/03/12 15:14, geovanisouza92 at gmail.com wrote:> How can I avoid include the same source-file more than once or the different > files with the same content, when all files will be merged in only one binary file? > > Let me clear this: In my programming language project, two classes with the same > names will be merged, not generating a semantic error or whatever. Isn't a bug, > is a feature. :o)it sounds like you are looking for weak linkage (there are several kinds of weak linkage, see http://llvm.org/docs/LangRef.html#linkage). Ciao, Duncan.> > E.g. > > ## file1.arc > include "base.arc" > > ## file2.arc > include "base.arc" > > I don't want use C/C++-like style guard or similar. > I think about an list of complete path of each file inside the compiler, or an > checksum, generated over the bytes of file, like git index does. > > -- > @geovanisouza92 - Geovani de Souza > > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev