diff options
author | John Brawn <john.brawn@arm.com> | 2016-06-15 14:14:51 +0000 |
---|---|---|
committer | John Brawn <john.brawn@arm.com> | 2016-06-15 14:14:51 +0000 |
commit | 771721cb35f359ec2acfb74259803cc636b84369 (patch) | |
tree | 2ce93989fb5eeb3247a652eca483a08231d1ad95 /llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp | |
parent | a54c21e742ac9fffe83c0cfec4fa164f28599880 (diff) | |
download | llvm-771721cb35f359ec2acfb74259803cc636b84369.zip llvm-771721cb35f359ec2acfb74259803cc636b84369.tar.gz llvm-771721cb35f359ec2acfb74259803cc636b84369.tar.bz2 |
Don't use static variables in LambdaCapture
When static variables are used in inline functions in header files anything that
uses that function ends up with a reference to the variable. Because
RecursiveASTVisitor uses the inline functions in LambdaCapture that use static
variables any AST plugin that uses RecursiveASTVisitor, such as the
PrintFunctionNames example, ends up with a reference to these variables. This is
bad on Windows when building with MSVC with LLVM_EXPORT_SYMBOLS_FOR_PLUGINS=ON
as variables used across a DLL boundary need to be explicitly dllimported in
the DLL using them.
This patch avoids that by adjusting LambdaCapture to be similar to before
r263921, with a capture of either 'this' or a VLA represented by a null Decl
pointer in DeclAndBits with an extra flag added to the bits to distinguish
between the two. This requires the use of an extra bit, and while Decl does
happen to be sufficiently aligned to allow this it's done in a way that means
PointerIntPair doesn't realise it and gives an assertion failure. Therefore I
also adjust Decl slightly to use LLVM_ALIGNAS to allow this.
Differential Revision: http://reviews.llvm.org/D20732
llvm-svn: 272788
Diffstat (limited to 'llvm/lib/Target/ARM/Disassembler/ARMDisassembler.cpp')
0 files changed, 0 insertions, 0 deletions