Take the fast path for any named value and any GlobalValue, which doesn't

need TypePrinting despite being a subclass of Constant. This fixes
compile-time problems especially visible on 403.gcc when -asm-verbose is
enabled.

llvm-svn: 78951
This commit is contained in:
Dan Gohman 2009-08-13 23:07:11 +00:00
parent c2f591b1e6
commit 0809712def
1 changed files with 2 additions and 1 deletions

View File

@ -1233,7 +1233,8 @@ void llvm::WriteAsOperand(raw_ostream &Out, const Value *V,
// Fast path: Don't construct and populate a TypePrinting object if we
// won't be needing any types printed.
if (!PrintType && !isa<Constant>(V)) {
if (!PrintType &&
(!isa<Constant>(V) || V->hasName() || isa<GlobalValue>(V))) {
WriteAsOperandInternal(Out, V, 0, 0);
return;
}