Skip to content

Commit

Permalink
Update source code
Browse files Browse the repository at this point in the history
  • Loading branch information
pfernique committed Apr 5, 2019
1 parent dc3ef34 commit ee91678
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 157 deletions.
4 changes: 4 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
branches:
except:
- release/fp17

image: Visual Studio 2017

platform:
Expand Down
146 changes: 0 additions & 146 deletions src/cpp/AutoWIG.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,152 +25,6 @@
import itertools

def controller(asg):
# if autowig.generator.plugin.startswith('boost_python'):
# for node in asg['::boost::python'].classes(nested = True):
# node.is_copyable = True

# for node in asg.classes():
# node.boost_python_export = False
# for node in asg.functions(free=True):
# node.boost_python_export = False
# for node in asg.variables(free = True):
# node.boost_python_export = False
# for node in asg.enumerations():
# node.boost_python_export = False
# for node in asg.enumerators():
# if node.parent.boost_python_export:
# node.boost_python_export = False
# for node in asg.typedefs():
# node.boost_python_export = False

# from autowig.default_controller import refactoring
# asg = refactoring(asg)

# if autowig.parser.plugin == 'libclang':
# for fct in asg.functions(free=False):
# asg._nodes[fct._node]['_is_virtual'] = False
# asg._nodes[fct._node]['_is_pure'] = False
# asg['class ::clang::QualType'].is_abstract = False
# asg['class ::clang::QualType'].is_copyable = True
# asg['class ::llvm::StringRef'].is_abstract = False
# asg['class ::llvm::StringRef'].is_copyable = True
# asg['class ::clang::FileID'].is_abstract = False
# asg['class ::clang::FileID'].is_copyable = True
# asg['class ::clang::SourceLocation'].is_abstract = False
# asg['class ::clang::SourceLocation'].is_copyable = True
# asg['class ::clang::TemplateArgument'].is_abstract = False
# asg['class ::clang::TemplateArgument'].is_copyable = True
# for cls in ['::clang::FriendDecl', '::clang::CapturedDecl', '::clang::OMPThreadPrivateDecl',
# '::clang::NonTypeTemplateParmDecl', '::clang::TemplateArgumentList', '::clang::ImportDecl',
# '::clang::TemplateTemplateParmDecl', '::clang::CapturedDecl', '::clang::OMPThreadPrivateDecl',
# '::clang::NonTypeTemplateParmDecl', '::clang::TemplateArgumentList', '::clang::ImportDecl',
# '::clang::TemplateTemplateParmDecl']:
# asg['class ' + cls].is_abstract = False

# asg['class ::boost::python::api::object'].boost_python_export = True
# asg['class ::boost::python::list'].boost_python_export = True
# asg['class ::boost::python::str'].boost_python_export = True

# subset = []
# classes = [asg['class ::clang::QualType'],
# asg['class ::clang::Type'],
# asg['class ::clang::Decl']]
# subset += classes
# for cls in classes:
# subset += cls.subclasses(recursive=True)
# for cls in subset:
# if not cls.globalname.strip('class ') in ['::clang::QualType',
# '::llvm::StringRef',
# '::clang::FileID',
# '::clang::SourceLocation',
# '::clang::TemplateArgument',
# '::clang::FriendDecl',
# '::clang::CapturedDecl',
# '::clang::OMPThreadPrivateDecl',
# '::clang::NonTypeTemplateParmDecl',
# '::clang::TemplateArgumentList',
# '::clang::ImportDecl',
# '::clang::TemplateTemplateParmDecl']:
# cls.is_copyable = False
# else:
# cls.is_copyable = True
# subset.append(asg['class ::llvm::StringRef'])

# subset.append(asg['class ::clang::Sema'])
# subset.append(asg['class ::clang::ASTUnit'])
# subset.append(asg['class ::clang::ASTContext'])
# subset.append(asg['class ::clang::SourceManager'])
# subset.append(asg['class ::clang::FileID'])

# subset.append(asg['class ::clang::SourceLocation'])

# subset.append(asg['class ::clang::CXXBaseSpecifier'])
# subset.append(asg['class ::clang::DeclContext'])
# subset.append(asg['class ::clang::TemplateArgument'])

# subset.append(asg['class ::clang::TemplateArgumentList'])
# subset.append(asg['enum ::clang::Type::TypeClass'])
# subset.append(asg['enum ::clang::AccessSpecifier'])
# subset.append(asg['enum ::clang::LinkageSpecDecl::LanguageIDs'])
# subset.append(asg['enum ::clang::BuiltinType::Kind'])
# subset.append(asg['enum ::clang::TemplateArgument::ArgKind'])
# subset.append(asg['enum ::clang::Decl::Kind'])
# subset.extend(asg.nodes('::clanglite::build_ast_from_code_with_args'))

# for node in subset:
# node.boost_python_export = True

# for fct in asg['::clanglite'].functions():
# if not fct.localname == 'build_ast_from_code_with_args':
# fct.parent = fct.parameters[0].qualified_type.desugared_type.unqualified_type
# fct.boost_python_export = True

# for mtd in asg['class ::clang::ASTContext'].methods(pattern='.*getSourceManager.*'):
# if mtd.return_type.globalname == 'class ::clang::SourceManager &':
# mtd.boost_python_export = True
# break

# if autowig.parser.plugin == 'libclang':
# for node in (asg.functions(pattern='.*(llvm|clang).*_(begin|end)')
# + asg.functions(pattern='::clang::CXXRecordDecl::getCaptureFields')
# + asg.functions(pattern='.*(llvm|clang).*getNameAsString')
# + asg.nodes('::clang::NamedDecl::getQualifiedNameAsString')
# + asg.functions(pattern='.*::clang::ObjCProtocolDecl')
# + asg.nodes('::clang::ObjCProtocolDecl::collectInheritedProtocolProperties')
# + asg.nodes('::clang::ASTUnit::LoadFromASTFile')
# + asg.nodes('::clang::ASTUnit::getCachedCompletionTypes')
# + asg.nodes('::clang::ASTUnit::getBufferForFile')
# + asg.nodes('::clang::CXXRecordDecl::getCaptureFields')
# + asg.nodes('::clang::ASTContext::SectionInfos')
# + asg.nodes('::clang::ASTContext::getAllocator')
# + asg.nodes('::clang::ASTContext::getObjCEncoding.*')
# + asg.nodes('::clang::ASTContext::getAllocator')
# + asg.nodes('::clang::QualType::getAsString')
# + asg.nodes('::clang::SourceLocation::printToString')
# + asg['class ::llvm::StringRef'].methods()):
# node.boost_python_export = False

# if autowig.parser.plugin == 'clanglite':
# for mtd in asg['class ::clang::Decl'].methods():
# if mtd.localname == 'hasAttr':
# mtd.boost_python_export = False

# import sys
# try:
# from path import path as Path
# except:
# from path import Path

# import platform
# if any(platform.win32_ver()):
# for header in (Path(sys.prefix)/'Library'/'include'/'clang').walkfiles('*.h'):
# asg[header.abspath()].is_external_dependency = False
# else:
# for header in (Path(sys.prefix)/'include'/'clang').walkfiles('*.h'):
# asg[header.abspath()].is_external_dependency = False

# return asg
# elif autowig.generator.plugin.startswith('pybind11'):
for node in asg.classes():
node.pybind11_export = False
for node in asg.functions(free=True):
Expand Down
10 changes: 0 additions & 10 deletions src/cpp/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ Alias("autowig", targets)
Alias("install", targets)

try:
# wigenv = cppenv.Clone(tools = ['boost_python_wig'])

# targets = wigenv.BoostPythonWIG('clanglite', [target for target in targets if target.name.endswith('.h')],
# module='../py/_clanglite.cpp',
# decorator='../py/clanglite/_clanglite.py',
# parser_bootstrap=False,
# controller='AutoWIG.py',
# generator='boost_python_pattern',
# generator_closure=False,
# depends=[])
wigenv = cppenv.Clone(tools = ['pybind11_wig'])

targets = wigenv.PyBind11WIG('clanglite', [target for target in targets if target.name.endswith('.h')],
Expand Down
1 change: 0 additions & 1 deletion src/cpp/tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
// permissions and limitations under the License. //

#include <clanglite/tool.h>
// #include <boost/algorithm/string/replace.hpp>
#include <stdexcept>

namespace clanglite
Expand Down
1 change: 1 addition & 0 deletions travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
branches:
except:
- doc
- release/fp17

language: cpp

Expand Down

0 comments on commit ee91678

Please sign in to comment.