diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-04-14 08:05:55 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-04-14 08:05:55 +0000 |
commit | 7c65e990e9f0dafaf9adbc59b766dcc23eaee845 (patch) | |
tree | b077648fbb7c0085690f5296b72fa20aee9505a5 /lib/CodeGen/CodeGenModule.h | |
parent | 55d6f50b23a1fd0a04b568787a25beb7537e6c9b (diff) |
Refactor how attributes are set on values.
- Pull out SetCommonAttributes, which handles the things common to
aliases, methods, functions, and variables.
- Pull out SetLLVMFunctionAttributesForDefinition, which handles the
LLVM attributes which we only want to apply to a definition (like
noinline and alwaysinline).
- Kill SetGVDeclarationAttributes (inlined into SetFunctionAttributes
and specialized).
- Kill SetFunctionAttributesForDefinition (inlined into sole caller).
- Inline SetGVDefinitionAttributes into SetMethodAttributes and
specialize.
- Rename SetGVDefinitionAttributes to SetFunctionDefinitionAttributes.
This is supposed to be a no functionality change commit, but I may
have made a mistake.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69036 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | lib/CodeGen/CodeGenModule.h | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 3dada6d1b7..f540a73e76 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -298,6 +298,10 @@ public: const CGFunctionInfo &Info, llvm::Function *F); + /// SetLLVMFunctionAttributesForDefinition - Set the LLVM function attributes + /// which only apply to a function definintion. + void SetLLVMFunctionAttributesForDefinition(const Decl *D, llvm::Function *F); + /// ReturnTypeUsesSret - Return true iff the given type uses 'sret' when used /// as a return type. bool ReturnTypeUsesSret(const CGFunctionInfo &FI); @@ -323,22 +327,17 @@ private: const llvm::PointerType *PTy, const VarDecl *D); - /// SetGVDefinitionAttributes - Set attributes for a global definition. - void SetGVDefinitionAttributes(const Decl *D, - GVALinkage Linkage, - llvm::GlobalValue *GV); - - /// SetGVDeclarationAttributes - Set attributes for a global declaration. - void SetGVDeclarationAttributes(const Decl *D, - llvm::GlobalValue *GV); - - /// SetFunctionAttributesForDefinition - Set function attributes specific to a - /// function definition. + /// SetCommonAttributes - Set attributes which are common to any + /// form of a global definition (alias, Objective-C method, + /// function, global variable). /// - /// \param D - The ObjCMethodDecl or FunctionDecl defining \arg F. - void SetFunctionAttributesForDefinition(const Decl *D, - llvm::Function *F); + /// NOTE: This should only be called for definitions. + void SetCommonAttributes(const Decl *D, llvm::GlobalValue *GV); + /// SetFunctionDefinitionAttributes - Set attributes for a global definition. + void SetFunctionDefinitionAttributes(const FunctionDecl *D, + llvm::GlobalValue *GV); + /// SetFunctionAttributes - Set function attributes for a function /// declaration. void SetFunctionAttributes(const FunctionDecl *FD, |