mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 05:16:06 +00:00
Emit codegen of enum literals.
llvm-svn: 39646
This commit is contained in:
parent
9fba02845b
commit
f99b3f5ec2
@ -338,7 +338,12 @@ RValue CodeGenFunction::EmitExpr(const Expr *E) {
|
||||
|
||||
// l-values.
|
||||
case Expr::DeclRefExprClass:
|
||||
// FIXME: EnumConstantDecl's are not lvalues. This is wrong for them.
|
||||
// DeclRef's of EnumConstantDecl's are simple rvalues.
|
||||
if (const EnumConstantDecl *EC =
|
||||
dyn_cast<EnumConstantDecl>(cast<DeclRefExpr>(E)->getDecl()))
|
||||
return RValue::get(ConstantInt::get(EC->getInitVal()));
|
||||
|
||||
// FALLTHROUGH
|
||||
case Expr::ArraySubscriptExprClass:
|
||||
return EmitLoadOfLValue(E);
|
||||
case Expr::StringLiteralClass:
|
||||
|
Loading…
x
Reference in New Issue
Block a user