mirror of
https://github.com/ziglang/zig.git
synced 2026-02-16 06:18:32 +00:00
update libclang C API wrapper
This commit is contained in:
parent
787fd0f1be
commit
3aa43dc31c
@ -1255,6 +1255,22 @@ static_assert((clang::StorageClass)ZigClangStorageClass_PrivateExtern == clang::
|
||||
static_assert((clang::StorageClass)ZigClangStorageClass_Auto == clang::SC_Auto, "");
|
||||
static_assert((clang::StorageClass)ZigClangStorageClass_Register == clang::SC_Register, "");
|
||||
|
||||
void ZigClang_detect_enum_RoundingMode(llvm::APFloat::roundingMode x) {
|
||||
switch (x) {
|
||||
case llvm::APFloat::rmNearestTiesToEven:
|
||||
case llvm::APFloat::rmTowardPositive:
|
||||
case llvm::APFloat::rmTowardNegative:
|
||||
case llvm::APFloat::rmTowardZero:
|
||||
case llvm::APFloat::rmNearestTiesToAway:
|
||||
break;
|
||||
}
|
||||
}
|
||||
static_assert((llvm::APFloat::roundingMode)ZigClangAPFloat_roundingMode_NearestTiesToEven == llvm::APFloat::rmNearestTiesToEven, "");
|
||||
static_assert((llvm::APFloat::roundingMode)ZigClangAPFloat_roundingMode_TowardPositive == llvm::APFloat::rmTowardPositive, "");
|
||||
static_assert((llvm::APFloat::roundingMode)ZigClangAPFloat_roundingMode_TowardNegative == llvm::APFloat::rmTowardNegative, "");
|
||||
static_assert((llvm::APFloat::roundingMode)ZigClangAPFloat_roundingMode_TowardZero == llvm::APFloat::rmTowardZero, "");
|
||||
static_assert((llvm::APFloat::roundingMode)ZigClangAPFloat_roundingMode_NearestTiesToAway == llvm::APFloat::rmNearestTiesToAway, "");
|
||||
|
||||
|
||||
static_assert(sizeof(ZigClangSourceLocation) == sizeof(clang::SourceLocation), "");
|
||||
static ZigClangSourceLocation bitcast(clang::SourceLocation src) {
|
||||
@ -1829,3 +1845,10 @@ ZigClangCompoundStmt_const_body_iterator ZigClangCompoundStmt_body_end(const str
|
||||
auto casted = reinterpret_cast<const clang::CompoundStmt *>(self);
|
||||
return bitcast(casted->body_end());
|
||||
}
|
||||
|
||||
unsigned ZigClangAPFloat_convertToHexString(const ZigClangAPFloat *self, char *DST,
|
||||
unsigned HexDigits, bool UpperCase, enum ZigClangAPFloat_roundingMode RM)
|
||||
{
|
||||
auto casted = reinterpret_cast<const llvm::APFloat *>(self);
|
||||
return casted->convertToHexString(DST, HexDigits, UpperCase, (llvm::APFloat::roundingMode)RM);
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@ struct ZigClangAPValueLValueBase {
|
||||
|
||||
struct ZigClangAPValue;
|
||||
struct ZigClangAPSInt;
|
||||
struct ZigClangAPFloat;
|
||||
struct ZigClangASTContext;
|
||||
struct ZigClangASTUnit;
|
||||
struct ZigClangArraySubscriptExpr;
|
||||
@ -713,6 +714,15 @@ enum ZigClangStorageClass {
|
||||
ZigClangStorageClass_Register,
|
||||
};
|
||||
|
||||
/// IEEE-754R 4.3: Rounding-direction attributes.
|
||||
enum ZigClangAPFloat_roundingMode {
|
||||
ZigClangAPFloat_roundingMode_NearestTiesToEven,
|
||||
ZigClangAPFloat_roundingMode_TowardPositive,
|
||||
ZigClangAPFloat_roundingMode_TowardNegative,
|
||||
ZigClangAPFloat_roundingMode_TowardZero,
|
||||
ZigClangAPFloat_roundingMode_NearestTiesToAway,
|
||||
};
|
||||
|
||||
ZIG_EXTERN_C struct ZigClangSourceLocation ZigClangSourceManager_getSpellingLoc(const struct ZigClangSourceManager *,
|
||||
struct ZigClangSourceLocation Loc);
|
||||
ZIG_EXTERN_C const char *ZigClangSourceManager_getFilename(const struct ZigClangSourceManager *,
|
||||
@ -827,4 +837,7 @@ ZIG_EXTERN_C struct ZigClangQualType ZigClangFunctionProtoType_getParamType(cons
|
||||
ZIG_EXTERN_C ZigClangCompoundStmt_const_body_iterator ZigClangCompoundStmt_body_begin(const struct ZigClangCompoundStmt *self);
|
||||
ZIG_EXTERN_C ZigClangCompoundStmt_const_body_iterator ZigClangCompoundStmt_body_end(const struct ZigClangCompoundStmt *self);
|
||||
|
||||
ZIG_EXTERN_C unsigned ZigClangAPFloat_convertToHexString(const struct ZigClangAPFloat *self, char *DST,
|
||||
unsigned HexDigits, bool UpperCase, enum ZigClangAPFloat_roundingMode RM);
|
||||
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user