[llvm-commits] [llvm] r134901 - /llvm/trunk/examples/ExceptionDemo/ExceptionDemo.cpp

Tobias Grosser tobias at grosser.es
Tue Jul 12 05:16:06 PDT 2011


On 07/11/2011 06:31 PM, Garrison Venn wrote:
> Author: gvenn
> Date: Mon Jul 11 11:31:53 2011
> New Revision: 134901
>
> URL: http://llvm.org/viewvc/llvm-project?rev=134901&view=rev
> Log:
> Modified demo to work with non const Type parameters as is required by new
> type system. However most of these modifications were due to IRBuilder
> (IRBuilderBase), not having been modified to NOT return such const qualified
> free types. If IRBuilder does not change, as can also be seen in its
> instruction creation methods, to use const free types, it may be useful to have
> ExceptionDemo drop IRBuilder usage. Modifying builder.getInt32Ty() to
> llvm::Type::getInt32Ty(builder.getContext()) is pretty ugly.

Hi Garrison,

it should be possible to revert larger parts of this commit, as Chris 
recently changed IRBuilder:

Author: lattner
Date: Mon Jul 11 23:14:22 2011
New Revision: 134959

URL: http://llvm.org/viewvc/llvm-project?rev=134959&view=rev
Log: make the IRBuilder type methods return non-const types.

> -  argTypes.push_back(builder.getInt32Ty());
> -  argTypes.push_back(builder.getInt32Ty());
> -  argTypes.push_back(builder.getInt64Ty());
> +  argTypes.push_back(llvm::Type::getInt32Ty(builder.getContext()));
> +  argTypes.push_back(llvm::Type::getInt32Ty(builder.getContext()));
> +  argTypes.push_back(llvm::Type::getInt64Ty(builder.getContext()));
>     argTypes.push_back(builder.getInt8Ty()->getPointerTo());
>     argTypes.push_back(builder.getInt8Ty()->getPointerTo());

This was not touched by this patch, but is it possible to replace
builder.getInt8Ty()->getPointerTo() with builder.getInt8PtrTy()?

Cheers
Tobi



More information about the llvm-commits mailing list