[llvm-commits] [127873] From Duncan:

clattner at apple.com clattner at apple.com
Thu May 31 11:18:57 PDT 2007


Revision: 127873
Author:   clattner
Date:     2007-05-31 11:18:57 -0700 (Thu, 31 May 2007)

Log Message:
-----------
>From Duncan:

"TypeInfos are passed around as pointers (i8*), yet when
a null value is needed it is passed as an i32 value of 0,
rather than an i8* null.  The attached patches change to
using an i8* null in LLVM and llvm-gcc.  At the same time
I eliminated some uses of std::vector<Value*> as a way of
holding a single Value* in the llvm-gcc EH stuff."

Modified Paths:
--------------
    apple-local/branches/llvm/gcc/llvm-convert.cpp

Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp
===================================================================
--- apple-local/branches/llvm/gcc/llvm-convert.cpp	2007-05-31 17:39:08 UTC (rev 127872)
+++ apple-local/branches/llvm/gcc/llvm-convert.cpp	2007-05-31 18:18:57 UTC (rev 127873)
@@ -703,9 +703,8 @@
 #ifdef ITANIUM_STYLE_EXCEPTIONS
     if (ExceptionValue) {
       // Fetch and store exception handler.
-      std::vector<Value*> Args;
-      Args.push_back(Builder.CreateLoad(ExceptionValue, "eh_ptr"));
-      Builder.CreateCall(FuncUnwindResume, &Args[0], Args.size());
+      Value *Arg = Builder.CreateLoad(ExceptionValue, "eh_ptr");
+      Builder.CreateCall(FuncUnwindResume, &Arg, 1);
       Builder.CreateUnreachable();
     } else {
       new UnwindInst(UnwindBB);
@@ -1899,7 +1898,9 @@
 
     if (!Types) {
       // Catch all.
-      TypeInfos.push_back(Constant::getNullValue(Type::Int32Ty));
+      TypeInfos.push_back(
+        Constant::getNullValue(PointerType::get(Type::Int8Ty))
+      );
     } else if (TREE_CODE(Types) != TREE_LIST) {
       // Construct typeinfo object.  Each call will produce a new expression
       // even if duplicate.
@@ -2206,9 +2207,7 @@
     Value *TypeInfo = Emit(TypeInfoNopExpr, 0);
 
     // Call get eh type id.
-    std::vector<Value*> Args;
-    Args.push_back(TypeInfo);
-    Value *TypeID = Builder.CreateCall(FuncEHGetTypeID, &Args[0], Args.size(),
+    Value *TypeID = Builder.CreateCall(FuncEHGetTypeID, &TypeInfo, 1,
                                        "eh_typeid");
     Value *Select = Builder.CreateLoad(ExceptionSelectorValue, "tmp");
 
@@ -2233,9 +2232,7 @@
       TypeInfo = BitCastToType(TypeInfo, PointerType::get(Type::Int8Ty));
 
       // Call get eh type id.
-      std::vector<Value*> Args;
-      Args.push_back(TypeInfo);
-      Value *TypeID = Builder.CreateCall(FuncEHGetTypeID, &Args[0], Args.size(),
+      Value *TypeID = Builder.CreateCall(FuncEHGetTypeID, &TypeInfo, 1,
                                          "eh_typeid");
       Value *Select = Builder.CreateLoad(ExceptionSelectorValue, "tmp");
 





More information about the llvm-commits mailing list