Introduce factory methods for SpecialCaseList
authorAlexey Samsonov <samsonov@google.com>
Mon, 12 Aug 2013 07:49:36 +0000 (07:49 +0000)
committerAlexey Samsonov <samsonov@google.com>
Mon, 12 Aug 2013 07:49:36 +0000 (07:49 +0000)
commitd976d43f23d67e18f097d72fd90923627f334c79
treee57f2453743e9921768ce65f7ce5fe5f56ebe26c
parent23331c30aefae840f55b52e2ed343117e5599682
Introduce factory methods for SpecialCaseList

Summary:
Doing work in constructors is bad: this change suggests to
call SpecialCaseList::create(Path, Error) instead of
"new SpecialCaseList(Path)". Currently the latter may crash with
report_fatal_error, which is undesirable - sometimes we want to report
the error to user gracefully - for example, if he provides an incorrect
file as an argument of Clang's -fsanitize-blacklist flag.

Reviewers: pcc

Reviewed By: pcc

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1327

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188156 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/SpecialCaseList.h
lib/Transforms/Utils/SpecialCaseList.cpp
unittests/Transforms/Utils/SpecialCaseList.cpp