forked from OSchip/llvm-project
fc55f5d1b0
for C++ classes. Replaced it with a less hacky approach: - If an expression is defined in the context of a method of class A, then that expression is wrapped as ___clang_class::___clang_expr(void*) { ... } instead of ___clang_expr(void*) { ... }. - ___clang_class is resolved as the type of the target of the "this" pointer in the method the expression is defined in. - When reporting the type of ___clang_class, a method with the signature ___clang_expr(void*) is added to that class, so that Clang doesn't complain about a method being defined without a corresponding declaration. - Whenever the expression gets called, "this" gets looked up, type-checked, and then passed in as the first argument. This required the following changes: - The ABIs were changed to support passing of the "this" pointer as part of trivial calls. - ThreadPlanCallFunction and ClangFunction were changed to support passing of an optional "this" pointer. - ClangUserExpression was extended to perform the wrapping described above. - ClangASTSource was changed to revert the changes required by the hack. - ClangExpressionParser, IRForTarget, and ClangExpressionDeclMap were changed to handle different manglings of ___clang_expr flexibly. This meant no longer searching for a function called ___clang_expr, but rather looking for a function whose name *contains* ___clang_expr. - ClangExpressionParser and ClangExpressionDeclMap now remember whether "this" is required, and know how to look it up as necessary. A few inheritance bugs remain, and I'm trying to resolve these. But it is now possible to use "this" as well as refer implicitly to member variables, when in the proper context. llvm-svn: 114384 |
||
---|---|---|
.. | ||
ASTResultSynthesizer.cpp | ||
ASTStructExtractor.cpp | ||
ClangASTSource.cpp | ||
ClangExpressionDeclMap.cpp | ||
ClangExpressionParser.cpp | ||
ClangExpressionVariable.cpp | ||
ClangFunction.cpp | ||
ClangPersistentVariables.cpp | ||
ClangUserExpression.cpp | ||
ClangUtilityFunction.cpp | ||
DWARFExpression.cpp | ||
IRDynamicChecks.cpp | ||
IRForTarget.cpp | ||
IRToDWARF.cpp | ||
Makefile | ||
RecordingMemoryManager.cpp |