From: Rafael Espindola Date: Mon, 5 May 2014 19:33:09 +0000 (+0000) Subject: Small refactoring, no functionality change. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9ef2e14f4918f6ae1c38cb9cce9eb58753e027d9;p=clang Small refactoring, no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207991 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 785c04cb39..caa4f24899 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -220,6 +220,7 @@ void CodeGenModule::checkAliases() { // that we have to do this in CodeGen, but we only construct mangled names // and aliases during codegen. bool Error = false; + DiagnosticsEngine &Diags = getDiags(); for (std::vector::iterator I = Aliases.begin(), E = Aliases.end(); I != E; ++I) { const GlobalDecl &GD = *I; @@ -231,10 +232,10 @@ void CodeGenModule::checkAliases() { llvm::GlobalValue *GV = Alias->getAliasedGlobal(); if (!GV) { Error = true; - getDiags().Report(AA->getLocation(), diag::err_cyclic_alias); + Diags.Report(AA->getLocation(), diag::err_cyclic_alias); } else if (GV->isDeclaration()) { Error = true; - getDiags().Report(AA->getLocation(), diag::err_alias_to_undefined); + Diags.Report(AA->getLocation(), diag::err_alias_to_undefined); } // We have to handle alias to weak aliases in here. LLVM itself disallows @@ -254,7 +255,7 @@ void CodeGenModule::checkAliases() { } if (auto GA = dyn_cast(AliaseeGV)) { if (GA->mayBeOverridden()) { - getDiags().Report(AA->getLocation(), diag::warn_alias_to_weak_alias) + Diags.Report(AA->getLocation(), diag::warn_alias_to_weak_alias) << GA->getAliasedGlobal()->getName() << GA->getName(); Aliasee = llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast( GA->getAliasee(), Alias->getType());