20 September 2023 by Phillip Johnston • Last updated 28 September 2023Your toolchain is a useful place to start when incorporating security into your development process. There are several warnings and program augmentations that help harden your application. This article focuses on GCC and Clang, as that’s what I primarily use. I’m happy to take … Continue reading "Leveraging Your Toolchain to Improve Security" The post Leveraging Your Toolchain to Improve Security appeared first on E...| Embedded Artistry
This guide is for Mac, but the tools are platform agnostic, so you can adjust them to your environment. I’m assuming you have Vim 9 or newer, and Homebrew installed. Install LLVM: Then check that clangd exists: Now make a directory for the language server plugin on Vim: Clone the git repository for the language […]| Ian's notes
This post describes how to compile a single C++ source file to an object file with the Clang API. Here is the code. It behaves like a simplified clang executable that handles -c and -S.| MaskRay
Clang provides a few options to generate timing report. Among them, -ftime-report and -ftime-trace can be used to analyze the performance of Clang's internal passes. -fproc-stat-report records time a| MaskRay
LLVM 3.9.1 was just released. It’s time to build the new LLVM/Clang with MinGW. I managed to build the following things successfully: LLVM: the base for everything else Clang: C++ and C compilers, libClang, clang-format Clang Tools Extra: mostly because it contains clang-tidy LLD: the LLVM linker; haven’t played around with it yet, but it builds ;-) These do not build, even after some coercion: OpenMP: generally supports Windows, but not MinGW libc++: from what I could gather from the doc...| Here Be Braces
Structures allow us to combine several variables to create a new data type. Some other languages support the same concept but call it “records”. If you come from object-oriented program…| Abstract Expression
People occasionally ask why LLVM-compiled code sometimes generates SIGTRAP signals when the optimizer is turned on. After digging in, they find that Clang generated a "ud2" instruction (assuming X86 code) - the same as is generated by __builtin_trap().| The LLVM Project Blog
As of a few days ago, a new feature in clang-query allows introspecting the source locations for a given clang AST node. The feature is also available for experimentation in Compiler Explorer. I previously delivered a talk at EuroLLVM 2019 and blogged in 2018 about this feature and others to assist in discovery of AST […]| Steveire's Blog
The upcoming version of Clang 12 includes a new traversal mode which can be used for easier matching of AST nodes. I presented this mode at EuroLLVM and ACCU 2019, but at the time I was calling it “ignoring invisible” mode. The primary aim is to make AST Matchers easier to write by requiring less […]| Steveire's Blog
I recently made a trip to LLVM in Brussels and ACCU in Bristol. It was a busy week. I gave a talk at both conferences on the topic of the future of AST Matchers-based refactoring. As usual, the ‘hallway track’ also proved useful at both conferences, leading to round-table discussions at the LLVM conference with […]| Steveire's Blog
Last week I flew to Brussels for EuroLLVM followed by Bristol for ACCU. At both conferences I presented the work I’ve been doing to make it easier for regular C++ programmers to perform ‘mechanical’ bespoke refactoring using the clang ASTMatchers tooling. Each talk was prepared specifically for the particular audience at that conference, but both […]| Steveire's Blog
I delivered a talk about writing a refactoring tool with Clang Tooling at code::dive in November. It was uploaded to YouTube today: The slides are available here and the code samples are here. This was a fun talk to deliver as I got to demo some features which had never been seen by anyone before. […]| Steveire's Blog
When creating clang-tidy checks, it is common to extract parts of AST Matcher expressions to local variables. I expanded on this in a previous blog. auto nonAwesomeFunction = functionDecl( unless(matchesName("^::awesome_")) ); Finder->addMatcher( nonAwesomeFunction.bind("addAwesomePrefix") , this); Finder->addMatcher( callExpr(callee(nonAwesomeFunction)).bind("addAwesomePrefix") , this); Use of such variables establishes an emergent extension API for re-use in the checks, or in […]| Steveire's Blog
Getting started – clang-tidy AST Matchers Over the last few weeks I published some blogs on the Visual C++ blog about Clang AST Matchers. The series can be found here: Extending clang-tidy Ex…| Steveire's Blog
This basically came to me in a vision the other day. It appeared in my head as a near fully formed idea: what if you could generate a Berserk-esque horric fates for your character’s lost love…| Save vs. Hollowing
In Part 1 of our series, we discussed what undefined behavior is, and how it allows C and C++ compilers to produce higher performance applications than "safe" languages. This post talks about how "| The LLVM Project Blog
How I decreased the compilation of DLL neural networks using C++17.| Blog blog("Baptiste Wicht");
Explanation on how I made DLL library 38% faster to compile with optimizations and using C++17 if constexpr.| Blog blog("Baptiste Wicht");
This article provides a description of popular assemblers and their architecture-specific differences. Assemblers GCC generates assembly code and invokes GNU Assembler (also known as "gas"), which is| MaskRay