Refactor OnExit utility class in ClangUserExpression

Summary:
OnExit ensures we call `ResetDeclMap` before this method ends. However,
we also have a few manual calls to ResetDeclMap in there that are actually unnecessary
because of this (calling the method multiple times has no effect). This patch also moves
the class out of the method that we can reuse it for the upcoming method that handles
parsing for completion.

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D48337

git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@335078 91177308-0d34-0410-b5e6-96231b3b80d8
1 file changed