blob: 58b7b79224fd29e44390223ec007aca35bf1f908 [file] [log] [blame]
Anton Korobeynikov82d0a412010-01-10 12:58:08 +00001//===---- 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
18namespace llvm {
19 class GlobalValue;
20}
21
22namespace 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 Gregor568bb2d2010-01-22 15:41:14 +000037 TargetCodeGenInfo(ABIInfo *info = 0):Info(info) { }
Anton Korobeynikov82d0a412010-01-10 12:58:08 +000038 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 Gregor568bb2d2010-01-22 15:41:14 +000046 CodeGen::CodeGenModule &M) const { }
Anton Korobeynikov82d0a412010-01-10 12:58:08 +000047 };
48}
49
50#endif // CLANG_CODEGEN_TARGETINFO_H