Index: include/llvm/LTO/LTO.h =================================================================== --- include/llvm/LTO/LTO.h +++ include/llvm/LTO/LTO.h @@ -145,6 +145,17 @@ skip(); } + /// For symbols that are aliases for other symbols (for example, + /// COFF weak externals), returns the name of the symbol the alias + /// to. For other symbols, returns the empty string. + StringRef getAliasName() const { + auto *A = dyn_cast(I->dyn_cast()); + if (A) + return A->getAliasee()->getName(); + else + return ""; + } + /// Returns the mangled name of the global. StringRef getName() const { return Name; }