* Use clangIndex to identify declarations across translation units.
* Added new Find*ByUSR methods and removed unused Find*(IntPtr) methods.
* Added Depth/Index and IsParameterPack fields to TemplateParameterType.
* Fixed member initialization issues in C++ Method class.
* Added AST tests for function and class templates.
* All tests pass with new and old parser.
Normalized all the line endings with:
git rm --cached -r .
git reset --hard
git add .
git commit -m "Normalize all the line endings"
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>
Fix the compilation warnings with gcc:
../../../src/CppParser/Parser.cpp: In member function ‘CppSharp::CppParser::AST::DeclarationContext*
CppSharp::CppParser::Parser::GetNamespace(clang::Decl*, clang::DeclContext*)’:
../../../src/CppParser/Parser.cpp:1119:68: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘llvm::StringRef’ [-Wformat=]
printf("Unhandled declaration context kind: %s\n", Kind);
^
../../../src/CppParser/Parser.cpp: In member function ‘CppSharp::CppParser::AST::Declaration* CppSharp::CppParser::Parser::WalkDeclaration(clang::Decl*, bool, bool)’:
../../../src/CppParser/Parser.cpp:2430:51: warning: format ‘%s’ expects argument of type ‘char*’, but argument 2 has type ‘llvm::StringRef’ [-Wformat=]
Debug(" %s (line %u)\n", FileName, LineNo);
^
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@iki.fi>
* Implemented missing parts in regards to class templates.
* Fixed couple of class member initialization issues in C++ AST classes.
* Make code more look alike so it's easier to compare them.
* All tests pass now with old and new parser. Especially the nasty STL one with the ostream typedef.
Even though they share the same original ptr to clang's PreprocessedEntity, they can still have different locations so we need to duplicate them when converting the AST.
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.