search for: dynamic_cast

Displaying 20 results from an estimated 137 matches for "dynamic_cast".

2012 Aug 30
2
[LLVMdev] dynamic_cast error detection
Hi all, I'm trying to convert our code base from GCC 4.0 to LLVM (on mac OS X), and ran into a problem. In the past we used mach_override and the dynamic_cast source to override the built-in dynamic_cast operator to detect shared library issues (http://gcc.gnu.org/faq.html#dso). Basically we'd assert at runtime when a duplicated RTTI is found, giving us a chance to backtrace the offending class. I'm looking for a better solution with llvm; I kno...
2012 Sep 02
0
[LLVMdev] dynamic_cast error detection
Hi Akos, you should send this to the clang mailing list instead. Ciao, Duncan. > I'm trying to convert our code base from GCC 4.0 to LLVM (on mac OS X), and ran > into a problem. In the past we used mach_override and the dynamic_cast source to > override the built-in dynamic_cast operator to detect shared library issues > (http://gcc.gnu.org/faq.html#dso). Basically we'd assert at runtime when a > duplicated RTTI is found, giving us a chance to backtrace the offending class. > > I'm looking for a better s...
2010 Nov 13
3
[LLVMdev] dyn_cast vs. dynamic_cast
LLVM has a relatively large number of proprietary replacements for standard C++ functions and classes. One of these is dyn_cast to replace dynamic_cast. The two calls appear to be semantically equivalent; the only difference that I can see is that dyn_cast reportedly works on classes that have no v-table [1]. Could someone please explain why I should use dyn_cast instead of dynamic_cast? (I thought all classes have v-tables...) Thanks, Tr...
2010 Nov 13
0
[LLVMdev] dyn_cast vs. dynamic_cast
Trevor Harmon <Trevor.W.Harmon at nasa.gov> writes: [snip] > Could someone > please explain why I should use dyn_cast instead of dynamic_cast? (I > thought all classes have v-tables...) Thanks, For reducing executable size, LLVM builds with RTTI disabled where possible.
2010 Nov 15
2
[LLVMdev] dyn_cast vs. dynamic_cast
On Nov 12, 2010, at 5:57 PM, Óscar Fuentes wrote: >> Could someone >> please explain why I should use dyn_cast instead of dynamic_cast? (I >> thought all classes have v-tables...) Thanks, > > For reducing executable size, LLVM builds with RTTI disabled where > possible. Right, but how does that relate to dyn_cast? I thought v-tables were present even when RTTI is not (because otherwise polymorphism would be imp...
2012 Oct 04
2
[LLVMdev] TableGen: Requesting feedback for "TGContext"
...o into its bump pointer, RecordKeeper should as well. Any other global state that exist should also. Sounds good. >> I'm also hoping that this change should loosen up some of the >> calcification that has accumulated on TableGen and get the ball >> rolling for transitioning dynamic_cast<> to dyn_cast<> and eliminating >> exceptions, along with general improvements in reliability and >> performance. Along the way I'm also hoping to pull together proper >> reference documentation for the language as it stands right now. > > This would be reall...
2016 Oct 07
3
RuntimeDyLdCOFF and RTTI on Windows
HI Stefan, CC'ing Reid Kleckner, who might have some insight here, and llvm-dev as this may be of interest to other windows JIT users. I am facing the issue that C++ dynamic_cast doesn't work for types > loaded from object files with RuntimeDyLd. <snip> Do you think it is possible that RuntimeDyLd misses type info data in > the COFF file or doesn't wire it up correctly? > I set ProcessAllSections = true, but I didn't recognize any change. I &gt...
2012 Oct 04
0
[LLVMdev] TableGen: Requesting feedback for "TGContext"
It won't cause a negative effect, go for it! Dynamic_cast is realllly slow compared to dyn_cast, it is worth the memory. -Chris On Oct 3, 2012, at 9:39 PM, Sean Silva <silvas at purdue.edu> wrote: > Thanks for the feedback! > >>> Does anybody have anything else they think should go into TGContext or >>> any other responsi...
2012 Oct 05
2
[LLVMdev] TableGen: Requesting feedback for "TGContext"
> It won't cause a negative effect, go for it! Dynamic_cast is realllly slow compared to dyn_cast, it is worth the memory. Ok, here's the first batch. It converts the RecTy hierarchy over to use LLVM-style RTTI. Along the way, I also wrote up a new doc "How to set up LLVM-style RTTI for your class hierarchy", which covers the previously undoc...
2012 Oct 04
7
[LLVMdev] TableGen: Requesting feedback for "TGContext"
...ave anything else they think should go into TGContext or any other responsibilities it should have? Or any feedback about the idea in general? I'm also hoping that this change should loosen up some of the calcification that has accumulated on TableGen and get the ball rolling for transitioning dynamic_cast<> to dyn_cast<> and eliminating exceptions, along with general improvements in reliability and performance. Along the way I'm also hoping to pull together proper reference documentation for the language as it stands right now. -- Sean Silva
2005 Apr 24
2
[LLVMdev] isa and friends as an alternative to dynamic cast?
As far as I can tell, exceptions work just fine without RTTI when using gcc 3.4.2. dynamic_cast, on the hand, crashes without RTTI (no compilation error or warning is generated). Jeff Cohen wrote: > This may be the case with GCC, but VC++ allows exception handling to > be enabled while RTTI is disabled. According to VC++ documentation, > RTTI is needed only to support dynamic_c...
2010 Jul 16
3
[LLVMdev] java front-end
...the Java front-end (which, based on svn commits, appears to be three-years-dead), and I'm running into some build errors. In that time did llvm change from building with exception handling and rtti to building without? I remember reading somewhere that llvm code should use dyn_cast instead of dynamic_cast. Do these need to be changed here? A little background: I'm trying to use llvm as a replacement aot compiler for the Avian JVM (see oss.readytalk.com). I figured I may be able to complete the java front end, and sufficiently parameterize it to be used with Avian (which will essentially just...
2016 Oct 24
2
RuntimeDyLdCOFF and RTTI on Windows
...lvm.org> wrote: > Hi Lang, hi dev-list (as it may be interesting for others too) > > With the cpp file attached, the repro is actually as simple as this: > $ clang -std=c++11 -emit-llvm repro_input.cpp -c -o repro_input.bc > $ lli repro_input.bc > > On Mac this prints: > dynamic_cast worked! dummy is 1 > > On Windows this prints: > dynamic_cast failed > > As the issue is reproducible with lli, it's probably unrelated to the COFF > implementation as originally stated. > I built LLVM and Clang from release39 HEAD and used both, clang and lli > from thi...
2020 Apr 02
3
RFC: dynamic_cast optimization in LTO
<font face="Verdana,Arial,Helvetica,sans-serif" size="2"> <span><div>Hi,<br>There was a mention of optimizing away C++ dynamic_casts in LTO in this presentation: <a href="https://www.youtube.com/watch?v=Fd3afoM3UOE&t=1306" target="_blank">https://www.youtube.com/watch?v=Fd3afoM3UOE&t=1306</a><br>I couldn't find any discussion on llvm-dev pertaining to this optimization.<br&gt...
2012 Oct 05
0
[LLVMdev] TableGen: Requesting feedback for "TGContext"
Why do you want to eliminate dynamic_cast and exceptions from tablegen? This is just a tool run over a few thousand lines of td files. You can't measure the difference in performance if you eliminate dynamic_cast and exceptions. I think it was a huge mistake to not use RTTI and exceptions in the compiler itself but I'm sure tha...
2005 Apr 22
6
[LLVMdev] isa and friends as an alternative to dynamic cast?
I see a bunch of definitions scattered throughout LLVM, and I could not find good documentation on them. I don't understand why they exist when LLVM is being compiled with RTTI enabled. It seems to me that: isa<T>(x) is a substitute for (dynamic_cast<T>(x) != NULL) and there are some other similar casting tools defined in Casting.h. Why should I use these instead of C++'s built-in features? Evan Jones
2016 Dec 16
0
Help needed: How to get during compile time the base class of casted C++ object inside static_cast<> and dynamic_cast<> and the pointer of the casted object
I want to detect bad casts in C++ code by using the Clang compiler. The approach is similar to what Caver and TypeSan do but without using the compiler-rt. Caver and TypeSan: https://www.usenix.org/system/files/conference/usenixsecurity15/sec15-paper-lee.pdf https://nebelwelt.net/publications/files/16CCS2.pdf For example if I have the following C++ code snippet where I want to cast object b into
2006 Feb 14
1
[LLVMdev] dynamic_cast error
Hello, Following statement from LLVM Programmer's Manual is not compiling. CallInst* callInst = dyn_cast<CallInst>(&*basic_block_iterator_1); The gcc version is : gcc (GCC) 4.0.2 20051125 (Red Hat 4.0.2-8) ============ Error message ============ llvm/include/llvm/Support/Casting.h: In function 'bool llvm::isa_impl(const From&) [with To = llvm::CallInst, From =
2012 Oct 04
0
[LLVMdev] TableGen: Requesting feedback for "TGContext"
...emory allocations should go into its bump pointer, RecordKeeper should as well. Any other global state that exist should also. > I'm also hoping that this change should loosen up some of the > calcification that has accumulated on TableGen and get the ball > rolling for transitioning dynamic_cast<> to dyn_cast<> and eliminating > exceptions, along with general improvements in reliability and > performance. Along the way I'm also hoping to pull together proper > reference documentation for the language as it stands right now. This would be really really great. Just...
2005 Apr 24
0
[LLVMdev] isa and friends as an alternative to dynamic cast?
My understanding is that EH works fine without RTTI. However, we use typeid in LLVM in a few limited spots like lib/VMCore/Pass.cpp Reid. On Sat, 2005-04-23 at 20:12 -0700, Jeff Cohen wrote: > As far as I can tell, exceptions work just fine without RTTI when using > gcc 3.4.2. dynamic_cast, on the hand, crashes without RTTI (no > compilation error or warning is generated). > > Jeff Cohen wrote: > > > This may be the case with GCC, but VC++ allows exception handling to > > be enabled while RTTI is disabled. According to VC++ documentation, > > RTTI...