forked from OSchip/llvm-project
Change rtti/Rtti to RTTI, as it is an acronym.
llvm-svn: 90334
This commit is contained in:
parent
d6eb364b31
commit
c01c2b87e8
|
@ -46,7 +46,7 @@ public:
|
|||
unsigned LaxVectorConversions : 1;
|
||||
unsigned AltiVec : 1; // Support AltiVec-style vector initializers.
|
||||
unsigned Exceptions : 1; // Support exception handling.
|
||||
unsigned Rtti : 1; // Support rtti information.
|
||||
unsigned RTTI : 1; // Support RTTI information.
|
||||
|
||||
unsigned NeXTRuntime : 1; // Use NeXT runtime.
|
||||
unsigned Freestanding : 1; // Freestanding implementation
|
||||
|
@ -125,7 +125,7 @@ public:
|
|||
CXXOperatorNames = PascalStrings = WritableStrings = 0;
|
||||
Exceptions = Freestanding = NoBuiltin = 0;
|
||||
NeXTRuntime = 1;
|
||||
Rtti = 1;
|
||||
RTTI = 1;
|
||||
LaxVectorConversions = 1;
|
||||
HeinousExtensions = 0;
|
||||
AltiVec = OpenCL = StackProtector = 0;
|
||||
|
|
|
@ -240,7 +240,7 @@ void CodeGenFunction::EmitCXXThrowExpr(const CXXThrowExpr *E) {
|
|||
|
||||
// Now throw the exception.
|
||||
const llvm::Type *Int8PtrTy = llvm::Type::getInt8PtrTy(getLLVMContext());
|
||||
llvm::Constant *TypeInfo = CGM.GenerateRtti(ThrowType);
|
||||
llvm::Constant *TypeInfo = CGM.GenerateRTTI(ThrowType);
|
||||
llvm::Constant *Dtor = llvm::Constant::getNullValue(Int8PtrTy);
|
||||
|
||||
llvm::CallInst *ThrowCall =
|
||||
|
@ -311,7 +311,8 @@ void CodeGenFunction::EmitCXXTryStmt(const CXXTryStmt &S) {
|
|||
const CXXCatchStmt *C = S.getHandler(i);
|
||||
VarDecl *CatchParam = C->getExceptionDecl();
|
||||
if (CatchParam) {
|
||||
llvm::Value *EHType = CGM.GenerateRtti(C->getCaughtType().getNonReferenceType());
|
||||
llvm::Value *EHType
|
||||
= CGM.GenerateRTTI(C->getCaughtType().getNonReferenceType());
|
||||
SelectorArgs.push_back(EHType);
|
||||
} else {
|
||||
// null indicates catch all
|
||||
|
|
|
@ -359,10 +359,10 @@ llvm::Value * CodeGenFunction::EmitCXXTypeidExpr(const CXXTypeidExpr *E) {
|
|||
if (const RecordType *RT = Ty->getAs<RecordType>()) {
|
||||
const CXXRecordDecl *RD = cast<CXXRecordDecl>(RT->getDecl());
|
||||
if (RD->isPolymorphic())
|
||||
return Builder.CreateBitCast(CGM.GenerateRttiRef(RD), LTy);
|
||||
return Builder.CreateBitCast(CGM.GenerateRtti(RD), LTy);
|
||||
return Builder.CreateBitCast(CGM.GenerateRTTIRef(RD), LTy);
|
||||
return Builder.CreateBitCast(CGM.GenerateRTTI(RD), LTy);
|
||||
}
|
||||
return Builder.CreateBitCast(CGM.GenerateRtti(Ty), LTy);
|
||||
return Builder.CreateBitCast(CGM.GenerateRTTI(Ty), LTy);
|
||||
}
|
||||
Expr *subE = E->getExprOperand();
|
||||
Ty = subE->getType();
|
||||
|
@ -404,9 +404,9 @@ llvm::Value * CodeGenFunction::EmitCXXTypeidExpr(const CXXTypeidExpr *E) {
|
|||
V = Builder.CreateLoad(V);
|
||||
return V;
|
||||
}
|
||||
return Builder.CreateBitCast(CGM.GenerateRtti(RD), LTy);
|
||||
return Builder.CreateBitCast(CGM.GenerateRTTI(RD), LTy);
|
||||
}
|
||||
return Builder.CreateBitCast(CGM.GenerateRtti(Ty), LTy);
|
||||
return Builder.CreateBitCast(CGM.GenerateRTTI(Ty), LTy);
|
||||
}
|
||||
|
||||
llvm::Value *CodeGenFunction::EmitDynamicCast(llvm::Value *V,
|
||||
|
@ -485,8 +485,8 @@ llvm::Value *CodeGenFunction::EmitDynamicCast(llvm::Value *V,
|
|||
|
||||
// FIXME: Calculate better hint.
|
||||
llvm::Value *hint = llvm::ConstantInt::get(PtrDiffTy, -1ULL);
|
||||
llvm::Value *SrcArg = CGM.GenerateRttiRef(SrcTy);
|
||||
llvm::Value *DstArg = CGM.GenerateRttiRef(DstTy);
|
||||
llvm::Value *SrcArg = CGM.GenerateRTTIRef(SrcTy);
|
||||
llvm::Value *DstArg = CGM.GenerateRTTIRef(DstTy);
|
||||
V = Builder.CreateBitCast(V, PtrToInt8Ty);
|
||||
V = Builder.CreateCall4(CGM.CreateRuntimeFunction(FTy, "__dynamic_cast"),
|
||||
V, SrcArg, DstArg, hint);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
//===--- CGCXXRtti.cpp - Emit LLVM Code for C++ RTTI descriptors ----------===//
|
||||
//===--- CGCXXRTTI.cpp - Emit LLVM Code for C++ RTTI descriptors ----------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
|
@ -17,14 +17,14 @@
|
|||
using namespace clang;
|
||||
using namespace CodeGen;
|
||||
|
||||
class RttiBuilder {
|
||||
class RTTIBuilder {
|
||||
CodeGenModule &CGM; // Per-module state.
|
||||
llvm::LLVMContext &VMContext;
|
||||
const llvm::Type *Int8PtrTy;
|
||||
llvm::SmallSet<const CXXRecordDecl *, 16> SeenVBase;
|
||||
llvm::SmallSet<const CXXRecordDecl *, 32> SeenBase;
|
||||
public:
|
||||
RttiBuilder(CodeGenModule &cgm)
|
||||
RTTIBuilder(CodeGenModule &cgm)
|
||||
: CGM(cgm), VMContext(cgm.getModule().getContext()),
|
||||
Int8PtrTy(llvm::Type::getInt8PtrTy(VMContext)) { }
|
||||
|
||||
|
@ -49,7 +49,7 @@ public:
|
|||
|
||||
llvm::Constant *BuildName(QualType Ty, bool Hidden, bool Extern) {
|
||||
llvm::SmallString<256> OutName;
|
||||
CGM.getMangleContext().mangleCXXRttiName(Ty, OutName);
|
||||
CGM.getMangleContext().mangleCXXRTTIName(Ty, OutName);
|
||||
llvm::StringRef Name = OutName.str();
|
||||
|
||||
llvm::GlobalVariable::LinkageTypes linktype;
|
||||
|
@ -94,11 +94,11 @@ public:
|
|||
llvm::Constant *BuildTypeRef(QualType Ty) {
|
||||
llvm::Constant *C;
|
||||
|
||||
if (!CGM.getContext().getLangOptions().Rtti)
|
||||
if (!CGM.getContext().getLangOptions().RTTI)
|
||||
return llvm::Constant::getNullValue(Int8PtrTy);
|
||||
|
||||
llvm::SmallString<256> OutName;
|
||||
CGM.getMangleContext().mangleCXXRtti(Ty, OutName);
|
||||
CGM.getMangleContext().mangleCXXRTTI(Ty, OutName);
|
||||
llvm::StringRef Name = OutName.str();
|
||||
|
||||
C = CGM.getModule().getGlobalVariable(Name);
|
||||
|
@ -186,13 +186,13 @@ public:
|
|||
|
||||
|
||||
llvm::Constant *Buildclass_type_info(const CXXRecordDecl *RD) {
|
||||
if (!CGM.getContext().getLangOptions().Rtti)
|
||||
if (!CGM.getContext().getLangOptions().RTTI)
|
||||
return llvm::Constant::getNullValue(Int8PtrTy);
|
||||
|
||||
llvm::Constant *C;
|
||||
|
||||
llvm::SmallString<256> OutName;
|
||||
CGM.getMangleContext().mangleCXXRtti(CGM.getContext().getTagDeclType(RD),
|
||||
CGM.getMangleContext().mangleCXXRTTI(CGM.getContext().getTagDeclType(RD),
|
||||
OutName);
|
||||
llvm::StringRef Name = OutName.str();
|
||||
|
||||
|
@ -230,7 +230,7 @@ public:
|
|||
e = RD->bases_end(); i != e; ++i) {
|
||||
const CXXRecordDecl *Base =
|
||||
cast<CXXRecordDecl>(i->getType()->getAs<RecordType>()->getDecl());
|
||||
info.push_back(CGM.GenerateRttiRef(Base));
|
||||
info.push_back(CGM.GenerateRTTIRef(Base));
|
||||
if (simple)
|
||||
break;
|
||||
int64_t offset;
|
||||
|
@ -287,7 +287,7 @@ public:
|
|||
llvm::Constant *C;
|
||||
|
||||
llvm::SmallString<256> OutName;
|
||||
CGM.getMangleContext().mangleCXXRtti(Ty, OutName);
|
||||
CGM.getMangleContext().mangleCXXRTTI(Ty, OutName);
|
||||
llvm::StringRef Name = OutName.str();
|
||||
|
||||
llvm::GlobalVariable *GV;
|
||||
|
@ -340,7 +340,7 @@ public:
|
|||
llvm::Constant *C;
|
||||
|
||||
llvm::SmallString<256> OutName;
|
||||
CGM.getMangleContext().mangleCXXRtti(Ty, OutName);
|
||||
CGM.getMangleContext().mangleCXXRTTI(Ty, OutName);
|
||||
llvm::StringRef Name = OutName.str();
|
||||
|
||||
llvm::GlobalVariable *GV;
|
||||
|
@ -407,20 +407,20 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
llvm::Constant *CodeGenModule::GenerateRttiRef(const CXXRecordDecl *RD) {
|
||||
RttiBuilder b(*this);
|
||||
llvm::Constant *CodeGenModule::GenerateRTTIRef(const CXXRecordDecl *RD) {
|
||||
RTTIBuilder b(*this);
|
||||
|
||||
return b.Buildclass_type_infoRef(RD);
|
||||
}
|
||||
|
||||
llvm::Constant *CodeGenModule::GenerateRtti(const CXXRecordDecl *RD) {
|
||||
RttiBuilder b(*this);
|
||||
llvm::Constant *CodeGenModule::GenerateRTTI(const CXXRecordDecl *RD) {
|
||||
RTTIBuilder b(*this);
|
||||
|
||||
return b.Buildclass_type_info(RD);
|
||||
}
|
||||
|
||||
llvm::Constant *CodeGenModule::GenerateRtti(QualType Ty) {
|
||||
RttiBuilder b(*this);
|
||||
llvm::Constant *CodeGenModule::GenerateRTTI(QualType Ty) {
|
||||
RTTIBuilder b(*this);
|
||||
|
||||
return b.BuildType(Ty);
|
||||
}
|
||||
|
|
|
@ -147,7 +147,7 @@ public:
|
|||
const CXXRecordDecl *l, uint64_t lo, CodeGenModule &cgm)
|
||||
: methods(meth), Class(c), LayoutClass(l), LayoutOffset(lo),
|
||||
BLayout(cgm.getContext().getASTRecordLayout(l)),
|
||||
rtti(cgm.GenerateRttiRef(c)), VMContext(cgm.getModule().getContext()),
|
||||
rtti(cgm.GenerateRTTIRef(c)), VMContext(cgm.getModule().getContext()),
|
||||
CGM(cgm), PureVirtualFn(0),subAddressPoints(AllocAddressPoint(cgm, l, c)),
|
||||
Extern(!l->isInAnonymousNamespace()),
|
||||
LLVMPointerWidth(cgm.getContext().Target.getPointerWidth(0)) {
|
||||
|
@ -1305,7 +1305,7 @@ llvm::Constant *CodeGenModule::GenerateVTT(const CXXRecordDecl *RD) {
|
|||
|
||||
void CGVtableInfo::GenerateClassData(const CXXRecordDecl *RD) {
|
||||
Vtables[RD] = CGM.GenerateVtable(RD, RD);
|
||||
CGM.GenerateRtti(RD);
|
||||
CGM.GenerateRTTI(RD);
|
||||
CGM.GenerateVTT(RD);
|
||||
}
|
||||
|
||||
|
@ -1327,7 +1327,7 @@ llvm::Constant *CGVtableInfo::getVtable(const CXXRecordDecl *RD) {
|
|||
}
|
||||
|
||||
if (CreateDefinition) {
|
||||
CGM.GenerateRtti(RD);
|
||||
CGM.GenerateRTTI(RD);
|
||||
CGM.GenerateVTT(RD);
|
||||
}
|
||||
return vtbl;
|
||||
|
|
|
@ -224,14 +224,14 @@ public:
|
|||
/// GenerateVTT - Generate the VTT for the given type.
|
||||
llvm::Constant *GenerateVTT(const CXXRecordDecl *RD);
|
||||
|
||||
/// GenerateRtti - Generate the rtti information for the given type.
|
||||
llvm::Constant *GenerateRtti(const CXXRecordDecl *RD);
|
||||
/// GenerateRttiRef - Generate a reference to the rtti information for the
|
||||
/// GenerateRTTI - Generate the rtti information for the given type.
|
||||
llvm::Constant *GenerateRTTI(const CXXRecordDecl *RD);
|
||||
/// GenerateRTTIRef - Generate a reference to the rtti information for the
|
||||
/// given type.
|
||||
llvm::Constant *GenerateRttiRef(const CXXRecordDecl *RD);
|
||||
/// GenerateRttiNonClass - Generate the rtti information for the given
|
||||
llvm::Constant *GenerateRTTIRef(const CXXRecordDecl *RD);
|
||||
/// GenerateRTTINonClass - Generate the rtti information for the given
|
||||
/// non-class type.
|
||||
llvm::Constant *GenerateRtti(QualType Ty);
|
||||
llvm::Constant *GenerateRTTI(QualType Ty);
|
||||
|
||||
/// BuildThunk - Build a thunk for the given method.
|
||||
llvm::Constant *BuildThunk(const CXXMethodDecl *MD, bool Extern,
|
||||
|
|
|
@ -1434,7 +1434,7 @@ void MangleContext::mangleCXXCtorVtable(const CXXRecordDecl *RD, int64_t Offset,
|
|||
Mangler.mangleName(Type);
|
||||
}
|
||||
|
||||
void MangleContext::mangleCXXRtti(QualType Ty,
|
||||
void MangleContext::mangleCXXRTTI(QualType Ty,
|
||||
llvm::SmallVectorImpl<char> &Res) {
|
||||
// <special-name> ::= TI <type> # typeinfo structure
|
||||
CXXNameMangler Mangler(*this, Res);
|
||||
|
@ -1442,7 +1442,7 @@ void MangleContext::mangleCXXRtti(QualType Ty,
|
|||
Mangler.mangleType(Ty);
|
||||
}
|
||||
|
||||
void MangleContext::mangleCXXRttiName(QualType Ty,
|
||||
void MangleContext::mangleCXXRTTIName(QualType Ty,
|
||||
llvm::SmallVectorImpl<char> &Res) {
|
||||
// <special-name> ::= TS <type> # typeinfo name (null terminated byte string)
|
||||
CXXNameMangler Mangler(*this, Res);
|
||||
|
|
|
@ -76,8 +76,8 @@ public:
|
|||
void mangleCXXCtorVtable(const CXXRecordDecl *RD, int64_t Offset,
|
||||
const CXXRecordDecl *Type,
|
||||
llvm::SmallVectorImpl<char> &);
|
||||
void mangleCXXRtti(QualType T, llvm::SmallVectorImpl<char> &);
|
||||
void mangleCXXRttiName(QualType T, llvm::SmallVectorImpl<char> &);
|
||||
void mangleCXXRTTI(QualType T, llvm::SmallVectorImpl<char> &);
|
||||
void mangleCXXRTTIName(QualType T, llvm::SmallVectorImpl<char> &);
|
||||
void mangleCXXCtor(const CXXConstructorDecl *D, CXXCtorType Type,
|
||||
llvm::SmallVectorImpl<char> &);
|
||||
void mangleCXXDtor(const CXXDestructorDecl *D, CXXDtorType Type,
|
||||
|
|
|
@ -445,7 +445,7 @@ static void LangOptsToArgs(const LangOptions &Opts,
|
|||
Res.push_back("-faltivec");
|
||||
if (Opts.Exceptions)
|
||||
Res.push_back("-fexceptions");
|
||||
if (!Opts.Rtti)
|
||||
if (!Opts.RTTI)
|
||||
Res.push_back("-fno-rtti");
|
||||
if (!Opts.NeXTRuntime)
|
||||
Res.push_back("-fgnu-runtime");
|
||||
|
@ -1115,7 +1115,7 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args,
|
|||
if (Args.hasArg(OPT_fno_lax_vector_conversions))
|
||||
Opts.LaxVectorConversions = 0;
|
||||
Opts.Exceptions = Args.hasArg(OPT_fexceptions);
|
||||
Opts.Rtti = !Args.hasArg(OPT_fno_rtti);
|
||||
Opts.RTTI = !Args.hasArg(OPT_fno_rtti);
|
||||
Opts.Blocks = Args.hasArg(OPT_fblocks);
|
||||
Opts.CharIsSigned = !Args.hasArg(OPT_fno_signed_char);
|
||||
Opts.ShortWChar = Args.hasArg(OPT_fshort_wchar);
|
||||
|
|
|
@ -596,7 +596,7 @@ PascalStrings("fpascal-strings",
|
|||
"string literals"));
|
||||
|
||||
static llvm::cl::opt<bool>
|
||||
NoRtti("fno-rtti",
|
||||
NoRTTI("fno-rtti",
|
||||
llvm::cl::desc("Disable generation of rtti information"));
|
||||
|
||||
static llvm::cl::opt<bool>
|
||||
|
@ -1193,7 +1193,7 @@ void clang::InitializeLangOptions(LangOptions &Options,
|
|||
if (NoLaxVectorConversions.getPosition())
|
||||
Options.LaxVectorConversions = 0;
|
||||
Options.Exceptions = Exceptions;
|
||||
Options.Rtti = !NoRtti;
|
||||
Options.RTTI = !NoRTTI;
|
||||
Options.Blocks = EnableBlocks;
|
||||
Options.CharIsSigned = !NoSignedChar;
|
||||
if (ShortWChar.getPosition())
|
||||
|
|
Loading…
Reference in New Issue