clang-format: Make GetStyle return Expected<FormatStyle> instead of FormatStyle
Change the contract of GetStyle so that it returns an error when an error occurs (i.e. when it writes to stderr), and only returns the fallback style when it can't find a configuration file. Differential Revision: https://reviews.llvm.org/D28081 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@292174 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Format/Format.h 8 additions, 6 deletionsinclude/clang/Format/Format.h
- lib/Format/Format.cpp 29 additions, 35 deletionslib/Format/Format.cpp
- lib/Tooling/Refactoring.cpp 9 additions, 4 deletionslib/Tooling/Refactoring.cpp
- test/Format/style-on-command-line.cpp 5 additions, 8 deletionstest/Format/style-on-command-line.cpp
- tools/clang-format/ClangFormat.cpp 17 additions, 7 deletionstools/clang-format/ClangFormat.cpp
- unittests/Format/FormatTest.cpp 32 additions, 3 deletionsunittests/Format/FormatTest.cpp
- unittests/Format/FormatTestObjC.cpp 10 additions, 6 deletionsunittests/Format/FormatTestObjC.cpp
Loading
Please register or sign in to comment