Add unnamed_addr when we can show that address of a global is not used.
[oota-llvm.git] / lib / VMCore / Verifier.cpp
index 2b87619038cd34b475127a6ae1c48fc24fe17415..58ec6fe88d355881cc5b791880ed4b5d09aaa238 100644 (file)
@@ -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());