[PATCH] DebugInfo: Emit info for constant expressions in template arguments

David Blaikie dblaikie at gmail.com
Tue Aug 20 23:16:00 PDT 2013


  1) We can codegen it through LLVM, I've run llvm-dwarfdump on .o files

  Great!

  > I don't understand what you mean by "what GCC thinks about this". GCC cannot handle __uuidof. GCC/GAS has no problem assembling a .s file produced by clang/LLVM though.

  Right, sorry, I meant GDB, not GCC. Sorry for the misleading question.

  > gdb seems to feel fine about it:

  So what GDB's printed out there is just the string description of the type. What I'm more interested in is how it copes with the actual template value argument, eg:

  given:

  template<const struct _GUID *G>
  void func() {
  }

  ...

  func<&__uuidof(uuid)>();

  break inside func and print out 'G', see if you can interact with it like you would expect to interact with the guid in other expressions (eg a non-template related situation where you just had a local (or global, etc) variable:

  const _GUID *X = __uuidof(...);

  /* break in the debugger, do stuff with "X" is it the same as what you can do with "G" in the above example? */


================
Comment at: test/CodeGenCXX/debug-info-template.cpp:102
@@ +101,3 @@
+struct __declspec(uuid("{12345678-1234-1234-1234-1234567890ab}")) uuid;
+template <const struct _GUID *>
+struct tmpl_guid {
----------------
Do you need the 'struct' keyword here? I assume not.


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



More information about the cfe-commits mailing list