[PATCH] D21987: [XRay] Implement `llvm-xray extract`, start of the llvm-xray tool

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 17:54:58 PDT 2016


majnemer added a subscriber: majnemer.

================
Comment at: tools/llvm-xray/xray-extract.cc:92
@@ +91,3 @@
+  const auto &Sections = ObjectFile->getBinary()->sections();
+  auto I = llvm::find_if(Sections, [&](const object::SectionRef &Section) {
+    StringRef Name = "";
----------------
Do you need the llvm:: qualifier here?

================
Comment at: tools/llvm-xray/xray-extract.cc:92
@@ +91,3 @@
+  const auto &Sections = ObjectFile->getBinary()->sections();
+  auto I = llvm::find_if(Sections, [&](const object::SectionRef &Section) {
+    StringRef Name = "";
----------------
majnemer wrote:
> Do you need the llvm:: qualifier here?
SectionRef is cheap, I'd pass it by value.

================
Comment at: tools/llvm-xray/xray-sleds.h:20-26
@@ +19,9 @@
+
+struct XRaySledEntry {
+  uint64_t Address;
+  uint64_t Function;
+  unsigned char Kind;
+  unsigned char AlwaysInstrument;
+  unsigned char Padding[14];
+};
+
----------------
This seems problematic, the fields should probably be ulittle64_t, etc..  This way they have the correct endianness and alignment.


https://reviews.llvm.org/D21987





More information about the llvm-commits mailing list