[llvm-commits] [llvm] r133266 - in /llvm/trunk: lib/AsmParser/LLParser.cpp test/CodeGen/X86/2007-10-15-CoalescerCrash.ll test/Feature/paramattrs.ll test/Integer/paramattrs_bt.ll test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll test/Transforms/InstCombine/2007-09-11-Trampoline.ll test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll

Chris Lattner sabre at nondot.org
Fri Jun 17 10:37:13 PDT 2011


Author: lattner
Date: Fri Jun 17 12:37:13 2011
New Revision: 133266

URL: http://llvm.org/viewvc/llvm-project?rev=133266&view=rev
Log:
Stop accepting and ignoring attributes in function types.  Attributes are applied 
to functions and call/invokes, not to types.

Removed:
    llvm/trunk/test/Integer/paramattrs_bt.ll
Modified:
    llvm/trunk/lib/AsmParser/LLParser.cpp
    llvm/trunk/test/CodeGen/X86/2007-10-15-CoalescerCrash.ll
    llvm/trunk/test/Feature/paramattrs.ll
    llvm/trunk/test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll
    llvm/trunk/test/Transforms/InstCombine/2007-09-11-Trampoline.ll
    llvm/trunk/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll

Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=133266&r1=133265&r2=133266&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Fri Jun 17 12:37:13 2011
@@ -1559,22 +1559,16 @@
 
   std::vector<ArgInfo> ArgList;
   bool isVarArg;
-  unsigned Attrs;
-  if (ParseArgumentList(ArgList, isVarArg, true) ||
-      // FIXME: Allow, but ignore attributes on function types!
-      // FIXME: Remove in LLVM 3.0
-      ParseOptionalAttrs(Attrs, 2))
+  if (ParseArgumentList(ArgList, isVarArg, true))
     return true;
 
   // Reject names on the arguments lists.
   for (unsigned i = 0, e = ArgList.size(); i != e; ++i) {
     if (!ArgList[i].Name.empty())
       return Error(ArgList[i].Loc, "argument name invalid in function type");
-    if (!ArgList[i].Attrs != 0) {
-      // Allow but ignore attributes on function types; this permits
-      // auto-upgrade.
-      // FIXME: REJECT ATTRIBUTES ON FUNCTION TYPES in LLVM 3.0
-    }
+    if (ArgList[i].Attrs != 0)
+      return Error(ArgList[i].Loc,
+                   "argument attributes invalid in function type");
   }
 
   std::vector<const Type*> ArgListTy;

Modified: llvm/trunk/test/CodeGen/X86/2007-10-15-CoalescerCrash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/2007-10-15-CoalescerCrash.ll?rev=133266&r1=133265&r2=133266&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/2007-10-15-CoalescerCrash.ll (original)
+++ llvm/trunk/test/CodeGen/X86/2007-10-15-CoalescerCrash.ll Fri Jun 17 12:37:13 2011
@@ -362,7 +362,7 @@
 
 cond_true1169:		; preds = %bb1159
 	%tmp11741175 = trunc i64 %lsum.11225.0 to i32		; <i32> [#uses=1]
-	%tmp1178 = tail call i32 (%struct._IO_FILE* noalias , i8* noalias , ...)* @fprintf( %struct._IO_FILE* noalias %file  , i8* getelementptr ([49 x i8]* @.str32, i32 0, i64 0)  , i32 %tmp11741175, i32 0 )		; <i32> [#uses=0]
+	%tmp1178 = tail call i32 (%struct._IO_FILE*  , i8*  , ...)* @fprintf( %struct._IO_FILE* noalias %file  , i8* getelementptr ([49 x i8]* @.str32, i32 0, i64 0)  , i32 %tmp11741175, i32 0 )		; <i32> [#uses=0]
 	ret void
 
 UnifiedReturnBlock:		; preds = %bb1159

Modified: llvm/trunk/test/Feature/paramattrs.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Feature/paramattrs.ll?rev=133266&r1=133265&r2=133266&view=diff
==============================================================================
--- llvm/trunk/test/Feature/paramattrs.ll (original)
+++ llvm/trunk/test/Feature/paramattrs.ll Fri Jun 17 12:37:13 2011
@@ -2,8 +2,8 @@
 ; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
 ; RUN: diff %t1.ll %t2.ll
 
-%ZFunTy = type i32(i8 zeroext)
-%SFunTy = type i32(i8 signext)
+%ZFunTy = type i32(i8)
+%SFunTy = type i32(i8)
 
 declare signext i16 @"test"(i16 signext %arg)  
 declare zeroext i8 @"test2" (i16 zeroext %a2) 
@@ -14,7 +14,7 @@
 
 define i32 @main(i32 inreg %argc, i8 ** inreg %argv) nounwind {
     %val = trunc i32 %argc to i16
-    %res1 = call signext i16 (i16 signext) *@test(i16 signext %val) 
+    %res1 = call signext i16 (i16 ) *@test(i16 signext %val) 
     %two = add i16 %res1, %res1
     %res2 = call zeroext i8 @test2(i16 zeroext %two )  
     %retVal = sext i16 %two to i32

Removed: llvm/trunk/test/Integer/paramattrs_bt.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Integer/paramattrs_bt.ll?rev=133265&view=auto
==============================================================================
--- llvm/trunk/test/Integer/paramattrs_bt.ll (original)
+++ llvm/trunk/test/Integer/paramattrs_bt.ll (removed)
@@ -1,19 +0,0 @@
-; RUN: llvm-as < %s | llvm-dis > %t1.ll
-; RUN: llvm-as %t1.ll -o - | llvm-dis > %t2.ll
-; RUN: diff %t1.ll %t2.ll
-
-%ZFunTy = type i33(i8 zeroext)
-%SFunTy = type i33(i8 signext)
-
-declare signext i16 @"test"(i16 signext %arg)  
-declare zeroext i8  @"test2" (i16 zeroext %a2)  
-
-
-define i33 @main(i33 %argc, i8 **%argv) {
-    %val = trunc i33 %argc to i16
-    %res = call signext i16 (i16 signext) *@test(i16 signext %val) 
-    %two = add i16 %res, %res
-    %res2 = call zeroext i8 @test2(i16 zeroext %two )  
-    %retVal = sext i16 %two to i33
-    ret i33 %retVal
-}

Modified: llvm/trunk/test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll?rev=133266&r1=133265&r2=133266&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/2007-05-18-CastFoldBug.ll Fri Jun 17 12:37:13 2011
@@ -3,7 +3,7 @@
 
 define void @blah(i16* %tmp10) {
 entry:
-	call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend_stret to void (i16* sret )*)( i16*  sret %tmp10  )
+	call void bitcast (i8* (i8*, i8*, ...)* @objc_msgSend_stret to void (i16*)*)( i16*  sret %tmp10  )
 	ret void
 }
 

Modified: llvm/trunk/test/Transforms/InstCombine/2007-09-11-Trampoline.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2007-09-11-Trampoline.ll?rev=133266&r1=133265&r2=133266&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/2007-09-11-Trampoline.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/2007-09-11-Trampoline.ll Fri Jun 17 12:37:13 2011
@@ -15,7 +15,7 @@
 	%tmp3 = getelementptr %struct.FRAME.nest* %FRAME.0, i32 0, i32 0		; <i32*> [#uses=1]
 	store i32 %n, i32* %tmp3, align 8
 	%FRAME.06 = bitcast %struct.FRAME.nest* %FRAME.0 to i8*		; <i8*> [#uses=1]
-	%tramp = call i8* @llvm.init.trampoline( i8* %TRAMP.216.sub, i8* bitcast (i32 (%struct.FRAME.nest* nest , i32)* @f to i8*), i8* %FRAME.06 )		; <i8*> [#uses=1]
+	%tramp = call i8* @llvm.init.trampoline( i8* %TRAMP.216.sub, i8* bitcast (i32 (%struct.FRAME.nest* , i32)* @f to i8*), i8* %FRAME.06 )		; <i8*> [#uses=1]
 	%tmp7 = getelementptr %struct.FRAME.nest* %FRAME.0, i32 0, i32 1		; <i32 (i32)**> [#uses=1]
 	%tmp89 = bitcast i8* %tramp to i32 (i32)*		; <i32 (i32)*> [#uses=2]
 	store i32 (i32)* %tmp89, i32 (i32)** %tmp7, align 8

Modified: llvm/trunk/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll?rev=133266&r1=133265&r2=133266&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll (original)
+++ llvm/trunk/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll Fri Jun 17 12:37:13 2011
@@ -5,7 +5,7 @@
 
 define i32 @main(i32 %argc, i8** %argv) {
 entry:
-	%tmp32 = tail call i32 (i8* noalias , ...) * bitcast (i32 (i8*, ...) nounwind * @printf to i32 (i8* noalias , ...) nounwind *)( i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0)  , i32 0 ) nounwind 		; <i32> [#uses=0]
+	%tmp32 = tail call i32 (i8*  , ...) * bitcast (i32 (i8*, ...)  * @printf to i32 (i8*  , ...)  *)( i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0)  , i32 0 ) nounwind 		; <i32> [#uses=0]
 	ret i32 undef
 }
 





More information about the llvm-commits mailing list