]> granicus.if.org Git - clang/commit
Frontend: Don't accept null DiagnosticsEngines when building ASTUnits
authorJustin Bogner <mail@justinbogner.com>
Wed, 15 Oct 2014 00:33:06 +0000 (00:33 +0000)
committerJustin Bogner <mail@justinbogner.com>
Wed, 15 Oct 2014 00:33:06 +0000 (00:33 +0000)
commit41ed5a7362c01b8969b9b2bbde5318bf447d1e0d
tree7525b1c348cd10e806a5b2b52b781996f6b419bf
parenta02506a1da61dc0684a3b78ed16048d15ed10d71
Frontend: Don't accept null DiagnosticsEngines when building ASTUnits

The various ways to create an ASTUnit all take a refcounted pointer to
a diagnostics engine as an argument, and if it isn't pointing at
anything they initialize it. This is a pretty confusing API, and it
really makes more sense for the caller to initialize the thing since
they control the lifetime anyway.

This fixes the one caller that didn't bother initializing the pointer
and asserts that the argument is initialized.

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