diff options
author | Anand Shukla <ashukla@cs.uiuc.edu> | 2003-06-01 02:40:49 +0000 |
---|---|---|
committer | Anand Shukla <ashukla@cs.uiuc.edu> | 2003-06-01 02:40:49 +0000 |
commit | 03a2134253a4560172d65d9bb0ba8b40ad65d45c (patch) | |
tree | c1bc27fdf2e5766dc4e7fdcda0f69f6300bc4a78 | |
parent | a0a6b9c1b789d27fc6450b990a9b5dea3284ce29 (diff) | |
download | bcm5719-llvm-03a2134253a4560172d65d9bb0ba8b40ad65d45c.tar.gz bcm5719-llvm-03a2134253a4560172d65d9bb0ba8b40ad65d45c.zip |
Added the #(internal functions) to output
llvm-svn: 6502
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp b/llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp index c9b8748cca3..ed3b63e81fc 100644 --- a/llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp +++ b/llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp @@ -21,10 +21,12 @@ namespace { bool EmitFunctionTable::run(Module &M){ std::vector<const Type*> vType; std::vector<Constant *> vConsts; + unsigned char counter = 0; for(Module::iterator MI = M.begin(), ME = M.end(); MI != ME; ++MI) if (!MI->isExternal()) { vType.push_back(MI->getType()); vConsts.push_back(ConstantPointerRef::get(MI)); + counter++; } StructType *sttype = StructType::get(vType); @@ -34,5 +36,11 @@ bool EmitFunctionTable::run(Module &M){ GlobalValue::ExternalLinkage, cstruct, "llvmFunctionTable"); M.getGlobalList().push_back(gb); + + ConstantInt *cnst = ConstantInt::get(Type::IntTy, counter); + GlobalVariable *fnCount = new GlobalVariable(Type::IntTy, true, + GlobalValue::ExternalLinkage, + cnst, "llvmFunctionCount"); + M.getGlobalList().push_back(fnCount); return true; // Always modifies program } |