]> granicus.if.org Git - clang/commit
Improve unique_ptr-y ownership in ASTUnit::ComputePreamble
authorDavid Blaikie <dblaikie@gmail.com>
Fri, 29 Aug 2014 06:34:53 +0000 (06:34 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Fri, 29 Aug 2014 06:34:53 +0000 (06:34 +0000)
commita0a1a1e037d04ed13777407c69b4a7dfe838655e
tree9dae779170f63013f5933be701d6f56ce676570b
parent1e65841b438850bfedde7a168d215a50228539a3
Improve unique_ptr-y ownership in ASTUnit::ComputePreamble

Rather than having a pair of pairs and a reference out parameter, build
a structure with everything together and named. A raw pointer and a
unique_ptr, rather than a raw pointer and a boolean, are used to
communicate ownership transfer.

It's possible one day we'll end up with a conditional pointer (probably
represented by a raw pointer and a boolean) abstraction to use in places
like this. Conditional ownership seems to be coming up more often than
I'd hoped...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216712 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Frontend/ASTUnit.h
lib/Frontend/ASTUnit.cpp
lib/Frontend/FrontendActions.cpp