The way we get AST layout info from Clang sometimes causes us to crash deep inside Clang.
While layout info is needed for binding C++ code, it is not usually necessary for more generalized AST consumption tasks, so add this option to make parsing code less problematic, until we are able to get the bugs tracked down.
Fix the following warning by renaming ParserResult::Parser to
CodeParser.
In file included from ../../../src/CppParser/Parser.h:16:0,
from ../../../src/CppParser/Comments.cpp:8:
../../../src/CppParser/CppParser.h:86:13: warning: declaration of ‘CppSharp::CppParser::Parser* CppSharp::CppParser::ParserResult::Parser’ [-fpermissive]
Parser* Parser;
^
../../../src/CppParser/CppParser.h:73:8: warning: changes meaning of ‘Parser’ from ‘struct CppSharp::CppParser::Parser’ [-fpermissive]
struct Parser;
^
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
Fix the following warnings:
../../../src/CppParser/CppParser.cpp: In destructor ‘CppSharp::CppParser::ParserResult::~ParserResul
t()’:
../../../src/CppParser/CppParser.cpp:49:12: warning: possible problem detected in invocation of dele
te operator: [enabled by default]
delete Parser;
^
../../../src/CppParser/CppParser.cpp:49:12: warning: invalid use of incomplete type ‘struct CppSharp::CppParser::Parser’ [enabled by default]
In file included from ../../../src/CppParser/CppParser.cpp:8:0:
../../../src/CppParser/CppParser.h:73:8: warning: forward declaration of ‘struct CppSharp::CppParser::Parser’ [enabled by default]
struct Parser;
^
../../../src/CppParser/CppParser.cpp:49:12: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined
delete Parser;
^
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
This fixes some non-deterministic behavior in the new parser but it means we are keeping around all the memory for parsing until the end of the process. This is a bit messy right now but at least we keep the API compatible between parsers. After all the new parser bugs are squashed, this will be reworked.
We should not need to do this, but Clang ignores the GCC flag "-fkeep-inline-functions" which we need to actually get these to be properly exported in a library...
This is a workaround for missing symbols when P/Invoking on the Mac for instance. There should be a working "-fkeep-inline-functions" switch available in Clang but upon reading the source code, it does not do anything besides consuming the option (not even a warning!).