Skip to content

Conversation

@seven-mile
Copy link
Collaborator

This PR enables ClangIR pipeline for LLVM bitcode output when it's specified properly, aligned with the behavior of text-form LLVM IR.

Some refactors about switch cases are also included to avoid too many dups.

// RUN: FileCheck --input-file=%t.ll %s -check-prefix=LLVM
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm-bc %s -o %t.bc
// RUN: llvm-dis %t.bc -o %t.bc.ll
// RUN: FileCheck --input-file=%t.bc.ll %s -check-prefix=LLVM
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentionally use the same check prefix to ensure that bitcode is equally exercised by check lines.

case CIRGenAction::OutputType::EmitLLVM:
return ci.createDefaultOutputFile(false, inFile, "llvm");
case CIRGenAction::OutputType::EmitBC:
return ci.createDefaultOutputFile(true, inFile, "bc");
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/*binary=*/true, similar to EmitObj.

Comment on lines +277 to +280
case CIRGenAction::OutputType::EmitLLVM:
case CIRGenAction::OutputType::EmitBC:
case CIRGenAction::OutputType::EmitObj:
case CIRGenAction::OutputType::EmitAssembly: {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3+1 dup cases are merged.

@bcardosolopes bcardosolopes merged commit 60214e0 into llvm:main Aug 9, 2024
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
…#782)

This PR enables ClangIR pipeline for LLVM bitcode output when it's
specified properly, aligned with the behavior of text-form LLVM IR.

Some refactors about switch cases are also included to avoid too many
dups.
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
…#782)

This PR enables ClangIR pipeline for LLVM bitcode output when it's
specified properly, aligned with the behavior of text-form LLVM IR.

Some refactors about switch cases are also included to avoid too many
dups.
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
…#782)

This PR enables ClangIR pipeline for LLVM bitcode output when it's
specified properly, aligned with the behavior of text-form LLVM IR.

Some refactors about switch cases are also included to avoid too many
dups.
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
…#782)

This PR enables ClangIR pipeline for LLVM bitcode output when it's
specified properly, aligned with the behavior of text-form LLVM IR.

Some refactors about switch cases are also included to avoid too many
dups.
lanza pushed a commit that referenced this pull request Nov 5, 2024
This PR enables ClangIR pipeline for LLVM bitcode output when it's
specified properly, aligned with the behavior of text-form LLVM IR.

Some refactors about switch cases are also included to avoid too many
dups.
lanza pushed a commit that referenced this pull request Mar 18, 2025
This PR enables ClangIR pipeline for LLVM bitcode output when it's
specified properly, aligned with the behavior of text-form LLVM IR.

Some refactors about switch cases are also included to avoid too many
dups.
terapines-osc-cir pushed a commit to Terapines/clangir that referenced this pull request Sep 2, 2025
…#782)

This PR enables ClangIR pipeline for LLVM bitcode output when it's
specified properly, aligned with the behavior of text-form LLVM IR.

Some refactors about switch cases are also included to avoid too many
dups.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants