diff options
author | Anders Carlsson <andersca@mac.com> | 2008-01-29 01:33:32 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2008-01-29 01:33:32 +0000 |
commit | ce6237edf61ce3e5b8686f303513412c43e69058 (patch) | |
tree | 9b7a7a19506a3d6fde0cae3217f93af96adf8d73 /CodeGen/CGExprConstant.cpp | |
parent | a3881fc62ac1ddbf9c236fffd47b637fb4745bbd (diff) |
Handle binary or in constant expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46482 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'CodeGen/CGExprConstant.cpp')
-rw-r--r-- | CodeGen/CGExprConstant.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/CodeGen/CGExprConstant.cpp b/CodeGen/CGExprConstant.cpp index faf2096d28..3b1c62bb16 100644 --- a/CodeGen/CGExprConstant.cpp +++ b/CodeGen/CGExprConstant.cpp @@ -236,6 +236,14 @@ public: return EmitLValue(E->getSubExpr()); } + // Binary operators + llvm::Constant *VisitBinOr(const BinaryOperator *E) { + llvm::Constant *LHS = Visit(E->getLHS()); + llvm::Constant *RHS = Visit(E->getRHS()); + + return llvm::ConstantExpr::getOr(LHS, RHS); + } + // Utility methods const llvm::Type *ConvertType(QualType T) { return CGM.getTypes().ConvertType(T); |