diff --git a/.github/workflows/llvm-win.yml b/.github/workflows/llvm-win.yml
index aab26ef97..43b9891fb 100644
--- a/.github/workflows/llvm-win.yml
+++ b/.github/workflows/llvm-win.yml
@@ -9,8 +9,6 @@ jobs:
fail-fast: false
matrix:
config:
- - { os: windows-2019, platform: x86, vs: "Program Files (x86)/Microsoft Visual Studio/2019" }
- - { os: windows-2019, platform: x64, vs: "Program Files (x86)/Microsoft Visual Studio/2019" }
- { os: windows-2022, platform: x86, vs: "Program Files/Microsoft Visual Studio/2022" }
- { os: windows-2022, platform: x64, vs: "Program Files/Microsoft Visual Studio/2022" }
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index c6d589987..d26b7adcb 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -11,7 +11,6 @@ jobs:
config:
- { os: ubuntu-22.04, platform: x64, cxx: g++-11, cc: gcc-11 }
- { os: macos-11, platform: x64, cxx: clang++, cc: clang }
- - { os: windows-2019, platform: x64, vs: "Program Files (x86)/Microsoft Visual Studio/2019" }
- { os: windows-2022, platform: x64, vs: "Program Files/Microsoft Visual Studio/2022" }
runs-on: ${{ matrix.config.os }}
diff --git a/Directory.Build.props b/Directory.Build.props
index 3fe84b36b..e6c25f85f 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -52,7 +52,6 @@
-
\ No newline at end of file
diff --git a/build/LLVM.lua b/build/LLVM.lua
index 841631e8c..86fa1be6b 100644
--- a/build/LLVM.lua
+++ b/build/LLVM.lua
@@ -42,6 +42,7 @@ function SetupLLVMIncludes()
includedirs
{
path.join(LLVMRootDirDebug, "include"),
+ path.join(LLVMRootDirDebug, "llvm/include"),
path.join(LLVMRootDirDebug, "lld/include"),
path.join(LLVMRootDirDebug, "clang/include"),
path.join(LLVMRootDirDebug, "clang/lib"),
@@ -53,6 +54,7 @@ function SetupLLVMIncludes()
includedirs
{
path.join(LLVMRootDirRelease, "include"),
+ path.join(LLVMRootDirRelease, "llvm/include"),
path.join(LLVMRootDirRelease, "lld/include"),
path.join(LLVMRootDirRelease, "clang/include"),
path.join(LLVMRootDirRelease, "clang/lib"),
@@ -64,6 +66,7 @@ function SetupLLVMIncludes()
includedirs
{
path.join(LLVMRootDir, "include"),
+ path.join(LLVMRootDir, "llvm/include"),
path.join(LLVMRootDir, "lld/include"),
path.join(LLVMRootDir, "clang/include"),
path.join(LLVMRootDir, "clang/lib"),
@@ -151,6 +154,7 @@ function SetupLLVMLibs()
"clangLex",
"clangBasic",
"clangIndex",
+ "clangASTMatchers",
"LLVMWindowsDriver",
"LLVMWindowsManifest",
"LLVMDebugInfoPDB",
@@ -158,6 +162,7 @@ function SetupLLVMLibs()
"LLVMPasses",
"LLVMObjCARCOpts",
"LLVMLibDriver",
+ "LLVMFrontendHLSL",
"LLVMFrontendOpenMP",
"LLVMOption",
"LLVMCoverage",
@@ -172,6 +177,7 @@ function SetupLLVMLibs()
"LLVMVectorize",
"LLVMLinker",
"LLVMIRReader",
+ "LLVMIRPrinter",
"LLVMAsmParser",
"LLVMMCDisassembler",
"LLVMCFGuard",
@@ -180,7 +186,9 @@ function SetupLLVMLibs()
"LLVMAsmPrinter",
"LLVMDebugInfoDWARF",
"LLVMCodeGen",
+ "LLVMCodeGenTypes",
"LLVMTarget",
+ "LLVMTargetParser",
"LLVMScalarOpts",
"LLVMInstCombine",
"LLVMAggressiveInstCombine",
@@ -204,7 +212,8 @@ function SetupLLVMLibs()
"lldCommon",
"lldCOFF",
"lldELF",
- "lldMachO"
+ "lldMachO",
+ "lldMinGW"
}
filter(c)
diff --git a/build/llvm/LLVM.lua b/build/llvm/LLVM.lua
index d1b7a653d..f375b39e9 100644
--- a/build/llvm/LLVM.lua
+++ b/build/llvm/LLVM.lua
@@ -459,7 +459,7 @@ function package_llvm(conf, llvm_base, llvm_build)
if os.isdir(out) then os.rmdir(out) end
os.mkdir(out)
- os.copydir(llvm_base .. "/llvm/include", out .. "/include")
+ os.copydir(llvm_base .. "/llvm/include", out .. "/llvm/include")
os.copydir(llvm_base .. "/lld/include", out .. "/lld/include")
os.copydir(llvm_build .. "/include", out .. "/build/include")
@@ -486,12 +486,10 @@ function package_llvm(conf, llvm_base, llvm_build)
local out_lib_dir = out .. "/build/lib"
if os.ishost("windows") then
os.rmfiles(out_lib_dir, "clang*ARC*.lib")
- os.rmfiles(out_lib_dir, "clang*Matchers*.lib")
os.rmfiles(out_lib_dir, "clang*Rewrite*.lib")
os.rmfiles(out_lib_dir, "clang*StaticAnalyzer*.lib")
else
os.rmfiles(out_lib_dir, "libclang*ARC*.a")
- os.rmfiles(out_lib_dir, "libclang*Matchers*.a")
os.rmfiles(out_lib_dir, "libclang*Rewrite*.a")
os.rmfiles(out_lib_dir, "libclang*StaticAnalyzer*.a")
end
diff --git a/src/CppParser/CppParser.cpp b/src/CppParser/CppParser.cpp
index 006645816..d6c1f7b36 100644
--- a/src/CppParser/CppParser.cpp
+++ b/src/CppParser/CppParser.cpp
@@ -7,7 +7,7 @@
#include "CppParser.h"
#include "Parser.h"
-#include
+#include
#include
namespace CppSharp { namespace CppParser {
diff --git a/src/CppParser/Link.cpp b/src/CppParser/Link.cpp
index 90fcd3047..6be117aea 100644
--- a/src/CppParser/Link.cpp
+++ b/src/CppParser/Link.cpp
@@ -11,6 +11,11 @@
#include
#include
+LLD_HAS_DRIVER(coff)
+LLD_HAS_DRIVER(elf)
+LLD_HAS_DRIVER(mingw)
+LLD_HAS_DRIVER(macho)
+
using namespace CppSharp::CppParser;
bool Parser::Link(const std::string& File, const CppLinkerOptions* LinkerOptions)
@@ -100,7 +105,7 @@ bool Parser::LinkWindows(const CppLinkerOptions* LinkerOptions,
std::string Out("-out:" + std::string(Output));
args.push_back(Out.data());
- return lld::coff::link(args, outs(), errs(), /*exitEarly=*/false, /*disableOutput=*/false);
+ return lld::coff::link(args, outs(), errs(), false, false);
#else
return false;
#endif
@@ -141,7 +146,7 @@ bool Parser::LinkELF(const CppLinkerOptions* LinkerOptions,
std::string Out(Output);
args.push_back(Out.data());
- return lld::elf::link(args, outs(), errs(), /*exitEarly=*/false, /*disableOutput=*/false);
+ return lld::elf::link(args, outs(), errs(), false, false);
#else
return false;
#endif
@@ -182,7 +187,7 @@ bool Parser::LinkMachO(const CppLinkerOptions* LinkerOptions,
std::string Out(Output);
args.push_back(Out.data());
- return lld::macho::link(args, outs(), errs(), /*exitEarly=*/false, /*disableOutput=*/false);
+ return lld::macho::link(args, outs(), errs(), false, false);
#else
return false;
#endif
diff --git a/src/CppParser/ParseExpr.cpp b/src/CppParser/ParseExpr.cpp
index 0c7a1dff8..27639a3d4 100644
--- a/src/CppParser/ParseExpr.cpp
+++ b/src/CppParser/ParseExpr.cpp
@@ -400,7 +400,7 @@ AST::Expr* Parser::WalkExpression(const clang::Expr* Expr)
_S->calleeDecl = static_cast(WalkDeclaration(S->getCalleeDecl()));
_S->directCallee = static_cast(WalkDeclaration(S->getDirectCallee()));
_S->numArgs = S->getNumArgs();
- _S->numCommas = S->getNumCommas();
+ _S->numCommas = 0; // Removed from Clang
_S->builtinCallee = S->getBuiltinCallee();
_S->isCallToStdMove = S->isCallToStdMove();
for (auto _E : S->arguments())
@@ -1172,7 +1172,7 @@ AST::Expr* Parser::WalkExpression(const clang::Expr* Expr)
_S->calleeDecl = static_cast(WalkDeclaration(S->getCalleeDecl()));
_S->directCallee = static_cast(WalkDeclaration(S->getDirectCallee()));
_S->numArgs = S->getNumArgs();
- _S->numCommas = S->getNumCommas();
+ _S->numCommas = 0; // Removed from Clang
_S->builtinCallee = S->getBuiltinCallee();
_S->isCallToStdMove = S->isCallToStdMove();
for (auto _E : S->arguments())
@@ -1207,7 +1207,7 @@ AST::Expr* Parser::WalkExpression(const clang::Expr* Expr)
_S->calleeDecl = static_cast(WalkDeclaration(S->getCalleeDecl()));
_S->directCallee = static_cast(WalkDeclaration(S->getDirectCallee()));
_S->numArgs = S->getNumArgs();
- _S->numCommas = S->getNumCommas();
+ _S->numCommas = 0; // Removed from Clang
_S->builtinCallee = S->getBuiltinCallee();
_S->isCallToStdMove = S->isCallToStdMove();
for (auto _E : S->arguments())
@@ -1241,7 +1241,7 @@ AST::Expr* Parser::WalkExpression(const clang::Expr* Expr)
_S->calleeDecl = static_cast(WalkDeclaration(S->getCalleeDecl()));
_S->directCallee = static_cast(WalkDeclaration(S->getDirectCallee()));
_S->numArgs = S->getNumArgs();
- _S->numCommas = S->getNumCommas();
+ _S->numCommas = 0; // Removed from Clang
_S->builtinCallee = S->getBuiltinCallee();
_S->isCallToStdMove = S->isCallToStdMove();
for (auto _E : S->arguments())
@@ -1391,7 +1391,7 @@ AST::Expr* Parser::WalkExpression(const clang::Expr* Expr)
_S->calleeDecl = static_cast(WalkDeclaration(S->getCalleeDecl()));
_S->directCallee = static_cast(WalkDeclaration(S->getDirectCallee()));
_S->numArgs = S->getNumArgs();
- _S->numCommas = S->getNumCommas();
+ _S->numCommas = 0; // Removed from Clang
_S->builtinCallee = S->getBuiltinCallee();
_S->isCallToStdMove = S->isCallToStdMove();
for (auto _E : S->arguments())
@@ -1850,7 +1850,7 @@ AST::Expr* Parser::WalkExpression(const clang::Expr* Expr)
_S->operatorDelete = static_cast(WalkDeclaration(S->getOperatorDelete()));
_S->allocatedType = GetQualifiedType(S->getAllocatedType());
_S->isArray = S->isArray();
- _S->arraySize = static_cast(WalkExpression(S->getArraySize().getValue()));
+ _S->arraySize = static_cast(WalkExpression(S->getArraySize().value()));
_S->numPlacementArgs = S->getNumPlacementArgs();
_S->isParenTypeId = S->isParenTypeId();
_S->isGlobalNew = S->isGlobalNew();
diff --git a/src/CppParser/Parser.cpp b/src/CppParser/Parser.cpp
index e034ba217..adc40ac2a 100644
--- a/src/CppParser/Parser.cpp
+++ b/src/CppParser/Parser.cpp
@@ -13,7 +13,7 @@
#include "ELFDumper.h"
#include "APValuePrinter.h"
-#include
+#include
#include
#include
#include
@@ -2586,7 +2586,7 @@ Type* Parser::WalkType(clang::QualType QualType, const clang::TypeLoc* TL,
{
auto TO = Type->getAs();
- Ty = WalkType(TO->getUnderlyingType());
+ Ty = WalkType(TO->getUnmodifiedType());
break;
}
case clang::Type::TypeOfExpr:
@@ -2648,8 +2648,7 @@ Type* Parser::WalkType(clang::QualType QualType, const clang::TypeLoc* TL,
TSTL = &TSpecTL;
}
- ArrayRef TSArgs(TS->getArgs(), TS->getNumArgs());
- TemplateArgumentList TArgs(TemplateArgumentList::OnStack, TSArgs);
+ TemplateArgumentList TArgs(TemplateArgumentList::OnStack, TS->template_arguments());
TST->Arguments = WalkTemplateArgumentList(&TArgs, TSTL);
Ty = TST;
@@ -2691,8 +2690,7 @@ Type* Parser::WalkType(clang::QualType QualType, const clang::TypeLoc* TL,
TSTL = &TSpecTL;
}
- ArrayRef TSArgs(TS->getArgs(), TS->getNumArgs());
- TemplateArgumentList TArgs(TemplateArgumentList::OnStack, TSArgs);
+ TemplateArgumentList TArgs(TemplateArgumentList::OnStack, TS->template_arguments());
TST->Arguments = WalkTemplateArgumentList(&TArgs, TSTL);
Ty = TST;
@@ -2755,9 +2753,9 @@ Type* Parser::WalkType(clang::QualType QualType, const clang::TypeLoc* TL,
auto RepTy = TP->getReplacementType();
TPT->replacement = GetQualifiedType(RepTy, &Next);
TPT->replacedParameter = (TemplateParameterType*)
- WalkType(clang::QualType(TP->getReplacedParameter(), 0), 0);
+ WalkType(c->getASTContext().getTypeDeclType(TP->getReplacedParameter()), 0);
TPT->replacedParameter->parameter = WalkTypeTemplateParameter(
- TP->getReplacedParameter()->getDecl());
+ TP->getReplacedParameter());
Ty = TPT;
break;
@@ -4379,10 +4377,8 @@ bool Parser::SetupSourceFiles(const std::vector& SourceFiles,
std::vector& FileEntries)
{
// Check that the file is reachable.
- clang::ConstSearchDirIterator *Dir;
- llvm::SmallVector<
- std::pair,
- 0> Includers;
+ clang::ConstSearchDirIterator *Dir = 0;
+ llvm::ArrayRef> Includers;
for (const auto& SourceFile : SourceFiles)
{
@@ -4896,8 +4892,8 @@ ParserTargetInfo* Parser::GetTargetInfo()
parserTargetInfo->longDoubleWidth = TI.getLongDoubleWidth();
parserTargetInfo->longLongAlign = TI.getLongLongAlign();
parserTargetInfo->longLongWidth = TI.getLongLongWidth();
- parserTargetInfo->pointerAlign = TI.getPointerAlign(0);
- parserTargetInfo->pointerWidth = TI.getPointerWidth(0);
+ parserTargetInfo->pointerAlign = TI.getPointerAlign(clang::LangAS::Default);
+ parserTargetInfo->pointerWidth = TI.getPointerWidth(clang::LangAS::Default);
parserTargetInfo->wCharAlign = TI.getWCharAlign();
parserTargetInfo->wCharWidth = TI.getWCharWidth();
parserTargetInfo->float128Align = TI.getFloat128Align();
diff --git a/src/CppParser/premake5.lua b/src/CppParser/premake5.lua
index f744c9fa0..c1bfe3044 100644
--- a/src/CppParser/premake5.lua
+++ b/src/CppParser/premake5.lua
@@ -4,6 +4,7 @@ clang_msvc_flags =
"/wd4355", "/wd4996", "/wd4624", "/wd4291",
"/wd4251",
"/wd4141", -- 'inline' : used more than once
+ "/Zc:preprocessor" -- needed for newer Clang Options.inc (VA_ARGS)
}
if EnableNativeProjects() then
diff --git a/src/Generator/Generators/CSharp/CSharpCommentPrinter.cs b/src/Generator/Generators/CSharp/CSharpCommentPrinter.cs
index dc7ec6cec..6f7fe7e26 100644
--- a/src/Generator/Generators/CSharp/CSharpCommentPrinter.cs
+++ b/src/Generator/Generators/CSharp/CSharpCommentPrinter.cs
@@ -37,6 +37,7 @@ private static void GetCommentSections(this Comment comment, List secti
blockCommandComment.ParagraphComment.GetCommentSections(sections);
break;
case CommentCommandKind.Return:
+ case CommentCommandKind.Returns:
sections.Add(new Section(CommentElement.Returns));
blockCommandComment.ParagraphComment.GetCommentSections(sections);
break;
diff --git a/src/Parser/ParserOptions.cs b/src/Parser/ParserOptions.cs
index ed516668d..511709449 100644
--- a/src/Parser/ParserOptions.cs
+++ b/src/Parser/ParserOptions.cs
@@ -377,6 +377,15 @@ private void SetupArguments(TargetPlatform targetPlatform)
AddArguments("-fno-rtti");
}
+ internal string BuiltinsDirBasePath
+ {
+ get
+ {
+ var version = ClangVersion.Split(".").First();
+ return Path.Combine("lib", "clang", version, "include");
+ }
+ }
+
public string BuiltinsDir
{
get
@@ -385,7 +394,7 @@ public string BuiltinsDir
if (assemblyDir == null)
throw new InvalidOperationException();
- return Path.Combine(assemblyDir, "lib", "clang", ClangVersion, "include");
+ return Path.Combine(assemblyDir, BuiltinsDirBasePath);
}
}
@@ -393,7 +402,7 @@ private void SetupIncludes(TargetPlatform targetPlatform)
{
// Check that the builtin includes folder exists.
if (!Directory.Exists(BuiltinsDir))
- throw new Exception($"Clang resource folder 'lib/clang/{ClangVersion}/include' was not found.");
+ throw new Exception($"Clang resource folder '{BuiltinsDirBasePath}' was not found.");
switch (targetPlatform)
{