diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2014-05-08 15:26:12 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2014-05-08 15:26:12 +0000 |
commit | e033c8c58c09f0cd18ad380612718508c92ef75a (patch) | |
tree | d0fddbbdab49faea82ed57339f1dbcef24d33749 | |
parent | f72791e464484116661f42ed4bffa07ed53df572 (diff) | |
download | bcm5719-llvm-e033c8c58c09f0cd18ad380612718508c92ef75a.tar.gz bcm5719-llvm-e033c8c58c09f0cd18ad380612718508c92ef75a.zip |
Cleanup setFunctionDefinitionAttributes.
Use more specific type, update comments and name style.
llvm-svn: 208328
-rw-r--r-- | clang/lib/CodeGen/CGCXX.cpp | 4 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 15 | ||||
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 6 |
3 files changed, 10 insertions, 15 deletions
diff --git a/clang/lib/CodeGen/CGCXX.cpp b/clang/lib/CodeGen/CGCXX.cpp index ef29af7e070..d2b62763472 100644 --- a/clang/lib/CodeGen/CGCXX.cpp +++ b/clang/lib/CodeGen/CGCXX.cpp @@ -217,7 +217,7 @@ void CodeGenModule::EmitCXXConstructor(const CXXConstructorDecl *ctor, CodeGenFunction(*this).GenerateCode(GlobalDecl(ctor, ctorType), fn, fnInfo); - SetFunctionDefinitionAttributes(ctor, fn); + setFunctionDefinitionAttributes(ctor, fn); SetLLVMFunctionAttributesForDefinition(ctor, fn); } @@ -274,7 +274,7 @@ void CodeGenModule::EmitCXXDestructor(const CXXDestructorDecl *dtor, CodeGenFunction(*this).GenerateCode(GlobalDecl(dtor, dtorType), fn, fnInfo); - SetFunctionDefinitionAttributes(dtor, fn); + setFunctionDefinitionAttributes(dtor, fn); SetLLVMFunctionAttributesForDefinition(dtor, fn); } diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 22ff2081c6b..cdd240ee2ab 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -594,14 +594,9 @@ CodeGenModule::getFunctionLinkage(GlobalDecl GD) { UseThunkForDtorVariant); } - -/// SetFunctionDefinitionAttributes - Set attributes for a global. -/// -/// FIXME: This is currently only done for aliases and functions, but not for -/// variables (these details are set in EmitGlobalVarDefinition for variables). -void CodeGenModule::SetFunctionDefinitionAttributes(const FunctionDecl *D, - llvm::GlobalValue *GV) { - setNonAliasAttributes(D, GV); +void CodeGenModule::setFunctionDefinitionAttributes(const FunctionDecl *D, + llvm::Function *F) { + setNonAliasAttributes(D, F); } void CodeGenModule::SetLLVMFunctionAttributes(const Decl *D, @@ -2247,14 +2242,14 @@ void CodeGenModule::EmitGlobalFunctionDefinition(GlobalDecl GD, llvm::Function *Fn = cast<llvm::Function>(GV); setFunctionLinkage(GD, Fn); - // FIXME: this is redundant with part of SetFunctionDefinitionAttributes + // FIXME: this is redundant with part of setFunctionDefinitionAttributes setGlobalVisibility(Fn, D); MaybeHandleStaticInExternC(D, Fn); CodeGenFunction(*this).GenerateCode(D, Fn, FI); - SetFunctionDefinitionAttributes(D, Fn); + setFunctionDefinitionAttributes(D, Fn); SetLLVMFunctionAttributesForDefinition(D, Fn); if (const ConstructorAttr *CA = D->getAttr<ConstructorAttr>()) diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index 38e85e62d1c..f601bfd4d6b 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -1061,9 +1061,9 @@ private: void setNonAliasAttributes(const Decl *D, llvm::GlobalValue *GV); - /// SetFunctionDefinitionAttributes - Set attributes for a global definition. - void SetFunctionDefinitionAttributes(const FunctionDecl *D, - llvm::GlobalValue *GV); + /// Set attributes for a global definition. + void setFunctionDefinitionAttributes(const FunctionDecl *D, + llvm::Function *F); /// SetFunctionAttributes - Set function attributes for a function /// declaration. |