[llvm-dev] Dead (or untested?) code in the gold plugin

Rafael EspĂ­ndola via llvm-dev llvm-dev at lists.llvm.org
Sun Apr 24 14:51:10 PDT 2016


> ld_plugin_input_file *file,
>        Res.IsLinkonceOdr &= GV->hasLinkOnceLinkage();
>        Res.Visibility = getMinVisibility(Res.Visibility, GV->getVisibility());
>        switch (GV->getVisibility()) {
> -      case GlobalValue::DefaultVisibility:
> -        sym.visibility = LDPV_DEFAULT;
> -        break;

This part is actually dead since we have initialized sym.visibility to
LDPV_DEFAULT just before the switch. I would still keep it just to
have a fully covered switch. Maybe delete just the assignment?

I have added tests for the other code parts.

Thanks,
Rafael


More information about the llvm-dev mailing list