Skip to content

Upstream enum support #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions clang/lib/CIR/CodeGen/CIRGenModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,9 @@ void CIRGenModule::emitTopLevelDecl(Decl *decl) {
case Decl::OpenACCDeclare:
emitGlobalOpenACCDecl(cast<OpenACCDeclareDecl>(decl));
break;
case Decl::Enum:
assert(!cir::MissingFeatures::generateDebugInfo() && "NYI");
break;

case Decl::Typedef:
case Decl::TypeAlias: // using foo = bar; [C++11]
Expand Down
5 changes: 5 additions & 0 deletions clang/test/CIR/CodeGen/basic.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,8 @@ size_type max_size(void) {

// OGCG: define{{.*}} i64 @max_size()
// OGCG: ret i64 2305843009213693951

enum {
um = 0,
dois = 1,
};
5 changes: 5 additions & 0 deletions clang/test/CIR/CodeGen/basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,8 @@ size_type max_size() {
// CHECK: %3 = cir.cast(integral, %2 : !s32i), !u64i
// CHECK: %4 = cir.const #cir.int<8> : !u64i
// CHECK: %5 = cir.binop(div, %3, %4) : !u64i

enum {
um = 0,
dois = 1,
};