[llvm-commits] [poolalloc] r133683 - in /poolalloc/trunk: lib/AssistDS/TypeChecks.cpp runtime/DynamicTypeChecks/TypeRuntime.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Wed Jun 22 21:14:27 PDT 2011
Author: aggarwa4
Date: Wed Jun 22 23:14:27 2011
New Revision: 133683
URL: http://llvm.org/viewvc/llvm-project?rev=133683&view=rev
Log:
Fix prototypes/arguments to be of the correct type
Modified:
poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.cpp
Modified: poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/TypeChecks.cpp?rev=133683&r1=133682&r2=133683&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/TypeChecks.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/TypeChecks.cpp Wed Jun 22 23:14:27 2011
@@ -1761,18 +1761,17 @@
Value *Size = ConstantInt::get(Int32Ty, getSize(LI.getType()));
AllocaInst *AI = new AllocaInst(TypeTagTy, Size, "", &*InsPt);
- CastInst *BCI_MD = BitCastInst::CreatePointerCast(AI, VoidPtrTy, "", &*InsPt);
std::vector<Value *>Args1;
Args1.push_back(BCI);
Args1.push_back(getSizeConstant(LI.getType()));
- Args1.push_back(BCI_MD);
+ Args1.push_back(AI);
CallInst *getTypeCall = CallInst::Create(getTypeTag, Args1.begin(), Args1.end(), "", &LI);
if(TrackAllLoads) {
std::vector<Value *> Args;
Args.push_back(getTypeMarkerConstant(&LI));
Args.push_back(getSizeConstant(LI.getType()));
- Args.push_back(BCI_MD);
+ Args.push_back(AI);
Args.push_back(BCI);
Args.push_back(getTagCounter());
CallInst::Create(checkTypeInst, Args.begin(), Args.end(), "", &LI);
@@ -1788,7 +1787,7 @@
std::vector<Value *> Args;
Args.push_back(getTypeMarkerConstant(&LI));
Args.push_back(getSizeConstant(LI.getType()));
- Args.push_back(BCI_MD);
+ Args.push_back(AI);
Args.push_back(BCI);
Args.push_back(getTagCounter());
if(StoreInst *SI = dyn_cast<StoreInst>(II)) {
@@ -1797,7 +1796,7 @@
std::vector<Value *> Args;
Args.push_back(BCI_Dest);
- Args.push_back(BCI_MD);
+ Args.push_back(AI);
Args.push_back(getSizeConstant(SI->getOperand(0)->getType()));
Args.push_back(getTagCounter());
// Create the call to the runtime check and place it before the copying store instruction.
@@ -1810,7 +1809,7 @@
CallInst::Create(checkTypeInst, Args.begin(), Args.end(), "", cast<Instruction>(II.getUse().getUser()));
}
}
- if(BCI_MD->getNumUses() == 1) {
+ if(AI->getNumUses() == 1) {
// No uses needed checks
getTypeCall->eraseFromParent();
}
Modified: poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.cpp?rev=133683&r1=133682&r2=133683&view=diff
==============================================================================
--- poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.cpp (original)
+++ poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.cpp Wed Jun 22 23:14:27 2011
@@ -69,7 +69,7 @@
void trackInitInst(void *ptr, uint64_t size, uint32_t tag) ;
void trackUnInitInst(void *ptr, uint64_t size, uint32_t tag) ;
void copyTypeInfo(void *dstptr, void *srcptr, uint64_t size, uint32_t tag) ;
- void setTypeInfo(void *dstptr, void *metadata, uint64_t size, uint32_t tag) ;
+ void setTypeInfo(void *dstptr, TypeTagTy *metadata, uint64_t size, uint32_t tag) ;
void setVAInfo(void *va_list, uint64_t totalCount, TypeTagTy *metadata_ptr, uint32_t tag) ;
void copyVAInfo(void *va_list_dst, void *va_list_src, uint32_t tag) ;
void trackctype(void *ptr, uint32_t tag) ;
@@ -290,7 +290,7 @@
/**
* Copy size bytes of metadata from metadata to dest ptr
*/
-void setTypeInfo(void *dstptr, void *metadata, uint64_t size, uint32_t tag) {
+void setTypeInfo(void *dstptr, TypeTagTy *metadata, uint64_t size, uint32_t tag) {
uintptr_t d = maskAddress(dstptr);
memcpy(&shadow_begin[d], metadata, size);
}
More information about the llvm-commits
mailing list