Aliasing chains cleanups: update langref, add check into verifier
authorAnton Korobeynikov <asl@math.spbu.ru>
Sat, 22 Mar 2008 08:36:14 +0000 (08:36 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Sat, 22 Mar 2008 08:36:14 +0000 (08:36 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48685 91177308-0d34-0410-b5e6-96231b3b80d8

docs/LangRef.html
lib/VMCore/Verifier.cpp

index 41128c3b23a2df67994ee0410c8602ddc082e320..096acf294a98a8e3916c5ee3f3423bb528028dd2 100644 (file)
@@ -763,8 +763,8 @@ a power of 2.</p>
 </div>
 <div class="doc_text">
   <p>Aliases act as "second name" for the aliasee value (which can be either
-  function or global variable or bitcast of global value). Aliases may have an
-  optional <a href="#linkage">linkage type</a>, and an
+  function, global variable, another alias or bitcast of global value). Aliases
+  may have an optional <a href="#linkage">linkage type</a>, and an
   optional <a href="#visibility">visibility style</a>.</p>
 
   <h5>Syntax:</h5>
index 6126253bfb9c1adb8821f17de8e890ca60ae5357..f6bc4b9db0d018dcf45cfa16e2543856405e5206 100644 (file)
@@ -377,7 +377,12 @@ void Verifier::visitGlobalAlias(GlobalAlias &GA) {
             "Aliasee should be either GlobalValue or bitcast of GlobalValue",
             &GA);
   }
-  
+
+  const GlobalValue* Aliasee = GA.resolveAliasedGlobal();
+  Assert1(Aliasee,
+          "Aliasing chain should end with global function or global variable",
+          &GA);
+
   visitGlobalValue(GA);
 }