Anton Korobeynikov | 82d0a41 | 2010-01-10 12:58:08 +0000 | [diff] [blame] | 1 | //===---- TargetInfo.h - Encapsulate target details -------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // These classes wrap the information about a call or function |
| 11 | // definition used to handle ABI compliancy. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
| 15 | #ifndef CLANG_CODEGEN_TARGETINFO_H |
| 16 | #define CLANG_CODEGEN_TARGETINFO_H |
| 17 | |
| 18 | namespace llvm { |
| 19 | class GlobalValue; |
| 20 | } |
| 21 | |
| 22 | namespace clang { |
| 23 | class ABIInfo; |
| 24 | class Decl; |
| 25 | |
| 26 | namespace CodeGen { |
| 27 | class CodeGenModule; |
| 28 | } |
| 29 | |
| 30 | /// TargetCodeGenInfo - This class organizes various target-specific |
| 31 | /// codegeneration issues, like target-specific attributes, builtins and so |
| 32 | /// on. |
| 33 | class TargetCodeGenInfo { |
| 34 | ABIInfo *Info; |
| 35 | public: |
| 36 | // WARNING: Acquires the ownership of ABIInfo. |
Douglas Gregor | 568bb2d | 2010-01-22 15:41:14 +0000 | [diff] [blame^] | 37 | TargetCodeGenInfo(ABIInfo *info = 0):Info(info) { } |
Anton Korobeynikov | 82d0a41 | 2010-01-10 12:58:08 +0000 | [diff] [blame] | 38 | virtual ~TargetCodeGenInfo(); |
| 39 | |
| 40 | /// getABIInfo() - Returns ABI info helper for the target. |
| 41 | const ABIInfo& getABIInfo() const { return *Info; } |
| 42 | |
| 43 | /// SetTargetAttributes - Provides a convenient hook to handle extra |
| 44 | /// target-specific attributes for the given global. |
| 45 | virtual void SetTargetAttributes(const Decl *D, llvm::GlobalValue *GV, |
Douglas Gregor | 568bb2d | 2010-01-22 15:41:14 +0000 | [diff] [blame^] | 46 | CodeGen::CodeGenModule &M) const { } |
Anton Korobeynikov | 82d0a41 | 2010-01-10 12:58:08 +0000 | [diff] [blame] | 47 | }; |
| 48 | } |
| 49 | |
| 50 | #endif // CLANG_CODEGEN_TARGETINFO_H |