[LLVMbugs] [PATCH] fix llvm::Interval name clash
Vladimir Prus
ghost at cs.msu.su
Mon Jun 21 06:22:34 PDT 2004
Vladimir Prus wrote:
> It turns out that there are two classes named llvm::Interval. The first is
> in llvm/Analysis/Interval.h and the second is in
> lib/CodeGen/LiveIntervals.h.
>
> I'm not sure why it works with make-based build system, but I've just build
> llc with Boost.Build, and this name clash result in run-time failure --
> since for shared libraries the linker will pick one of the symbols in case
> of name clash, and this time it's the wrong symbol.
Ok, I think I even know why it used to work. The crash happened when instead
of destructor of the latter class the desctructor for the former class was
called. The destructor is the only method which is present in both classes
and has the same name and parameter list. Further, in both classes destructor
is implicitly defined and so is inline. As the result, gcc either fully
inlines them, or generates weak symbol -- so there's no linker error during
static linking. And with dynamic linking... everything crashes.
- Volodya
More information about the llvm-bugs
mailing list