Fixed a bunch of ownership problems with the expression
parser. Specifically: - ClangUserExpression now keeps weak pointers to the structures it needs and then locks them when needed. This ensures that they continue to be valid without leaking memory if the ClangUserExpression is long lived. - ClangExpressionDeclMap, instead of keeping a pointer to an ExecutionContext, now contains an ExecutionContext. This prevents bugs if the pointer or its contents somehow become stale. It also no longer requires that ExecutionContexts be passed into any function except its initialization function, since it can count on the ExecutionContext still being around. There's a lot of room for improvement (specifically, ClangExpressionDeclMap should also use weak pointers insetad of shared pointers) but this is an important first step that codifies assumptions that already existed in the code. llvm-svn: 150217
Loading
Please register or sign in to comment