diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-06-30 02:34:44 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-06-30 02:34:44 +0000 |
commit | 40b598eea1310ec9ed554d56ce3e25b34c585458 (patch) | |
tree | 8e2c3592f8ed4ac239504747ebffb388d5b170d6 /lib/CodeGen/CGDecl.cpp | |
parent | e4f2142d00fa5fdb580c4e2413da91882d955381 (diff) |
Remove the ASTContext parameter from the attribute-related methods of Decl.
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.
This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r-- | lib/CodeGen/CGDecl.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp index f97c62f9d1..2ae7e225eb 100644 --- a/lib/CodeGen/CGDecl.cpp +++ b/lib/CodeGen/CGDecl.cpp @@ -60,7 +60,7 @@ void CodeGenFunction::EmitDecl(const Decl &D) { /// EmitBlockVarDecl - This method handles emission of any variable declaration /// inside a function, including static vars etc. void CodeGenFunction::EmitBlockVarDecl(const VarDecl &D) { - if (D.hasAttr<AsmLabelAttr>(getContext())) + if (D.hasAttr<AsmLabelAttr>()) CGM.ErrorUnsupported(&D, "__asm__"); switch (D.getStorageClass()) { @@ -171,7 +171,7 @@ void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D) { } // FIXME: Merge attribute handling. - if (const AnnotateAttr *AA = D.getAttr<AnnotateAttr>(getContext())) { + if (const AnnotateAttr *AA = D.getAttr<AnnotateAttr>()) { SourceManager &SM = CGM.getContext().getSourceManager(); llvm::Constant *Ann = CGM.EmitAnnotateAttr(GV, AA, @@ -179,10 +179,10 @@ void CodeGenFunction::EmitStaticBlockVarDecl(const VarDecl &D) { CGM.AddAnnotation(Ann); } - if (const SectionAttr *SA = D.getAttr<SectionAttr>(getContext())) + if (const SectionAttr *SA = D.getAttr<SectionAttr>()) GV->setSection(SA->getName()); - if (D.hasAttr<UsedAttr>(getContext())) + if (D.hasAttr<UsedAttr>()) CGM.AddUsedGlobal(GV); // We may have to cast the constant because of the initializer @@ -244,7 +244,7 @@ const llvm::Type *CodeGenFunction::BuildByRefType(QualType Ty, /// These turn into simple stack objects, or GlobalValues depending on target. void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) { QualType Ty = D.getType(); - bool isByRef = D.hasAttr<BlocksAttr>(getContext()); + bool isByRef = D.hasAttr<BlocksAttr>(); bool needsDispose = false; unsigned Align = 0; @@ -414,7 +414,7 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D) { } // Handle the cleanup attribute - if (const CleanupAttr *CA = D.getAttr<CleanupAttr>(getContext())) { + if (const CleanupAttr *CA = D.getAttr<CleanupAttr>()) { const FunctionDecl *FD = CA->getFunctionDecl(); llvm::Constant* F = CGM.GetAddrOfFunction(GlobalDecl(FD)); |