diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-08-21 20:56:28 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2018-08-21 20:56:28 -0400 |
| commit | 02ba4b1678b9eca4262b2912c6e15030a2e75624 (patch) | |
| tree | 97a9ed923fa45cbc4df5be6a1d32473d5298ec1f /src | |
| parent | 478db39866ff5cc49dca50a8d5a7740d08122d26 (diff) | |
| parent | b2917e6be09138adcf7cfdab51a1909a30eec320 (diff) | |
| download | zig-02ba4b1678b9eca4262b2912c6e15030a2e75624.tar.gz zig-02ba4b1678b9eca4262b2912c6e15030a2e75624.zip | |
Merge branch 'master' into shawnl-path_max
Diffstat (limited to 'src')
| -rw-r--r-- | src/translate_c.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/translate_c.cpp b/src/translate_c.cpp index 830ed27cd6..735a671bcc 100644 --- a/src/translate_c.cpp +++ b/src/translate_c.cpp @@ -458,15 +458,9 @@ static const char *decl_name(const Decl *decl) { static AstNode *trans_create_node_apint(Context *c, const llvm::APSInt &aps_int) { AstNode *node = trans_create_node(c, NodeTypeIntLiteral); node->data.int_literal.bigint = allocate<BigInt>(1); - bool is_negative = aps_int.isNegative(); - // ACHTUNG: llvm::APSInt stores an int's sign inside of its getRawData; - // Internally to Zig we store an integer's sign outside of getRawData! - // ++(~aps_int) calls .flip() internally on the raw data to match Zig. - bigint_init_data( node->data.int_literal.bigint - , (is_negative ? (++(~aps_int)) : aps_int).getRawData() - , aps_int.getNumWords() - , is_negative ); + bigint_init_data(node->data.int_literal.bigint, aps_int.getRawData(), aps_int.getNumWords(), aps_int.isNegative()); return node; + } static const Type *qual_type_canon(QualType qt) { |
