[PATCH] D30897: [WIP] New AsmPrinterHandler that is able to interleave source code

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 14 13:42:26 PDT 2017


hfinkel added inline comments.


================
Comment at: lib/CodeGen/AsmPrinter/SourceInterleave.cpp:38
+    std::unique_ptr<SourceCodeInfo> SI(new SourceCodeInfo);
+    auto ErrorMemBuffer = MemoryBuffer::getFile(FullPathname);
+    if (ErrorMemBuffer) {
----------------
efriedma wrote:
> If we're compiling source code using clang, we already have the source code in a buffer in memory.  Re-reading it from the disk is useless work at best, and might not even work in some cases (for example, clang supports reading C code from stdin).
I think that it is definitely worth considering about more of a handshake here between the frontend and the backend. 

That having been said, we have the same problem with stdin code as we do with optimization reports. We just can't support that in a reasonable way right now.


https://reviews.llvm.org/D30897





More information about the llvm-commits mailing list