From 222e2a7620e6520ffaf4fc4e69d79c18da31542e Mon Sep 17 00:00:00 2001 From: "Zancanaro; Carlo" Date: Mon, 24 Sep 2012 09:58:17 +1000 Subject: Add the clang library to the repo (with some of my changes, too). --- clang/tools/libclang/CXTranslationUnit.h | 53 ++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 clang/tools/libclang/CXTranslationUnit.h (limited to 'clang/tools/libclang/CXTranslationUnit.h') diff --git a/clang/tools/libclang/CXTranslationUnit.h b/clang/tools/libclang/CXTranslationUnit.h new file mode 100644 index 0000000..3ad867c --- /dev/null +++ b/clang/tools/libclang/CXTranslationUnit.h @@ -0,0 +1,53 @@ +//===- CXTranslationUnit.h - Routines for manipulating CXTranslationUnits -===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file defines routines for manipulating CXTranslationUnits. +// +//===----------------------------------------------------------------------===// + +#ifndef LLVM_CLANG_CXTRANSLATIONUNIT_H +#define LLVM_CLANG_CXTRANSLATIONUNIT_H + +extern "C" { +struct CXTranslationUnitImpl { + void *CIdx; + void *TUData; + void *StringPool; + void *Diagnostics; +}; +} + +namespace clang { + class ASTUnit; + class CIndexer; + +namespace cxtu { + +CXTranslationUnitImpl *MakeCXTranslationUnit(CIndexer *CIdx, ASTUnit *TU); + +class CXTUOwner { + CXTranslationUnitImpl *TU; + +public: + CXTUOwner(CXTranslationUnitImpl *tu) : TU(tu) { } + ~CXTUOwner(); + + CXTranslationUnitImpl *getTU() const { return TU; } + + CXTranslationUnitImpl *takeTU() { + CXTranslationUnitImpl *retTU = TU; + TU = 0; + return retTU; + } +}; + + +}} // end namespace clang::cxtu + +#endif -- cgit v1.2.3