[llvm-commits] [poolalloc] r131782 - in /poolalloc/trunk: lib/AssistDS/TypeChecks.cpp runtime/DynamicTypeChecks/TypeRuntime.c
Arushi Aggarwal
aggarwa4 at illinois.edu
Fri May 20 18:31:58 PDT 2011
Author: aggarwa4
Date: Fri May 20 20:31:58 2011
New Revision: 131782
URL: http://llvm.org/viewvc/llvm-project?rev=131782&view=rev
Log:
1. Handle __ctype_b_loc. Occurs in 458.sjeng
2. For copying values from a type safe node to a
non typesafe node, do not use the type of the
load/store pair(these could be spurious types). Instead
assume initialized, and then let the future accesses
initialize it. This still ensures accesses as a single
type.
Modified:
poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.c
Modified: poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/TypeChecks.cpp?rev=131782&r1=131781&r2=131782&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/TypeChecks.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/TypeChecks.cpp Fri May 20 20:31:58 2011
@@ -907,6 +907,15 @@
CallInst::Create(F, Args.begin(), Args.end(), "", I);
return true;
}
+ } else if (F->getNameStr() == std::string("__ctype_b_loc")) {
+ CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy);
+ BCI->insertAfter(I);
+ std::vector<Value *>Args;
+ Args.push_back(BCI);
+ Args.push_back(ConstantInt::get(Int32Ty, tagCounter++));
+ Constant *F = M.getOrInsertFunction("trackctype", VoidTy, VoidPtrTy, Int32Ty, NULL);
+ CallInst *CI = CallInst::Create(F, Args.begin(), Args.end());
+ CI->insertAfter(BCI);
} else if (F->getNameStr() == std::string("strcpy")) {
std::vector<Value *> Args;
Args.push_back(I->getOperand(1));
@@ -1121,10 +1130,9 @@
if(TS->isTypeSafe(LI->getPointerOperand(), SI.getParent()->getParent())) {
std::vector<Value *> Args;
Args.push_back(BCI_Src);
- Args.push_back(ConstantInt::get(Int8Ty, UsedTypes[SI.getOperand(0)->getType()])); // SI.getValueOperand()
Args.push_back(ConstantInt::get(Int64Ty, TD->getTypeStoreSize(SI.getOperand(0)->getType())));
Args.push_back(ConstantInt::get(Int32Ty, tagCounter++));
- Constant *F = M.getOrInsertFunction("trackStoreInst", VoidTy, VoidPtrTy, Int8Ty, Int64Ty, Int32Ty, NULL);
+ Constant *F = M.getOrInsertFunction("trackInitInst", VoidTy, VoidPtrTy, Int64Ty, Int32Ty, NULL);
CallInst::Create(F, Args.begin(), Args.end(), "", &SI);
}
}
Modified: poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.c
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.c?rev=131782&r1=131781&r2=131782&view=diff
==============================================================================
--- poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.c (original)
+++ poolalloc/trunk/runtime/DynamicTypeChecks/TypeRuntime.c Fri May 20 20:31:58 2011
@@ -201,6 +201,11 @@
#endif
}
+void trackctype(void *ptr, uint32_t tag) {
+ trackInitInst(ptr, sizeof(short*), tag);
+ trackInitInst(*(short**)ptr, sizeof(short)*384, tag);
+}
+
void trackStrcpyInst(void *dst, void *src, uint32_t tag) {
copyTypeInfo(dst, src, strlen(src), tag);
}
More information about the llvm-commits
mailing list