r290799 - CodeGen: update comment about RTTI field

Saleem Abdulrasool via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 1 11:16:03 PST 2017


Author: compnerd
Date: Sun Jan  1 13:16:02 2017
New Revision: 290799

URL: http://llvm.org/viewvc/llvm-project?rev=290799&view=rev
Log:
CodeGen: update comment about RTTI field

The MS ABI RTTI has a reserved field which is used as a cache for the
demangled name.  It must be zero-initialized, which is used as a hint by
the runtime to say that the cache has not been populated.  Since this
field is populated at runtime, the RTTI structures must be placed in the
.data section rather than .rdata.  NFC

Modified:
    cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp

Modified: cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp?rev=290799&r1=290798&r2=290799&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp (original)
+++ cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp Sun Jan  1 13:16:02 2017
@@ -3536,7 +3536,7 @@ llvm::GlobalVariable *MSRTTIBuilder::get
 
   // Initialize the base class ClassHierarchyDescriptor.
   llvm::Constant *Fields[] = {
-      llvm::ConstantInt::get(CGM.IntTy, 0), // Unknown
+      llvm::ConstantInt::get(CGM.IntTy, 0), // reserved by the runtime
       llvm::ConstantInt::get(CGM.IntTy, Flags),
       llvm::ConstantInt::get(CGM.IntTy, Classes.size()),
       ABI.getImageRelativeConstant(llvm::ConstantExpr::getInBoundsGetElementPtr(




More information about the cfe-commits mailing list