Skip to content

Commit 042df9b

Browse files
committed
Modified how wchar_t string constants are communicated so that their char width can be inferred.
1 parent 41c5b06 commit 042df9b

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

ClangSharp.Pathogen/PathogenConstantValueInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public struct PathogenConstantValueInfo
1111
/// <summary>The subkind of the constant, see remarks for details.</summary>
1212
/// <remarks>
1313
/// If <see cref="Kind"/> is <see cref="PathogenConstantValueKind.UnsignedInteger"/>, <see cref="PathogenConstantValueKind.SignedInteger"/>, or <see cref="PathogenConstantValueKind.FloatingPoint"/>: This is the size of the value in bits.
14-
/// If <see cref="Kind"/> is <see cref="PathogenConstantValueKind.String"/>, this is one of <see cref="PathogenStringConstantKind"/>.
14+
/// If <see cref="Kind"/> is <see cref="PathogenConstantValueKind.String"/>, this is one of <see cref="PathogenStringConstantKind"/>, potentially with WideCharBit set in the case of wchar_t.
1515
/// If <see cref="Kind"/> is <see cref="PathogenConstantValueKind.Unknown"/>, this is one of <see cref="ClangConstantValueKind"/>.
1616
/// </remarks>
1717
public int SubKind;
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
namespace ClangSharp.Pathogen
1+
using System;
2+
3+
namespace ClangSharp.Pathogen
24
{
35
public enum PathogenStringConstantKind : int
46
{
57
Ascii,
8+
/// <summary>Never actually used. We replace this with the more appropriate UTF equivalent with WideCharBit set instead.</summary>
9+
[Obsolete("This kind will not appear under normal circumstances. It will be replaced with the appropriate UTF kind.")]
610
WideChar,
711
Utf8,
812
Utf16,
9-
Utf32
13+
Utf32,
14+
/// <summary>When combined with one of the UTF values, indicates that the constant was originally a <c>wchar_t</c> string.</summary>
15+
WideCharBit = 1 << 31
1016
}
1117
}

external/llvm-project

0 commit comments

Comments
 (0)