[llvm-commits] [llvm-gcc-4.2] r46469 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Evan Cheng
evan.cheng at apple.com
Mon Jan 28 14:28:50 PST 2008
Author: evancheng
Date: Mon Jan 28 16:28:50 2008
New Revision: 46469
URL: http://llvm.org/viewvc/llvm-project?rev=46469&view=rev
Log:
Debug info for byval parameter. First attempt, unclear if it is right. But at least it tells gdb there is a parameter.
Modified:
llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=46469&r1=46468&r2=46469&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Mon Jan 28 16:28:50 2008
@@ -672,13 +672,22 @@
if (DECL_NAME(Args)) Name = IDENTIFIER_POINTER(DECL_NAME(Args));
const Type *ArgTy = ConvertType(TREE_TYPE(Args));
- if (isPassedByInvisibleReference(TREE_TYPE(Args)) ||
+ bool isInvRef = isPassedByInvisibleReference(TREE_TYPE(Args));
+ if (isInvRef ||
(!ArgTy->isFirstClassType() &&
LLVM_SHOULD_PASS_AGGREGATE_USING_BYVAL_ATTR(TREE_TYPE(Args), ArgTy))) {
// If the value is passed by 'invisible reference' or 'byval reference',
// the l-value for the argument IS the argument itself.
- SET_DECL_LLVM(Args, AI);
AI->setName(Name);
+ SET_DECL_LLVM(Args, AI);
+ if (!isInvRef && TheDebugInfo) {
+ Value *Tmp = CreateTemporary(PointerType::getUnqual(ArgTy));
+ Tmp->setName(std::string(Name)+"_addr");
+ TheDebugInfo->EmitDeclare(Args, llvm::dwarf::DW_TAG_arg_variable,
+ Name, TREE_TYPE(Args), Tmp,
+ Builder.GetInsertBlock());
+ Builder.CreateStore(AI, Tmp);
+ }
++AI;
} else {
// Otherwise, we create an alloca to hold the argument value and provide
More information about the llvm-commits
mailing list