summaryrefslogtreecommitdiff
path: root/lib/Transforms/Instrumentation
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-06-20 04:01:31 +0000
committerChris Lattner <sabre@nondot.org>2011-06-20 04:01:31 +0000
commitb065b06c12dba6001b8140df2744d0c856ef6ea1 (patch)
treef5acc3cd50c70497e3cfd6490de4f33190acd81e /lib/Transforms/Instrumentation
parent5d6fa7f2ac10f5494d3645abfc91a9045b70c802 (diff)
downloadllvm-b065b06c12dba6001b8140df2744d0c856ef6ea1.tar.gz
llvm-b065b06c12dba6001b8140df2744d0c856ef6ea1.tar.bz2
llvm-b065b06c12dba6001b8140df2744d0c856ef6ea1.tar.xz
Revamp the "ConstantStruct::get" methods. Previously, these were scattered
all over the place in different styles and variants. Standardize on two preferred entrypoints: one that takes a StructType and ArrayRef, and one that takes StructType and varargs. In cases where there isn't a struct type convenient, we now add a ConstantStruct::getAnon method (whose name will make more sense after a few more patches land). It would be "really really nice" if the ConstantStruct::get and ConstantVector::get methods didn't make temporary std::vectors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133412 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Instrumentation')
-rw-r--r--lib/Transforms/Instrumentation/ProfilingUtils.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Transforms/Instrumentation/ProfilingUtils.cpp b/lib/Transforms/Instrumentation/ProfilingUtils.cpp
index 7435bc37fb..4224ee303f 100644
--- a/lib/Transforms/Instrumentation/ProfilingUtils.cpp
+++ b/lib/Transforms/Instrumentation/ProfilingUtils.cpp
@@ -164,7 +164,8 @@ void llvm::InsertProfilingShutdownCall(Function *Callee, Module *Mod) {
GlobalVariable *GlobalDtors = new GlobalVariable(
*Mod, ArrayType::get(GlobalDtorElemTy, 1), false,
GlobalValue::AppendingLinkage, NULL, "llvm.global_dtors");
- dtors.push_back(ConstantStruct::get(Mod->getContext(), Elem, 2, false));
+
+ dtors.push_back(ConstantStruct::get(GlobalDtorElemTy, Elem));
GlobalDtors->setInitializer(ConstantArray::get(
cast<ArrayType>(GlobalDtors->getType()->getElementType()), dtors));
}