[llvm] [docs][langref] Explain c"..." syntax of string constants (PR #84240)

via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 6 13:49:56 PST 2024


nlewycky wrote:

String constants are used in `.ll` files with and without the `c` prefix, and the rules about escaping as described in this section still apply to those too. For a few examples of what I mean, one per line:

* `target triple = "x86_64-unknown-linux-gnu"`
* `!0 = !{i64 0, !"typeid1"}`
* `@llvm.used = appending global [1 x i8*] [i8* bitcast (i32* @x to i8*)], section "llvm.metadata"`
* `define void @test() "frame-pointer"="all" gc "statepoint-example" {`

The `c` prefix indicates that this string is an llvm::Constant (probably a ConstantDataSequential or ConstantArray) value type in LLVM. The right place to explain them is probably in the [Complex Constants](https://llvm.org/docs/LangRef.html#complex-constants) section?

https://github.com/llvm/llvm-project/pull/84240


More information about the llvm-commits mailing list