aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/LLVMContext.cpp
diff options
context:
space:
mode:
authorSimon Tatham <simon.tatham@arm.com>2021-07-22 10:08:06 +0100
committerSimon Tatham <simon.tatham@arm.com>2021-07-22 10:24:52 +0100
commitbd41136746a0b47882914cee5a8d1ac6714288d1 (patch)
tree74e33a018222afdc0875e1536141aed877fb4a01 /llvm/lib/IR/LLVMContext.cpp
parenta92974bfdf4fe3a3ac5e284ed3db174291bcbcba (diff)
downloadllvm-bd41136746a0b47882914cee5a8d1ac6714288d1.zip
llvm-bd41136746a0b47882914cee5a8d1ac6714288d1.tar.gz
llvm-bd41136746a0b47882914cee5a8d1ac6714288d1.tar.bz2
[clang] Use i64 for the !srcloc metadata on asm IR nodes.
This is part of a patch series working towards the ability to make SourceLocation into a 64-bit type to handle larger translation units. !srcloc is generated in clang codegen, and pulled back out by llvm functions like AsmPrinter::emitInlineAsm that need to report errors in the inline asm. From there it goes to LLVMContext::emitError, is stored in DiagnosticInfoInlineAsm, and ends up back in clang, at BackendConsumer::InlineAsmDiagHandler(), which reconstitutes a true clang::SourceLocation from the integer cookie. Throughout this code path, it's now 64-bit rather than 32, which means that if SourceLocation is expanded to a 64-bit type, this error report won't lose half of the data. The compiler will tolerate both of i32 and i64 !srcloc metadata in input IR without faulting. Test added in llvm/MC. (The semantic accuracy of the metadata is another matter, but I don't know of any situation where that matters: if you're reading an IR file written by a previous run of clang, you don't have the SourceManager that can relate those source locations back to the original source files.) Original version of the patch by Mikhail Maltsev. Reviewed By: dexonsmith Differential Revision: https://reviews.llvm.org/D105491
Diffstat (limited to 'llvm/lib/IR/LLVMContext.cpp')
-rw-r--r--llvm/lib/IR/LLVMContext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/IR/LLVMContext.cpp b/llvm/lib/IR/LLVMContext.cpp
index 234806b..c4a713d 100644
--- a/llvm/lib/IR/LLVMContext.cpp
+++ b/llvm/lib/IR/LLVMContext.cpp
@@ -248,7 +248,7 @@ void LLVMContext::diagnose(const DiagnosticInfo &DI) {
exit(1);
}
-void LLVMContext::emitError(unsigned LocCookie, const Twine &ErrorStr) {
+void LLVMContext::emitError(uint64_t LocCookie, const Twine &ErrorStr) {
diagnose(DiagnosticInfoInlineAsm(LocCookie, ErrorStr));
}