search for: discope

Displaying 20 results from an estimated 76 matches for "discope".

2017 Nov 15
2
workaround for debug info bug?
Seems like something infinite-recursion like to me: $ clang --version clang version 6.0.0 (trunk 317833) Target: powerpc64le-unknown-linux-gnu $ clang -c test.ll warning: overriding the module target triple with powerpc64le-unknown-linux-gnu [-Woverride-module] ... #255 0x0000000012b07a78 llvm::DwarfUnit::getOrCreateTypeDIE(llvm::MDNode const*) ... So I'd say it reproduces. On Wed, Nov 15,
2012 Jan 20
1
[LLVMdev] context/scope of instruction
...gt; >> My program contains: >> call void (...)* @commit(), !dbg !16 >> >> !16 = metadata !{i32 16, i32 5, metadata !8, null} >> >> !8 = metadata !{i32 589835, metadata !4, i32 10, i32 1, metadata !2, i32 0} ; [ DW_TAG_lexical_block ] >> > > !8 is DIScope here (actually it is DILexicalBlock, which is derived from DIScope). I know. I am writing an LLVM pass and I do not know how I get a hand on the DIScope object. Which method(s) of the LLVM C++ API do I have to call to get a pointer or reference (!8) to the LLVM::DIScope of an LLVM::Instruction? C...
2012 Feb 28
0
[LLVMdev] Getting corresponding c-instruction line number along with ir-instruction in a function's CFG
....o): In function `llvm::DIDescriptor::getUnsignedField(unsigned int) const':/home/rangi/llvm/include/llvm/Analysis/DebugInfo.h:70: undefined reference to `llvm::DIDescriptor::getUInt64Field(unsigned int) const'/home/rangi/llvm/build/Debug+Asserts/lib/libLLVMCore.a(AsmWriter.o): In function `DIScope':/home/rangi/llvm/include/llvm/Analysis/DebugInfo.h:160: undefined reference to `vtable for llvm::DIScope'/home/rangi/llvm/build/Debug+Asserts/lib/libLLVMCore.a(AsmWriter.o): In function `~DIScope':/home/rangi/llvm/include/llvm/Analysis/DebugInfo.h:161: undefined reference to `vtable fo...
2012 Jan 19
2
[LLVMdev] context/scope of instruction
Hello, I need to know how I get the LLVM::IDScope object of an instruction. My program contains: call void (...)* @commit(), !dbg !16 !16 = metadata !{i32 16, i32 5, metadata !8, null} !8 = metadata !{i32 589835, metadata !4, i32 10, i32 1, metadata !2, i32 0} ; [ DW_TAG_lexical_block ] LLVM::Instruction.hasMetadata() is 0 I got LLVM::Scope for variables over DIGlobalVariable.getContext()
2012 Jan 20
0
[LLVMdev] context/scope of instruction
...M::IDScope object of an instruction. > > My program contains: > call void (...)* @commit(), !dbg !16 > > !16 = metadata !{i32 16, i32 5, metadata !8, null} > > !8 = metadata !{i32 589835, metadata !4, i32 10, i32 1, metadata !2, i32 0} ; [ DW_TAG_lexical_block ] > !8 is DIScope here (actually it is DILexicalBlock, which is derived from DIScope). - Devang
2015 Nov 04
2
how to add the location debug info for each instruction
> On Nov 3, 2015, at 5:00 PM, Hui Zhang <wayne.huizhang at gmail.com> wrote: > > Hello, > > I found a weird thing in llvm 3.3: > > For exactly the same MDNode *space, if I cast it to DILocation loc(space) and call loc.getFileName(), or I cast it to DIScope sco(space) and call sco.getFilename(), the return value would be different ! Totally two different files > > I don't know if it's a bug or why it is happening like this, and what's the conceptual difference between these two classes: DIScope and DILocation ? > In the old l...
2015 Jul 27
0
[LLVMdev] [un]wrapping llvm:DITypeRef
...uch places. > > However, in looking more carefully at DIType, with the intention of being able to better > explain why DITypeRef gives me a problem that DIType does not, I find the way I need > to construct a DITypeRef is actually declared in DIType: > > > class DIType : public DIScope { > ... > public: > ... > operator DITypeRef () const { > ^^^^^^^^^^^^^^^^^^ > assert(isType() && > "constructing DITypeRef from an MDNode that is not a type"); > return DITypeRef(&*getRef()); > } > > This,...
2015 Jul 27
2
[LLVMdev] [un]wrapping llvm:DITypeRef
...3.6.1, as they give DIType in such places. However, in looking more carefully at DIType, with the intention of being able to better explain why DITypeRef gives me a problem that DIType does not, I find the way I need to construct a DITypeRef is actually declared in DIType: class DIType : public DIScope { ... public: ... operator DITypeRef () const { ^^^^^^^^^^^^^^^^^^ assert(isType() && "constructing DITypeRef from an MDNode that is not a type"); return DITypeRef(&*getRef()); } This, through a series of specializations, befriendings, et...
2010 Aug 31
5
[LLVMdev] More DIFactory questions
Here are some issues that I am unclear about. What would be great is if the answers could be incorporated into the comments and documentation for DIFactory and DebugInfo.h: 1) What types of DIScope are valid arguments for DebugLoc::get()? The method takes an MDNode* argument, so looking at the function signature is no help. For example, DIFile is a subtype of DIScope, however looking at DwarfDebug::recordSourceLine, I see that DIFile scopes are not valid for source lines. 2) What is the pro...
2013 Nov 15
1
[LLVMdev] DebugInfo: LTO Metadata Size reduction by removing some cycles
...diff --git lib/CodeGen/CGDebugInfo.cpp lib/CodeGen/CGDebugInfo.cpp index 9b131fd..c75fd05 100644 --- lib/CodeGen/CGDebugInfo.cpp +++ lib/CodeGen/CGDebugInfo.cpp @@ -138,7 +138,7 @@ void CGDebugInfo::setLocation(SourceLocation Loc) { /// getContextDescriptor - Get context info for the decl. llvm::DIScope CGDebugInfo::getContextDescriptor(const Decl *Context) { if (!Context) - return TheCU; + return llvm::DIScope(); llvm::DenseMap<const Decl *, llvm::WeakVH>::iterator I = RegionMap.find(Context); @@ -155,7 +155,7 @@ llvm::DIScope CGDebugInfo::getContextDescriptor(const Decl...
2018 Sep 19
2
Obtaining the origin function for a local var after inlining
...s, > > > > For [K]MSAN we need to figure out 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_in...
2015 Nov 03
3
how to add the location debug info for each instruction
Hello, For some reason, I have to stick on llvm 3.3 for a language compiler, I find that the location debug info is attached to each instruction using !dbg, however, I found some of that information is mis-attched and need to be changed, so I want to *know what functions(I checked all funcs in DIBuilder.h but didn't find a appropriate one) are used to attach those !dbg nodes to each
2014 Nov 10
5
[LLVMdev] [RFC] Separating Metadata from the Value hierarchy
...`MDNode`s don't have to pay for RAUW overhead. The class hierarchy I envision looks something like this: Metadata MDNode TempMDNode // MDNodeFwdRef? UniquableMDNode // GenericMDNode? DINode // Is this layer useful? DILocation DIScope DIType DIBasicType DICompositeType ... DISubprogram ... DICompileUnit ... MDString ValueAsMetadata `UniquableMDNode` is a leaf-class that behaves like the current `MDNode` (when it...
2018 Mar 21
2
lld/lto/win32 crash on DIE code
Op 21-3-2018 om 10:28 schreef Evgeny Leviant: > It looks the problem lies in how your compiler generates debug info. LLVM doesn't > expect DIDerivedType scope to be an instance of DICompileUnit. Here is a quick fix: > > DIE *DwarfUnit::getOrCreateContextDIE(const DIScope *Context) { > - if (!Context || isa<DIFile>(Context)) > + if (!Context || isa<DIFile>(Context) || isa<DICompileUnit>(Context)) > > However, I suggest talking to someone with in-depth debug info experience, as the problem > itself seems to be not related to LTO....
2013 Jul 22
0
[LLVMdev] [RFC] Add warning capabilities in LLVM.
...ything. How about something like this: - The message string is text but a single kind of markup is allowed: <debug/>, for example: "We cannot vectorize <debug/> because <debug/> is an unfriendly variable" (where the first will be replaced by text derived from a DIScope and the second from a DIVariable). - The structure is this: struct Msg { const char *Message; Function *F; // If nothing else, we can extract a useful name from here, hopefully. SmallVector<DIDescriptor, 2> DIs; // Should be DIDescriptor* ? }; Then, in the backend...
2016 Feb 16
4
[help] Kaleidoscope build fails after llvm-3.8
...ction*)", referenced from: llvm::IRBuilder<true, llvm::ConstantFolder, llvm::IRBuilderDefaultInserter<true> >::CreateFCmp(llvm::CmpInst::Predicate, llvm::Value*, llvm::Value*, llvm::Twine const&, llvm::MDNode*) in toy-1f302b.o "llvm::DIBuilder::createFunction(llvm::DIScope*, llvm::StringRef, llvm::StringRef, llvm::DIFile*, unsigned int, llvm::DISubroutineType*, bool, bool, unsigned int, unsigned int, bool, llvm::MDTupleTypedArrayWrapper<llvm::DITemplateParameter>, llvm::DISubprogram*)", referenced from: (anonymous namespace)::FunctionAST::codegen() i...
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
...to figure out 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 slight...
2018 Mar 21
0
lld/lto/win32 crash on DIE code
...rash on DIE code Op 21-3-2018 om 10:28 schreef Evgeny Leviant: > It looks the problem lies in how your compiler generates debug info. LLVM doesn't > expect DIDerivedType scope to be an instance of DICompileUnit. Here is a quick fix: > > DIE *DwarfUnit::getOrCreateContextDIE(const DIScope *Context) { > - if (!Context || isa<DIFile>(Context)) > + if (!Context || isa<DIFile>(Context) || isa<DICompileUnit>(Context)) > > However, I suggest talking to someone with in-depth debug info experience, as the problem > itself seems to be not related to LTO. T...
2018 Mar 21
3
lld/lto/win32 crash on DIE code
...Op 21-3-2018 om 10:28 schreef Evgeny Leviant: >> It looks the problem lies in how your compiler generates debug info. LLVM doesn't >> expect DIDerivedType scope to be an instance of DICompileUnit. Here is a quick fix: >> >> DIE *DwarfUnit::getOrCreateContextDIE(const DIScope *Context) { >> - if (!Context || isa<DIFile>(Context)) >> + if (!Context || isa<DIFile>(Context) || isa<DICompileUnit>(Context)) >> >> However, I suggest talking to someone with in-depth debug info experience, as the problem >> itself seems to be no...