summaryrefslogtreecommitdiffstats
path: root/lib/CodeGen/ABIInfo.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-07-29 02:01:43 +0000
committerChris Lattner <sabre@nondot.org>2010-07-29 02:01:43 +0000
commitea0443212e7ec6ff82e2f174e8e948a6eb0e0876 (patch)
tree2c91628df9cd216296a452e47d223ee61f3dcfb6 /lib/CodeGen/ABIInfo.h
parent741b9be084a61b4d5eb9b626f7f75949cfda3b11 (diff)
cave in to reality and make ABIInfo depend on CodeGenTypes.
This will simplify a bunch of code, coming up next. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109722 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/ABIInfo.h')
-rw-r--r--lib/CodeGen/ABIInfo.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/CodeGen/ABIInfo.h b/lib/CodeGen/ABIInfo.h
index e22ab8eb7a..e16e409ec2 100644
--- a/lib/CodeGen/ABIInfo.h
+++ b/lib/CodeGen/ABIInfo.h
@@ -16,16 +16,16 @@
namespace llvm {
class Value;
class LLVMContext;
+ class TargetData;
}
namespace clang {
class ASTContext;
- // FIXME: This is a layering issue if we want to move ABIInfo
- // down. Fortunately CGFunctionInfo has no real tie to CodeGen.
namespace CodeGen {
class CGFunctionInfo;
class CodeGenFunction;
+ class CodeGenTypes;
}
// FIXME: All of this stuff should be part of the target interface
@@ -45,6 +45,10 @@ namespace clang {
Extend, /// Valid only for integer argument types. Same as 'direct'
/// but also emit a zero/sign extension attribute.
+ Coerce, /// Only valid for aggregate return types, the argument
+ /// should be accessed by coercion to a provided type.
+
+
Indirect, /// Pass the argument indirectly via a hidden pointer
/// with the specified alignment (0 indicates default
/// alignment).
@@ -52,10 +56,7 @@ namespace clang {
Ignore, /// Ignore the argument (treat as void). Useful for
/// void and empty structs.
- Coerce, /// Only valid for aggregate return types, the argument
- /// should be accessed by coercion to a provided type.
-
- Expand, /// Only valid for aggregate argument types. The
+ Expand, /// Only valid for aggregate argument types. The
/// structure should be expanded into consecutive
/// arguments for its constituent fields. Currently
/// expand is only allowed on structures whose fields
@@ -129,7 +130,14 @@ namespace clang {
/// passed or returned from functions.
class ABIInfo {
public:
+ CodeGen::CodeGenTypes &CGT;
+
+ ABIInfo(CodeGen::CodeGenTypes &cgt) : CGT(cgt) {}
virtual ~ABIInfo();
+
+ ASTContext &getContext() const;
+ llvm::LLVMContext &getVMContext() const;
+ const llvm::TargetData &getTargetData() const;
virtual void computeInfo(CodeGen::CGFunctionInfo &FI,
ASTContext &Ctx,