aboutsummaryrefslogtreecommitdiff
path: root/src/clang.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2021-05-17 19:30:38 -0700
committerAndrew Kelley <andrew@ziglang.org>2021-05-17 19:30:38 -0700
commit615d45da779842715a3ab65b59233e9cfb4fa122 (patch)
tree9c269e8fa9beded00954d82ebc0c95d56c485322 /src/clang.zig
parent1d3f76bbda90f810a24845c15516235d91ee12ad (diff)
parent0dd0c9620d66afcfabaf3dcb21b636530fd0ccba (diff)
downloadzig-615d45da779842715a3ab65b59233e9cfb4fa122.tar.gz
zig-615d45da779842715a3ab65b59233e9cfb4fa122.zip
Merge remote-tracking branch 'origin/master' into stage2-whole-file-astgen
Conflicts: * src/codegen/spirv.zig * src/link/SpirV.zig We're going to want to improve the stage2 test harness to print the source file name when a compile error occurs otherwise std lib contributors are going to see some confusing CI failures when they cause stage2 AstGen compile errors.
Diffstat (limited to 'src/clang.zig')
-rw-r--r--src/clang.zig5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/clang.zig b/src/clang.zig
index 256dbda1e1..b9e152aef4 100644
--- a/src/clang.zig
+++ b/src/clang.zig
@@ -1,3 +1,4 @@
+const std = @import("std");
pub const builtin = @import("builtin");
pub const SourceLocation = extern struct {
@@ -115,7 +116,9 @@ pub const APFloatBaseSemantics = extern enum {
};
pub const APInt = opaque {
- pub const getLimitedValue = ZigClangAPInt_getLimitedValue;
+ pub fn getLimitedValue(self: *const APInt, comptime T: type) T {
+ return @truncate(T, ZigClangAPInt_getLimitedValue(self, std.math.maxInt(T)));
+ }
extern fn ZigClangAPInt_getLimitedValue(*const APInt, limit: u64) u64;
};