[PATCH] CodeGen: __uuidof should work even with an incomplete _GUID type

David Majnemer david.majnemer at gmail.com
Tue Aug 13 02:15:06 PDT 2013


Hi rsmith, rnk, thakis,

We would crash in CodeGen::CodeGenModule::EmitUuidofInitializer
because our attempt to enter CodeGen::CodeGenModule::EmitConstantValue
will be foiled: the type of the constant value is incomplete.

Instead, create an unnamed type with the proper layout on all platforms.
Punt the problem of wrongly defined struct _GUID types to the user.
(It's impossible because the TU may never get to see the type and thus
we can't verify that it is suitable.)

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

Files:
  lib/CodeGen/CGExpr.cpp
  lib/CodeGen/CodeGenModule.cpp
  test/CodeGenCXX/microsoft-uuidof-unsupported-target.cpp
  test/CodeGenCXX/microsoft-uuidof.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1375.1.patch
Type: text/x-patch
Size: 12275 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130813/7484e09f/attachment.bin>


More information about the cfe-commits mailing list