<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Nov 29, 2018, at 1:19 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="">dblaikie@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Can't say I know much about -fdebug-prefix-map, but...<br class=""><br class=""><div class="gmail_quote"><div dir="ltr" class="">On Thu, Nov 29, 2018 at 1:07 PM Adrian Prantl <<a href="mailto:aprantl@apple.com" target="_blank" class="">aprantl@apple.com</a>> wrote:<br class=""></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks for the feedback! Closely-related follow-up question: Is *this* a bug?<br class="">
<br class="">
llvm/tools/clang/test/CodeGen/debug-prefix-map.c:33:27:<br class="">
// CHECK-COMPILATION-DIR: !DIFile(filename: "/var/empty{{[/\\]}}Inputs/stdio.h", directory: "/var/empty")<br class=""></blockquote><div class=""><br class=""></div><div class="">Yeah, that doesn't look quite right to me. The duplication of the directory in both the filename and directory... <br class=""><br class="">Well, I guess it could be read as "resolve the filename relative to this directory" - but since the filename is absolute, the directory is ignored?</div><div class=""> </div></div></div></div></blockquote><br class=""></div><div><span style="font-family: monospace;" class="">Apparently LLVM is smart enough to not emit this as "/var/empty/var/empty/...</span><span style="font-family: monospace;" class="">", but I don't understand why we wouldn't strip the directory prefix in CGDebugInfo::getOrCreateFile() to save space, or at least not emit a redundant directory.</span><div style="font-family: monospace;" class=""><br class=""></div><div style="font-family: monospace;" class="">I'll send out a patch to strip a common prefix. It should save a little bit of memory and go better with my sense of aesthetics :-)</div><div style="font-family: monospace;" class=""><br class=""></div><div style="font-family: monospace;" class="">Let me know if someone has an idea why this would be useful to keep.</div><div style="font-family: monospace;" class=""><br class=""></div><div style="font-family: monospace;" class="">-- adrian</div></div></body></html>