[LLVMdev] How to avoid include the same source-file more than once?

Duncan Sands baldrick at free.fr
Fri Mar 9 06:42:50 PST 2012


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




More information about the llvm-dev mailing list