Proper macro handling in C/C++
Macros are not handled properly in C/C++ plugin. Earlier we had the feature for displaying a whole macro expansion. This feature should be ported to the current master version.
Besides this we should find the way of presenting symbols inside macro definitions if possible. These symbols have a standard location (place of usage) and a "spelling location" (i.e. inside macro definition). Since there are no AST nodes at spelling locations, we can't click them and jump to them:
#define MyStruct struct S { int member; }
int main()
{
MyStruct x;
}
In this example we can't check the type of x in info tree, because no AST node belongs to x in our database. Furthermore, we can't click on any occurrences of MyStruct as a struct. To be precise, we can click there, but info tree shows only the macro expansion even if there is a record declaration too. I consider this the same issue as #421: there are multiple entities at the same location and we should present them gracefully.
We should also review getFileLoc() and getSourceText() functions of CodeCompass. In these functions we have code fragments related to macro expansion and we should understand what locations are returned here in case of macros.
Yes, I vividly recall that feature, made us have a few crashes when self-analysing or LLVM-analysing... I remember "fixing" it to a shortcut <Expansion failed.> in the previous iteration of CodeCompass.
However, there is an ORM entity called CppMacroExpansion... was that also never wired in, like BuildLog?