[LLVMdev] [RFC] Exhaustive bitcode compatibility tests for IR features

Rafael EspĂ­ndola rafael.espindola at gmail.com
Mon Oct 6 22:33:35 PDT 2014


On 2 October 2014 12:05, Sergei Larin <slarin at codeaurora.org> wrote:
>
> Hi Rafael,
>
>   I have a quick question for you. First of all I am not very familiar with this code, so....
>
>
> Before this change:
>
> [llvm] r212349 - Implement LTOModule on top of IRObjectFile
> http://comments.gmane.org/gmane.comp.compilers.llvm.cvs/195450
>
>
> LTOModule::parseSymbols used to explicitly add global aliases as defined symbols:
>
>   // add aliases
>  for (const auto &Alias : IRFile->aliases())
>     addDefinedDataSymbol(Alias);
>
> After your patch I do not seem to see an explicit handling of aliases... I would naively expect something like this:
>
> for (auto &Sym : IRFile->symbols()) {
> .....
>     if (isa<GlobalVariable>(GV)) {
>       addDefinedDataSymbol(Sym);
>       continue;
>     }
>
>     if (isa<GlobalAlias>(GV)) {
>       addDefinedDataSymbol(Sym);
>       continue;
>     }

It looks almost like that:

557 if (F) {
558 addDefinedFunctionSymbol(Sym);
559 continue;
560 }
561
562 if (isa<GlobalVariable>(GV)) {
563 addDefinedDataSymbol(Sym);
564 continue;
565 }
566
567 assert(isa<GlobalAlias>(GV));
568 addDefinedDataSymbol(Sym);

Cheers,
Rafael



More information about the llvm-dev mailing list