Browse Source

Merge pull request #292 from tomba/fixes

Fixes
pull/293/head
João Matos 12 years ago
parent
commit
f63d6219a4
  1. 2
      build/Helpers.lua
  2. 64
      build/LLVM.lua
  3. 4
      docs/GettingStarted.md
  4. 2
      src/CppParser/AST.cpp
  5. 370
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs
  6. 68
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs
  7. 2
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Sources.cs
  8. 2
      src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs
  9. 2
      src/CppParser/Bindings/premake4.lua

2
build/Helpers.lua

@ -19,7 +19,7 @@ gendir = path.join(builddir, "gen");
common_flags = { "Unicode", "Symbols" } common_flags = { "Unicode", "Symbols" }
msvc_buildflags = { "/wd4267" } msvc_buildflags = { "/wd4267" }
gcc_buildflags = { "-std=c++11" } gcc_buildflags = { "-std=c++11 -fpermissive" }
msvc_cpp_defines = { } msvc_cpp_defines = { }

64
build/LLVM.lua

@ -40,46 +40,46 @@ function SetupLLVMLibs()
configuration "*" configuration "*"
links links
{ {
"LLVMAnalysis", "clangFrontend",
"LLVMAsmParser", "clangDriver",
"LLVMBitReader", "clangSerialization",
"LLVMBitWriter", "clangCodeGen",
"LLVMCodeGen", "clangParse",
"LLVMCore", "clangSema",
"LLVMipa", "clangAnalysis",
"clangEdit",
"clangAST",
"clangLex",
"clangBasic",
"clangIndex",
"LLVMObjCARCOpts",
"LLVMLinker",
"LLVMipo", "LLVMipo",
"LLVMInstCombine", "LLVMVectorize",
"LLVMInstrumentation", "LLVMBitWriter",
"LLVMIRReader", "LLVMIRReader",
"LLVMLinker", "LLVMAsmParser",
"LLVMMC",
"LLVMMCParser",
"LLVMObjCARCOpts",
"LLVMObject",
"LLVMOption", "LLVMOption",
"LLVMInstrumentation",
"LLVMProfileData", "LLVMProfileData",
"LLVMScalarOpts",
"LLVMSupport",
"LLVMTarget",
"LLVMTransformUtils",
"LLVMVectorize",
"LLVMX86AsmParser", "LLVMX86AsmParser",
"LLVMX86AsmPrinter",
"LLVMX86Desc", "LLVMX86Desc",
"LLVMObject",
"LLVMMCParser",
"LLVMBitReader",
"LLVMX86Info", "LLVMX86Info",
"LLVMX86AsmPrinter",
"LLVMX86Utils", "LLVMX86Utils",
"clangAnalysis", "LLVMCodeGen",
"clangAST", "LLVMScalarOpts",
"clangBasic", "LLVMInstCombine",
"clangCodeGen", "LLVMTransformUtils",
"clangDriver", "LLVMipa",
"clangEdit", "LLVMAnalysis",
"clangFrontend", "LLVMTarget",
"clangLex", "LLVMMC",
"clangParse", "LLVMCore",
"clangSema", "LLVMSupport",
"clangSerialization",
"clangIndex",
} }
configuration(c) configuration(c)

4
docs/GettingStarted.md

@ -27,9 +27,9 @@ excruciatingly slow.
Last revisions known to work: Last revisions known to work:
LLVM `r212459` / Git mirror revision `c9bf74fdc543c2da90f334e0bf8e34b128c8a615`. LLVM `r212459` / Git mirror revision `a15d70370edd030198cb42960b62e660b9288f25`.
Clang `r212458` / Git mirror revision `30577e6c4f5ba66b8dc832ed9955b1a7475f788a`. Clang `r212458` / Git mirror revision `c785591d768074e1666bc306086588b1242d156c`.
It has been reported that running the solution upgrade process under VS 2013 breaks the build due It has been reported that running the solution upgrade process under VS 2013 breaks the build due
to an incompatibility of .NET versions between projects (4.5 and 4.0). If you experience this to an incompatibility of .NET versions between projects (4.5 and 4.0). If you experience this

2
src/CppParser/AST.cpp

@ -563,7 +563,7 @@ Namespace::Namespace()
PreprocessedEntity::PreprocessedEntity() PreprocessedEntity::PreprocessedEntity()
: Declaration(DeclarationKind::PreprocessedEntity), : Declaration(DeclarationKind::PreprocessedEntity),
MacroLocation(MacroLocation::Unknown) {} MacroLocation(AST::MacroLocation::Unknown) {}
MacroDefinition::MacroDefinition() { Kind = DeclarationKind::MacroDefinition; } MacroDefinition::MacroDefinition() { Kind = DeclarationKind::MacroDefinition; }

370
src/CppParser/Bindings/CSharp/i686-pc-win32/AST.cs → src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/AST.cs

File diff suppressed because it is too large Load Diff

68
src/CppParser/Bindings/CSharp/i686-pc-win32/CppParser.cs → src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/CppParser.cs

@ -38,7 +38,7 @@ namespace CppSharp
public unsafe partial class ParserOptions : IDisposable public unsafe partial class ParserOptions : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 124)] [StructLayout(LayoutKind.Explicit, Size = 124)]
public struct Internal public partial struct Internal
{ {
[FieldOffset(84)] [FieldOffset(84)]
public global::System.IntPtr ASTContext; public global::System.IntPtr ASTContext;
@ -86,6 +86,11 @@ namespace CppSharp
EntryPoint="?addArguments@ParserOptions@CppParser@CppSharp@@QAEXPBD@Z")] EntryPoint="?addArguments@ParserOptions@CppParser@CppSharp@@QAEXPBD@Z")]
internal static extern void addArguments_0(global::System.IntPtr instance, global::System.IntPtr s); internal static extern void addArguments_0(global::System.IntPtr instance, global::System.IntPtr s);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?clearArguments@ParserOptions@CppParser@CppSharp@@QAEXXZ")]
internal static extern void clearArguments_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?getIncludeDirs@ParserOptions@CppParser@CppSharp@@QAEPBDI@Z")] EntryPoint="?getIncludeDirs@ParserOptions@CppParser@CppSharp@@QAEPBDI@Z")]
@ -96,6 +101,11 @@ namespace CppSharp
EntryPoint="?addIncludeDirs@ParserOptions@CppParser@CppSharp@@QAEXPBD@Z")] EntryPoint="?addIncludeDirs@ParserOptions@CppParser@CppSharp@@QAEXPBD@Z")]
internal static extern void addIncludeDirs_0(global::System.IntPtr instance, global::System.IntPtr s); internal static extern void addIncludeDirs_0(global::System.IntPtr instance, global::System.IntPtr s);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?clearIncludeDirs@ParserOptions@CppParser@CppSharp@@QAEXXZ")]
internal static extern void clearIncludeDirs_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?getSystemIncludeDirs@ParserOptions@CppParser@CppSharp@@QAEPBDI@Z")] EntryPoint="?getSystemIncludeDirs@ParserOptions@CppParser@CppSharp@@QAEPBDI@Z")]
@ -106,6 +116,11 @@ namespace CppSharp
EntryPoint="?addSystemIncludeDirs@ParserOptions@CppParser@CppSharp@@QAEXPBD@Z")] EntryPoint="?addSystemIncludeDirs@ParserOptions@CppParser@CppSharp@@QAEXPBD@Z")]
internal static extern void addSystemIncludeDirs_0(global::System.IntPtr instance, global::System.IntPtr s); internal static extern void addSystemIncludeDirs_0(global::System.IntPtr instance, global::System.IntPtr s);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?clearSystemIncludeDirs@ParserOptions@CppParser@CppSharp@@QAEXXZ")]
internal static extern void clearSystemIncludeDirs_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?getDefines@ParserOptions@CppParser@CppSharp@@QAEPBDI@Z")] EntryPoint="?getDefines@ParserOptions@CppParser@CppSharp@@QAEPBDI@Z")]
@ -116,6 +131,11 @@ namespace CppSharp
EntryPoint="?addDefines@ParserOptions@CppParser@CppSharp@@QAEXPBD@Z")] EntryPoint="?addDefines@ParserOptions@CppParser@CppSharp@@QAEXPBD@Z")]
internal static extern void addDefines_0(global::System.IntPtr instance, global::System.IntPtr s); internal static extern void addDefines_0(global::System.IntPtr instance, global::System.IntPtr s);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?clearDefines@ParserOptions@CppParser@CppSharp@@QAEXXZ")]
internal static extern void clearDefines_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?getLibraryDirs@ParserOptions@CppParser@CppSharp@@QAEPBDI@Z")] EntryPoint="?getLibraryDirs@ParserOptions@CppParser@CppSharp@@QAEPBDI@Z")]
@ -126,6 +146,11 @@ namespace CppSharp
EntryPoint="?addLibraryDirs@ParserOptions@CppParser@CppSharp@@QAEXPBD@Z")] EntryPoint="?addLibraryDirs@ParserOptions@CppParser@CppSharp@@QAEXPBD@Z")]
internal static extern void addLibraryDirs_0(global::System.IntPtr instance, global::System.IntPtr s); internal static extern void addLibraryDirs_0(global::System.IntPtr instance, global::System.IntPtr s);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?clearLibraryDirs@ParserOptions@CppParser@CppSharp@@QAEXXZ")]
internal static extern void clearLibraryDirs_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?getArgumentsCount@ParserOptions@CppParser@CppSharp@@QAEIXZ")] EntryPoint="?getArgumentsCount@ParserOptions@CppParser@CppSharp@@QAEIXZ")]
@ -221,6 +246,11 @@ namespace CppSharp
Marshal.FreeHGlobal(arg0); Marshal.FreeHGlobal(arg0);
} }
public void clearArguments()
{
Internal.clearArguments_0(__Instance);
}
public string getIncludeDirs(uint i) public string getIncludeDirs(uint i)
{ {
var __ret = Internal.getIncludeDirs_0(__Instance, i); var __ret = Internal.getIncludeDirs_0(__Instance, i);
@ -235,6 +265,11 @@ namespace CppSharp
Marshal.FreeHGlobal(arg0); Marshal.FreeHGlobal(arg0);
} }
public void clearIncludeDirs()
{
Internal.clearIncludeDirs_0(__Instance);
}
public string getSystemIncludeDirs(uint i) public string getSystemIncludeDirs(uint i)
{ {
var __ret = Internal.getSystemIncludeDirs_0(__Instance, i); var __ret = Internal.getSystemIncludeDirs_0(__Instance, i);
@ -249,6 +284,11 @@ namespace CppSharp
Marshal.FreeHGlobal(arg0); Marshal.FreeHGlobal(arg0);
} }
public void clearSystemIncludeDirs()
{
Internal.clearSystemIncludeDirs_0(__Instance);
}
public string getDefines(uint i) public string getDefines(uint i)
{ {
var __ret = Internal.getDefines_0(__Instance, i); var __ret = Internal.getDefines_0(__Instance, i);
@ -263,6 +303,11 @@ namespace CppSharp
Marshal.FreeHGlobal(arg0); Marshal.FreeHGlobal(arg0);
} }
public void clearDefines()
{
Internal.clearDefines_0(__Instance);
}
public string getLibraryDirs(uint i) public string getLibraryDirs(uint i)
{ {
var __ret = Internal.getLibraryDirs_0(__Instance, i); var __ret = Internal.getLibraryDirs_0(__Instance, i);
@ -277,6 +322,11 @@ namespace CppSharp
Marshal.FreeHGlobal(arg0); Marshal.FreeHGlobal(arg0);
} }
public void clearLibraryDirs()
{
Internal.clearLibraryDirs_0(__Instance);
}
public uint ArgumentsCount public uint ArgumentsCount
{ {
get get
@ -465,7 +515,7 @@ namespace CppSharp
public unsafe partial class ParserDiagnostic : IDisposable public unsafe partial class ParserDiagnostic : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 60)] [StructLayout(LayoutKind.Explicit, Size = 60)]
public struct Internal public partial struct Internal
{ {
[FieldOffset(48)] [FieldOffset(48)]
public CppSharp.Parser.ParserDiagnosticLevel Level; public CppSharp.Parser.ParserDiagnosticLevel Level;
@ -630,7 +680,7 @@ namespace CppSharp
public unsafe partial class ParserResult : IDisposable public unsafe partial class ParserResult : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 28)] [StructLayout(LayoutKind.Explicit, Size = 28)]
public struct Internal public partial struct Internal
{ {
[FieldOffset(0)] [FieldOffset(0)]
public CppSharp.Parser.ParserResultKind Kind; public CppSharp.Parser.ParserResultKind Kind;
@ -666,6 +716,11 @@ namespace CppSharp
EntryPoint="?addDiagnostics@ParserResult@CppParser@CppSharp@@QAEXAAUParserDiagnostic@23@@Z")] EntryPoint="?addDiagnostics@ParserResult@CppParser@CppSharp@@QAEXAAUParserDiagnostic@23@@Z")]
internal static extern void addDiagnostics_0(global::System.IntPtr instance, global::System.IntPtr s); internal static extern void addDiagnostics_0(global::System.IntPtr instance, global::System.IntPtr s);
[SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?clearDiagnostics@ParserResult@CppParser@CppSharp@@QAEXXZ")]
internal static extern void clearDiagnostics_0(global::System.IntPtr instance);
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,
EntryPoint="?getDiagnosticsCount@ParserResult@CppParser@CppSharp@@QAEIXZ")] EntryPoint="?getDiagnosticsCount@ParserResult@CppParser@CppSharp@@QAEIXZ")]
@ -722,6 +777,11 @@ namespace CppSharp
Internal.addDiagnostics_0(__Instance, arg0); Internal.addDiagnostics_0(__Instance, arg0);
} }
public void clearDiagnostics()
{
Internal.clearDiagnostics_0(__Instance);
}
public uint DiagnosticsCount public uint DiagnosticsCount
{ {
get get
@ -780,7 +840,7 @@ namespace CppSharp
public unsafe partial class ClangParser : IDisposable public unsafe partial class ClangParser : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 1)] [StructLayout(LayoutKind.Explicit, Size = 1)]
public struct Internal public partial struct Internal
{ {
[SuppressUnmanagedCodeSecurity] [SuppressUnmanagedCodeSecurity]
[DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall, [DllImport("CppSharp.CppParser.dll", CallingConvention = global::System.Runtime.InteropServices.CallingConvention.ThisCall,

2
src/CppParser/Bindings/CSharp/i686-pc-win32/Sources.cs → src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Sources.cs

@ -13,7 +13,7 @@ namespace CppSharp
public unsafe partial struct SourceLocation public unsafe partial struct SourceLocation
{ {
[StructLayout(LayoutKind.Explicit, Size = 4)] [StructLayout(LayoutKind.Explicit, Size = 4)]
public struct Internal public partial struct Internal
{ {
[FieldOffset(0)] [FieldOffset(0)]
public uint ID; public uint ID;

2
src/CppParser/Bindings/CSharp/i686-pc-win32/Target.cs → src/CppParser/Bindings/CSharp/i686-pc-win32-msvc/Target.cs

@ -28,7 +28,7 @@ namespace CppSharp
public unsafe partial class ParserTargetInfo : IDisposable public unsafe partial class ParserTargetInfo : IDisposable
{ {
[StructLayout(LayoutKind.Explicit, Size = 176)] [StructLayout(LayoutKind.Explicit, Size = 176)]
public struct Internal public partial struct Internal
{ {
[FieldOffset(24)] [FieldOffset(24)]
public CppSharp.Parser.ParserIntType Char16Type; public CppSharp.Parser.ParserIntType Char16Type;

2
src/CppParser/Bindings/premake4.lua

@ -27,7 +27,7 @@ project "CppSharp.Parser.CSharp"
links { "CppSharp.Runtime" } links { "CppSharp.Runtime" }
if os.is_windows() then if os.is_windows() then
files { "CSharp/i686-pc-win32/**.cs" } files { "CSharp/i686-pc-win32-msvc/**.cs" }
elseif os.is_osx() then elseif os.is_osx() then
files { "CSharp/i686-apple-darwin12.4.0/**.cs" } files { "CSharp/i686-apple-darwin12.4.0/**.cs" }
else else

Loading…
Cancel
Save