[llvm-commits] [poolalloc] r132378 - /poolalloc/trunk/lib/AssistDS/TypeChecks.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Tue May 31 17:36:55 PDT 2011
Author: aggarwa4
Date: Tue May 31 19:36:55 2011
New Revision: 132378
URL: http://llvm.org/viewvc/llvm-project?rev=132378&view=rev
Log:
Assume stdout,stderr and stdin have been initialized.
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=132378&r1=132377&r2=132378&view=diff
==============================================================================
--- poolalloc/trunk/lib/AssistDS/TypeChecks.cpp (original)
+++ poolalloc/trunk/lib/AssistDS/TypeChecks.cpp Tue May 31 19:36:55 2011
@@ -867,6 +867,20 @@
I != E; ++I) {
if(I->use_empty())
continue;
+ if(I->getNameStr() == "stderr" ||
+ I->getNameStr() == "stdout" ||
+ I->getNameStr() == "stdin") {
+ // assume initialized
+ CastInst *BCI = BitCastInst::CreatePointerCast(I, VoidPtrTy, "", InsertPt);
+ std::vector<Value *> Args;
+ Args.push_back(BCI);
+ unsigned int size = TD->getTypeStoreSize(I->getType()->getElementType());
+ Args.push_back(ConstantInt::get(Int64Ty, size));
+ Args.push_back(ConstantInt::get(Int32Ty, tagCounter++));
+ Constant *F = M.getOrInsertFunction("trackInitInst", VoidTy, VoidPtrTy, Int64Ty, Int32Ty, NULL);
+ CallInst::Create(F, Args.begin(), Args.end(), "", InsertPt);
+ continue;
+ }
if(!I->hasInitializer())
continue;
visitGlobal(M, *I, I->getInitializer(), *InsertPt, 0);
More information about the llvm-commits
mailing list