-
Notifications
You must be signed in to change notification settings - Fork 128
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
[CIR][FrontendAction] Use ClangIR pipeline to emit LLVM bitcode #782
Conversation
@@ -2,6 +2,9 @@ | |||
// RUN: FileCheck --input-file=%t.mlir %s -check-prefix=MLIR | |||
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-llvm %s -o %t.ll | |||
// 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 |
There was a problem hiding this comment.
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.
@@ -364,6 +356,8 @@ getOutputStream(CompilerInstance &ci, StringRef inFile, | |||
return ci.createDefaultOutputFile(false, inFile, "mlir"); | |||
case CIRGenAction::OutputType::EmitLLVM: | |||
return ci.createDefaultOutputFile(false, inFile, "llvm"); | |||
case CIRGenAction::OutputType::EmitBC: | |||
return ci.createDefaultOutputFile(true, inFile, "bc"); |
There was a problem hiding this comment.
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.
case CIRGenAction::OutputType::EmitLLVM: | ||
case CIRGenAction::OutputType::EmitBC: | ||
case CIRGenAction::OutputType::EmitObj: | ||
case CIRGenAction::OutputType::EmitAssembly: { |
There was a problem hiding this comment.
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.
…#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.
…#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.
…#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.
…#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.
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.
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.