diff options
Diffstat (limited to 'lib/VMCore')
-rw-r--r-- | lib/VMCore/AsmWriter.cpp | 3 | ||||
-rw-r--r-- | lib/VMCore/Verifier.cpp | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/lib/VMCore/AsmWriter.cpp b/lib/VMCore/AsmWriter.cpp index 7a1b7dd..3fefbbc 100644 --- a/lib/VMCore/AsmWriter.cpp +++ b/lib/VMCore/AsmWriter.cpp @@ -1459,6 +1459,7 @@ void AssemblyWriter::printGlobal(const GlobalVariable *GV) { if (GV->isThreadLocal()) Out << "thread_local "; if (unsigned AddressSpace = GV->getType()->getAddressSpace()) Out << "addrspace(" << AddressSpace << ") "; + if (GV->hasUnnamedAddr()) Out << "unnamed_addr "; Out << (GV->isConstant() ? "constant " : "global "); TypePrinter.print(GV->getType()->getElementType(), Out); @@ -1589,6 +1590,8 @@ void AssemblyWriter::printFunction(const Function *F) { Attributes RetAttrs = Attrs.getRetAttributes(); if (RetAttrs != Attribute::None) Out << Attribute::getAsString(Attrs.getRetAttributes()) << ' '; + if (F->hasUnnamedAddr()) + Out << "unnamed_addr "; TypePrinter.print(F->getReturnType(), Out); Out << ' '; WriteAsOperandInternal(Out, F, &TypePrinter, &Machine, F->getParent()); diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 2b87619..58ec6fe 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -484,6 +484,7 @@ void Verifier::visitGlobalAlias(GlobalAlias &GA) { "Aliasee cannot be NULL!", &GA); Assert1(GA.getType() == GA.getAliasee()->getType(), "Alias and aliasee types should match!", &GA); + Assert1(!GA.hasUnnamedAddr(), "Alias cannot have unnamed_addr!", &GA); if (!isa<GlobalValue>(GA.getAliasee())) { const ConstantExpr *CE = dyn_cast<ConstantExpr>(GA.getAliasee()); |