diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-12-31 05:48:39 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-12-31 05:48:39 +0000 |
commit | c5b206b6be61d0d933b98b6af5e22f42edd48ad1 (patch) | |
tree | 9e6a1e6d3b90890de3d1464a44a7cef8d30fe1ae /lib/Transforms/IPO/LowerSetJmp.cpp | |
parent | 05e52a1b35e7feb359a176af462591697c4d9647 (diff) |
For PR950:
This patch replaces signed integer types with signless ones:
1. [US]Byte -> Int8
2. [U]Short -> Int16
3. [U]Int -> Int32
4. [U]Long -> Int64.
5. Removal of isSigned, isUnsigned, getSignedVersion, getUnsignedVersion
and other methods related to signedness. In a few places this warranted
identifying the signedness information from other sources.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32785 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/IPO/LowerSetJmp.cpp')
-rw-r--r-- | lib/Transforms/IPO/LowerSetJmp.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/Transforms/IPO/LowerSetJmp.cpp b/lib/Transforms/IPO/LowerSetJmp.cpp index d7f22fb9cb..44b0ab5d5c 100644 --- a/lib/Transforms/IPO/LowerSetJmp.cpp +++ b/lib/Transforms/IPO/LowerSetJmp.cpp @@ -193,7 +193,7 @@ bool LowerSetJmp::runOnModule(Module& M) { // This function is always successful, unless it isn't. bool LowerSetJmp::doInitialization(Module& M) { - const Type *SBPTy = PointerType::get(Type::SByteTy); + const Type *SBPTy = PointerType::get(Type::Int8Ty); const Type *SBPPTy = PointerType::get(SBPTy); // N.B. See llvm/runtime/GCCLibraries/libexception/SJLJ-Exception.h for @@ -209,17 +209,17 @@ bool LowerSetJmp::doInitialization(Module& M) // void __llvm_sjljeh_add_setjmp_to_map(void**, void*, unsigned) AddSJToMap = M.getOrInsertFunction("__llvm_sjljeh_add_setjmp_to_map", Type::VoidTy, SBPPTy, SBPTy, - Type::UIntTy, (Type *)0); + Type::Int32Ty, (Type *)0); // void __llvm_sjljeh_throw_longjmp(int*, int) ThrowLongJmp = M.getOrInsertFunction("__llvm_sjljeh_throw_longjmp", - Type::VoidTy, SBPTy, Type::IntTy, + Type::VoidTy, SBPTy, Type::Int32Ty, (Type *)0); // unsigned __llvm_sjljeh_try_catching_longjmp_exception(void **) TryCatchLJ = M.getOrInsertFunction("__llvm_sjljeh_try_catching_longjmp_exception", - Type::UIntTy, SBPPTy, (Type *)0); + Type::Int32Ty, SBPPTy, (Type *)0); // bool __llvm_sjljeh_is_longjmp_exception() IsLJException = M.getOrInsertFunction("__llvm_sjljeh_is_longjmp_exception", @@ -227,7 +227,7 @@ bool LowerSetJmp::doInitialization(Module& M) // int __llvm_sjljeh_get_longjmp_value() GetLJValue = M.getOrInsertFunction("__llvm_sjljeh_get_longjmp_value", - Type::IntTy, (Type *)0); + Type::Int32Ty, (Type *)0); return true; } @@ -250,7 +250,7 @@ bool LowerSetJmp::IsTransformableFunction(const std::string& Name) { // throwing the exception for us. void LowerSetJmp::TransformLongJmpCall(CallInst* Inst) { - const Type* SBPTy = PointerType::get(Type::SByteTy); + const Type* SBPTy = PointerType::get(Type::Int8Ty); // Create the call to "__llvm_sjljeh_throw_longjmp". This takes the // same parameters as "longjmp", except that the buffer is cast to a @@ -300,7 +300,7 @@ AllocaInst* LowerSetJmp::GetSetJmpMap(Function* Func) assert(Inst && "Couldn't find even ONE instruction in entry block!"); // Fill in the alloca and call to initialize the SJ map. - const Type *SBPTy = PointerType::get(Type::SByteTy); + const Type *SBPTy = PointerType::get(Type::Int8Ty); AllocaInst* Map = new AllocaInst(SBPTy, 0, "SJMap", Inst); new CallInst(InitSJMap, make_vector<Value*>(Map, 0), "", Inst); return SJMap[Func] = Map; @@ -372,12 +372,12 @@ void LowerSetJmp::TransformSetJmpCall(CallInst* Inst) Function* Func = ABlock->getParent(); // Add this setjmp to the setjmp map. - const Type* SBPTy = PointerType::get(Type::SByteTy); + const Type* SBPTy = PointerType::get(Type::Int8Ty); CastInst* BufPtr = new BitCastInst(Inst->getOperand(1), SBPTy, "SBJmpBuf", Inst); new CallInst(AddSJToMap, make_vector<Value*>(GetSetJmpMap(Func), BufPtr, - ConstantInt::get(Type::UIntTy, + ConstantInt::get(Type::Int32Ty, SetJmpIDMap[Func]++), 0), "", Inst); @@ -421,14 +421,14 @@ void LowerSetJmp::TransformSetJmpCall(CallInst* Inst) // This PHI node will be in the new block created from the // splitBasicBlock call. - PHINode* PHI = new PHINode(Type::IntTy, "SetJmpReturn", Inst); + PHINode* PHI = new PHINode(Type::Int32Ty, "SetJmpReturn", Inst); // Coming from a call to setjmp, the return is 0. - PHI->addIncoming(ConstantInt::getNullValue(Type::IntTy), ABlock); + PHI->addIncoming(ConstantInt::getNullValue(Type::Int32Ty), ABlock); // Add the case for this setjmp's number... SwitchValuePair SVP = GetSJSwitch(Func, GetRethrowBB(Func)); - SVP.first->addCase(ConstantInt::get(Type::UIntTy, SetJmpIDMap[Func] - 1), + SVP.first->addCase(ConstantInt::get(Type::Int32Ty, SetJmpIDMap[Func] - 1), SetJmpContBlock); // Value coming from the handling of the exception. |