diff options
author | dim <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-06-12 15:46:16 +0000 |
commit | c49018d9cce52d8c9f34b44865ec3ba8e89a1488 (patch) | |
tree | c5e9e10bc189de0058aa763c47b9920a8351b7df /www/clang-tutorial.html | |
parent | 110eaaceddcec790f7e6a5e3bf1261c9aa1e73ab (diff) | |
download | FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.zip FreeBSD-src-c49018d9cce52d8c9f34b44865ec3ba8e89a1488.tar.gz |
Vendor import of clang trunk r132879:
http://llvm.org/svn/llvm-project/cfe/trunk@132879
Diffstat (limited to 'www/clang-tutorial.html')
-rw-r--r-- | www/clang-tutorial.html | 56 |
1 files changed, 0 insertions, 56 deletions
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 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" - "http://www.w3.org/TR/html4/strict.dtd"> -<html> -<head> - <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> - <title>Clang - Quick Tutorial</title> - <link type="text/css" rel="stylesheet" href="menu.css" /> - <link type="text/css" rel="stylesheet" href="content.css" /> -</head> -<body> - -<!--#include virtual="menu.html.incl"--> - -<div id="content"> - -<h1>Tutorial</h1> - - <p>Invoking the BoostCon tool:</p> - <pre> -$ clang -cc1 -boostcon t.cpp -</pre> - - <p>Teach the BoostCon action to identify and print C++ classes:</p> - <pre> -bool VisitCXXRecordDecl(CXXRecordDecl *D) { - std::cout << D->getNameAsString() - << '\n'; - return false; -} -</pre> - - <p>Walk and print base classes of a class:</p> - <pre> -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'; -} -</pre> - - <p>Retrieve the C++ class declaration from a base type:</p> - <pre> -if (const RecordType *RTy - = BaseType->getAs<RecordType>()) { - RecordDecl *Base = RTy->getDecl(); - if (CXXRecordDecl *BaseCXX - = dyn_cast<CXXRecordDecl>(Base)) { - - } -} -</pre> -</div> -</body> -</html> |