summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGVTT.cpp3
-rw-r--r--clang/lib/CodeGen/CGVTables.cpp6
-rw-r--r--clang/lib/CodeGen/ItaniumCXXABI.cpp6
-rw-r--r--clang/lib/CodeGen/MicrosoftCXXABI.cpp16
-rw-r--r--clang/lib/CodeGen/MicrosoftVBTables.cpp3
5 files changed, 22 insertions, 12 deletions
diff --git a/clang/lib/CodeGen/CGVTT.cpp b/clang/lib/CodeGen/CGVTT.cpp
index ea1456f8251..31beb02a52f 100644
--- a/clang/lib/CodeGen/CGVTT.cpp
+++ b/clang/lib/CodeGen/CGVTT.cpp
@@ -102,7 +102,8 @@ llvm::GlobalVariable *CodeGenVTables::GetAddrOfVTT(const CXXRecordDecl *RD) {
SmallString<256> OutName;
llvm::raw_svector_ostream Out(OutName);
- CGM.getCXXABI().getMangleContext().mangleCXXVTT(RD, Out);
+ cast<ItaniumMangleContext>(CGM.getCXXABI().getMangleContext())
+ .mangleCXXVTT(RD, Out);
Out.flush();
StringRef Name = OutName.str();
diff --git a/clang/lib/CodeGen/CGVTables.cpp b/clang/lib/CodeGen/CGVTables.cpp
index 393e723812c..b987eb4d079 100644
--- a/clang/lib/CodeGen/CGVTables.cpp
+++ b/clang/lib/CodeGen/CGVTables.cpp
@@ -650,9 +650,9 @@ CodeGenVTables::GenerateConstructionVTable(const CXXRecordDecl *RD,
// Get the mangled construction vtable name.
SmallString<256> OutName;
llvm::raw_svector_ostream Out(OutName);
- CGM.getCXXABI().getMangleContext().
- mangleCXXCtorVTable(RD, Base.getBaseOffset().getQuantity(), Base.getBase(),
- Out);
+ cast<ItaniumMangleContext>(CGM.getCXXABI().getMangleContext())
+ .mangleCXXCtorVTable(RD, Base.getBaseOffset().getQuantity(),
+ Base.getBase(), Out);
Out.flush();
StringRef Name = OutName.str();
diff --git a/clang/lib/CodeGen/ItaniumCXXABI.cpp b/clang/lib/CodeGen/ItaniumCXXABI.cpp
index 2934e6307e0..ecf5d577981 100644
--- a/clang/lib/CodeGen/ItaniumCXXABI.cpp
+++ b/clang/lib/CodeGen/ItaniumCXXABI.cpp
@@ -41,6 +41,10 @@ protected:
bool UseARMMethodPtrABI;
bool UseARMGuardVarABI;
+ ItaniumMangleContext &getMangleContext() {
+ return cast<ItaniumMangleContext>(CodeGen::CGCXXABI::getMangleContext());
+ }
+
public:
ItaniumCXXABI(CodeGen::CodeGenModule &CGM,
bool UseARMMethodPtrABI = false,
@@ -997,7 +1001,7 @@ llvm::GlobalVariable *ItaniumCXXABI::getAddrOfVTable(const CXXRecordDecl *RD,
SmallString<256> OutName;
llvm::raw_svector_ostream Out(OutName);
- CGM.getCXXABI().getMangleContext().mangleCXXVTable(RD, Out);
+ getMangleContext().mangleCXXVTable(RD, Out);
Out.flush();
StringRef Name = OutName.str();
diff --git a/clang/lib/CodeGen/MicrosoftCXXABI.cpp b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
index cfdbaa2957f..1d73b213b7d 100644
--- a/clang/lib/CodeGen/MicrosoftCXXABI.cpp
+++ b/clang/lib/CodeGen/MicrosoftCXXABI.cpp
@@ -215,6 +215,10 @@ public:
CharUnits cookieSize);
private:
+ MicrosoftMangleContext &getMangleContext() {
+ return cast<MicrosoftMangleContext>(CodeGen::CGCXXABI::getMangleContext());
+ }
+
llvm::Constant *getZeroInt() {
return llvm::ConstantInt::get(CGM.IntTy, 0);
}
@@ -678,11 +682,11 @@ llvm::Value *MicrosoftCXXABI::getVTableAddressPointInStructor(
return VTableAddressPoint;
}
-static void mangleVFTableName(CodeGenModule &CGM, const CXXRecordDecl *RD,
- const VFPtrInfo &VFPtr, SmallString<256> &Name) {
+static void mangleVFTableName(MicrosoftMangleContext &MangleContext,
+ const CXXRecordDecl *RD, const VFPtrInfo &VFPtr,
+ SmallString<256> &Name) {
llvm::raw_svector_ostream Out(Name);
- CGM.getCXXABI().getMangleContext().mangleCXXVFTable(
- RD, VFPtr.PathToMangle, Out);
+ MangleContext.mangleCXXVFTable(RD, VFPtr.PathToMangle, Out);
}
llvm::Constant *MicrosoftCXXABI::getVTableAddressPointForConstExpr(
@@ -722,7 +726,7 @@ llvm::GlobalVariable *MicrosoftCXXABI::getAddrOfVTable(const CXXRecordDecl *RD,
llvm::StringSet<> ObservedMangledNames;
for (size_t J = 0, F = VFPtrs.size(); J != F; ++J) {
SmallString<256> Name;
- mangleVFTableName(CGM, RD, VFPtrs[J], Name);
+ mangleVFTableName(getMangleContext(), RD, VFPtrs[J], Name);
if (!ObservedMangledNames.insert(Name.str()))
llvm_unreachable("Already saw this mangling before?");
}
@@ -739,7 +743,7 @@ llvm::GlobalVariable *MicrosoftCXXABI::getAddrOfVTable(const CXXRecordDecl *RD,
.getNumVTableComponents());
SmallString<256> Name;
- mangleVFTableName(CGM, RD, VFPtrs[J], Name);
+ mangleVFTableName(getMangleContext(), RD, VFPtrs[J], Name);
VTable = CGM.CreateOrReplaceCXXRuntimeVariable(
Name.str(), ArrayType, llvm::GlobalValue::ExternalLinkage);
VTable->setUnnamedAddr(true);
diff --git a/clang/lib/CodeGen/MicrosoftVBTables.cpp b/clang/lib/CodeGen/MicrosoftVBTables.cpp
index 4523aa82b73..f901eb562c9 100644
--- a/clang/lib/CodeGen/MicrosoftVBTables.cpp
+++ b/clang/lib/CodeGen/MicrosoftVBTables.cpp
@@ -170,7 +170,8 @@ VBTableBuilder::getAddrOfVBTable(const CXXRecordDecl *ReusingBase,
SmallString<256> OutName;
llvm::raw_svector_ostream Out(OutName);
- MangleContext &Mangler = CGM.getCXXABI().getMangleContext();
+ MicrosoftMangleContext &Mangler =
+ cast<MicrosoftMangleContext>(CGM.getCXXABI().getMangleContext());
Mangler.mangleCXXVBTable(MostDerived, BasePath, Out);
Out.flush();
StringRef Name = OutName.str();
OpenPOWER on IntegriCloud