[cfe-users] Checking if a class can be copy constructed

2019-12-16 Thread Luke Zhou via cfe-users
Hello,


I’ve been trying to do some code generation using clang (not libclang), and
want to find out if a class can be copy constructed.


I’ve tried testing if the copy constructor is deleted, but this does not
work well with templates. For example, I have a class that contains a
std::vector, whose copy constructor will apparently fail
to instantiate, but doesn’t cause the copy constructors of std::vector or
my class to be marked as deleted. Also, isInvalidDecl() returns false,
which (I think) means that the compiler didn’t even attempt to instantiate
the constructor as it has never been used.


I believe that my best bet is to try to manually check if the constructor
can instantiate. I’ve looked at clang::Sema, but was overwhelmed by the
large amount of functions. I also noticed that a lot of these functions
seem to have side effects, which is undesired since I do not want this
check to cause other parts of the code to not compile.


Am I on the right path? If so, which functions in clang::Sema should I use,
and how? If not, is there a better way?


Thank you very much.
___
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users


[cfe-users] Clang and CDO, CDQ x64 instructions

2019-12-16 Thread Victor via cfe-users
Hello Clang users and developers!

I have problem compiling some generated assembly code with clang:
mc.s:35739:2: error: invalid instruction mnemonic 'cdo'

Does Clang support x64 CDO and CDQ instructions?
The code is generated by MLRISC library. A bit older versions used CQTO/CLTD
and that worked.

Invocation options:
clang -g -O2 -D_GNU_SOURCE -pedantic -m64
 -Wno-unused-command-line-argument  mc.s

clang --version:
clang version 9.0.1-+20191205081203+432bf48c08d-1~exp1~20191205191740.102
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Best wishes
Victor
___
cfe-users mailing list
cfe-users@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-users