forked from bytedeco/javacpp-presets
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclang.java
8443 lines (7575 loc) · 329 KB
/
clang.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Targeted by JavaCPP version 1.4.1-SNAPSHOT: DO NOT EDIT THIS FILE
package org.bytedeco.javacpp;
import java.nio.*;
import org.bytedeco.javacpp.*;
import org.bytedeco.javacpp.annotation.*;
import static org.bytedeco.javacpp.LLVM.*;
public class clang extends org.bytedeco.javacpp.presets.clang {
static { Loader.load(); }
// Parsed from <clang-c/Platform.h>
/*===-- clang-c/Platform.h - C Index platform decls -------------*- C -*-===*\
|* *|
|* The LLVM Compiler Infrastructure *|
|* *|
|* This file is distributed under the University of Illinois Open Source *|
|* License. See LICENSE.TXT for details. *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This header provides platform specific macros (dllimport, deprecated, ...) *|
|* *|
\*===----------------------------------------------------------------------===*/
// #ifndef LLVM_CLANG_C_PLATFORM_H
// #define LLVM_CLANG_C_PLATFORM_H
// #ifdef __cplusplus
// #endif
/* MSVC DLL import/export. */
// #ifdef _MSC_VER
// #ifdef _CINDEX_LIB_
// #define CINDEX_LINKAGE __declspec(dllexport)
// #else
// #define CINDEX_LINKAGE __declspec(dllimport)
// #endif
// #else
// #define CINDEX_LINKAGE
// #endif
// #ifdef __GNUC__
// #define CINDEX_DEPRECATED __attribute__((deprecated))
// #else
// #ifdef _MSC_VER
// #define CINDEX_DEPRECATED __declspec(deprecated)
// #else
// #define CINDEX_DEPRECATED
// #endif
// #endif
// #ifdef __cplusplus
// #endif
// #endif
// Parsed from <clang-c/CXErrorCode.h>
/*===-- clang-c/CXErrorCode.h - C Index Error Codes --------------*- C -*-===*\
|* *|
|* The LLVM Compiler Infrastructure *|
|* *|
|* This file is distributed under the University of Illinois Open Source *|
|* License. See LICENSE.TXT for details. *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This header provides the CXErrorCode enumerators. *|
|* *|
\*===----------------------------------------------------------------------===*/
// #ifndef LLVM_CLANG_C_CXERRORCODE_H
// #define LLVM_CLANG_C_CXERRORCODE_H
// #include "clang-c/Platform.h"
// #ifdef __cplusplus
// #endif
/**
* \brief Error codes returned by libclang routines.
*
* Zero (\c CXError_Success) is the only error code indicating success. Other
* error codes, including not yet assigned non-zero values, indicate errors.
*/
/** enum CXErrorCode */
public static final int
/**
* \brief No error.
*/
CXError_Success = 0,
/**
* \brief A generic error code, no further details are available.
*
* Errors of this kind can get their own specific error codes in future
* libclang versions.
*/
CXError_Failure = 1,
/**
* \brief libclang crashed while performing the requested operation.
*/
CXError_Crashed = 2,
/**
* \brief The function detected that the arguments violate the function
* contract.
*/
CXError_InvalidArguments = 3,
/**
* \brief An AST deserialization error has occurred.
*/
CXError_ASTReadError = 4;
// #ifdef __cplusplus
// #endif
// #endif
// Parsed from <clang-c/CXString.h>
/*===-- clang-c/CXString.h - C Index strings --------------------*- C -*-===*\
|* *|
|* The LLVM Compiler Infrastructure *|
|* *|
|* This file is distributed under the University of Illinois Open Source *|
|* License. See LICENSE.TXT for details. *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This header provides the interface to C Index strings. *|
|* *|
\*===----------------------------------------------------------------------===*/
// #ifndef LLVM_CLANG_C_CXSTRING_H
// #define LLVM_CLANG_C_CXSTRING_H
// #include "clang-c/Platform.h"
// #ifdef __cplusplus
// #endif
/**
* \defgroup CINDEX_STRING String manipulation routines
* \ingroup CINDEX
*
* \{
*/
/**
* \brief A character string.
*
* The \c CXString type is used to return strings from the interface when
* the ownership of that string might differ from one call to the next.
* Use \c clang_getCString() to retrieve the string data and, once finished
* with the string data, call \c clang_disposeString() to free the string.
*/
public static class CXString extends Pointer {
static { Loader.load(); }
/** Default native constructor. */
public CXString() { super((Pointer)null); allocate(); }
/** Native array allocator. Access with {@link Pointer#position(long)}. */
public CXString(long size) { super((Pointer)null); allocateArray(size); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CXString(Pointer p) { super(p); }
private native void allocate();
private native void allocateArray(long size);
@Override public CXString position(long position) {
return (CXString)super.position(position);
}
public String getString() {
String s = clang_getCString(this).getString();
clang_disposeString(this);
return s;
}
public native @Const Pointer data(); public native CXString data(Pointer data);
public native @Cast("unsigned") int private_flags(); public native CXString private_flags(int private_flags);
}
public static class CXStringSet extends Pointer {
static { Loader.load(); }
/** Default native constructor. */
public CXStringSet() { super((Pointer)null); allocate(); }
/** Native array allocator. Access with {@link Pointer#position(long)}. */
public CXStringSet(long size) { super((Pointer)null); allocateArray(size); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CXStringSet(Pointer p) { super(p); }
private native void allocate();
private native void allocateArray(long size);
@Override public CXStringSet position(long position) {
return (CXStringSet)super.position(position);
}
public native CXString Strings(); public native CXStringSet Strings(CXString Strings);
public native @Cast("unsigned") int Count(); public native CXStringSet Count(int Count);
}
/**
* \brief Retrieve the character data associated with the given string.
*/
public static native @Cast("const char*") BytePointer clang_getCString(@ByVal CXString string);
/**
* \brief Free the given string.
*/
public static native void clang_disposeString(@ByVal CXString string);
/**
* \brief Free the given string set.
*/
public static native void clang_disposeStringSet(CXStringSet set);
/**
* \}
*/
// #ifdef __cplusplus
// #endif
// #endif
// Parsed from <clang-c/CXCompilationDatabase.h>
/*===-- clang-c/CXCompilationDatabase.h - Compilation database ---*- C -*-===*\
|* *|
|* The LLVM Compiler Infrastructure *|
|* *|
|* This file is distributed under the University of Illinois Open Source *|
|* License. See LICENSE.TXT for details. *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This header provides a public interface to use CompilationDatabase without *|
|* the full Clang C++ API. *|
|* *|
\*===----------------------------------------------------------------------===*/
// #ifndef LLVM_CLANG_C_CXCOMPILATIONDATABASE_H
// #define LLVM_CLANG_C_CXCOMPILATIONDATABASE_H
// #include "clang-c/Platform.h"
// #include "clang-c/CXString.h"
// #ifdef __cplusplus
// #endif
/** \defgroup COMPILATIONDB CompilationDatabase functions
* \ingroup CINDEX
*
* \{
*/
/**
* A compilation database holds all information used to compile files in a
* project. For each file in the database, it can be queried for the working
* directory or the command line used for the compiler invocation.
*
* Must be freed by \c clang_CompilationDatabase_dispose
*/
@Namespace @Name("void") @Opaque public static class CXCompilationDatabase extends Pointer {
/** Empty constructor. Calls {@code super((Pointer)null)}. */
public CXCompilationDatabase() { super((Pointer)null); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CXCompilationDatabase(Pointer p) { super(p); }
}
/**
* \brief Contains the results of a search in the compilation database
*
* When searching for the compile command for a file, the compilation db can
* return several commands, as the file may have been compiled with
* different options in different places of the project. This choice of compile
* commands is wrapped in this opaque data structure. It must be freed by
* \c clang_CompileCommands_dispose.
*/
@Namespace @Name("void") @Opaque public static class CXCompileCommands extends Pointer {
/** Empty constructor. Calls {@code super((Pointer)null)}. */
public CXCompileCommands() { super((Pointer)null); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CXCompileCommands(Pointer p) { super(p); }
}
/**
* \brief Represents the command line invocation to compile a specific file.
*/
@Namespace @Name("void") @Opaque public static class CXCompileCommand extends Pointer {
/** Empty constructor. Calls {@code super((Pointer)null)}. */
public CXCompileCommand() { super((Pointer)null); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CXCompileCommand(Pointer p) { super(p); }
}
/**
* \brief Error codes for Compilation Database
*/
/** enum CXCompilationDatabase_Error */
public static final int
/*
* \brief No error occurred
*/
CXCompilationDatabase_NoError = 0,
/*
* \brief Database can not be loaded
*/
CXCompilationDatabase_CanNotLoadDatabase = 1;
/**
* \brief Creates a compilation database from the database found in directory
* buildDir. For example, CMake can output a compile_commands.json which can
* be used to build the database.
*
* It must be freed by \c clang_CompilationDatabase_dispose.
*/
public static native CXCompilationDatabase clang_CompilationDatabase_fromDirectory(@Cast("const char*") BytePointer BuildDir,
@Cast("CXCompilationDatabase_Error*") IntPointer ErrorCode);
public static native CXCompilationDatabase clang_CompilationDatabase_fromDirectory(String BuildDir,
@Cast("CXCompilationDatabase_Error*") IntBuffer ErrorCode);
public static native CXCompilationDatabase clang_CompilationDatabase_fromDirectory(@Cast("const char*") BytePointer BuildDir,
@Cast("CXCompilationDatabase_Error*") int[] ErrorCode);
public static native CXCompilationDatabase clang_CompilationDatabase_fromDirectory(String BuildDir,
@Cast("CXCompilationDatabase_Error*") IntPointer ErrorCode);
public static native CXCompilationDatabase clang_CompilationDatabase_fromDirectory(@Cast("const char*") BytePointer BuildDir,
@Cast("CXCompilationDatabase_Error*") IntBuffer ErrorCode);
public static native CXCompilationDatabase clang_CompilationDatabase_fromDirectory(String BuildDir,
@Cast("CXCompilationDatabase_Error*") int[] ErrorCode);
/**
* \brief Free the given compilation database
*/
public static native void clang_CompilationDatabase_dispose(CXCompilationDatabase arg0);
/**
* \brief Find the compile commands used for a file. The compile commands
* must be freed by \c clang_CompileCommands_dispose.
*/
public static native CXCompileCommands clang_CompilationDatabase_getCompileCommands(CXCompilationDatabase arg0,
@Cast("const char*") BytePointer CompleteFileName);
public static native CXCompileCommands clang_CompilationDatabase_getCompileCommands(CXCompilationDatabase arg0,
String CompleteFileName);
/**
* \brief Get all the compile commands in the given compilation database.
*/
public static native CXCompileCommands clang_CompilationDatabase_getAllCompileCommands(CXCompilationDatabase arg0);
/**
* \brief Free the given CompileCommands
*/
public static native void clang_CompileCommands_dispose(CXCompileCommands arg0);
/**
* \brief Get the number of CompileCommand we have for a file
*/
public static native @Cast("unsigned") int clang_CompileCommands_getSize(CXCompileCommands arg0);
/**
* \brief Get the I'th CompileCommand for a file
*
* Note : 0 <= i < clang_CompileCommands_getSize(CXCompileCommands)
*/
public static native CXCompileCommand clang_CompileCommands_getCommand(CXCompileCommands arg0, @Cast("unsigned") int I);
/**
* \brief Get the working directory where the CompileCommand was executed from
*/
public static native @ByVal CXString clang_CompileCommand_getDirectory(CXCompileCommand arg0);
/**
* \brief Get the filename associated with the CompileCommand.
*/
public static native @ByVal CXString clang_CompileCommand_getFilename(CXCompileCommand arg0);
/**
* \brief Get the number of arguments in the compiler invocation.
*
*/
public static native @Cast("unsigned") int clang_CompileCommand_getNumArgs(CXCompileCommand arg0);
/**
* \brief Get the I'th argument value in the compiler invocations
*
* Invariant :
* - argument 0 is the compiler executable
*/
public static native @ByVal CXString clang_CompileCommand_getArg(CXCompileCommand arg0, @Cast("unsigned") int I);
/**
* \brief Get the number of source mappings for the compiler invocation.
*/
public static native @Cast("unsigned") int clang_CompileCommand_getNumMappedSources(CXCompileCommand arg0);
/**
* \brief Get the I'th mapped source path for the compiler invocation.
*/
public static native @ByVal CXString clang_CompileCommand_getMappedSourcePath(CXCompileCommand arg0, @Cast("unsigned") int I);
/**
* \brief Get the I'th mapped source content for the compiler invocation.
*/
public static native @ByVal CXString clang_CompileCommand_getMappedSourceContent(CXCompileCommand arg0, @Cast("unsigned") int I);
/**
* \}
*/
// #ifdef __cplusplus
// #endif
// #endif
// Parsed from <clang-c/BuildSystem.h>
/*==-- clang-c/BuildSystem.h - Utilities for use by build systems -*- C -*-===*\
|* *|
|* The LLVM Compiler Infrastructure *|
|* *|
|* This file is distributed under the University of Illinois Open Source *|
|* License. See LICENSE.TXT for details. *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This header provides various utilities for use by build systems. *|
|* *|
\*===----------------------------------------------------------------------===*/
// #ifndef LLVM_CLANG_C_BUILDSYSTEM_H
// #define LLVM_CLANG_C_BUILDSYSTEM_H
// #include "clang-c/Platform.h"
// #include "clang-c/CXErrorCode.h"
// #include "clang-c/CXString.h"
// #ifdef __cplusplus
// #endif
/**
* \defgroup BUILD_SYSTEM Build system utilities
* \{
*/
/**
* \brief Return the timestamp for use with Clang's
* \c -fbuild-session-timestamp= option.
*/
public static native @Cast("unsigned long long") long clang_getBuildSessionTimestamp();
/**
* \brief Object encapsulating information about overlaying virtual
* file/directories over the real file system.
*/
@Name("CXVirtualFileOverlayImpl") @Opaque public static class CXVirtualFileOverlay extends Pointer {
/** Empty constructor. Calls {@code super((Pointer)null)}. */
public CXVirtualFileOverlay() { super((Pointer)null); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CXVirtualFileOverlay(Pointer p) { super(p); }
}
/**
* \brief Create a \c CXVirtualFileOverlay object.
* Must be disposed with \c clang_VirtualFileOverlay_dispose().
*
* @param options is reserved, always pass 0.
*/
public static native CXVirtualFileOverlay clang_VirtualFileOverlay_create(@Cast("unsigned") int options);
/**
* \brief Map an absolute virtual file path to an absolute real one.
* The virtual path must be canonicalized (not contain "."/"..").
* @return 0 for success, non-zero to indicate an error.
*/
public static native @Cast("CXErrorCode") int clang_VirtualFileOverlay_addFileMapping(CXVirtualFileOverlay arg0,
@Cast("const char*") BytePointer virtualPath,
@Cast("const char*") BytePointer realPath);
public static native @Cast("CXErrorCode") int clang_VirtualFileOverlay_addFileMapping(CXVirtualFileOverlay arg0,
String virtualPath,
String realPath);
/**
* \brief Set the case sensitivity for the \c CXVirtualFileOverlay object.
* The \c CXVirtualFileOverlay object is case-sensitive by default, this
* option can be used to override the default.
* @return 0 for success, non-zero to indicate an error.
*/
public static native @Cast("CXErrorCode") int clang_VirtualFileOverlay_setCaseSensitivity(CXVirtualFileOverlay arg0,
int caseSensitive);
/**
* \brief Write out the \c CXVirtualFileOverlay object to a char buffer.
*
* @param options is reserved, always pass 0.
* @param out_buffer_ptr pointer to receive the buffer pointer, which should be
* disposed using \c clang_free().
* @param out_buffer_size pointer to receive the buffer size.
* @return 0 for success, non-zero to indicate an error.
*/
public static native @Cast("CXErrorCode") int clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay arg0, @Cast("unsigned") int options,
@Cast("char**") PointerPointer out_buffer_ptr,
@Cast("unsigned*") IntPointer out_buffer_size);
public static native @Cast("CXErrorCode") int clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay arg0, @Cast("unsigned") int options,
@Cast("char**") @ByPtrPtr BytePointer out_buffer_ptr,
@Cast("unsigned*") IntPointer out_buffer_size);
public static native @Cast("CXErrorCode") int clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay arg0, @Cast("unsigned") int options,
@Cast("char**") @ByPtrPtr ByteBuffer out_buffer_ptr,
@Cast("unsigned*") IntBuffer out_buffer_size);
public static native @Cast("CXErrorCode") int clang_VirtualFileOverlay_writeToBuffer(CXVirtualFileOverlay arg0, @Cast("unsigned") int options,
@Cast("char**") @ByPtrPtr byte[] out_buffer_ptr,
@Cast("unsigned*") int[] out_buffer_size);
/**
* \brief free memory allocated by libclang, such as the buffer returned by
* \c CXVirtualFileOverlay() or \c clang_ModuleMapDescriptor_writeToBuffer().
*
* @param buffer memory pointer to free.
*/
public static native void clang_free(Pointer buffer);
/**
* \brief Dispose a \c CXVirtualFileOverlay object.
*/
public static native void clang_VirtualFileOverlay_dispose(CXVirtualFileOverlay arg0);
/**
* \brief Object encapsulating information about a module.map file.
*/
@Name("CXModuleMapDescriptorImpl") @Opaque public static class CXModuleMapDescriptor extends Pointer {
/** Empty constructor. Calls {@code super((Pointer)null)}. */
public CXModuleMapDescriptor() { super((Pointer)null); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CXModuleMapDescriptor(Pointer p) { super(p); }
}
/**
* \brief Create a \c CXModuleMapDescriptor object.
* Must be disposed with \c clang_ModuleMapDescriptor_dispose().
*
* @param options is reserved, always pass 0.
*/
public static native CXModuleMapDescriptor clang_ModuleMapDescriptor_create(@Cast("unsigned") int options);
/**
* \brief Sets the framework module name that the module.map describes.
* @return 0 for success, non-zero to indicate an error.
*/
public static native @Cast("CXErrorCode") int clang_ModuleMapDescriptor_setFrameworkModuleName(CXModuleMapDescriptor arg0,
@Cast("const char*") BytePointer name);
public static native @Cast("CXErrorCode") int clang_ModuleMapDescriptor_setFrameworkModuleName(CXModuleMapDescriptor arg0,
String name);
/**
* \brief Sets the umbrealla header name that the module.map describes.
* @return 0 for success, non-zero to indicate an error.
*/
public static native @Cast("CXErrorCode") int clang_ModuleMapDescriptor_setUmbrellaHeader(CXModuleMapDescriptor arg0,
@Cast("const char*") BytePointer name);
public static native @Cast("CXErrorCode") int clang_ModuleMapDescriptor_setUmbrellaHeader(CXModuleMapDescriptor arg0,
String name);
/**
* \brief Write out the \c CXModuleMapDescriptor object to a char buffer.
*
* @param options is reserved, always pass 0.
* @param out_buffer_ptr pointer to receive the buffer pointer, which should be
* disposed using \c clang_free().
* @param out_buffer_size pointer to receive the buffer size.
* @return 0 for success, non-zero to indicate an error.
*/
public static native @Cast("CXErrorCode") int clang_ModuleMapDescriptor_writeToBuffer(CXModuleMapDescriptor arg0, @Cast("unsigned") int options,
@Cast("char**") PointerPointer out_buffer_ptr,
@Cast("unsigned*") IntPointer out_buffer_size);
public static native @Cast("CXErrorCode") int clang_ModuleMapDescriptor_writeToBuffer(CXModuleMapDescriptor arg0, @Cast("unsigned") int options,
@Cast("char**") @ByPtrPtr BytePointer out_buffer_ptr,
@Cast("unsigned*") IntPointer out_buffer_size);
public static native @Cast("CXErrorCode") int clang_ModuleMapDescriptor_writeToBuffer(CXModuleMapDescriptor arg0, @Cast("unsigned") int options,
@Cast("char**") @ByPtrPtr ByteBuffer out_buffer_ptr,
@Cast("unsigned*") IntBuffer out_buffer_size);
public static native @Cast("CXErrorCode") int clang_ModuleMapDescriptor_writeToBuffer(CXModuleMapDescriptor arg0, @Cast("unsigned") int options,
@Cast("char**") @ByPtrPtr byte[] out_buffer_ptr,
@Cast("unsigned*") int[] out_buffer_size);
/**
* \brief Dispose a \c CXModuleMapDescriptor object.
*/
public static native void clang_ModuleMapDescriptor_dispose(CXModuleMapDescriptor arg0);
/**
* \}
*/
// #ifdef __cplusplus
// #endif
// #endif /* CLANG_C_BUILD_SYSTEM_H */
// Parsed from <clang-c/Index.h>
/*===-- clang-c/Index.h - Indexing Public C Interface -------------*- C -*-===*\
|* *|
|* The LLVM Compiler Infrastructure *|
|* *|
|* This file is distributed under the University of Illinois Open Source *|
|* License. See LICENSE.TXT for details. *|
|* *|
|*===----------------------------------------------------------------------===*|
|* *|
|* This header provides a public interface to a Clang library for extracting *|
|* high-level symbol information from source files without exposing the full *|
|* Clang C++ API. *|
|* *|
\*===----------------------------------------------------------------------===*/
// #ifndef LLVM_CLANG_C_INDEX_H
// #define LLVM_CLANG_C_INDEX_H
// #include <time.h>
// #include "clang-c/Platform.h"
// #include "clang-c/CXErrorCode.h"
// #include "clang-c/CXString.h"
// #include "clang-c/BuildSystem.h"
/**
* \brief The version constants for the libclang API.
* CINDEX_VERSION_MINOR should increase when there are API additions.
* CINDEX_VERSION_MAJOR is intended for "major" source/ABI breaking changes.
*
* The policy about the libclang API was always to keep it source and ABI
* compatible, thus CINDEX_VERSION_MAJOR is expected to remain stable.
*/
public static final int CINDEX_VERSION_MAJOR = 0;
public static final int CINDEX_VERSION_MINOR = 43;
// #define CINDEX_VERSION_ENCODE(major, minor) (
// ((major) * 10000)
// + ((minor) * 1))
public static native @MemberGetter int CINDEX_VERSION();
public static final int CINDEX_VERSION = CINDEX_VERSION();
// #define CINDEX_VERSION_STRINGIZE_(major, minor)
// #major"."#minor
// #define CINDEX_VERSION_STRINGIZE(major, minor)
// CINDEX_VERSION_STRINGIZE_(major, minor)
// #define CINDEX_VERSION_STRING CINDEX_VERSION_STRINGIZE(
// CINDEX_VERSION_MAJOR,
// CINDEX_VERSION_MINOR)
// #ifdef __cplusplus
// #endif
/** \defgroup CINDEX libclang: C Interface to Clang
*
* The C Interface to Clang provides a relatively small API that exposes
* facilities for parsing source code into an abstract syntax tree (AST),
* loading already-parsed ASTs, traversing the AST, associating
* physical source locations with elements within the AST, and other
* facilities that support Clang-based development tools.
*
* This C interface to Clang will never provide all of the information
* representation stored in Clang's C++ AST, nor should it: the intent is to
* maintain an API that is relatively stable from one release to the next,
* providing only the basic functionality needed to support development tools.
*
* To avoid namespace pollution, data types are prefixed with "CX" and
* functions are prefixed with "clang_".
*
* \{
*/
/**
* \brief An "index" that consists of a set of translation units that would
* typically be linked together into an executable or library.
*/
@Namespace @Name("void") @Opaque public static class CXIndex extends Pointer {
/** Empty constructor. Calls {@code super((Pointer)null)}. */
public CXIndex() { super((Pointer)null); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CXIndex(Pointer p) { super(p); }
}
/**
* \brief An opaque type representing target information for a given translation
* unit.
*/
@Name("CXTargetInfoImpl") @Opaque public static class CXTargetInfo extends Pointer {
/** Empty constructor. Calls {@code super((Pointer)null)}. */
public CXTargetInfo() { super((Pointer)null); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CXTargetInfo(Pointer p) { super(p); }
}
/**
* \brief A single translation unit, which resides in an index.
*/
@Name("CXTranslationUnitImpl") @Opaque public static class CXTranslationUnit extends Pointer {
/** Empty constructor. Calls {@code super((Pointer)null)}. */
public CXTranslationUnit() { super((Pointer)null); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CXTranslationUnit(Pointer p) { super(p); }
}
/**
* \brief Opaque pointer representing client data that will be passed through
* to various callbacks and visitors.
*/
@Namespace @Name("void") @Opaque public static class CXClientData extends Pointer {
/** Empty constructor. Calls {@code super((Pointer)null)}. */
public CXClientData() { super((Pointer)null); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CXClientData(Pointer p) { super(p); }
}
/**
* \brief Provides the contents of a file that has not yet been saved to disk.
*
* Each CXUnsavedFile instance provides the name of a file on the
* system along with the current contents of that file that have not
* yet been saved to disk.
*/
public static class CXUnsavedFile extends Pointer {
static { Loader.load(); }
/** Default native constructor. */
public CXUnsavedFile() { super((Pointer)null); allocate(); }
/** Native array allocator. Access with {@link Pointer#position(long)}. */
public CXUnsavedFile(long size) { super((Pointer)null); allocateArray(size); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CXUnsavedFile(Pointer p) { super(p); }
private native void allocate();
private native void allocateArray(long size);
@Override public CXUnsavedFile position(long position) {
return (CXUnsavedFile)super.position(position);
}
/**
* \brief The file whose contents have not yet been saved.
*
* This file must already exist in the file system.
*/
@MemberGetter public native @Cast("const char*") BytePointer Filename();
/**
* \brief A buffer containing the unsaved contents of this file.
*/
@MemberGetter public native @Cast("const char*") BytePointer Contents();
/**
* \brief The length of the unsaved contents of this buffer.
*/
public native @Cast("unsigned long") long Length(); public native CXUnsavedFile Length(long Length);
}
/**
* \brief Describes the availability of a particular entity, which indicates
* whether the use of this entity will result in a warning or error due to
* it being deprecated or unavailable.
*/
/** enum CXAvailabilityKind */
public static final int
/**
* \brief The entity is available.
*/
CXAvailability_Available = 0,
/**
* \brief The entity is available, but has been deprecated (and its use is
* not recommended).
*/
CXAvailability_Deprecated = 1,
/**
* \brief The entity is not available; any use of it will be an error.
*/
CXAvailability_NotAvailable = 2,
/**
* \brief The entity is available, but not accessible; any use of it will be
* an error.
*/
CXAvailability_NotAccessible = 3;
/**
* \brief Describes a version number of the form major.minor.subminor.
*/
public static class CXVersion extends Pointer {
static { Loader.load(); }
/** Default native constructor. */
public CXVersion() { super((Pointer)null); allocate(); }
/** Native array allocator. Access with {@link Pointer#position(long)}. */
public CXVersion(long size) { super((Pointer)null); allocateArray(size); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CXVersion(Pointer p) { super(p); }
private native void allocate();
private native void allocateArray(long size);
@Override public CXVersion position(long position) {
return (CXVersion)super.position(position);
}
/**
* \brief The major version number, e.g., the '10' in '10.7.3'. A negative
* value indicates that there is no version number at all.
*/
public native int Major(); public native CXVersion Major(int Major);
/**
* \brief The minor version number, e.g., the '7' in '10.7.3'. This value
* will be negative if no minor version number was provided, e.g., for
* version '10'.
*/
public native int Minor(); public native CXVersion Minor(int Minor);
/**
* \brief The subminor version number, e.g., the '3' in '10.7.3'. This value
* will be negative if no minor or subminor version number was provided,
* e.g., in version '10' or '10.7'.
*/
public native int Subminor(); public native CXVersion Subminor(int Subminor);
}
/**
* \brief Describes the exception specification of a cursor.
*
* A negative value indicates that the cursor is not a function declaration.
*/
/** enum CXCursor_ExceptionSpecificationKind */
public static final int
/**
* \brief The cursor has no exception specification.
*/
CXCursor_ExceptionSpecificationKind_None = 0,
/**
* \brief The cursor has exception specification throw()
*/
CXCursor_ExceptionSpecificationKind_DynamicNone = 1,
/**
* \brief The cursor has exception specification throw(T1, T2)
*/
CXCursor_ExceptionSpecificationKind_Dynamic = 2,
/**
* \brief The cursor has exception specification throw(...).
*/
CXCursor_ExceptionSpecificationKind_MSAny = 3,
/**
* \brief The cursor has exception specification basic noexcept.
*/
CXCursor_ExceptionSpecificationKind_BasicNoexcept = 4,
/**
* \brief The cursor has exception specification computed noexcept.
*/
CXCursor_ExceptionSpecificationKind_ComputedNoexcept = 5,
/**
* \brief The exception specification has not yet been evaluated.
*/
CXCursor_ExceptionSpecificationKind_Unevaluated = 6,
/**
* \brief The exception specification has not yet been instantiated.
*/
CXCursor_ExceptionSpecificationKind_Uninstantiated = 7,
/**
* \brief The exception specification has not been parsed yet.
*/
CXCursor_ExceptionSpecificationKind_Unparsed = 8;
/**
* \brief Provides a shared context for creating translation units.
*
* It provides two options:
*
* - excludeDeclarationsFromPCH: When non-zero, allows enumeration of "local"
* declarations (when loading any new translation units). A "local" declaration
* is one that belongs in the translation unit itself and not in a precompiled
* header that was used by the translation unit. If zero, all declarations
* will be enumerated.
*
* Here is an example:
*
* <pre>{@code
* // excludeDeclsFromPCH = 1, displayDiagnostics=1
* Idx = clang_createIndex(1, 1);
*
* // IndexTest.pch was produced with the following command:
* // "clang -x c IndexTest.h -emit-ast -o IndexTest.pch"
* TU = clang_createTranslationUnit(Idx, "IndexTest.pch");
*
* // This will load all the symbols from 'IndexTest.pch'
* clang_visitChildren(clang_getTranslationUnitCursor(TU),
* TranslationUnitVisitor, 0);
* clang_disposeTranslationUnit(TU);
*
* // This will load all the symbols from 'IndexTest.c', excluding symbols
* // from 'IndexTest.pch'.
* char *args[] = { "-Xclang", "-include-pch=IndexTest.pch" };
* TU = clang_createTranslationUnitFromSourceFile(Idx, "IndexTest.c", 2, args,
* 0, 0);
* clang_visitChildren(clang_getTranslationUnitCursor(TU),
* TranslationUnitVisitor, 0);
* clang_disposeTranslationUnit(TU);
* }</pre>
*
* This process of creating the 'pch', loading it separately, and using it (via
* -include-pch) allows 'excludeDeclsFromPCH' to remove redundant callbacks
* (which gives the indexer the same performance benefit as the compiler).
*/
public static native CXIndex clang_createIndex(int excludeDeclarationsFromPCH,
int displayDiagnostics);
/**
* \brief Destroy the given index.
*
* The index must not be destroyed until all of the translation units created
* within that index have been destroyed.
*/
public static native void clang_disposeIndex(CXIndex index);
/** enum CXGlobalOptFlags */
public static final int
/**
* \brief Used to indicate that no special CXIndex options are needed.
*/
CXGlobalOpt_None = 0x0,
/**
* \brief Used to indicate that threads that libclang creates for indexing
* purposes should use background priority.
*
* Affects #clang_indexSourceFile, #clang_indexTranslationUnit,
* #clang_parseTranslationUnit, #clang_saveTranslationUnit.
*/
CXGlobalOpt_ThreadBackgroundPriorityForIndexing = 0x1,
/**
* \brief Used to indicate that threads that libclang creates for editing
* purposes should use background priority.
*
* Affects #clang_reparseTranslationUnit, #clang_codeCompleteAt,
* #clang_annotateTokens
*/
CXGlobalOpt_ThreadBackgroundPriorityForEditing = 0x2,
/**
* \brief Used to indicate that all threads that libclang creates should use
* background priority.
*/
CXGlobalOpt_ThreadBackgroundPriorityForAll =
CXGlobalOpt_ThreadBackgroundPriorityForIndexing |
CXGlobalOpt_ThreadBackgroundPriorityForEditing;
/**
* \brief Sets general options associated with a CXIndex.
*
* For example:
* <pre>{@code
* CXIndex idx = ...;
* clang_CXIndex_setGlobalOptions(idx,
* clang_CXIndex_getGlobalOptions(idx) |
* CXGlobalOpt_ThreadBackgroundPriorityForIndexing);
* }</pre>
*
* @param options A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags.
*/
public static native void clang_CXIndex_setGlobalOptions(CXIndex arg0, @Cast("unsigned") int options);
/**
* \brief Gets the general options associated with a CXIndex.
*
* @return A bitmask of options, a bitwise OR of CXGlobalOpt_XXX flags that
* are associated with the given CXIndex object.
*/
public static native @Cast("unsigned") int clang_CXIndex_getGlobalOptions(CXIndex arg0);
/**
* \defgroup CINDEX_FILES File manipulation routines
*
* \{
*/
/**
* \brief A particular source file that is part of a translation unit.
*/
@Namespace @Name("void") @Opaque public static class CXFile extends Pointer {
/** Empty constructor. Calls {@code super((Pointer)null)}. */
public CXFile() { super((Pointer)null); }
/** Pointer cast constructor. Invokes {@link Pointer#Pointer(Pointer)}. */
public CXFile(Pointer p) { super(p); }