Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 7a6365a

Browse files
author
Dylan McKay
committed
[AVR] Add argument indices to the instrumention hook functions
This allows the instrumention hook functions to do better pretty-printing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289793 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent cc0ebc0 commit 7a6365a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Target/AVR/AVRInstrumentFunctions.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,14 +117,16 @@ static void BuildArgument(BasicBlock &BB, Argument &Arg) {
117117
Function &F = *Arg.getParent();
118118
LLVMContext &Ctx = F.getContext();
119119

120+
Type *I8 = Type::getInt8Ty(Ctx);
121+
120122
FunctionType *FnType = FunctionType::get(Type::getVoidTy(Ctx),
121-
{Type::getInt8PtrTy(Ctx), Arg.getType()}, false);
123+
{Type::getInt8PtrTy(Ctx), I8, Arg.getType()}, false);
122124

123125
Constant *Fn = F.getParent()->getOrInsertFunction(
124126
GetArgumentSymbolName(Arg), FnType);
125127
Value *ArgName = CreateStringPtr(BB, Arg.getName());
126128

127-
Value *Args[] = {ArgName, &Arg};
129+
Value *Args[] = {ArgName, ConstantInt::get(I8, Arg.getArgNo()), &Arg};
128130
CallInst::Create(Fn, Args, "", &BB);
129131
}
130132

0 commit comments

Comments
 (0)