2010-11-18 07:24:11 +08:00
|
|
|
//===- 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 {
|
2012-03-28 10:18:05 +08:00
|
|
|
void *CIdx;
|
2010-11-18 07:24:11 +08:00
|
|
|
void *TUData;
|
|
|
|
void *StringPool;
|
2011-11-10 16:43:12 +08:00
|
|
|
void *Diagnostics;
|
2010-11-18 07:24:11 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2011-10-12 15:07:33 +08:00
|
|
|
namespace clang {
|
|
|
|
class ASTUnit;
|
2012-03-28 10:18:05 +08:00
|
|
|
class CIndexer;
|
2011-10-12 15:07:33 +08:00
|
|
|
|
|
|
|
namespace cxtu {
|
|
|
|
|
2012-03-28 10:18:05 +08:00
|
|
|
CXTranslationUnitImpl *MakeCXTranslationUnit(CIndexer *CIdx, ASTUnit *TU);
|
2011-11-10 16:43:12 +08:00
|
|
|
|
2011-10-18 03:48:19 +08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-10-12 15:07:33 +08:00
|
|
|
}} // end namespace clang::cxtu
|
|
|
|
|
2010-11-18 07:24:11 +08:00
|
|
|
#endif
|