diff options
Diffstat (limited to 'lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp')
-rw-r--r-- | lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp b/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp index 39e7c35121..57b17a590f 100644 --- a/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp +++ b/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp @@ -183,14 +183,19 @@ bool ProfilePaths::runOnFunction(Function &F){ for(int xi=0; xi<numPaths; xi++) arrayInitialize.push_back(ConstantSInt::get(Type::IntTy, 0)); - Constant *initializer = ConstantArray::get(ArrayType::get(Type::IntTy, numPaths), arrayInitialize); - GlobalVariable *countVar = new GlobalVariable(ArrayType::get(Type::IntTy, numPaths), false, true, initializer, "Count", F.getParent()); + const ArrayType *ATy = ArrayType::get(Type::IntTy, numPaths); + Constant *initializer = ConstantArray::get(ATy, arrayInitialize); + GlobalVariable *countVar = new GlobalVariable(ATy, false, + GlobalValue::InternalLinkage, + initializer, "Count", + F.getParent()); static GlobalVariable *threshold = NULL; static bool insertedThreshold = false; if(!insertedThreshold){ - threshold = new GlobalVariable(Type::IntTy, false, false, 0, - "reopt_threshold"); + threshold = new GlobalVariable(Type::IntTy, false, + GlobalValue::ExternalLinkage, 0, + "reopt_threshold"); F.getParent()->getGlobalList().push_back(threshold); insertedThreshold = true; |