aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Instrumentation
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-04-16 20:28:45 +0000
committerChris Lattner <sabre@nondot.org>2003-04-16 20:28:45 +0000
commit4ad02e726d9b634372b037d4b352d8b63bb9e849 (patch)
tree463f4e5e0773c2c8ca3e891556fc0a36c83e3ab5 /lib/Transforms/Instrumentation
parent2c72b184b86152d4c9e00731d9257240f39ce20b (diff)
downloadexternal_llvm-4ad02e726d9b634372b037d4b352d8b63bb9e849.zip
external_llvm-4ad02e726d9b634372b037d4b352d8b63bb9e849.tar.gz
external_llvm-4ad02e726d9b634372b037d4b352d8b63bb9e849.tar.bz2
Add new linkage types to support a real frontend
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5786 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation')
-rw-r--r--lib/Transforms/Instrumentation/EmitFunctions.cpp3
-rw-r--r--lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp13
-rw-r--r--lib/Transforms/Instrumentation/TraceValues.cpp3
3 files changed, 13 insertions, 6 deletions
diff --git a/lib/Transforms/Instrumentation/EmitFunctions.cpp b/lib/Transforms/Instrumentation/EmitFunctions.cpp
index d4a99e2..32488d6 100644
--- a/lib/Transforms/Instrumentation/EmitFunctions.cpp
+++ b/lib/Transforms/Instrumentation/EmitFunctions.cpp
@@ -33,7 +33,8 @@ bool EmitFunctionTable::run(Module &M){
StructType *sttype = StructType::get(vType);
ConstantStruct *cstruct = ConstantStruct::get(sttype, vConsts);
- GlobalVariable *gb = new GlobalVariable(cstruct->getType(), true, false,
+ GlobalVariable *gb = new GlobalVariable(cstruct->getType(), true,
+ GlobalValue::ExternalLinkage,
cstruct, "llvmFunctionTable");
M.getGlobalList().push_back(gb);
return true; // Always modifies program
diff --git a/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp b/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp
index 39e7c35..57b17a5 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;
diff --git a/lib/Transforms/Instrumentation/TraceValues.cpp b/lib/Transforms/Instrumentation/TraceValues.cpp
index c19848d..75149ce 100644
--- a/lib/Transforms/Instrumentation/TraceValues.cpp
+++ b/lib/Transforms/Instrumentation/TraceValues.cpp
@@ -154,7 +154,8 @@ static inline GlobalVariable *getStringRef(Module *M, const string &str) {
// Create the global variable and record it in the module
// The GV will be renamed to a unique name if needed.
- GlobalVariable *GV = new GlobalVariable(Init->getType(), true, true, Init,
+ GlobalVariable *GV = new GlobalVariable(Init->getType(), true,
+ GlobalValue::InternalLinkage, Init,
"trstr");
M->getGlobalList().push_back(GV);
return GV;