[llvm-commits] [llvm] r70080 - in /llvm/trunk: lib/AsmParser/LLParser.cpp test/Assembler/2009-04-25-AliasGEP.ll

Chris Lattner sabre at nondot.org
Sat Apr 25 14:26:01 PDT 2009


Author: lattner
Date: Sat Apr 25 16:26:00 2009
New Revision: 70080

URL: http://llvm.org/viewvc/llvm-project?rev=70080&view=rev
Log:
testcase and asmparser fix for PR4066

Added:
    llvm/trunk/test/Assembler/2009-04-25-AliasGEP.ll
Modified:
    llvm/trunk/lib/AsmParser/LLParser.cpp

Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=70080&r1=70079&r2=70080&view=diff

==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Sat Apr 25 16:26:00 2009
@@ -357,7 +357,9 @@
 /// ParseAlias:
 ///   ::= GlobalVar '=' OptionalVisibility 'alias' OptionalLinkage Aliasee
 /// Aliasee
-///   ::= TypeAndValue | 'bitcast' '(' TypeAndValue 'to' Type ')'
+///   ::= TypeAndValue
+///   ::= 'bitcast' '(' TypeAndValue 'to' Type ')'
+///   ::= 'getelementptr' '(' ... ')'
 ///
 /// Everything through visibility has already been parsed.
 ///
@@ -379,7 +381,8 @@
   
   Constant *Aliasee;
   LocTy AliaseeLoc = Lex.getLoc();
-  if (Lex.getKind() != lltok::kw_bitcast) {
+  if (Lex.getKind() != lltok::kw_bitcast &&
+      Lex.getKind() != lltok::kw_getelementptr) {
     if (ParseGlobalTypeAndValue(Aliasee)) return true;
   } else {
     // The bitcast dest type is not present, it is implied by the dest type.

Added: llvm/trunk/test/Assembler/2009-04-25-AliasGEP.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Assembler/2009-04-25-AliasGEP.ll?rev=70080&view=auto

==============================================================================
--- llvm/trunk/test/Assembler/2009-04-25-AliasGEP.ll (added)
+++ llvm/trunk/test/Assembler/2009-04-25-AliasGEP.ll Sat Apr 25 16:26:00 2009
@@ -0,0 +1,8 @@
+; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis
+; PR4066
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
+target triple = "i386-apple-darwin9"
+	%struct.i2c_device_id = type { }
+ at w83l785ts_id = internal constant [0 x %struct.i2c_device_id] zeroinitializer, align 1		; <[0 x %struct.i2c_device_id]*> [#uses=1]
+
+ at __mod_i2c_device_table = alias getelementptr ([0 x %struct.i2c_device_id]* @w83l785ts_id, i32 0, i32 0)		; <%struct.i2c_device_id*> [#uses=0]





More information about the llvm-commits mailing list