[llvm-commits] [poolalloc] r130976 - /poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Thu May 5 19:51:38 PDT 2011
Author: aggarwa4
Date: Thu May 5 21:51:37 2011
New Revision: 130976
URL: http://llvm.org/viewvc/llvm-project?rev=130976&view=rev
Log:
Add support for read.
Needed for gzip.
Modified:
poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
Modified: poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/AssistDS/TypeChecks.cpp?rev=130976&r1=130975&r2=130976&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/TypeChecks.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/TypeChecks.cpp Thu May 5 21:51:37 2011
@@ -578,6 +578,16 @@
CallInst::Create(F, Args.begin(), Args.end(), "", I);
break;
}
+ } else if(F->getNameStr() == std::string("read")) {
+ CastInst *BCI = BitCastInst::CreatePointerCast(I->getOperand(2), VoidPtrTy);
+ BCI->insertAfter(I);
+ std::vector<Value *> Args;
+ Args.push_back(BCI);
+ Args.push_back(I);
+ Args.push_back(ConstantInt::get(Int32Ty, tagCounter++));
+ Constant *F = M.getOrInsertFunction("trackInitInst", VoidTy, VoidPtrTy, I->getType(), Int32Ty, NULL);
+ CallInst *CI = CallInst::Create(F, Args.begin(), Args.end());
+ CI->insertAfter(BCI);
} else if(F->getNameStr() == std::string("calloc")) {
CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy);
BCI->insertAfter(I);
@@ -596,8 +606,6 @@
F = M.getOrInsertFunction("trackGlobalArray", VoidTy, VoidPtrTy, I->getOperand(2)->getType(), I->getOperand(1)->getType(), Int32Ty, NULL);
CallInst *CI_Arr = CallInst::Create(F, Args1.begin(), Args1.end());
CI_Arr->insertAfter(CI);
-
-
} else if(F->getNameStr() == std::string("realloc")) {
CastInst *BCI_Src = BitCastInst::CreatePointerCast(I->getOperand(1), VoidPtrTy);
CastInst *BCI_Dest = BitCastInst::CreatePointerCast(I, VoidPtrTy);
More information about the llvm-commits
mailing list