diff options
| author | Aaron Ballman <aaron@aaronballman.com> | 2014-01-16 13:03:14 +0000 |
|---|---|---|
| committer | Aaron Ballman <aaron@aaronballman.com> | 2014-01-16 13:03:14 +0000 |
| commit | 36a5350e51a6dcfae424332aaa266a1e5bfb8c4f (patch) | |
| tree | 4a97f7178bb62aece03a55278b72d7e675f1897b /clang/lib/Sema/SemaExprCXX.cpp | |
| parent | c61623b1708fa7aff26cdaf25a6007f7d656ba7d (diff) | |
| download | bcm5719-llvm-36a5350e51a6dcfae424332aaa266a1e5bfb8c4f.tar.gz bcm5719-llvm-36a5350e51a6dcfae424332aaa266a1e5bfb8c4f.zip | |
Distinguish between attributes explicitly written at the request of the user, and attributes implicitly generated to assist in bookkeeping by the compiler. This is done so by table generating a CreateImplicit method for each attribute.
Additionally, remove the optional nature of the spelling list index when creating attributes. This is supported by table generating a Spelling enumeration when the spellings for an attribute are distinct enough to warrant it.
llvm-svn: 199378
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index a29a279e4ba..363c7710b4c 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -2058,8 +2058,7 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name, if (InitialParam1Type == Param1 && (NumParams == 1 || InitialParam2Type == Param2)) { if (AddMallocAttr && !Func->hasAttr<MallocAttr>()) - Func->addAttr(::new (Context) MallocAttr(SourceLocation(), - Context)); + Func->addAttr(MallocAttr::CreateImplicit(Context)); // Make the function visible to name lookup, even if we found it in // an unimported module. It either is an implicitly-declared global // allocation function, or is suppressing that function. @@ -2102,7 +2101,7 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name, Alloc->setImplicit(); if (AddMallocAttr) - Alloc->addAttr(::new (Context) MallocAttr(SourceLocation(), Context)); + Alloc->addAttr(MallocAttr::CreateImplicit(Context)); ParmVarDecl *ParamDecls[2]; for (unsigned I = 0; I != NumParams; ++I) |

