forked from OSchip/llvm-project
Handle binary or in constant expressions.
llvm-svn: 46482
This commit is contained in:
parent
0674a7417f
commit
ce0740e1f5
|
@ -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);
|
||||
|
|
|
@ -36,8 +36,12 @@ void booltest2() {
|
|||
static int a = { 1 };
|
||||
static int b = { 1, 2 };
|
||||
|
||||
// References to enums.
|
||||
enum {
|
||||
EnumA, EnumB
|
||||
};
|
||||
|
||||
int c[] = { EnumA, EnumB };
|
||||
|
||||
// Binary operators
|
||||
int d[] = { EnumA | EnumB };
|
||||
|
|
Loading…
Reference in New Issue