<div dir="ltr">Should've been fixed already: 257793</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 14, 2016 at 1:29 PM, Mike Aizatsky <span dir="ltr"><<a href="mailto:aizatsky@google.com" target="_blank">aizatsky@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This change breaks the build: <a href="http://lab.llvm.org:8011/builders/clang-cmake-aarch64-42vma/builds/5209/steps/build%20stage%201/logs/stdio" target="_blank">http://lab.llvm.org:8011/builders/clang-cmake-aarch64-42vma/builds/5209/steps/build%20stage%201/logs/stdio</a></div><div class="HOEnZb"><div class="h5"><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 14, 2016 at 11:24 AM Reid Kleckner via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rnk<br>
Date: Thu Jan 14 13:20:17 2016<br>
New Revision: 257790<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=257790&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=257790&view=rev</a><br>
Log:<br>
[codeview] Dump CodeView inlinee lines subsection<br>
<br>
Added:<br>
llvm/trunk/test/tools/llvm-readobj/Inputs/codeview-inlining.obj.coff<br>
llvm/trunk/test/tools/llvm-readobj/codeview-inlining.test<br>
Modified:<br>
llvm/trunk/include/llvm/DebugInfo/CodeView/Line.h<br>
llvm/trunk/tools/llvm-readobj/COFFDumper.cpp<br>
<br>
Modified: llvm/trunk/include/llvm/DebugInfo/CodeView/Line.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/Line.h?rev=257790&r1=257789&r2=257790&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/DebugInfo/CodeView/Line.h?rev=257790&r1=257789&r2=257790&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/include/llvm/DebugInfo/CodeView/Line.h (original)<br>
+++ llvm/trunk/include/llvm/DebugInfo/CodeView/Line.h Thu Jan 14 13:20:17 2016<br>
@@ -10,11 +10,14 @@<br>
#ifndef LLVM_DEBUGINFO_CODEVIEW_LINE_H<br>
#define LLVM_DEBUGINFO_CODEVIEW_LINE_H<br>
<br>
+#include "llvm/Support/Endian.h"<br>
#include <cinttypes><br>
<br>
namespace llvm {<br>
namespace codeview {<br>
<br>
+using llvm::support::ulittle32_t;<br>
+<br>
class LineInfo {<br>
public:<br>
static const uint32_t AlwaysStepIntoLineNumber = 0xfeefee;<br>
@@ -118,7 +121,22 @@ public:<br>
<br>
bool isNeverStepInto() const { return LineInf.isNeverStepInto(); }<br>
};<br>
-}<br>
-}<br>
+<br>
+enum class InlineeLinesSignature : uint32_t {<br>
+ Normal, // CV_INLINEE_SOURCE_LINE_SIGNATURE<br>
+ ExtraFiles // CV_INLINEE_SOURCE_LINE_SIGNATURE_EX<br>
+};<br>
+<br>
+struct InlineeSourceLine {<br>
+ TypeIndex Inlinee; // ID of the function that was inlined.<br>
+ ulittle32_t FileID; // Offset into FileChecksums subsection.<br>
+ ulittle32_t SourceLineNum; // First line of inlined code.<br>
+ // If extra files present:<br>
+ // ulittle32_t ExtraFileCount;<br>
+ // ulittle32_t Files[];<br>
+};<br>
+<br>
+} // namespace codeview<br>
+} // namespace llvm<br>
<br>
#endif<br>
<br>
Added: llvm/trunk/test/tools/llvm-readobj/Inputs/codeview-inlining.obj.coff<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/codeview-inlining.obj.coff?rev=257790&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/Inputs/codeview-inlining.obj.coff?rev=257790&view=auto</a><br>
==============================================================================<br>
Binary files llvm/trunk/test/tools/llvm-readobj/Inputs/codeview-inlining.obj.coff (added) and llvm/trunk/test/tools/llvm-readobj/Inputs/codeview-inlining.obj.coff Thu Jan 14 13:20:17 2016 differ<br>
<br>
Added: llvm/trunk/test/tools/llvm-readobj/codeview-inlining.test<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/codeview-inlining.test?rev=257790&view=auto" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-readobj/codeview-inlining.test?rev=257790&view=auto</a><br>
==============================================================================<br>
--- llvm/trunk/test/tools/llvm-readobj/codeview-inlining.test (added)<br>
+++ llvm/trunk/test/tools/llvm-readobj/codeview-inlining.test Thu Jan 14 13:20:17 2016<br>
@@ -0,0 +1,65 @@<br>
+; The following two object files were generated using the following command:<br>
+; $ cl /d2Zi+ /Zc:inline /O2 /Z7 /c t.cpp<br>
+; The contents of t.cpp follow:<br>
+; static void bar() {<br>
+; __asm nop<br>
+; }<br>
+; static void baz() {<br>
+; __asm nop<br>
+; }<br>
+; static __forceinline void foo() {<br>
+; __asm nop<br>
+; #include "a.h"<br>
+; #include "b.h"<br>
+; __asm nop<br>
+; goto forwards;<br>
+;<br>
+; backwards:<br>
+; __asm nop<br>
+; return;<br>
+;<br>
+; forwards:<br>
+; __asm rep nop<br>
+; goto backwards;<br>
+; }<br>
+; int main() {<br>
+; bar();<br>
+; baz();<br>
+; foo();<br>
+; }<br>
+;<br>
+; Both a.h and b.h contain "__asm nop".<br>
+<br>
+RUN: llvm-readobj -s -codeview -section-symbols %p/Inputs/codeview-inlining.obj.coff | FileCheck %s<br>
+<br>
+; FIXME: If we were more clever, we could turn FileIDs into paths.<br>
+<br>
+; CHECK: SubSectionType: InlineeLines (0xF6)<br>
+; CHECK-NEXT: SubSectionSize: 0x3C<br>
+; CHECK-NEXT: InlineeSourceLine {<br>
+; CHECK-NEXT: Inlinee: bar (0x1002)<br>
+; CHECK-NEXT: FileID: 0x30<br>
+; CHECK-NEXT: SourceLineNum: 2<br>
+; CHECK-NEXT: ExtraFileCount: 0<br>
+; CHECK-NEXT: ExtraFiles [<br>
+; CHECK-NEXT: ]<br>
+; CHECK-NEXT: }<br>
+; CHECK-NEXT: InlineeSourceLine {<br>
+; CHECK-NEXT: Inlinee: baz (0x1003)<br>
+; CHECK-NEXT: FileID: 0x30<br>
+; CHECK-NEXT: SourceLineNum: 5<br>
+; CHECK-NEXT: ExtraFileCount: 0<br>
+; CHECK-NEXT: ExtraFiles [<br>
+; CHECK-NEXT: ]<br>
+; CHECK-NEXT: }<br>
+; The 'foo' inline site has extra files due to includes.<br>
+; CHECK-NEXT: InlineeSourceLine {<br>
+; CHECK-NEXT: Inlinee: foo (0x1004)<br>
+; CHECK-NEXT: FileID: 0x0<br>
+; CHECK-NEXT: SourceLineNum: 1<br>
+; CHECK-NEXT: ExtraFileCount: 2<br>
+; CHECK-NEXT: ExtraFiles [<br>
+; CHECK-NEXT: FileID: 0x18<br>
+; CHECK-NEXT: FileID: 0x30<br>
+; CHECK-NEXT: ]<br>
+; CHECK-NEXT: }<br>
<br>
Modified: llvm/trunk/tools/llvm-readobj/COFFDumper.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=257790&r1=257789&r2=257790&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/COFFDumper.cpp?rev=257790&r1=257789&r2=257790&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/tools/llvm-readobj/COFFDumper.cpp (original)<br>
+++ llvm/trunk/tools/llvm-readobj/COFFDumper.cpp Thu Jan 14 13:20:17 2016<br>
@@ -25,6 +25,7 @@<br>
#include "llvm/ADT/StringExtras.h"<br>
#include "llvm/ADT/StringSet.h"<br>
#include "llvm/DebugInfo/CodeView/CodeView.h"<br>
+#include "llvm/DebugInfo/CodeView/Line.h"<br>
#include "llvm/DebugInfo/CodeView/TypeIndex.h"<br>
#include "llvm/DebugInfo/CodeView/TypeRecord.h"<br>
#include "llvm/DebugInfo/CodeView/SymbolRecord.h"<br>
@@ -91,6 +92,8 @@ private:<br>
const SectionRef &Section,<br>
StringRef SectionContents);<br>
<br>
+ void printCodeViewInlineeLines(StringRef Subsection);<br>
+<br>
void printMemberAttributes(MemberAttributes Attrs);<br>
<br>
void printRelocatedField(StringRef Label, const coff_section *Sec,<br>
@@ -991,6 +994,11 @@ void COFFDumper::printCodeViewSymbolSect<br>
case ModuleSubstreamKind::Symbols:<br>
printCodeViewSymbolsSubsection(Contents, Section, SectionContents);<br>
break;<br>
+<br>
+ case ModuleSubstreamKind::InlineeLines:<br>
+ printCodeViewInlineeLines(Contents);<br>
+ break;<br>
+<br>
case ModuleSubstreamKind::Lines: {<br>
// Holds a PC to file:line table. Some data to parse this subsection is<br>
// stored in the other subsections, so just check sanity and store the<br>
@@ -1685,6 +1693,34 @@ void COFFDumper::printCodeViewSymbolsSub<br>
}<br>
}<br>
<br>
+void COFFDumper::printCodeViewInlineeLines(StringRef Subsection) {<br>
+ StringRef Data = Subsection;<br>
+ uint32_t Signature;<br>
+ error(consumeUInt32(Data, Signature));<br>
+ bool HasExtraFiles = Signature == unsigned(InlineeLinesSignature::ExtraFiles);<br>
+<br>
+ while (!Data.empty()) {<br>
+ const InlineeSourceLine *ISL;<br>
+ error(consumeObject(Data, ISL));<br>
+ DictScope S(W, "InlineeSourceLine");<br>
+ printTypeIndex("Inlinee", ISL->Inlinee);<br>
+ W.printHex("FileID", ISL->FileID);<br>
+ W.printNumber("SourceLineNum", ISL->SourceLineNum);<br>
+<br>
+ if (HasExtraFiles) {<br>
+ uint32_t ExtraFileCount;<br>
+ error(consumeUInt32(Data, ExtraFileCount));<br>
+ W.printNumber("ExtraFileCount", ExtraFileCount);<br>
+ ListScope ExtraFiles(W, "ExtraFiles");<br>
+ for (unsigned I = 0; I < ExtraFileCount; ++I) {<br>
+ uint32_t FileID;<br>
+ error(consumeUInt32(Data, FileID));<br>
+ W.printHex("FileID", FileID);<br>
+ }<br>
+ }<br>
+ }<br>
+}<br>
+<br>
StringRef getRemainingTypeBytes(const TypeRecordPrefix *Rec, const char *Start) {<br>
ptrdiff_t StartOffset = Start - reinterpret_cast<const char *>(Rec);<br>
size_t RecSize = Rec->Len + 2;<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div></div><span class="HOEnZb"><font color="#888888"><div dir="ltr">-- <br></div>Mike<br>Sent from phone
</font></span></blockquote></div><br></div>