[CIR] Add CIRGen support for static local variables with non-constant initializers
This adds CIRGen infrastructure for C++ function-local static variables
that require guarded initialization (Itanium C++ ABI).
Changes:
- Add ASTVarDeclAttr to carry VarDecl AST through the pipeline
- Add emitGuardedInit() to CIRGenCXXABI for guarded initialization
- Add emitCXXGuardedInit() to CIRGenFunction
- Replace NYI in addInitializerToStaticVarDecl() with ctor region emission
- Set static_local attribute on GlobalOp and GetGlobalOp
The global's ctor region contains the initialization code, which will be
lowered by LoweringPrepare to emit the actual guard variable pattern with
__cxa_guard_acquire/__cxa_guard_release calls.
[CIR] Add static_local attribute to GlobalOp and GetGlobalOp (#179826)
This attribute marks function-local static variables that require
guarded initialization (e.g., C++ static local variables with
non-constant initializers).
It will be used by CIRGen to communicate to LoweringPrepare which globals need guard variable emission.
This PR only adds the attribute and tests, CIRGen is in the next one.
[CIR] Add static_local attribute to GlobalOp and GetGlobalOp
This attribute marks function-local static variables that require
guarded initialization (e.g., C++ static local variables with
non-constant initializers). It is used by CIRGen to communicate
to LoweringPrepare which globals need guard variable emission.
[RISCV] Simply add the march/mabi strings to Flags for multilib selection (#180104)
It does't need to compare the march/mabi with multilib's before adding
such string into Flags. The negative one (!march/!mabi) has no effect
during multilib selection. We can select either a multilib with
identical march and mabi, or one with a subset of march and the same
mabi.
[CIR] Add static_local attribute to GlobalOp and GetGlobalOp
This attribute marks function-local static variables that require
guarded initialization (e.g., C++ static local variables with
non-constant initializers). It is used by CIRGen to communicate
to LoweringPrepare which globals need guard variable emission.
[CIR] Add ASTVarDeclInterface for AST attribute access (#179825)
Add the ASTVarDeclInterface which provides methods to access clang AST
VarDecl information from CIR attributes. This interface enables:
- mangleStaticGuardVariable: Mangle guard variable names using clang's
MangleContext
- isLocalVarDecl: Check if a variable is function-local
- getTLSKind: Get thread-local storage kind
- isInline: Check if the variable is inline
- getTemplateSpecializationKind: Get template specialization info
- getVarDecl: Direct access to the underlying VarDecl pointer
This infrastructure is needed for proper handling of static local
variables with guard variables in LoweringPrepare.
[CIR] Add ASTVarDeclInterface for AST attribute access
Add the ASTVarDeclInterface which provides methods to access clang AST
VarDecl information from CIR attributes. This interface enables:
- mangleStaticGuardVariable: Mangle guard variable names using clang's
MangleContext
- isLocalVarDecl: Check if a variable is function-local
- getTLSKind: Get thread-local storage kind
- isInline: Check if the variable is inline
- getTemplateSpecializationKind: Get template specialization info
- getVarDecl: Direct access to the underlying VarDecl pointer
This infrastructure is needed for proper handling of static local
variables with guard variables in LoweringPrepare.
[lldb] Add tree-sitter based Rust syntax highlighting
This adds tree-sitter based Rust syntax highlighting to LLDB. It
consists of the RustTreeSitterHighlighter plugin and some vendored
tree-sitter code, which is licensed under MIT.
The vendored code consists of:
1. A few header files from tree-sitter, which are commonly shared by
grammars.
2. The Rust grammar consisting of scanner.c and parser.c. These files
are generated by tree-sitter.
[1] https://github.com/tree-sitter/tree-sitter
[2] https://github.com/tree-sitter/tree-sitter-rust
This is a stacked pull request on top of: #181279
[CIR] Add ASTVarDeclInterface for AST attribute access
Add the ASTVarDeclInterface which provides methods to access clang AST
VarDecl information from CIR attributes. This interface enables:
- mangleStaticGuardVariable: Mangle guard variable names using clang's
MangleContext
- isLocalVarDecl: Check if a variable is function-local
- getTLSKind: Get thread-local storage kind
- isInline: Check if the variable is inline
- getTemplateSpecializationKind: Get template specialization info
- getVarDecl: Direct access to the underlying VarDecl pointer
This infrastructure is needed for proper handling of static local
variables with guard variables in LoweringPrepare.
[lldb] Add tree-sitter based syntax highlighting
This adds the necessary infrastructure to use tree-sitter for syntax
highlighting in LLDB. It provides the base class for a tree-sitter
highlighter plugin. Its primary function is interfacing with the
tree-sitter library, and converting captures to highlighting styles.
Adding a new tree-sitter highlighter consists of creating an LLDB plugin
that inherits from this class. The plugin has two core responsibilities:
1. Loading the tree-sitter grammar.
2. Specifying the tree-sitter syntax highlighting query.
Everything else is handled by the base class, making it extremely easy
to add a new language.
For more context and the motivation behind using tree-sitter for syntax
highlighting, see #170250.
gn build: Port d090311aa7dfe60a69ab8a9e created a dependency on clangFrontend from clangDriver.
This broke the build of clang-offload-bundler because it only depends
on Driver (and only in debug builds, probably because the dependency was
dead code in clang-offload-bundler). Add the dependency to fix the build,
which also ports d090311aa7df from CMake.