summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-06-20 21:44:55 +0000
committerNico Weber <nicolasweber@gmx.de>2013-06-20 21:44:55 +0000
commite1687c5e2554a6ceb16d2d2d791fd54e6472c3b4 (patch)
treee0d848fe23ed03c586943a083a83ea9ad7fec2a7 /clang/lib/AST/ASTContext.cpp
parentc84e4e9b1ce2e7dbb4d19ad4c1bfa4035c407685 (diff)
downloadbcm5719-llvm-e1687c5e2554a6ceb16d2d2d791fd54e6472c3b4.tar.gz
bcm5719-llvm-e1687c5e2554a6ceb16d2d2d791fd54e6472c3b4.zip
Lazily provide a __float128 dummy type in -std=gnu++11 mode.
This is needed to parse libstdc++ 4.7's type_traits, see PR13530. llvm-svn: 184476
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r--clang/lib/AST/ASTContext.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index c76ed5fdb98..870e09cc674 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -698,7 +698,7 @@ ASTContext::ASTContext(LangOptions& LOpts, SourceManager &SM,
DependentTemplateSpecializationTypes(this_()),
SubstTemplateTemplateParmPacks(this_()),
GlobalNestedNameSpecifier(0),
- Int128Decl(0), UInt128Decl(0),
+ Int128Decl(0), UInt128Decl(0), Float128StubDecl(0),
BuiltinVaListDecl(0),
ObjCIdDecl(0), ObjCSelDecl(0), ObjCClassDecl(0), ObjCProtocolClassDecl(0),
BOOLDecl(0),
@@ -857,6 +857,19 @@ TypedefDecl *ASTContext::getUInt128Decl() const {
return UInt128Decl;
}
+TypeDecl *ASTContext::getFloat128StubType() const {
+ if (!Float128StubDecl) {
+ Float128StubDecl = RecordDecl::Create(const_cast<ASTContext &>(*this),
+ TTK_Struct,
+ getTranslationUnitDecl(),
+ SourceLocation(),
+ SourceLocation(),
+ &Idents.get("__float128"));
+ }
+
+ return Float128StubDecl;
+}
+
void ASTContext::InitBuiltinType(CanQualType &R, BuiltinType::Kind K) {
BuiltinType *Ty = new (*this, TypeAlignment) BuiltinType(K);
R = CanQualType::CreateUnsafe(QualType(Ty, 0));
OpenPOWER on IntegriCloud