-
Notifications
You must be signed in to change notification settings - Fork 12.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PCH] Support writing BuiltinBitCastExprs to PCHs
eee944e adds the new BuiltinBitCastExpr, but does not set the Code member of ASTStmtWriter. This is not correct and causes an assertion failue in ASTStmtWriter::emit() when building PCHs that contain __builtin_bit_cast. This commit adds serialization::EXPR_BUILTIN_BIT_CAST and handles ASTStmtWriter::Code properly. Differential revision: https://reviews.llvm.org/D80360
- Loading branch information
Showing
5 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// RUN: %clang_cc1 -emit-pch -o %t %s | ||
// RUN: %clang_cc1 -include-pch %t -fsyntax-only -verify %s | ||
// expected-no-diagnostics | ||
|
||
#ifndef HEADER | ||
#define HEADER | ||
|
||
template <class T, class U> | ||
constexpr T BuiltinBitCastWrapper(const U &Arg) { | ||
return __builtin_bit_cast(T, Arg); | ||
} | ||
|
||
#else | ||
|
||
int main() { | ||
return BuiltinBitCastWrapper<int>(0); | ||
} | ||
|
||
#endif |