Skip to content
Commit 504f38da authored by Zachary Turner's avatar Zachary Turner
Browse files

Fix record layout when synthesizing class types.

Prior to this patch, we would try to synthesize class types by
iterating over a DenseMap of FieldDecls and adding each one to
a CXXRecordDecl.  Since a DenseMap doesn't provide a deterministic
ordering of the elements, this would not add the fields in
FieldOffset order, but rather in some random order determined by
the memory layout of the DenseMap.

This patch fixes the issue by changing DenseMaps to vectors.  The
ability to lookup a value in the DenseMap was hardly being used,
and where it is sufficient to do a vector lookup.

Differential Revision: http://reviews.llvm.org/D8512

llvm-svn: 233090
parent 186d2cbd
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment