Generating Serialisation Code with Clang
EURO-LLVM CONFERENCE 12th April 2012 Wayne Palmer
12-Apr-2012 Generating Serialisation Code with Clang 1
Generating Serialisation Code with Clang EURO-LLVM CONFERENCE 12 th - - PowerPoint PPT Presentation
Generating Serialisation Code with Clang EURO-LLVM CONFERENCE 12 th April 2012 Wayne Palmer Generating Serialisation Code with Clang 1 12-Apr-2012 Generating Serialisation Code with Clang INTRODUCTION TO THE QUANTITATIVE ANALYTICS LIBRARY
12-Apr-2012 Generating Serialisation Code with Clang 1
12-Apr-2012
Generating Serialisation Code with Clang 2
12-Apr-2012 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Unit ¡Square 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Quarter ¡Circle Unit ¡Square 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Random ¡Points Quarter ¡Circle Unit ¡Square Generating Serialisation Code with Clang 3
12-Apr-2012 Generating Serialisation Code with Clang 4
12-Apr-2012
Generating Serialisation Code with Clang 5
12-Apr-2012
Generating Serialisation Code with Clang 6
12-Apr-2012
Generating Serialisation Code with Clang 7
12-Apr-2012
Generating Serialisation Code with Clang 8
#ifdef __clang__ # define ATTR(...) __attribute__((annotate( " " #__VA_ARGS__ ))) #else # define ATTR(...) #endif
12-Apr-2012
Generating Serialisation Code with Clang 9
#ifndef SIMPLE_H #define SIMPLE_H #include "ATTR.h" class ATTR(serialise) Simple { public: Simple() : m_SerMember(65) {} int m_SerMember; virtual void needAMethod(); virtual ~Simple() {} }; #endif // SIMPLE_H
12-Apr-2012
Generating Serialisation Code with Clang 10
#ifndef SIMPLE_H #define SIMPLE_H #include "ATTR.h" class ATTR(serialise) Simple { public: Simple() : m_SerMember(65), m_NoSerMember(65) {} int m_SerMember; char ATTR(no_serialise) m_NoSerMember; virtual void needAMethod(); virtual ~Simple() {} }; #endif // SIMPLE_H
12-Apr-2012
Generating Serialisation Code with Clang 11
#ifndef SIMPLE_H #define SIMPLE_H #include "ATTR.h" class ATTR(hand_serialise(HandSer.h)) Simple { public: Simple() : m_SerMember(65) {} int m_SerMember; virtual void needAMethod(); virtual ~Simple() {} }; #endif // SIMPLE_H
12-Apr-2012
Generating Serialisation Code with Clang 12
12-Apr-2012
Generating Serialisation Code with Clang 13
12-Apr-2012
Generating Serialisation Code with Clang 14
12-Apr-2012
Generating Serialisation Code with Clang 15
12-Apr-2012
Generating Serialisation Code with Clang 16
void Action::VisitCXXMethodDecl( CXXMethodDeclIter iter ) { }
12-Apr-2012
Generating Serialisation Code with Clang 17
clang::DeclContext const * declCtxt(iter->getDeclContext()); if (!declCtxt) return;
12-Apr-2012
Generating Serialisation Code with Clang 18
if (clang::CXXRecordDecl const * cxxRecDecl = dyn_cast<clang::CXXRecordDecl>(declCtxt))
12-Apr-2012
Generating Serialisation Code with Clang 19
if (methodDecl->isPure()) continue; if (methodDecl->isImplicit()) continue; if (methodDecl->isInlineSpecified()) continue; if (methodDecl->hasInlineBody()) continue; foundDecl = methodDecl; break;
12-Apr-2012
Generating Serialisation Code with Clang 20
struct Reflection { template<typename T> static void owner(const T &, const size_t = sizeof(T)); }; #define OWN_THE_SERIALISATION_FOR(TYPE) \ template<> void Reflection::owner(const TYPE &, const size_t); OWN_THE_SERIALISATION_FOR(A)
12-Apr-2012
Generating Serialisation Code with Clang 21
12-Apr-2012
Generating Serialisation Code with Clang 22
12-Apr-2012
Generating Serialisation Code with Clang 23
12-Apr-2012
Generating Serialisation Code with Clang 24
12-Apr-2012
Generating Serialisation Code with Clang 25
12-Apr-2012
Generating Serialisation Code with Clang 26
12-Apr-2012
EMEA Amsterdam Birmingham Doha Dubai Dublin Frankfurt Geneva Glasgow Johannesburg Kiev Lisbon London Lugano Luxembourg Madrid Manchester Milan Moscow Paris Prague Rome Tel Aviv Zurich AMERICAS Atlanta Boston Buenos Aires Calgary Chicago Dallas Houston Los Angeles Menlo Park Mexico City Miami New York Portland Puerto Rico San Diego San Francisco Santa Monica Sao Paulo Seattle Toronto Washington, DC ASIA Beijing Hong Kong Jakarta Kuala Lumpur Labuan Manila Mumbai Seoul Shanghai Singapore Sydney Taipei Tokyo
Generating Serialisation Code with Clang 27