Simplify code. No functionality change.

llvm-svn: 203804
This commit is contained in:
Rafael Espindola
2014-03-13 15:47:50 +00:00
parent 574705ed7f
commit 93c7a6532e

View File

@@ -217,13 +217,13 @@ void CodeGenModule::checkAliases() {
StringRef MangledName = getMangledName(GD);
llvm::GlobalValue *Entry = GetGlobalValue(MangledName);
llvm::GlobalAlias *Alias = cast<llvm::GlobalAlias>(Entry);
llvm::GlobalValue *GV = Alias->getAliasedGlobal();
if (GV->isDeclaration()) {
Error = true;
getDiags().Report(AA->getLocation(), diag::err_alias_to_undefined);
} else if (!Alias->resolveAliasedGlobal(/*stopOnWeak*/ false)) {
llvm::GlobalValue *GV = Alias->resolveAliasedGlobal(/*stopOnWeak*/ false);
if (!GV) {
Error = true;
getDiags().Report(AA->getLocation(), diag::err_cyclic_alias);
} else if (GV->isDeclaration()) {
Error = true;
getDiags().Report(AA->getLocation(), diag::err_alias_to_undefined);
}
}
if (!Error)