[PATCH] MS RTTI Generation
David Majnemer
david.majnemer at gmail.com
Tue May 20 09:42:12 PDT 2014
================
Comment at: lib/AST/MicrosoftMangle.cpp:2265-2268
@@ -2264,6 +2264,6 @@
Mangler.getStream() << "\01??_R1";
- Mangler.mangleNumber(NVOffset);
- Mangler.mangleNumber(VBPtrOffset);
- Mangler.mangleNumber(VBTableOffset);
- Mangler.mangleNumber(Flags);
+ Mangler.mangleNumber((int)NVOffset);
+ Mangler.mangleNumber((int)VBPtrOffset);
+ Mangler.mangleNumber((int)VBTableOffset);
+ Mangler.mangleNumber((int)Flags);
Mangler.mangleName(Derived);
----------------
Instead of making these a cast to `int`, can you just make the params `int32_t`?
================
Comment at: lib/CodeGen/CGRTTI.cpp:1056
@@ +1055,3 @@
+static int countNonVirtualBases(const CXXRecordDecl *RD) {
+ int Count = 0;
+ for (const CXXBaseSpecifier &Base : RD->bases())
----------------
This should be `unsigned` to match `CXXRecordDecl::getNumBases`
================
Comment at: lib/CodeGen/CGRTTI.cpp:1240
@@ +1239,3 @@
+ BaseClass &Base = Bases[i];
+ if (Base.Flags & BaseClass::IsVirtual && !VirtualBases.insert(Base.RD))
+ i += Base.NumBases;
----------------
Can we have a comment describing what this does?
Also, please parenthesize the bitwise-and operation.
http://reviews.llvm.org/D3833
More information about the cfe-commits
mailing list