search for: getscope

Displaying 13 results from an estimated 13 matches for "getscope".

2018 Sep 19
2
Obtaining the origin function for a local var after inlining
...which inlined function a local var > > originally belonged to in the source file. > > If you are looking at a llvm.dbg.declar/value/addr intrinsic, then the DILocation attached to the intrinsic indirectly points there: > > DIScope *Scope = DILocation(dbg_intrinsic.getDebugLoc()).getScope(); > while (!isa<DISubprogram>(Scope)) > Scope = Scope->getScope(); > auto *origFunction = cast<DIFunction>(Scope); This works, thank you! (I had to slightly modify the code FWIW: DILocation *DIL = dbg_intrinsic.getDebugLoc(); if (DIL) { DIScope *Scope...
2018 Sep 17
3
Obtaining the origin function for a local var after inlining
(I think I've asked a similar question off-list a couple of times, but never got an answer) Hi folks, For [K]MSAN we need to figure out which inlined function a local var originally belonged to in the source file. E.g. when a local buffer %buf is declared in @bar(), but @bar() is inlined into @foo(), then there's a local %buf.i in @foo(), but we need to determine that the local came from
2018 Sep 25
1
Obtaining the origin function for a local var after inlining
...;>> originally belonged to in the source file. > >> > >> If you are looking at a llvm.dbg.declar/value/addr intrinsic, then the DILocation attached to the intrinsic indirectly points there: > >> > >> DIScope *Scope = DILocation(dbg_intrinsic.getDebugLoc()).getScope(); > >> while (!isa<DISubprogram>(Scope)) > >> Scope = Scope->getScope(); > >> auto *origFunction = cast<DIFunction>(Scope); > > This works, thank you! > > > > (I had to slightly modify the code FWIW: > > DILocation *DIL = db...
2015 May 13
2
[LLVMdev] Modifying debug information through llvm pass
Hi All, I want to change debug information of an llvm instruction so that the modified debug info is subsequently passed to executable binary. So if I use "addr2line" utility on the binary, it will return my modified debug information. I've tried to change by using the following code snippet: MDNode *N = Inst->getMetadata("dbg"); DebugLoc Loc =
2011 Apr 27
1
[LLVMdev] LLVM internal getDirectory() for LexicalBlock debug information returns filename?
...ctory whenever Scope refers to a lexical block: if (const Instruction *Inst = dyn_cast<Instruction>(&I)) { const DebugLoc &Loc = Inst->getDebugLoc(); if (!Loc.isUnknown()) { LLVMContext &Ctx = Inst->getParent()->getParent()->getContext(); DIScope Scope(Loc.getScope(Ctx)); StringRef Dir = Scope.getDirectory(); // Wrong: contains filename iso. directory .... } } Here, if Scope refers to a Subprogram, this works correctly. However, if Scope is a LexicalBlock, getDirectory() returns the filename (conv.c) iso. the directory. The associated .ll does hav...
2017 Jun 09
2
Get segfault with ModulePass
...IR/Metadata.h:690:0 #5 0x00007fa709a06c0e llvm::MDOperand::operator llvm::Metadata*() const /usr/lib/llvm/4/include/llvm/IR/Metadata.h:691:0 #6 0x00007fa709a074d7 llvm::DILocation::getRawScope() const /usr/lib/llvm/4/include/llvm/IR/DebugInfoMetadata.h:1336:0 #7 0x00007fa709a07486 llvm::DILocation::getScope() const /usr/lib/llvm/4/include/llvm/IR/DebugInfoMetadata.h:1274:0 #8 0x00007fa709a074a8 llvm::DILocation::getFilename() const /usr/lib/llvm/4/include/llvm/IR/DebugInfoMetadata.h:1280:0 #9 0x00007fa709a062e2 (anonymous namespace)::DebugPass::runOnModule(llvm::Module&) /home/gerion/sourcecode/de...
2014 Oct 16
2
[LLVMdev] [RFC] Less memory and greater maintainability for debug info IR
...;> static MDLineTable *getBase(MDLineTable *Inlined); >> >> unsigned getLine() const { return Line; } >> unsigned getColumn() const { return Column; } >> bool isInlined() const { return getNumOperands() == 2; } >> MDNode *getScope() const { return getOperand(0); } >> MDNode *getInlinedAt() const { return getOperand(1); } >> }; >> >> Proposed assembly syntax: >> >> ; Not inlined. >> !7 = metadata !MDLineTable(line: 45, column: 7, scope: metadata !9) &g...
2014 Oct 13
9
[LLVMdev] [RFC] Less memory and greater maintainability for debug info IR
...etInlined(MDLineTable *Base, MDNode *Scope); static MDLineTable *getBase(MDLineTable *Inlined); unsigned getLine() const { return Line; } unsigned getColumn() const { return Column; } bool isInlined() const { return getNumOperands() == 2; } MDNode *getScope() const { return getOperand(0); } MDNode *getInlinedAt() const { return getOperand(1); } }; Proposed assembly syntax: ; Not inlined. !7 = metadata !MDLineTable(line: 45, column: 7, scope: metadata !9) ; Inlined. !7 = metadata !MDLineTable(lin...
2013 Apr 26
0
[LLVMdev] Inconsistent use of is_stmt flag in .debug_line
...ich lacks the is_stmt flag. The relevant code is: unsigned Flags = 0; PrevInstLoc = DL; if (DL == PrologEndLoc) { Flags |= DWARF2_FLAG_PROLOGUE_END; PrologEndLoc = DebugLoc(); } if (PrologEndLoc.isUnknown()) Flags |= DWARF2_FLAG_IS_STMT; if (!DL.isUnknown()) { const MDNode *Scope = DL.getScope(Asm->MF->getFunction()->getContext()); recordSourceLine(DL.getLine(), DL.getCol(), Scope, Flags); It's easy to change this code to apply is_stmt for every line table entry but I think that this is the wrong approach. The real question is, why do we have an inconsistency where some...
2014 Oct 15
3
[LLVMdev] [RFC] Less memory and greater maintainability for debug info IR
...able *getBase(MDLineTable *Inlined); > >> > >> unsigned getLine() const { return Line; } > >> unsigned getColumn() const { return Column; } > >> bool isInlined() const { return getNumOperands() == 2; } > >> MDNode *getScope() const { return getOperand(0); } > >> MDNode *getInlinedAt() const { return getOperand(1); } > >> }; > >> > >> Proposed assembly syntax: > >> > >> ; Not inlined. > >> !7 = metadata !MDLineTable(lin...
2014 Oct 14
2
[LLVMdev] [RFC] Less memory and greater maintainability for debug info IR
...MDNode *Scope); > static MDLineTable *getBase(MDLineTable *Inlined); > > unsigned getLine() const { return Line; } > unsigned getColumn() const { return Column; } > bool isInlined() const { return getNumOperands() == 2; } > MDNode *getScope() const { return getOperand(0); } > MDNode *getInlinedAt() const { return getOperand(1); } > }; > > Proposed assembly syntax: > > ; Not inlined. > !7 = metadata !MDLineTable(line: 45, column: 7, scope: metadata !9) > > ; Inlin...
2017 Jun 11
2
Get segfault with ModulePass
...#5 0x00007fa709a06c0e llvm::MDOperand::operator llvm::Metadata*() const /usr/lib/llvm/4/include/llvm/IR/Metadata.h:691:0 > > #6 0x00007fa709a074d7 llvm::DILocation::getRawScope() const /usr/lib/llvm/4/include/llvm/IR/DebugInfoMetadata.h:1336:0 > > #7 0x00007fa709a07486 llvm::DILocation::getScope() const /usr/lib/llvm/4/include/llvm/IR/DebugInfoMetadata.h:1274:0 > > #8 0x00007fa709a074a8 llvm::DILocation::getFilename() const /usr/lib/llvm/4/include/llvm/IR/DebugInfoMetadata.h:1280:0 > > #9 0x00007fa709a062e2 (anonymous namespace)::DebugPass::runOnModule(llvm::Module&) /home/...
2011 Apr 05
3
[LLVMdev] Building LLVM on Solaris/Sparc
...erts/AnalysisWrappers.o llvm::ModulePass::createPrinterPass(llvm::raw_ostream&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const/n/fs/scratch/tpondich/ParallelAssert/llvm-objects/tools/opt/Debug+Asserts/AnalysisWrappers.o llvm::DebugLoc::getScope(llvm::LLVMContext const&) const/n/fs/scratch/tpondich/ParallelAssert/llvm-objects/tools/opt/Debug+Asserts/opt.o llvm::PassRegistrationListener::PassRegistrationListener()/n/fs/scratch/tpondich/ParallelAssert/llvm-objects/tools/opt/Debug+Asserts/opt.o llvm::LoopPass::assignPassManager(llvm::PMSt...