summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ExprConstant.cpp6
-rw-r--r--clang/lib/CodeGen/CGExprScalar.cpp3
2 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/AST/ExprConstant.cpp b/clang/lib/AST/ExprConstant.cpp
index 11f07fb1166..db9536633be 100644
--- a/clang/lib/AST/ExprConstant.cpp
+++ b/clang/lib/AST/ExprConstant.cpp
@@ -416,6 +416,12 @@ public:
return true;
}
+ bool VisitGNUNullExpr(const GNUNullExpr *E) {
+ Result = APSInt::getNullValue(getIntTypeSizeInBits(E->getType()));
+ Result.setIsUnsigned(E->getType()->isUnsignedIntegerType());
+ return true;
+ }
+
bool VisitCXXZeroInitValueExpr(const CXXZeroInitValueExpr *E) {
Result = APSInt::getNullValue(getIntTypeSizeInBits(E->getType()));
Result.setIsUnsigned(E->getType()->isUnsignedIntegerType());
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp
index a5d5bc22af0..71f9f92f9c4 100644
--- a/clang/lib/CodeGen/CGExprScalar.cpp
+++ b/clang/lib/CodeGen/CGExprScalar.cpp
@@ -113,6 +113,9 @@ public:
Value *VisitCXXZeroInitValueExpr(const CXXZeroInitValueExpr *E) {
return llvm::Constant::getNullValue(ConvertType(E->getType()));
}
+ Value *VisitGNUNullExpr(const GNUNullExpr *E) {
+ return llvm::Constant::getNullValue(ConvertType(E->getType()));
+ }
Value *VisitTypesCompatibleExpr(const TypesCompatibleExpr *E) {
return llvm::ConstantInt::get(ConvertType(E->getType()),
CGF.getContext().typesAreCompatible(
OpenPOWER on IntegriCloud