[cfe-dev] Symbol names for constructors

Tamas Berghammer tberghammer at google.com
Wed Apr 8 04:21:23 PDT 2015


I am compiling the following code with clang TOT (clang version 3.7.0
(trunk 234376) (llvm/trunk 234392) Target: x86_64-unknown-linux-gnu Thread
model: posix) with the following command:

=== source ===
class myInt {
public: myInt(int _x) : theValue(_x) {}
private: int theValue;
};

int main() {
    myInt x{3};
    return 0;
}

=== compile command ===
./bin/clang++ --std=c++11 ~/tmp/C12.cpp

After compilation I see a symbol created for the constructor with name
"_ZN5myIntC2Ei" what is the base object constructor but I don't have a
symbol for "_ZN5myIntC1Ei" what would be the complete object constructor.

This issue cause us some problem in LLDB during expression evaluation so I
am interested if it is a bug (and clang should generate both symbol as gcc
do) or it is an intended behavior as an optimization. In either case I
would appreciate if someone can give me an idea about what is the case when
only one of the symbol is emitted so I can handle that case in LLDB
properly.

Thanks,
Tamas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150408/0ec99471/attachment.html>


More information about the cfe-dev mailing list