From 5dd48ccf50697fbcffcab964265738ef51dff3f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Mon, 8 Apr 2019 14:55:09 +0200 Subject: [PATCH 1/3] Fix missing switch cases --- src/libclang/type_parser.cpp | 67 ++---------------------------------- 1 file changed, 2 insertions(+), 65 deletions(-) diff --git a/src/libclang/type_parser.cpp b/src/libclang/type_parser.cpp index 2cec59f..08f76cb 100644 --- a/src/libclang/type_parser.cpp +++ b/src/libclang/type_parser.cpp @@ -525,70 +525,7 @@ std::unique_ptr parse_type_impl(const detail::parse_context& context, { // stuff I can't parse // or have no idea what it is and wait for bug report - case CXType_Invalid: - case CXType_Overload: - case CXType_ObjCId: - case CXType_ObjCClass: - case CXType_ObjCSel: - case CXType_BlockPointer: - case CXType_Vector: - case CXType_ObjCInterface: - case CXType_ObjCObjectPointer: -#if CINDEX_VERSION_MINOR >= 43 - case CXType_Half: - case CXType_Pipe: - case CXType_OCLImage1dRO: - case CXType_OCLImage1dArrayRO: - case CXType_OCLImage1dBufferRO: - case CXType_OCLImage2dRO: - case CXType_OCLImage2dArrayRO: - case CXType_OCLImage2dDepthRO: - case CXType_OCLImage2dArrayDepthRO: - case CXType_OCLImage2dMSAARO: - case CXType_OCLImage2dArrayMSAARO: - case CXType_OCLImage2dMSAADepthRO: - case CXType_OCLImage2dArrayMSAADepthRO: - case CXType_OCLImage3dRO: - case CXType_OCLImage1dWO: - case CXType_OCLImage1dArrayWO: - case CXType_OCLImage1dBufferWO: - case CXType_OCLImage2dWO: - case CXType_OCLImage2dArrayWO: - case CXType_OCLImage2dDepthWO: - case CXType_OCLImage2dArrayDepthWO: - case CXType_OCLImage2dMSAAWO: - case CXType_OCLImage2dArrayMSAAWO: - case CXType_OCLImage2dMSAADepthWO: - case CXType_OCLImage2dArrayMSAADepthWO: - case CXType_OCLImage3dWO: - case CXType_OCLImage1dRW: - case CXType_OCLImage1dArrayRW: - case CXType_OCLImage1dBufferRW: - case CXType_OCLImage2dRW: - case CXType_OCLImage2dArrayRW: - case CXType_OCLImage2dDepthRW: - case CXType_OCLImage2dArrayDepthRW: - case CXType_OCLImage2dMSAARW: - case CXType_OCLImage2dArrayMSAARW: - case CXType_OCLImage2dMSAADepthRW: - case CXType_OCLImage2dArrayMSAADepthRW: - case CXType_OCLImage3dRW: - case CXType_OCLSampler: - case CXType_OCLEvent: - case CXType_OCLQueue: - case CXType_OCLReserveID: -#endif -#if CINDEX_VERSION_MINOR > 43 - case CXType_Float16: -#endif -#if CINDEX_VERSION_MINOR > 48 - case CXType_ShortAccum: - case CXType_Accum: - case CXType_LongAccum: - case CXType_UShortAccum: - case CXType_UAccum: - case CXType_ULongAccum: -#endif + default: context.logger->log("libclang parser", format_diagnostic(severity::warning, detail::make_location(type), "unexpected type of kind '", @@ -615,7 +552,7 @@ std::unique_ptr parse_type_impl(const detail::parse_context& context, return ptype; // fallthrough case CXType_Complex: - return cpp_unexposed_type::build(get_type_spelling(cur, type).c_str()); + return cpp_unexposed_type::build(get_type_spelling(cur, type)); case CXType_Void: return make_leave_type(cur, type, From 80b805db4635b95e0f093b276cf7f1a820d00874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Mon, 8 Apr 2019 14:56:06 +0200 Subject: [PATCH 2/3] Update CI --- azure-pipelines.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5d14906..b14005e 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -39,6 +39,8 @@ jobs: IMAGE: 'foonathan/micro_cpp_llvm:llvm6' LLVM7: IMAGE: 'foonathan/micro_cpp_llvm:llvm7' + LLVM8: + IMAGE: 'foonathan/micro_cpp_llvm:llvm8' steps: - script: docker run -u root -v "$PWD:/cppast" $(IMAGE) bash -c "cmake -DCMAKE_CXX_COMPILER=clang++ /cppast/ && cmake --build . && ctest --output-on-failure -R test" displayName: "Compiling using $(IMAGE)" @@ -57,6 +59,8 @@ jobs: URL: 'http://releases.llvm.org/6.0.0/clang+llvm-6.0.0-x86_64-apple-darwin.tar.xz' LLVM7: URL: 'http://releases.llvm.org/7.0.0/clang+llvm-7.0.0-x86_64-apple-darwin.tar.xz' + LLVM8: + URL: 'http://releases.llvm.org/8.0.0/clang+llvm-8.0.0-x86_64-apple-darwin.tar.xz' steps: - script: | mkdir build && cd build/ From bda6629bd9db31abdb0dd5131b1a6e925da9c6b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Mon, 8 Apr 2019 14:59:33 +0200 Subject: [PATCH 3/3] Fix unreachable warning --- src/libclang/type_parser.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/libclang/type_parser.cpp b/src/libclang/type_parser.cpp index 08f76cb..1013c94 100644 --- a/src/libclang/type_parser.cpp +++ b/src/libclang/type_parser.cpp @@ -675,9 +675,6 @@ std::unique_ptr parse_type_impl(const detail::parse_context& context, case CXType_Auto: return make_leave_type(cur, type, [&](std::string&&) { return cpp_auto_type::build(); }); } - - DEBUG_UNREACHABLE(detail::assert_handler{}); - return nullptr; } } // namespace