Skip to content
  • Sean Callanan's avatar
    Fixed a bunch of ownership problems with the expression · 933693b6
    Sean Callanan authored
    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
    933693b6
Loading