[PATCH] Add llvm-pdbdump to tools

Zachary Turner zturner at google.com
Fri Jan 23 13:48:19 PST 2015


================
Comment at: tools/CMakeLists.txt:64
@@ -63,1 +63,3 @@
 
+if(MSVC)
+  add_llvm_tool_subdirectory(llvm-pdbdump)
----------------
chandlerc wrote:
> Shouldn't this be checking if the host OS is Windows rather than the compiler?
COM uses a bunch of Microsoft extensions and stuff.  I'm pretty sure this won't compile with MinGW, for example.  Is there a better check for "any MSVC compatible compiler, including clang"?

================
Comment at: tools/llvm-pdbdump/COMExtras.h:18-19
@@ +17,4 @@
+
+template <class R, class... Args>
+struct function_traits<R (*)(Args...)> : public function_traits<R(Args...)> {};
+
----------------
chandlerc wrote:
> MSVC 2012 doesn't support variadiac templates I thought?
Umm..  Crap?  Can we drop support for VS 2012 yet?  lol.  I'm not really sure how to implement this without it.

================
Comment at: tools/llvm-pdbdump/llvm-pdbdump.cpp:44-47
@@ +43,6 @@
+namespace windows {
+extern std::error_code UTF8ToUTF16(StringRef utf8,
+                                   SmallVectorImpl<wchar_t> &utf16);
+extern std::error_code UTF16ToUTF8(const wchar_t *utf16, size_t utf16_len,
+                                   SmallVectorImpl<char> &utf8);
+}
----------------
chandlerc wrote:
> If these aren't provided by Support, they should be. If they are, just include the header rather than declaring them yourself.
They're part of that stuff that I used to frequently complain about which is in Support, but not exposed through a header file since it's Windows-specific.

================
Comment at: tools/llvm-pdbdump/llvm-pdbdump.cpp:127
@@ +126,3 @@
+
+int main(int argc_, const char *argv_[]) {
+  // Print a stack trace if we signal out.
----------------
chandlerc wrote:
> Why the _s?
Because I use llvm::Sys::Process::GetArgumentVector() so there ends up being a second argv.  I used _ to make it clear that they're not going to be used, and that the argv vector should be used instead.

http://reviews.llvm.org/D7153

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list