From c49018d9cce52d8c9f34b44865ec3ba8e89a1488 Mon Sep 17 00:00:00 2001 From: dim Date: Sun, 12 Jun 2011 15:46:16 +0000 Subject: Vendor import of clang trunk r132879: http://llvm.org/svn/llvm-project/cfe/trunk@132879 --- www/clang-tutorial.html | 56 ------------------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 www/clang-tutorial.html (limited to 'www/clang-tutorial.html') diff --git a/www/clang-tutorial.html b/www/clang-tutorial.html deleted file mode 100644 index 0e17046..0000000 --- a/www/clang-tutorial.html +++ /dev/null @@ -1,56 +0,0 @@ - - - - - Clang - Quick Tutorial - - - - - - - -
- -

Tutorial

- -

Invoking the BoostCon tool:

-
-$ clang -cc1 -boostcon t.cpp
-
- -

Teach the BoostCon action to identify and print C++ classes:

-
-bool VisitCXXRecordDecl(CXXRecordDecl *D) {
-  std::cout << D->getNameAsString() 
-    << '\n';
-  return false;
-}
-
- -

Walk and print base classes of a class:

-
-for(CXXRecordDecl::base_class_iterator 
-      B = D->bases_begin(), BEnd = D->bases_end();
-      B != BEnd; ++B) {
-  QualType BaseType = B->getType();
-  std::cout << "  " << BaseType.getAsString() 
-    << '\n';
-}
-
- -

Retrieve the C++ class declaration from a base type:

-
-if (const RecordType *RTy
-             = BaseType->getAs<RecordType>()) { 
-  RecordDecl *Base = RTy->getDecl();
-  if (CXXRecordDecl *BaseCXX
-        = dyn_cast<CXXRecordDecl>(Base)) {
-  
-  }
-}
-
-
- - -- cgit v1.1