summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorDylan McKay <dylanmckay34@gmail.com>2016-12-15 09:38:09 +0000
committerDylan McKay <dylanmckay34@gmail.com>2016-12-15 09:38:09 +0000
commit4b028e2ee112a7b22c7b246f8d74d727fb87a6b9 (patch)
tree994e6da39c7d2127310b39f90365e6a774f33268 /llvm/lib/Target
parentaff2530cf897f18057e0169ed1f63627b87a1195 (diff)
downloadbcm5719-llvm-4b028e2ee112a7b22c7b246f8d74d727fb87a6b9.tar.gz
bcm5719-llvm-4b028e2ee112a7b22c7b246f8d74d727fb87a6b9.zip
[AVR] Add argument indices to the instrumention hook functions
This allows the instrumention hook functions to do better pretty-printing. llvm-svn: 289793
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AVR/AVRInstrumentFunctions.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/AVR/AVRInstrumentFunctions.cpp b/llvm/lib/Target/AVR/AVRInstrumentFunctions.cpp
index ae2428e5e1e..a2f20e02be1 100644
--- a/llvm/lib/Target/AVR/AVRInstrumentFunctions.cpp
+++ b/llvm/lib/Target/AVR/AVRInstrumentFunctions.cpp
@@ -117,14 +117,16 @@ static void BuildArgument(BasicBlock &BB, Argument &Arg) {
Function &F = *Arg.getParent();
LLVMContext &Ctx = F.getContext();
+ Type *I8 = Type::getInt8Ty(Ctx);
+
FunctionType *FnType = FunctionType::get(Type::getVoidTy(Ctx),
- {Type::getInt8PtrTy(Ctx), Arg.getType()}, false);
+ {Type::getInt8PtrTy(Ctx), I8, Arg.getType()}, false);
Constant *Fn = F.getParent()->getOrInsertFunction(
GetArgumentSymbolName(Arg), FnType);
Value *ArgName = CreateStringPtr(BB, Arg.getName());
- Value *Args[] = {ArgName, &Arg};
+ Value *Args[] = {ArgName, ConstantInt::get(I8, Arg.getArgNo()), &Arg};
CallInst::Create(Fn, Args, "", &BB);
}
OpenPOWER on IntegriCloud