[cfe-commits] r99385 - in /cfe/trunk/lib/CodeGen: CGClass.cpp CGVTT.cpp CGVtable.cpp CGVtable.h

Anders Carlsson andersca at mac.com
Tue Mar 23 22:32:05 PDT 2010


Author: andersca
Date: Wed Mar 24 00:32:05 2010
New Revision: 99385

URL: http://llvm.org/viewvc/llvm-project?rev=99385&view=rev
Log:
Use getNamedGlobal instead of getGlobalVariable. (Fixes self-host).

Modified:
    cfe/trunk/lib/CodeGen/CGClass.cpp
    cfe/trunk/lib/CodeGen/CGVTT.cpp
    cfe/trunk/lib/CodeGen/CGVtable.cpp
    cfe/trunk/lib/CodeGen/CGVtable.h

Modified: cfe/trunk/lib/CodeGen/CGClass.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGClass.cpp?rev=99385&r1=99384&r2=99385&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGClass.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGClass.cpp Wed Mar 24 00:32:05 2010
@@ -1560,7 +1560,7 @@
   if (!ClassDecl->isDynamicClass())
     return;
 
-  llvm::Constant *VTable = CGM.getVTables().getAddrOfVTable(ClassDecl);
+  llvm::Constant *VTable = CGM.getVTables().GetAddrOfVTable(ClassDecl);
   const CodeGenVTables::AddrSubMap_t& AddressPoints =
     CGM.getVTables().getAddressPoints(ClassDecl);
 

Modified: cfe/trunk/lib/CodeGen/CGVTT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVTT.cpp?rev=99385&r1=99384&r2=99385&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVTT.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVTT.cpp Wed Mar 24 00:32:05 2010
@@ -268,7 +268,7 @@
       GenerateDefinition(GenerateDefinition) {
     
     // First comes the primary virtual table pointer for the complete class...
-    ClassVtbl = GenerateDefinition ? CGM.getVTables().getAddrOfVTable(Class) :0;
+    ClassVtbl = GenerateDefinition ? CGM.getVTables().GetAddrOfVTable(Class) :0;
 
     llvm::Constant *Init = BuildVtablePtr(ClassVtbl, Class, Class, 0);
     Inits.push_back(Init);

Modified: cfe/trunk/lib/CodeGen/CGVtable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.cpp?rev=99385&r1=99384&r2=99385&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.cpp Wed Mar 24 00:32:05 2010
@@ -3918,7 +3918,7 @@
   GenerateVTT(Linkage, /*GenerateDefinition=*/true, RD);
 }
 
-llvm::Constant *CodeGenVTables::getAddrOfVTable(const CXXRecordDecl *RD) {
+llvm::Constant *CodeGenVTables::GetAddrOfVTable(const CXXRecordDecl *RD) {
   llvm::SmallString<256> OutName;
   CGM.getMangleContext().mangleCXXVtable(RD, OutName);
   llvm::StringRef Name = OutName.str();
@@ -3926,7 +3926,7 @@
   const llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(CGM.getLLVMContext());
   llvm::ArrayType *ArrayType = llvm::ArrayType::get(Int8PtrTy, 0);
   
-  llvm::GlobalVariable *GV = CGM.getModule().getGlobalVariable(Name);
+  llvm::GlobalVariable *GV = CGM.getModule().getNamedGlobal(Name);
   if (GV) {
     if (!GV->isDeclaration() || GV->getType()->getElementType() == ArrayType)
       return GV;

Modified: cfe/trunk/lib/CodeGen/CGVtable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGVtable.h?rev=99385&r1=99384&r2=99385&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGVtable.h (original)
+++ cfe/trunk/lib/CodeGen/CGVtable.h Wed Mar 24 00:32:05 2010
@@ -316,8 +316,8 @@
   int64_t getVirtualBaseOffsetOffset(const CXXRecordDecl *RD,
                                      const CXXRecordDecl *VBase);
 
-  /// getAddrOfVTable - Get the address of the vtable for the given record decl.
-  llvm::Constant *getAddrOfVTable(const CXXRecordDecl *RD);
+  /// GetAddrOfVTable - Get the address of the vtable for the given record decl.
+  llvm::Constant *GetAddrOfVTable(const CXXRecordDecl *RD);
 
   /// CtorVtableInfo - Information about a constructor vtable.
   struct CtorVtableInfo {





More information about the cfe-commits mailing list