[PATCH] Recursive AST deserialization

Erik Olofsson erik.olofsson at hansoft.se
Sun Aug 11 06:51:33 PDT 2013


This patch demonstrates the fixes needed to support deserializing functions with decltype return types correctly.

The problem is that depending on the order other types are deserialized a decltype might end up needing to recursively deserialize itself. Currently this causes a crash when the type is profiled.

An assert is added to make sure that the same type is not returned with different type pointers, as clang relies on the pointer value for equality comparisons.

What would be the proper way to fix this? The current implementation uses ugly placement new and relies on the types to eventually become complete.

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

Files:
  include/clang/AST/ASTContext.h
  include/clang/AST/Type.h
  lib/AST/ASTContext.cpp
  lib/AST/Type.cpp
  lib/Serialization/ASTReader.cpp
  test/PCH/cxx11-decltype.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D1359.1.patch
Type: text/x-patch
Size: 12333 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130811/d2187a9d/attachment.bin>


More information about the cfe-commits mailing list