[llvm] r289793 - [AVR] Add argument indices to the instrumention hook functions
Dylan McKay via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 15 01:38:09 PST 2016
Author: dylanmckay
Date: Thu Dec 15 03:38:09 2016
New Revision: 289793
URL: http://llvm.org/viewvc/llvm-project?rev=289793&view=rev
Log:
[AVR] Add argument indices to the instrumention hook functions
This allows the instrumention hook functions to do better
pretty-printing.
Modified:
llvm/trunk/lib/Target/AVR/AVRInstrumentFunctions.cpp
Modified: llvm/trunk/lib/Target/AVR/AVRInstrumentFunctions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AVR/AVRInstrumentFunctions.cpp?rev=289793&r1=289792&r2=289793&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AVR/AVRInstrumentFunctions.cpp (original)
+++ llvm/trunk/lib/Target/AVR/AVRInstrumentFunctions.cpp Thu Dec 15 03:38:09 2016
@@ -117,14 +117,16 @@ static void BuildArgument(BasicBlock &BB
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);
}
More information about the llvm-commits
mailing list