aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-10-31 20:01:01 +0000
committerDevang Patel <dpatel@apple.com>2007-10-31 20:01:01 +0000
commit7a4718e813e5e99d478567a482217c7eef8572c5 (patch)
tree75d9133b327688e4871cc867fd6ed0b2e9f5feed /include
parent5451350ea6881c55c9e05f3a15486471b97f0757 (diff)
Take 2.
Make target info available to clang code generator. This is far from complete but this helps clang codegen module make progress. At the moment target triplet and target description strings are hard coded in clang::TargetInfo git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43572 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/clang/Basic/TargetInfo.h11
-rw-r--r--include/clang/CodeGen/ModuleBuilder.h4
2 files changed, 14 insertions, 1 deletions
diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h
index 334f87851d..0637af864b 100644
--- a/include/clang/Basic/TargetInfo.h
+++ b/include/clang/Basic/TargetInfo.h
@@ -218,6 +218,17 @@ public:
getLongLongInfo(Size, Align, Loc);
return static_cast<unsigned>(Size);
}
+
+ const char *getTargetTriple() {
+ // FIXME !
+ return "i686-apple-darwin9";
+ }
+ const char *getTargetDescription() {
+ // FIXME !
+ // Hard code darwin-x86 for now.
+ return "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:\
+32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128";
+ }
private:
void ComputeWCharInfo(SourceLocation Loc);
};
diff --git a/include/clang/CodeGen/ModuleBuilder.h b/include/clang/CodeGen/ModuleBuilder.h
index 0b1ae476ed..96b0f59b8e 100644
--- a/include/clang/CodeGen/ModuleBuilder.h
+++ b/include/clang/CodeGen/ModuleBuilder.h
@@ -16,6 +16,7 @@
namespace llvm {
class Module;
+ class TargetData;
}
namespace clang {
@@ -29,7 +30,8 @@ namespace CodeGen {
typedef void BuilderTy;
/// Init - Create an ModuleBuilder with the specified ASTContext.
- BuilderTy *Init(ASTContext &Context, llvm::Module &M);
+ BuilderTy *Init(ASTContext &Context, llvm::Module &M,
+ const llvm::TargetData &TD);
/// CodeGenFunction - Convert the AST node for a FunctionDecl into LLVM.
///