diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-04-16 20:28:45 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-04-16 20:28:45 +0000 |
| commit | 379a8d2d1cb3f5b6dbe13b94ed09a29d3e400a89 (patch) | |
| tree | 76f2336957b62005e10d223d5493eda780e27cef /llvm/lib/Transforms/Instrumentation | |
| parent | f0e92b575f675ee8fb09b7fdb56cc27e8a5bdd21 (diff) | |
| download | bcm5719-llvm-379a8d2d1cb3f5b6dbe13b94ed09a29d3e400a89.tar.gz bcm5719-llvm-379a8d2d1cb3f5b6dbe13b94ed09a29d3e400a89.zip | |
Add new linkage types to support a real frontend
llvm-svn: 5786
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation')
3 files changed, 13 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp b/llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp index d4a99e2c674..32488d69b53 100644 --- a/llvm/lib/Transforms/Instrumentation/EmitFunctions.cpp +++ b/llvm/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/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp b/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp index 39e7c351210..57b17a590ff 100644 --- a/llvm/lib/Transforms/Instrumentation/ProfilePaths/ProfilePaths.cpp +++ b/llvm/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/llvm/lib/Transforms/Instrumentation/TraceValues.cpp b/llvm/lib/Transforms/Instrumentation/TraceValues.cpp index c19848dd4b5..75149ce9123 100644 --- a/llvm/lib/Transforms/Instrumentation/TraceValues.cpp +++ b/llvm/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; |

