[PATCH] D14961: LLVM CodeView library

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 2 13:50:19 PST 2015


rnk added a subscriber: rnk.

================
Comment at: include/llvm/CodeView/CodeView.h:1
@@ +1,2 @@
+#ifndef LLVM_CODEVIEW_CODEVIEW_H
+#define LLVM_CODEVIEW_CODEVIEW_H
----------------
Each file should have the standard LLVM header that references the license: http://llvm.org/docs/CodingStandards.html#file-headers

================
Comment at: include/llvm/CodeView/CodeView.h:9
@@ +8,3 @@
+
+enum class CallingConvention : uint8_t {
+  NearC = 0x00,       // near right to left push, caller pops stack
----------------
I notice our existing PDB library, which wraps DIA, duplicates these constants. I'll take responsibility for going back and making them use this.

================
Comment at: include/llvm/CodeView/TypeRecordBuilder.h:6-7
@@ +5,4 @@
+#include "llvm/CodeView/TypeIndex.h"
+#include <llvm/ADT/SmallVector.h>
+#include <llvm/Support/raw_ostream.h>
+
----------------
You probably don't want to use angle brackets to bring in non-system headers.

================
Comment at: lib/CodeView/TypeRecordBuilder.cpp:15
@@ +14,3 @@
+void TypeRecordBuilder::writeUInt8(uint8_t Value) {
+  Stream.write(reinterpret_cast<const char *>(&Value), sizeof(uint8_t));
+}
----------------
This will not work on big endian machines. LLVM has an endian writer in include/llvm/Support/EndianWriter.h that will wrap a raw_ostream, and provide an API like this:
  endian::Writer<endian::little> ES(Stream);
  ES.write<uint32_t>(Value);


http://reviews.llvm.org/D14961





More information about the llvm-commits mailing list