Repository navigation
Releases: humphrey0925/norn
Releases · humphrey0925/norn
Release list
v0.25.0
Kconfig builds read as they are configured, and saving a file of the kernel in seconds
Linux and U-Boot, as their configuration builds them
- U-Boot's configuration names its architecture and board (
CONFIG_SYS_ARCH,CONFIG_SYS_BOARD,CONFIG_SYS_VENDOR): the other architectures' and boards' folders are taken as not built, and__UBOOT__is defined. - Headers a build reads before every file (Kbuild's
-include include/linux/kconfig.h) are read first; any project can name its own with"includeFirst": [...]. With it,CONFIG_IS_ENABLEDis worked out as U-Boot has it (CONFIG_<prefix>X, the prefix none outside SPL, TPL and VPL). - The makefiles say which source files the configuration builds (
obj-$(CONFIG_X) += foo.o,ifdef,ifeqand the like): a file or folder they list only where it is not built is taken as not built (U-Boot'stiny-printf.cbesidevsprintf.c). What they do not name, or name in a way Norn does not work out, is left alone, and so are headers."notBuilt"now takes files as well as folders. - Configured U-Boot (sandbox), against clang: certain calls 78.3% → 91.6%, calls found 97.5% → 98.8%, definitions precision 98.2% → 99.7%. Configured Linux (x86_64 defconfig): definitions precision 98.2% → 99.4%, certain calls 95.6% → 95.9%.
More accurate
- A definition on a line a compilation does not compile is not there for it: FreeRTOS's
tasks.cdefinesMPU_WRAPPERS_INCLUDED_FROM_API_FILEbefore includingmpu_wrappers.h, so itsxTaskCreateis not renamedMPU_xTaskCreate. FreeRTOS definitions precision 68.8% → 98.2%. - A called name may have up to 128 definitions, not 32 (FreeRTOS defines
vPortEnterCriticalin 86 ports): FreeRTOS calls found 80.0% → 98.6%. _Pragma (...),__asm__ __volatile__ (...)and the like in a macro's body are no calls; atypedefof a function pointer type (the kernel'sBPF_CALL_x) declares no function. On the configured kernel, 28.76 million edges → 28.25 million, accuracy unchanged or better.- Measured against clang on six more projects: curl, SQLite, Mbed TLS, FreeRTOS, lwIP and U-Boot.
Saving a file
- On the configured kernel, saving
kernel/sched/core.cafter an edit that changes no macro takes 4.6 s (48 s before); after new macros ininclude/linux/sched.h, about 10 s (48 s). On binutils, 0.12 s (1.0–1.4 s). - How it gets there: definitions are compared as the index has them, by the file's path; what the sources settle of a file is moved with its directives when lines are put in above them; when only definitions change, of names no
#iftests, what the sources settle is worked out from where it stood instead of from nothing; and only the files whose expansion asked for a macro that changed are expanded again. - Fixed: what the sources settle of a file's
#ifs was kept for its old text after an edit that left every#defineas it was. After a start from the save with a file edited meanwhile, or after edits while running, a branch could be indexed under the wrong answer until the conditions were set again. - Indexing the configured kernel from nothing: 82 s → 73 s (which compilations read each file is worked out once).
VS Code
norn.conditions.followBuildConfig: off, a workspace with no configuration of its own is indexed with no compile conditions instead of following the first build configuration found. The configuration switch also offers No configuration; on the command line,norn --no-build-config.norn.relation.click: what one click on a row of the Relation view does.auto(as before): a reference is shown in Context, a caller or callee opens;context: every row is shown in Context first, a double click opens it;editor: every row opens.- Editing the configuration in force keeps the settings it does not touch (
notBuilt,includeFirst,kbuildof a Kconfig configuration found in the tree). si/setConditionswith parameters that do not read answers an error instead of saving an empty configuration.
Documentation
- The language server protocol: the standard LSP methods, every
si/*request and notification,.norn/config.jsonand the extension's commands, for other editors, front ends and tools; the server learns of changed files from its client.
The first opening after the upgrade builds the index again.
v0.24.0
C++ and the Linux kernel more accurate
C++
- Implicit conversions of arguments (a
std::stringwhere aSliceis taken, format strings throughLogInfoorstrprintf),T x(a);andT{...}making aT,return s;calling the copy or move constructor, and overloads in several files narrowed by the number of arguments. - gtest and Boost.Test:
ASSERT_*/EXPECT_*,TEST_Ffixtures and their bases,ASSERT_THAT'soperator(),name_invoker. - Parsing: a macro alone in a class or function body,
extern "C" {split across#ifdef __cplusplus, a header whose C++ part defines a class. - Against clang: fmt calls found 75.0% → 89.7% (certain 62.6% → 79.6%), leveldb 86.8% → 95.9% (68.2% → 87.8%), bitcoin 86.1% → 93.9% (78.5% → 89.6%); certain precision up a little on each. The first opening after the upgrade builds the index again.
C, and the Linux kernel
- A Kconfig configuration of Linux says which architecture it is for. The other architectures' folders, and
tools/andscripts/(programs the host runs), are taken as not built: still indexed and searched, but where a name or an#includecould mean what is there or what the build compiles, it means what the build compiles. The setting is"notBuilt": [...], for any project to use. - With it, what Kbuild and the compiler it names define for C:
__KERNEL__, the compiler's own macros (__clang__and its version, or__GNUC__), the architecture's (__x86_64__);__ASSEMBLY__and__CHECKER__not defined. __ASSEMBLER__is never defined in C: the many headers inside#ifndef __ASSEMBLER__are no longer undecided.- A macro defined in a source file is not taken as a meaning of a name in another source file that does not include it (
kfreefromlib/decompress_unxz.c). - Told its architecture, the kernel's compilations are each read through (they were too many to read before), and what they compile of a file is asked once per file, not once per call.
- A call inside a function a macro makes is there whenever the function is: that the macro may not be defined (the kernel's
TRACE_EVENT, read again and again under other definitions) no longer makes the call uncertain. - Macros of folders the build does not compile are not seen from those it does (
READ_ONCEfromsamples/bpf), neither where macros are expanded nor where code is read (m68k's#define clear_bit_unlock clear_bitturned x86'sclear_bit_unlockinto a secondclear_bit). - In a macro's body, a name its own file defined just before it means that definition: the kernel's
trace_events.hredefines its macros stage after stage, and itsdo_trace_event_raw_event_*functions were never made. - A macro defined further down the file a use is in is not there yet at the use (the kernel's
mutex.hmakesclass_mutex_constructor, then a macro of that name): the functions its guards make were read as declarations, and everyguard(mutex)call missed. - A call through a macro that wraps the function of its own name (
#define error(...) (error(__VA_ARGS__), const_error()), or the kernel's guard constructors, whose bodies come back to the name through another macro) reaches that function for certain. A macro that does without the function (#define htab_size(h) ((h)->size)) is still another reading. - Where every compilation was read, every definition of a macro met is expanded once, and a name first met under another choice of definition is read under it (the kernel's
TRACE_EVENT, then each stage ofDECLARE_EVENT_CLASS). - On the Linux kernel (x86_64 defconfig, against clang), with the build's configuration in the tree: calls found and certain 69.9% → 95.6%, all calls found 90.3% → 98.4%, definitions found 92.8% → 99.7%, precision of certain calls 98.7% → 99.2%. Without a configuration: certain 59.7% → 64.2%, though their precision 98.5% → 98.1%.
- Indexing the kernel with its configuration takes about 75 s and 5.2 GB at most on the machine measured: each expansion is recognised once, what a use's expansions find is kept once, and what was read already is known by a hash.
- git's certain calls 99.4% → 99.6%; Redis, binutils, STM32F4 HAL and nrfx unchanged.
v0.23.2
On the Visual Studio Marketplace, with complete third-party notices
- Third-party notices are complete: each release has
THIRD_PARTY_NOTICES-<platform>.txtbeside the server executables (0.23.0 and 0.23.1 shipped them without); and the notices now include the Rust standard library, musl (in the static Linux servers), and the MIT license of tree-sitter-cpp, whose crate ships none.