How to Build Your First C++ Automated Refactoring Tool - CppCon 2023Tool ## KRISTEN SHAKER ## Agenda • Who Am I • Refactoring Tooling Use Cases • Clang Crash Course • Writing a Clang Tidy Check Live • Special Thanks & Questions ## 01 ## Who Am I ## C++ Core Libraries & other Bugs 03 ## Clang Tidies! ## What is a Clang Tidy  Existing Clang Tidies ## Existing Clang Tidies   ## Existing Clang Tidies0 码力 | 83 页 | 6.03 MB | 1 年前3
Conan 1.62 Documentationcompiler and any version. There are default definitions for the most popular ones: gcc, cl.exe, clang, apple-clang, intel, with different configurations of versions, runtimes, C++ standard library, etc. This contain: Listing 1: clang_3.5 [settings] os=Macos arch=x86_64 compiler=clang compiler.version=3.5 compiler.libcxx=libstdc++11 build_type=Release [env] CC=/usr/bin/clang-3.5 CXX=/usr/bin/clang++-3.5 A profile file as a command line argument as shown in the example below: $ conan create . demo/testing -pr=clang_3.5 Continuing with the example of Poco, instead of passing in a long list of command line arguments0 码力 | 993 页 | 7.53 MB | 1 年前3
Bazel编译分享 程义 - 存储计算部 2022年11月11日 ## 更新内容 1 升级 bazel 到 4.2.2 2 支持 Debian9、Debian10、Debian11 3 支持 gcc clang ## 1 ## 编译 Debian11-Dockerfile .bazelrc bazel 版本:4.2.2 ( bazelisk) docker run -v $(pwd):/curve -config=gcc7-later ... # use '-faligned-new' to enable C++17 over-aligned new support # 使用 clang 编译 CC=clang CXX=clang++ bazel build ... ## 2 ## 制作镜像 docker run -v $(pwd):/curve -v /root/.cache/bazel:/root/ ian11 ## 3 ## 修改 & 单元测试 curvefs/test/tools/curvefs_version_tool_test.cpp # 使用 clang 编译 CC=clang CXX=clang++ bazel build curvefs/... ## THANK YOU 網易 NETEASE0 码力 | 6 页 | 4.69 MB | 1 年前3
2020: The Year of Sanitizers?VIRTUAL ## 2020 : The Year of Sanitizers? Victor Ciura Principal Engineer CAPHYON ## Abstract Clang-tidy is the go-to assistant for most C++ programmers looking to improve their code, whether to modernize smart tools, you have to try dynamic/runtime analysis. After years of improvements and successes for Clang and GCC users, LLVM AddressSanitizer (ASan) is finally available on Windows, in the latest Visual under active development 3.5 million lines of C++ code a few brave nerds... or “How we manage to clang-tidy our whole code base, while maintaining our monthly release cycle” https://www.youtube.com/watch0 码力 | 135 页 | 27.77 MB | 1 年前3
Mastering C++ ModulesTo use C++20 modules with CMake, you'll need to use a compiler that supports them, such as Clang 12 or later, or GCC 11 or later. You'll also need to specify the language standard and module B; export void b() {} ## Built Module Interface (BMI) MSVC - .ifc file • G++ - .gcm file • Clang - .pcm P1838R0: Modules User-Facing Lexicon and File Extensions ISO/IEC JTC1 SC22/WG21 - Programming Ben Boeckel ben.boeckel at kitware.com Fri Feb 8 16:55:20 CET 2019 • Previous message: [Tooling] Clang Modules and build system requirements • Next message: [Tooling] Fwd: [D1483] How CMake supports Fortran0 码力 | 77 页 | 9.07 MB | 1 年前3
Adventures with Legacy Codebases: Tales of Incremental Improvementcode without user/business value ## Evolving styleguides ....with clang-format Improving with static analysis • Always provide a clang-format file - git-hooks to automatically apply formatting to changes 0_3.jpg) ## Static analysis and handling deprecations ...with clang-tidy • clang-tidy-diff lets you run only on changed lines - clang-compilation database may need modifications - replace PCH with namespace solutions • Different error handling strategies • Different code styles ### Please provide a .clang-format ## Dynamic library sharing ...with TestableDSP (TDSP)  ## Static analysis tools • Compiler errors and warnings ## • Lifetime safety • Clang experimental -Wlifetime ## Lifetime safety std::string get_string(); void dangling_string_view() (always_false()) foo(); } ## Data Flow Analysis ## CLion: • Local DFA since 1.x • Local DFA on Clang since 2020.1 Global (TU) DFA since 2021.1 • Lifetimes in 2021.2 ## PVS-Studio: • Value Range Analysis Analysis Data Flow Analysis: CTU ## Cross Translation Unit (CTU) Analysis: ##### https://clang.llvm.org/docs/analyzer/user-docs/CrossTranslationUnit.html CodeChecker https://github.com/Ericsson/ codechecker0 码力 | 61 页 | 2.70 MB | 1 年前3
LLVM's Realtime Safety Revolution: Tools for Modern Mission Critical Systemssanitizers #includeint main() { auto v = std::vector (16); return v[16]; } > clang -fsanitize=address main.cpp >=98481==ERROR: AddressSanitizer: heap-buffer-overflow on address ## Using RealtimeSanitizer (RTSan) float process(float x) [[clang::nonblocking]] { auto const y = std::vector (16); } > clang++ -fsanitize=realtime main.cpp ==86660==ERROR: RealtimeSanitizer: main+0x1c /app/example.cpp:12:5 ## Two steps 1. Attribute real-time functions with [[clang::nonblocking]] 2. Compile and link with -fsanitize=realtime ## How RealtimeSanitizer works RealtimeSanitizer0 码力 | 153 页 | 1.38 MB | 1 年前3
Just-In-Time Compilation: The Next Big ThingC++ CLING • RUNTIME COMPILED C++ / EASY-JIT • [[CLANG::JIT]] - P1609R1 ## EXISTING SOLUTIONS - C++ CLING • RUNTIME COMPILED C++ / EASY-JIT • [[CLANG::JIT]] - P1609R1 • D MIXIN** * WITH CUSTOM MODIFICATIONS EASY-JIT • [[CLANG::JIT]] - P1609R1 • D MIXIN** • OTHERS ## * WITH CUSTOM MODIFICATIONS ** COMPILE-TIME ## CLING ## [[CLANG::JIT]] ## CLING * PRIMARY A READ-EVAL-PRINT LOOP (REPL) ## [[CLANG::JIT]] ## (ATTRIBUTE) ## CLING ## * PRIMARY A READ-EVAL-PRINT LOOP (REPL) * ALWAYS JIT COMPILES THE WHOLE PROGRAM [[CLANG::JIT]] * C++ LANGUAGE EXTENSION (ATTRIBUTE) * ALLOWS JIT COMPILATION OF SPECIFICALLY-ANNOTATED FUNCTIONS0 码力 | 222 页 | 5.45 MB | 1 年前3
Extending and Simplifying C++: Thoughts on Pattern Matching using 'is' and 'as', and Can C++ be 10x Simpler & Safer?std::endl; } ## Or like that? x as Type; ## Available now! If you have C++20 compiler (GCC 10+, Clang 12+, MSVC 16.30+) ## FILIP SAJDAK Head of Engineering I am helping teams build HMI for premium cars Subsumption rules are not easy to grasp at first – CE gives fast feedbacks ## x is Type g++-10 Clang-12 MSVC v19.29 templateconstexpr auto is( X const& ) -> nullptr; } ## x is Type g++-10 Clang-12 MSVC v19.29 template< typename C, typename X> constexpr auto is( X const& ) -> std::false_type0 码力 | 108 页 | 5.08 MB | 1 年前3
共 617 条
- 1
- 2
- 3
- 4
- 5
- 6
- 62
相关搜索词
Refactoring Tooling Use CasesClangClang Tidy CheckAST MatchersLLVMConanBazelDepsPythonGCCBazelDebianclanggccCurveFSsanitizersAddressSanitizerClang-tidyVisual StudioC++ ModulesCMakeC++20P1689R5遗留代码库静态分析代码格式化clang-tidy增量改进Clang-Tidy静态分析工具C++ Core Guidelines域特定分析工具样式检查工具RealtimeSanitizerPerformance constraintsMission critical systemsDavid Trevelyan & Christopher AppleJust-In-Time CompilationJITAhead-of-Time CompilationAOTPerformance OptimizationC++Herb Sutter模式匹配类型安全强制类型转换













