[PATCH] Emit Clang version information into .comment section (CodeGen's part of implementation) [PART 2A]

Rafael Ávila de Espíndola rafael.espindola at gmail.com
Thu Oct 3 14:18:33 PDT 2013


  Almost there, just a few nits.


================
Comment at: lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1347
@@ +1346,3 @@
+             "llvm.ident metadata entry can have only one operand");
+      if (const MDString *S = cast<MDString>(N->getOperand(0)))
+          OutStreamer.EmitIdent(S->getString());
----------------
You don't need the if when using cast. It return non-null or asserts.

================
Comment at: lib/IR/Verifier.cpp:621
@@ +620,3 @@
+  const NamedMDNode *Idents = M.getNamedMetadata("llvm.ident");
+  if (!Idents) return;
+  
----------------
Please put the return in the next line.

clang-formating the patch would be a good idea.


================
Comment at: test/CodeGen/X86/ident-metadata.ll:2
@@ +1,3 @@
+; RUN: llc -march=x86 < %s | FileCheck %s
+; RUN: llc -march=x86 -filetype=obj -o %t < %s
+; RUN: llvm-readobj -s -sd  %t | FileCheck %s -check-prefix=OBJ
----------------
No need for the -filetype=obj test. I will be tested in the MC part.



http://llvm-reviews.chandlerc.com/D1806



More information about the llvm-commits mailing list