aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenAction.cpp
diff options
context:
space:
mode:
authorRyan Senanayake <senanayake@google.com>2022-03-09 00:27:27 +0000
committerDaniele Castagna <dcastagna@chromium.org>2022-03-09 00:39:48 +0000
commitb3dae59b9dfb579d396bd97ca1b5a16529daac75 (patch)
treeeab2fe6d42b13f3330e295ffead0923eb00a5234 /clang/lib/CodeGen/CodeGenAction.cpp
parentaf2247893320ac601d807a71aef41c09d7d85b9a (diff)
downloadllvm-b3dae59b9dfb579d396bd97ca1b5a16529daac75.zip
llvm-b3dae59b9dfb579d396bd97ca1b5a16529daac75.tar.gz
llvm-b3dae59b9dfb579d396bd97ca1b5a16529daac75.tar.bz2
[clang] Fix CodeGenAction for LLVM IR MemBuffers
Replaces use of getCurrentFile with getCurrentFileOrBufferName in CodeGenAction. This avoids an assertion error or an incorrect name chosen for the output file when assertions are disabled. This error previously occurred when the FrontendInputFile was a MemoryBuffer instead of a file. Reviewed By: jlebar Differential Revision: https://reviews.llvm.org/D121259
Diffstat (limited to 'clang/lib/CodeGen/CodeGenAction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenAction.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenAction.cpp b/clang/lib/CodeGen/CodeGenAction.cpp
index c2c508d..807880f 100644
--- a/clang/lib/CodeGen/CodeGenAction.cpp
+++ b/clang/lib/CodeGen/CodeGenAction.cpp
@@ -1113,7 +1113,7 @@ void CodeGenAction::ExecuteAction() {
auto &CodeGenOpts = CI.getCodeGenOpts();
auto &Diagnostics = CI.getDiagnostics();
std::unique_ptr<raw_pwrite_stream> OS =
- GetOutputStream(CI, getCurrentFile(), BA);
+ GetOutputStream(CI, getCurrentFileOrBufferName(), BA);
if (BA != Backend_EmitNothing && !OS)
return;