summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenTBAA.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-10-14 23:06:10 +0000
committerDan Gohman <gohman@apple.com>2010-10-14 23:06:10 +0000
commit947c9af77497a67a6ee079e3afd1ec82059b5186 (patch)
treeb8d202729b8d3190fd5739df3d3608e61c1f5403 /clang/lib/CodeGen/CodeGenTBAA.h
parent0f58561907985a879d90b210a2a32fac1d5518c8 (diff)
downloadbcm5719-llvm-947c9af77497a67a6ee079e3afd1ec82059b5186.tar.gz
bcm5719-llvm-947c9af77497a67a6ee079e3afd1ec82059b5186.zip
Experimental TBAA support.
This enables metadata generation by default, however the TBAA pass in the optimizer is still disabled for now. llvm-svn: 116536
Diffstat (limited to 'clang/lib/CodeGen/CodeGenTBAA.h')
-rw-r--r--clang/lib/CodeGen/CodeGenTBAA.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenTBAA.h b/clang/lib/CodeGen/CodeGenTBAA.h
new file mode 100644
index 00000000000..8cfad3b6175
--- /dev/null
+++ b/clang/lib/CodeGen/CodeGenTBAA.h
@@ -0,0 +1,67 @@
+//===--- CodeGenTBAA.h - TBAA information for LLVM CodeGen ------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This is the code that manages TBAA information.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef CLANG_CODEGEN_CODEGENTBAA_H
+#define CLANG_CODEGEN_CODEGENTBAA_H
+
+#include "llvm/LLVMContext.h"
+#include "llvm/ADT/DenseMap.h"
+
+namespace llvm {
+ class LLVMContext;
+ class MDNode;
+}
+
+namespace clang {
+ class ASTContext;
+ class LangOptions;
+ class QualType;
+ class Type;
+
+namespace CodeGen {
+ class CGCXXABI;
+ class CGRecordLayout;
+
+/// CodeGenTBAA - This class organizes the cross-module state that is used
+/// while lowering AST types to LLVM types.
+class CodeGenTBAA {
+ ASTContext &Context;
+ llvm::LLVMContext& VMContext;
+ const LangOptions &Features;
+
+ /// MetadataCache - This maps clang::Types to llvm::MDNodes describing them.
+ llvm::DenseMap<const Type *, llvm::MDNode *> MetadataCache;
+
+ /// Root - This is the mdnode for the root of the metadata type graph
+ /// for this translation unit.
+ llvm::MDNode *Root;
+
+ /// Char - This is the mdnode for "char", which is special, and any types
+ /// considered to be equivalent to it.
+ llvm::MDNode *Char;
+
+ llvm::MDNode *getTBAAInfoForNamedType(const char *NameStr,
+ llvm::MDNode *Parent);
+
+public:
+ CodeGenTBAA(ASTContext &Ctx, llvm::LLVMContext &VMContext,
+ const LangOptions &Features);
+ ~CodeGenTBAA();
+
+ llvm::MDNode *getTBAAInfo(QualType QTy);
+};
+
+} // end namespace CodeGen
+} // end namespace clang
+
+#endif
OpenPOWER on IntegriCloud