| Index: allocated-type.patch
|
| ===================================================================
|
| --- allocated-type.patch (revision 213326)
|
| +++ allocated-type.patch (working copy)
|
| @@ -1,8 +1,8 @@
|
| diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h
|
| -index bc1bf0b..31fdc74 100644
|
| +index 6ed55ca..16819a4 100644
|
| --- a/include/clang/AST/ExprCXX.h
|
| +++ b/include/clang/AST/ExprCXX.h
|
| -@@ -1677,6 +1677,9 @@ class CXXNewExpr : public Expr {
|
| +@@ -1676,6 +1676,9 @@ class CXXNewExpr : public Expr {
|
| /// null.
|
| FunctionDecl *OperatorDelete;
|
|
|
| @@ -12,7 +12,7 @@
|
| /// \brief The allocated type-source information, as written in the source.
|
| TypeSourceInfo *AllocatedTypeInfo;
|
|
|
| -@@ -1753,6 +1756,9 @@ public:
|
| +@@ -1752,6 +1755,9 @@ public:
|
| FunctionDecl *getOperatorDelete() const { return OperatorDelete; }
|
| void setOperatorDelete(FunctionDecl *D) { OperatorDelete = D; }
|
|
|
| @@ -22,7 +22,7 @@
|
| bool isArray() const { return Array; }
|
| Expr *getArraySize() {
|
| return Array ? cast<Expr>(SubExprs[0]) : 0;
|
| -@@ -1862,6 +1868,8 @@ public:
|
| +@@ -1861,6 +1867,8 @@ public:
|
| class CXXDeleteExpr : public Expr {
|
| /// Points to the operator delete overload that is used. Could be a member.
|
| FunctionDecl *OperatorDelete;
|
| @@ -31,7 +31,7 @@
|
| /// The pointer expression to be deleted.
|
| Stmt *Argument;
|
| /// Location of the expression.
|
| -@@ -1884,7 +1892,9 @@ public:
|
| +@@ -1883,7 +1891,9 @@ public:
|
| : Expr(CXXDeleteExprClass, ty, VK_RValue, OK_Ordinary, false, false,
|
| arg->isInstantiationDependent(),
|
| arg->containsUnexpandedParameterPack()),
|
| @@ -42,7 +42,7 @@
|
| GlobalDelete(globalDelete),
|
| ArrayForm(arrayForm), ArrayFormAsWritten(arrayFormAsWritten),
|
| UsualArrayDeleteWantsSize(usualArrayDeleteWantsSize) { }
|
| -@@ -1904,6 +1914,12 @@ public:
|
| +@@ -1903,6 +1913,12 @@ public:
|
| }
|
|
|
| FunctionDecl *getOperatorDelete() const { return OperatorDelete; }
|
| @@ -56,10 +56,10 @@
|
| Expr *getArgument() { return cast<Expr>(Argument); }
|
| const Expr *getArgument() const { return cast<Expr>(Argument); }
|
| diff --git a/include/clang/Basic/LangOptions.def b/include/clang/Basic/LangOptions.def
|
| -index e8fe482..5ac2179 100644
|
| +index 22662e0..5b48593 100644
|
| --- a/include/clang/Basic/LangOptions.def
|
| +++ b/include/clang/Basic/LangOptions.def
|
| -@@ -132,6 +132,8 @@ BENIGN_LANGOPT(DebuggerSupport , 1, 0, "debugger support")
|
| +@@ -137,6 +137,8 @@ BENIGN_LANGOPT(DebuggerSupport , 1, 0, "debugger support")
|
| BENIGN_LANGOPT(DebuggerCastResultToId, 1, 0, "for 'po' in the debugger, cast the result to id if it is of unknown type")
|
| BENIGN_LANGOPT(DebuggerObjCLiteral , 1, 0, "debugger Objective-C literals and subscripting support")
|
|
|
| @@ -69,13 +69,13 @@
|
| LANGOPT(SinglePrecisionConstants , 1, 0, "treating double-precision floating point constants as single precision constants")
|
| LANGOPT(FastRelaxedMath , 1, 0, "OpenCL fast relaxed math")
|
| diff --git a/include/clang/Driver/Options.td b/include/clang/Driver/Options.td
|
| -index 7e7e111..a6da64c 100644
|
| +index efe9818..062b428 100644
|
| --- a/include/clang/Driver/Options.td
|
| +++ b/include/clang/Driver/Options.td
|
| -@@ -330,6 +330,9 @@ def faddress_sanitizer : Flag<["-"], "faddress-sanitizer">, Group<f_Group>;
|
| - def fno_address_sanitizer : Flag<["-"], "fno-address-sanitizer">, Group<f_Group>;
|
| - def fthread_sanitizer : Flag<["-"], "fthread-sanitizer">, Group<f_Group>;
|
| - def fno_thread_sanitizer : Flag<["-"], "fno-thread-sanitizer">, Group<f_Group>;
|
| +@@ -357,6 +357,9 @@ def fapple_kext : Flag<["-"], "fapple-kext">, Group<f_Group>, Flags<[CC1Option]>
|
| + HelpText<"Use Apple's kernel extensions ABI">;
|
| + def fapple_pragma_pack : Flag<["-"], "fapple-pragma-pack">, Group<f_Group>, Flags<[CC1Option]>,
|
| + HelpText<"Enable Apple gcc-compatible #pragma pack handling">;
|
| +def fintercept_allocation_functions : Flag<["-"], "fintercept-allocation-functions">, Group<f_Group>, Flags<[CC1Option]>,
|
| + HelpText<"Intercept allocation functions and allocated types">;
|
| +def fno_intercept_allocation_functions : Flag<["-"], "fno-intercept-allocation-functions">, Group<f_Group>, Flags<[CC1Option]>;
|
| @@ -83,10 +83,10 @@
|
|
|
| def fasm_blocks : Flag<["-"], "fasm-blocks">, Group<f_Group>, Flags<[CC1Option]>;
|
| diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h
|
| -index 6b4079e..8d75ace 100644
|
| +index 5ce80a6..9a32130 100644
|
| --- a/include/clang/Sema/Sema.h
|
| +++ b/include/clang/Sema/Sema.h
|
| -@@ -3517,6 +3517,9 @@ public:
|
| +@@ -3685,6 +3685,9 @@ public:
|
| NamespaceDecl *getStdNamespace() const;
|
| NamespaceDecl *getOrCreateStdNamespace();
|
|
|
| @@ -96,19 +96,19 @@
|
| CXXRecordDecl *getStdBadAlloc() const;
|
|
|
| /// \brief Tests whether Ty is an instance of std::initializer_list and, if
|
| -@@ -4056,6 +4059,7 @@ public:
|
| - void DeclareGlobalAllocationFunction(DeclarationName Name, QualType Return,
|
| - QualType Argument,
|
| +@@ -4237,6 +4240,7 @@ public:
|
| + QualType Param1,
|
| + QualType Param2 = QualType(),
|
| bool addMallocAttr = false);
|
| + void DeclareGlobalAllocatorInterceptFunctions(DeclarationName Name);
|
|
|
| bool FindDeallocationFunction(SourceLocation StartLoc, CXXRecordDecl *RD,
|
| DeclarationName Name, FunctionDecl* &Operator,
|
| diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp
|
| -index 55bd199..d0e29a2 100644
|
| +index ee49925..9f5dda9 100644
|
| --- a/lib/AST/ExprCXX.cpp
|
| +++ b/lib/AST/ExprCXX.cpp
|
| -@@ -92,6 +92,7 @@ CXXNewExpr::CXXNewExpr(ASTContext &C, bool globalNew, FunctionDecl *operatorNew,
|
| +@@ -150,6 +150,7 @@ CXXNewExpr::CXXNewExpr(const ASTContext &C, bool globalNew,
|
| ty->isInstantiationDependentType(),
|
| ty->containsUnexpandedParameterPack()),
|
| SubExprs(0), OperatorNew(operatorNew), OperatorDelete(operatorDelete),
|
| @@ -117,11 +117,11 @@
|
| Range(Range), DirectInitRange(directInitRange),
|
| GlobalNew(globalNew), UsualArrayDeleteWantsSize(usualArrayDeleteWantsSize) {
|
| diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp
|
| -index 2bb4455..918efa3 100644
|
| +index 071f8b3..2434149 100644
|
| --- a/lib/CodeGen/CGClass.cpp
|
| +++ b/lib/CodeGen/CGClass.cpp
|
| -@@ -1338,7 +1338,8 @@ namespace {
|
| - void Emit(CodeGenFunction &CGF, Flags flags) {
|
| +@@ -1364,7 +1364,8 @@ namespace {
|
| + void Emit(CodeGenFunction &CGF, Flags flags) override {
|
| const CXXDestructorDecl *Dtor = cast<CXXDestructorDecl>(CGF.CurCodeDecl);
|
| const CXXRecordDecl *ClassDecl = Dtor->getParent();
|
| - CGF.EmitDeleteCall(Dtor->getOperatorDelete(), CGF.LoadCXXThis(),
|
| @@ -130,7 +130,7 @@
|
| CGF.getContext().getTagDeclType(ClassDecl));
|
| }
|
| };
|
| -@@ -1361,7 +1362,7 @@ namespace {
|
| +@@ -1387,7 +1388,7 @@ namespace {
|
| CGF.EmitBlock(callDeleteBB);
|
| const CXXDestructorDecl *Dtor = cast<CXXDestructorDecl>(CGF.CurCodeDecl);
|
| const CXXRecordDecl *ClassDecl = Dtor->getParent();
|
| @@ -140,11 +140,11 @@
|
| CGF.Builder.CreateBr(continueBB);
|
|
|
| diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp
|
| -index 672e86d..983e913 100644
|
| +index f71a3de..6b52585 100644
|
| --- a/lib/CodeGen/CGExprCXX.cpp
|
| +++ b/lib/CodeGen/CGExprCXX.cpp
|
| -@@ -1233,6 +1233,31 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
|
| - allocatorArgs, allocator);
|
| +@@ -1186,6 +1186,31 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
|
| + RV = EmitNewDeleteCall(*this, allocator, allocatorType, allocatorArgs);
|
| }
|
|
|
| + FunctionDecl *Intercept = E->getOperatorNewIntercept();
|
| @@ -154,7 +154,7 @@
|
| + const FunctionProtoType *InterceptType =
|
| + Intercept->getType()->castAs<FunctionProtoType>();
|
| +
|
| -+ QualType ThirdType = InterceptType->getArgType(2);
|
| ++ QualType ThirdType = InterceptType->getParamType(2);
|
| + const IdentifierInfo *identifier = ThirdType.getBaseTypeIdentifier();
|
| + if (identifier && strcmp(identifier->getNameStart(), "type_info") == 0) {
|
| + llvm::Value* TypeInfo = Builder.CreateBitCast(
|
| @@ -175,7 +175,7 @@
|
| // Emit a null check on the allocation result if the allocation
|
| // function is allowed to return null (because it has a non-throwing
|
| // exception spec; for this part, we inline
|
| -@@ -1323,6 +1348,7 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
|
| +@@ -1276,6 +1301,7 @@ llvm::Value *CodeGenFunction::EmitCXXNewExpr(const CXXNewExpr *E) {
|
| }
|
|
|
| void CodeGenFunction::EmitDeleteCall(const FunctionDecl *DeleteFD,
|
| @@ -183,9 +183,9 @@
|
| llvm::Value *Ptr,
|
| QualType DeleteTy) {
|
| assert(DeleteFD->getOverloadedOperator() == OO_Delete);
|
| -@@ -1344,7 +1370,39 @@ void CodeGenFunction::EmitDeleteCall(const FunctionDecl *DeleteFD,
|
| -
|
| - QualType ArgTy = DeleteFTy->getArgType(0);
|
| +@@ -1297,7 +1323,39 @@ void CodeGenFunction::EmitDeleteCall(const FunctionDecl *DeleteFD,
|
| +
|
| + QualType ArgTy = DeleteFTy->getParamType(0);
|
| llvm::Value *DeletePtr = Builder.CreateBitCast(Ptr, ConvertType(ArgTy));
|
| - DeleteArgs.add(RValue::get(DeletePtr), ArgTy);
|
| +
|
| @@ -198,12 +198,12 @@
|
| + Intercept->getType()->castAs<FunctionProtoType>();
|
| +
|
| + llvm::Value *SizeIntercept = 0;
|
| -+ QualType SecondType = InterceptType->getArgType(1);
|
| ++ QualType SecondType = InterceptType->getParamType(1);
|
| + CharUnits DeleteTypeSize = getContext().getTypeSizeInChars(DeleteTy);
|
| + SizeIntercept = llvm::ConstantInt::get(ConvertType(SecondType),
|
| + DeleteTypeSize.getQuantity());
|
| +
|
| -+ QualType ThirdType = InterceptType->getArgType(2);
|
| ++ QualType ThirdType = InterceptType->getParamType(2);
|
| + const IdentifierInfo *identifier = ThirdType.getBaseTypeIdentifier();
|
| + if (identifier && strcmp(identifier->getNameStart(), "type_info") == 0) {
|
| + llvm::Value* TypeInfo = Builder.CreateBitCast(
|
| @@ -224,7 +224,7 @@
|
|
|
| if (Size)
|
| DeleteArgs.add(RValue::get(Size), SizeTy);
|
| -@@ -1360,15 +1418,20 @@ namespace {
|
| +@@ -1311,15 +1369,20 @@ namespace {
|
| struct CallObjectDelete : EHScopeStack::Cleanup {
|
| llvm::Value *Ptr;
|
| const FunctionDecl *OperatorDelete;
|
| @@ -240,14 +240,14 @@
|
| + OperatorDeleteIntercept(OperatorDeleteIntercept),
|
| + ElementType(ElementType) {}
|
|
|
| - void Emit(CodeGenFunction &CGF, Flags flags) {
|
| + void Emit(CodeGenFunction &CGF, Flags flags) override {
|
| - CGF.EmitDeleteCall(OperatorDelete, Ptr, ElementType);
|
| + CGF.EmitDeleteCall(OperatorDelete, OperatorDeleteIntercept, Ptr,
|
| + ElementType);
|
| }
|
| };
|
| }
|
| -@@ -1376,6 +1439,7 @@ namespace {
|
| +@@ -1327,6 +1390,7 @@ namespace {
|
| /// Emit the code for deleting a single object.
|
| static void EmitObjectDelete(CodeGenFunction &CGF,
|
| const FunctionDecl *OperatorDelete,
|
| @@ -255,7 +255,7 @@
|
| llvm::Value *Ptr,
|
| QualType ElementType,
|
| bool UseGlobalDelete) {
|
| -@@ -1399,6 +1463,7 @@ static void EmitObjectDelete(CodeGenFunction &CGF,
|
| +@@ -1350,6 +1414,7 @@ static void EmitObjectDelete(CodeGenFunction &CGF,
|
|
|
| CGF.EHStack.pushCleanup<CallObjectDelete>(NormalAndEHCleanup,
|
| completePtr, OperatorDelete,
|
| @@ -263,7 +263,7 @@
|
| ElementType);
|
| }
|
|
|
| -@@ -1420,7 +1485,9 @@ static void EmitObjectDelete(CodeGenFunction &CGF,
|
| +@@ -1371,7 +1436,9 @@ static void EmitObjectDelete(CodeGenFunction &CGF,
|
| // This doesn't have to a conditional cleanup because we're going
|
| // to pop it off in a second.
|
| CGF.EHStack.pushCleanup<CallObjectDelete>(NormalAndEHCleanup,
|
| @@ -274,7 +274,7 @@
|
|
|
| if (Dtor)
|
| CGF.EmitCXXDestructorCall(Dtor, Dtor_Complete,
|
| -@@ -1458,16 +1525,20 @@ namespace {
|
| +@@ -1409,16 +1476,20 @@ namespace {
|
| struct CallArrayDelete : EHScopeStack::Cleanup {
|
| llvm::Value *Ptr;
|
| const FunctionDecl *OperatorDelete;
|
| @@ -295,9 +295,9 @@
|
| + NumElements(NumElements),
|
| ElementType(ElementType), CookieSize(CookieSize) {}
|
|
|
| - void Emit(CodeGenFunction &CGF, Flags flags) {
|
| -@@ -1481,7 +1552,42 @@ namespace {
|
| - QualType VoidPtrTy = DeleteFTy->getArgType(0);
|
| + void Emit(CodeGenFunction &CGF, Flags flags) override {
|
| +@@ -1432,7 +1503,42 @@ namespace {
|
| + QualType VoidPtrTy = DeleteFTy->getParamType(0);
|
| llvm::Value *DeletePtr
|
| = CGF.Builder.CreateBitCast(Ptr, CGF.ConvertType(VoidPtrTy));
|
| - Args.add(RValue::get(DeletePtr), VoidPtrTy);
|
| @@ -311,13 +311,13 @@
|
| + Intercept->getType()->castAs<FunctionProtoType>();
|
| +
|
| + llvm::Value *SizeIntercept = 0;
|
| -+ QualType SecondType = InterceptType->getArgType(1);
|
| ++ QualType SecondType = InterceptType->getParamType(1);
|
| + CharUnits DeleteTypeSize =
|
| + CGF.CGM.getContext().getTypeSizeInChars(ElementType);
|
| + SizeIntercept = llvm::ConstantInt::get(CGF.ConvertType(SecondType),
|
| + DeleteTypeSize.getQuantity());
|
| +
|
| -+ QualType ThirdType = InterceptType->getArgType(2);
|
| ++ QualType ThirdType = InterceptType->getParamType(2);
|
| + const IdentifierInfo *identifier = ThirdType.getBaseTypeIdentifier();
|
| + if (identifier && strcmp(identifier->getNameStart(), "type_info") == 0) {
|
| + llvm::Value* TypeInfo = CGF.Builder.CreateBitCast(
|
| @@ -339,8 +339,8 @@
|
| + Args.add(RV, VoidPtrTy);
|
|
|
| // Pass the original requested size as the second argument.
|
| - if (DeleteFTy->getNumArgs() == 2) {
|
| -@@ -1530,8 +1636,10 @@ static void EmitArrayDelete(CodeGenFunction &CGF,
|
| + if (DeleteFTy->getNumParams() == 2) {
|
| +@@ -1479,8 +1585,10 @@ static void EmitArrayDelete(CodeGenFunction &CGF,
|
|
|
| // Make sure that we call delete even if one of the dtors throws.
|
| const FunctionDecl *operatorDelete = E->getOperatorDelete();
|
| @@ -351,7 +351,7 @@
|
| numElements, elementType,
|
| cookieSize);
|
|
|
| -@@ -1597,7 +1705,8 @@ void CodeGenFunction::EmitCXXDeleteExpr(const CXXDeleteExpr *E) {
|
| +@@ -1546,7 +1654,8 @@ void CodeGenFunction::EmitCXXDeleteExpr(const CXXDeleteExpr *E) {
|
| if (E->isArrayForm()) {
|
| EmitArrayDelete(*this, E, Ptr, DeleteTy);
|
| } else {
|
| @@ -362,10 +362,10 @@
|
| }
|
|
|
| diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h
|
| -index 1b62048..f9241cc 100644
|
| +index c583a30..dbf3717 100644
|
| --- a/lib/CodeGen/CodeGenFunction.h
|
| +++ b/lib/CodeGen/CodeGenFunction.h
|
| -@@ -1620,8 +1620,9 @@ public:
|
| +@@ -1641,8 +1641,9 @@ public:
|
| llvm::Value *EmitCXXNewExpr(const CXXNewExpr *E);
|
| void EmitCXXDeleteExpr(const CXXDeleteExpr *E);
|
|
|
| @@ -378,7 +378,7 @@
|
| llvm::Value* EmitCXXTypeidExpr(const CXXTypeidExpr *E);
|
| llvm::Value *EmitDynamicCast(llvm::Value *V, const CXXDynamicCastExpr *DCE);
|
| diff --git a/lib/CodeGen/EHScopeStack.h b/lib/CodeGen/EHScopeStack.h
|
| -index e9d9a33..7adf8c8 100644
|
| +index 166d420..5f79adf 100644
|
| --- a/lib/CodeGen/EHScopeStack.h
|
| +++ b/lib/CodeGen/EHScopeStack.h
|
| @@ -356,6 +356,14 @@ public:
|
| @@ -397,10 +397,10 @@
|
|
|
| /// Push a cleanup with non-constant storage requirements on the
|
| diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
|
| -index d19486e..e4cb913 100644
|
| +index ea60551..35a06a3 100644
|
| --- a/lib/Driver/Tools.cpp
|
| +++ b/lib/Driver/Tools.cpp
|
| -@@ -2887,6 +2887,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
| +@@ -3144,6 +3144,13 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
|
| if (getToolChain().SupportsProfiling())
|
| Args.AddLastArg(CmdArgs, options::OPT_pg);
|
|
|
| @@ -415,10 +415,10 @@
|
| if (!Args.hasFlag(options::OPT_flax_vector_conversions,
|
| options::OPT_fno_lax_vector_conversions))
|
| diff --git a/lib/Frontend/CompilerInvocation.cpp b/lib/Frontend/CompilerInvocation.cpp
|
| -index 97ca50a..8a45713 100644
|
| +index d744865..2efac8e 100644
|
| --- a/lib/Frontend/CompilerInvocation.cpp
|
| +++ b/lib/Frontend/CompilerInvocation.cpp
|
| -@@ -1314,6 +1314,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
|
| +@@ -1395,6 +1395,8 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK,
|
| Opts.DebuggerSupport = Args.hasArg(OPT_fdebugger_support);
|
| Opts.DebuggerCastResultToId = Args.hasArg(OPT_fdebugger_cast_result_to_id);
|
| Opts.DebuggerObjCLiteral = Args.hasArg(OPT_fdebugger_objc_literal);
|
| @@ -428,10 +428,10 @@
|
| Opts.CurrentModule = Args.getLastArgValue(OPT_fmodule_name);
|
|
|
| diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
|
| -index 0b79953..eb1ae84 100644
|
| +index 1a5a4ed..a1dfbf1 100644
|
| --- a/lib/Sema/SemaDeclCXX.cpp
|
| +++ b/lib/Sema/SemaDeclCXX.cpp
|
| -@@ -5934,6 +5934,7 @@ bool Sema::CheckDestructor(CXXDestructorDecl *Destructor) {
|
| +@@ -6222,6 +6222,7 @@ bool Sema::CheckDestructor(CXXDestructorDecl *Destructor) {
|
|
|
| MarkFunctionReferenced(Loc, OperatorDelete);
|
|
|
| @@ -439,7 +439,7 @@
|
| Destructor->setOperatorDelete(OperatorDelete);
|
| }
|
|
|
| -@@ -6438,6 +6439,32 @@ NamespaceDecl *Sema::getOrCreateStdNamespace() {
|
| +@@ -6724,6 +6725,32 @@ NamespaceDecl *Sema::getOrCreateStdNamespace() {
|
| return getStdNamespace();
|
| }
|
|
|
| @@ -458,7 +458,7 @@
|
| + CXXTypeInfoDecl = R.getAsSingle<RecordDecl>();
|
| + // Microsoft's typeinfo doesn't have type_info in std but in the global
|
| + // namespace if _HAS_EXCEPTIONS is defined to 0. See PR13153.
|
| -+ if (!CXXTypeInfoDecl && LangOpts.MicrosoftMode) {
|
| ++ if (!CXXTypeInfoDecl && LangOpts.MSVCCompat) {
|
| + LookupQualifiedName(R, Context.getTranslationUnitDecl());
|
| + CXXTypeInfoDecl = R.getAsSingle<RecordDecl>();
|
| + }
|
| @@ -473,10 +473,10 @@
|
| assert(getLangOpts().CPlusPlus &&
|
| "Looking for std::initializer_list outside of C++.");
|
| diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
|
| -index 39c4211..b7efc6b 100644
|
| +index 8b9c0e2..305c886 100644
|
| --- a/lib/Sema/SemaExprCXX.cpp
|
| +++ b/lib/Sema/SemaExprCXX.cpp
|
| -@@ -417,26 +417,15 @@ Sema::ActOnCXXTypeid(SourceLocation OpLoc, SourceLocation LParenLoc,
|
| +@@ -454,26 +454,15 @@ Sema::ActOnCXXTypeid(SourceLocation OpLoc, SourceLocation LParenLoc,
|
| if (!getStdNamespace())
|
| return ExprError(Diag(OpLoc, diag::err_need_header_before_typeid));
|
|
|
| @@ -487,7 +487,7 @@
|
| - CXXTypeInfoDecl = R.getAsSingle<RecordDecl>();
|
| - // Microsoft's typeinfo doesn't have type_info in std but in the global
|
| - // namespace if _HAS_EXCEPTIONS is defined to 0. See PR13153.
|
| -- if (!CXXTypeInfoDecl && LangOpts.MicrosoftMode) {
|
| +- if (!CXXTypeInfoDecl && LangOpts.MSVCCompat) {
|
| - LookupQualifiedName(R, Context.getTranslationUnitDecl());
|
| - CXXTypeInfoDecl = R.getAsSingle<RecordDecl>();
|
| - }
|
| @@ -507,7 +507,7 @@
|
|
|
| if (isType) {
|
| // The operand is a type; handle it as such.
|
| -@@ -1477,13 +1466,74 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
|
| +@@ -1539,13 +1528,74 @@ Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
|
| }
|
| }
|
|
|
| @@ -584,8 +584,8 @@
|
| }
|
|
|
| /// \brief Checks that a type is suitable as the allocated type
|
| -@@ -1929,6 +1979,82 @@ void Sema::DeclareGlobalNewDelete() {
|
| - Context.VoidTy, VoidPtr);
|
| +@@ -2037,6 +2087,82 @@ void Sema::DeclareGlobalNewDelete() {
|
| + }
|
| }
|
|
|
| +/// DeclareGlobalAllocatorInterceptFunctions - Declares a single implicit global
|
| @@ -667,7 +667,7 @@
|
| /// DeclareGlobalAllocationFunction - Declares a single implicit global
|
| /// allocation function if it doesn't already exist.
|
| void Sema::DeclareGlobalAllocationFunction(DeclarationName Name,
|
| -@@ -2302,10 +2428,70 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal,
|
| +@@ -2449,10 +2575,70 @@ Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal,
|
| }
|
| }
|
|
|
|
|