Make vendor/clang/dist exactly the same as upstream's r108428. Some
files and directories were already added/removed in the upstream repository, but were not added/removed here, when the previous snapshot was imported. Note: I did not import the file test/Lexer/conflict-marker.c, because it contains merge conflict markers on purpose, which upsets our pre-commit hooks. Approved by: rpaulo (mentor)
This commit is contained in:
parent
4e58654b47
commit
a0482fa4e7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor/clang/dist/; revision=212766 svn path=/vendor/clang/clang-r108428/; revision=212768; tag=vendor/clang/clang-r108428
@ -1,647 +0,0 @@
|
||||
Block Implementation Specification
|
||||
|
||||
Copyright 2008-2009 Apple, Inc.
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
|
||||
0. History
|
||||
|
||||
2008/7/14 - created
|
||||
2008/8/21 - revised, C++
|
||||
2008/9/24 - add NULL isa field to __block storage
|
||||
2008/10/1 - revise block layout to use a static descriptor structure
|
||||
2008/10/6 - revise block layout to use an unsigned long int flags
|
||||
2008/10/28 - specify use of _Block_object_assign/dispose for all "Object" types in helper functions
|
||||
2008/10/30 - revise new layout to have invoke function in same place
|
||||
2008/10/30 - add __weak support
|
||||
|
||||
This document describes the Apple ABI implementation specification of Blocks.
|
||||
|
||||
1. High Level
|
||||
|
||||
A Block consists of a structure of the following form:
|
||||
|
||||
struct Block_literal_1 {
|
||||
void *isa; // initialized to &_NSConcreteStackBlock or &_NSConcreteGlobalBlock
|
||||
int flags;
|
||||
int reserved;
|
||||
void (*invoke)(void *, ...);
|
||||
struct Block_descriptor_1 {
|
||||
unsigned long int reserved; // NULL
|
||||
unsigned long int size; // sizeof(struct Block_literal_1)
|
||||
// optional helper functions
|
||||
void (*copy_helper)(void *dst, void *src);
|
||||
void (*dispose_helper)(void *src);
|
||||
} *descriptor;
|
||||
// imported variables
|
||||
};
|
||||
|
||||
The following flags bits are used by the compiler:
|
||||
|
||||
enum {
|
||||
BLOCK_HAS_COPY_DISPOSE = (1 << 25),
|
||||
BLOCK_HAS_CTOR = (1 << 26), // helpers have C++ code
|
||||
BLOCK_IS_GLOBAL = (1 << 28),
|
||||
BLOCK_HAS_DESCRIPTOR = (1 << 29), // interim until complete world build is accomplished
|
||||
};
|
||||
|
||||
Block literals may occur within functions where the structure is created in stack local memory. They may also appear as initialization expressions for Block variables of global or static local variables.
|
||||
|
||||
When a Block literal expression is evaluated the stack based structure is initialized as follows:
|
||||
|
||||
1) static descriptor structure is declared and initialized as follows:
|
||||
1a) the invoke function pointer is set to a function that takes the Block structure as its first argument and the rest of the arguments (if any) to the Block and executes the Block compound statement.
|
||||
1b) the size field is set to the size of the following Block literal structure.
|
||||
1c) the copy_helper and dispose_helper function pointers are set to respective helper functions if they are required by the Block literal
|
||||
2) a stack (or global) Block literal data structure is created and initialized as follows:
|
||||
2a) the isa field is set to the address of the external _NSConcreteStackBlock, which is a block of uninitialized memory supplied in libSystem, or _NSConcreteGlobalBlock if this is a static or file level block literal.
|
||||
2) The flags field is set to zero unless there are variables imported into the block that need helper functions for program level Block_copy() and Block_release() operations, in which case the (1<<25) flags bit is set.
|
||||
|
||||
As an example, the Block literal expression
|
||||
^ { printf("hello world\n"); }
|
||||
would cause to be created on a 32-bit system:
|
||||
|
||||
struct __block_literal_1 {
|
||||
void *isa;
|
||||
int flags;
|
||||
int reserved;
|
||||
void (*invoke)(struct __block_literal_1 *);
|
||||
struct __block_descriptor_1 *descriptor;
|
||||
};
|
||||
|
||||
void __block_invoke_1(struct __block_literal_1 *_block) {
|
||||
printf("hello world\n");
|
||||
}
|
||||
|
||||
static struct __block_descriptor_1 {
|
||||
unsigned long int reserved;
|
||||
unsigned long int Block_size;
|
||||
} __block_descriptor_1 = { 0, sizeof(struct __block_literal_1), __block_invoke_1 };
|
||||
|
||||
and where the block literal appeared
|
||||
|
||||
struct __block_literal_1 _block_literal = {
|
||||
&_NSConcreteStackBlock,
|
||||
(1<<29), <uninitialized>,
|
||||
__block_invoke_1,
|
||||
&__block_descriptor_1
|
||||
};
|
||||
|
||||
Blocks import other Block references, const copies of other variables, and variables marked __block. In Objective-C variables may additionally be objects.
|
||||
|
||||
When a Block literal expression used as the initial value of a global or static local variable it is initialized as follows:
|
||||
struct __block_literal_1 __block_literal_1 = {
|
||||
&_NSConcreteGlobalBlock,
|
||||
(1<<28)|(1<<29), <uninitialized>,
|
||||
__block_invoke_1,
|
||||
&__block_descriptor_1
|
||||
};
|
||||
that is, a different address is provided as the first value and a particular (1<<28) bit is set in the flags field, and otherwise it is the same as for stack based Block literals. This is an optimization that can be used for any Block literal that imports no const or __block storage variables.
|
||||
|
||||
|
||||
2. Imported Variables
|
||||
|
||||
Variables of "auto" storage class are imported as const copies. Variables of "__block" storage class are imported as a pointer to an enclosing data structure. Global variables are simply referenced and not considered as imported.
|
||||
|
||||
2.1 Imported const copy variables
|
||||
|
||||
Automatic storage variables not marked with __block are imported as const copies.
|
||||
|
||||
The simplest example is that of importing a variable of type int.
|
||||
|
||||
int x = 10;
|
||||
void (^vv)(void) = ^{ printf("x is %d\n", x); }
|
||||
x = 11;
|
||||
vv();
|
||||
|
||||
would be compiled
|
||||
|
||||
struct __block_literal_2 {
|
||||
void *isa;
|
||||
int flags;
|
||||
int reserved;
|
||||
void (*invoke)(struct __block_literal_2 *);
|
||||
struct __block_descriptor_2 *descriptor;
|
||||
const int x;
|
||||
};
|
||||
|
||||
void __block_invoke_2(struct __block_literal_2 *_block) {
|
||||
printf("x is %d\n", _block->x);
|
||||
}
|
||||
|
||||
static struct __block_descriptor_2 {
|
||||
unsigned long int reserved;
|
||||
unsigned long int Block_size;
|
||||
} __block_descriptor_2 = { 0, sizeof(struct __block_literal_2) };
|
||||
|
||||
and
|
||||
|
||||
struct __block_literal_2 __block_literal_2 = {
|
||||
&_NSConcreteStackBlock,
|
||||
(1<<29), <uninitialized>,
|
||||
__block_invoke_2,
|
||||
&__block_descriptor_2,
|
||||
x
|
||||
};
|
||||
|
||||
In summary, scalars, structures, unions, and function pointers are generally imported as const copies with no need for helper functions.
|
||||
|
||||
2.2 Imported const copy of Block reference
|
||||
|
||||
The first case where copy and dispose helper functions are required is for the case of when a block itself is imported. In this case both a copy_helper function and a dispose_helper function are needed. The copy_helper function is passed both the existing stack based pointer and the pointer to the new heap version and should call back into the runtime to actually do the copy operation on the imported fields within the block. The runtime functions are all described in Section 5.0 Runtime Helper Functions.
|
||||
|
||||
An example:
|
||||
|
||||
void (^existingBlock)(void) = ...;
|
||||
void (^vv)(void) = ^{ existingBlock(); }
|
||||
vv();
|
||||
|
||||
struct __block_literal_3 {
|
||||
...; // existing block
|
||||
};
|
||||
|
||||
struct __block_literal_4 {
|
||||
void *isa;
|
||||
int flags;
|
||||
int reserved;
|
||||
void (*invoke)(struct __block_literal_4 *);
|
||||
struct __block_literal_3 *const existingBlock;
|
||||
};
|
||||
|
||||
void __block_invoke_4(struct __block_literal_2 *_block) {
|
||||
__block->existingBlock->invoke(__block->existingBlock);
|
||||
}
|
||||
|
||||
void __block_copy_4(struct __block_literal_4 *dst, struct __block_literal_4 *src) {
|
||||
//_Block_copy_assign(&dst->existingBlock, src->existingBlock, 0);
|
||||
_Block_object_assign(&dst->existingBlock, src->existingBlock, BLOCK_FIELD_IS_BLOCK);
|
||||
}
|
||||
|
||||
void __block_dispose_4(struct __block_literal_4 *src) {
|
||||
// was _Block_destroy
|
||||
_Block_object_dispose(src->existingBlock, BLOCK_FIELD_IS_BLOCK);
|
||||
}
|
||||
|
||||
static struct __block_descriptor_4 {
|
||||
unsigned long int reserved;
|
||||
unsigned long int Block_size;
|
||||
void (*copy_helper)(struct __block_literal_4 *dst, struct __block_literal_4 *src);
|
||||
void (*dispose_helper)(struct __block_literal_4 *);
|
||||
} __block_descriptor_4 = {
|
||||
0,
|
||||
sizeof(struct __block_literal_4),
|
||||
__block_copy_4,
|
||||
__block_dispose_4,
|
||||
};
|
||||
|
||||
and where it is used
|
||||
|
||||
struct __block_literal_4 _block_literal = {
|
||||
&_NSConcreteStackBlock,
|
||||
(1<<25)|(1<<29), <uninitialized>
|
||||
__block_invoke_4,
|
||||
& __block_descriptor_4
|
||||
existingBlock,
|
||||
};
|
||||
|
||||
2.2.1 Importing __attribute__((NSObject)) variables.
|
||||
|
||||
GCC introduces __attribute__((NSObject)) on structure pointers to mean "this is an object". This is useful because many low level data structures are declared as opaque structure pointers, e.g. CFStringRef, CFArrayRef, etc. When used from C, however, these are still really objects and are the second case where that requires copy and dispose helper functions to be generated. The copy helper functions generated by the compiler should use the _Block_object_assign runtime helper function and in the dispose helper the _Block_object_dispose runtime helper function should be called.
|
||||
|
||||
For example, block xyzzy in the following
|
||||
|
||||
struct Opaque *__attribute__((NSObject)) objectPointer = ...;
|
||||
...
|
||||
void (^xyzzy)(void) = ^{ CFPrint(objectPointer); };
|
||||
|
||||
would have helper functions
|
||||
|
||||
void __block_copy_xyzzy(struct __block_literal_5 *dst, struct __block_literal_5 *src) {
|
||||
_Block_object_assign(&dst->objectPointer, src-> objectPointer, BLOCK_FIELD_IS_OBJECT);
|
||||
}
|
||||
|
||||
void __block_dispose_xyzzy(struct __block_literal_5 *src) {
|
||||
_Block_object_dispose(src->objectPointer, BLOCK_FIELD_IS_OBJECT);
|
||||
}
|
||||
|
||||
generated.
|
||||
|
||||
|
||||
2.3 Imported __block marked variables.
|
||||
|
||||
2.3.1 Layout of __block marked variables
|
||||
|
||||
The compiler must embed variables that are marked __block in a specialized structure of the form:
|
||||
|
||||
struct _block_byref_xxxx {
|
||||
void *isa;
|
||||
struct Block_byref *forwarding;
|
||||
int flags; //refcount;
|
||||
int size;
|
||||
typeof(marked_variable) marked_variable;
|
||||
};
|
||||
|
||||
Variables of certain types require helper functions for when Block_copy() and Block_release() are performed upon a referencing Block. At the "C" level only variables that are of type Block or ones that have __attribute__((NSObject)) marked require helper functions. In Objective-C objects require helper functions and in C++ stack based objects require helper functions. Variables that require helper functions use the form:
|
||||
|
||||
struct _block_byref_xxxx {
|
||||
void *isa;
|
||||
struct _block_byref_xxxx *forwarding;
|
||||
int flags; //refcount;
|
||||
int size;
|
||||
// helper functions called via Block_copy() and Block_release()
|
||||
void (*byref_keep)(void *dst, void *src);
|
||||
void (*byref_dispose)(void *);
|
||||
typeof(marked_variable) marked_variable;
|
||||
};
|
||||
|
||||
The structure is initialized such that
|
||||
a) the forwarding pointer is set to the beginning of its enclosing structure,
|
||||
b) the size field is initialized to the total size of the enclosing structure,
|
||||
c) the flags field is set to either 0 if no helper functions are needed or (1<<25) if they are,
|
||||
d) the helper functions are initialized (if present)
|
||||
e) the variable itself is set to its initial value.
|
||||
f) the isa field is set to NULL
|
||||
|
||||
2.3.2 Access to __block variables from within its lexical scope.
|
||||
|
||||
In order to "move" the variable to the heap upon a copy_helper operation the compiler must rewrite access to such a variable to be indirect through the structures forwarding pointer. For example:
|
||||
|
||||
int __block i = 10;
|
||||
i = 11;
|
||||
|
||||
would be rewritten to be:
|
||||
|
||||
struct _block_byref_i {
|
||||
void *isa;
|
||||
struct _block_byref_i *forwarding;
|
||||
int flags; //refcount;
|
||||
int size;
|
||||
int captured_i;
|
||||
} i = { NULL, &i, 0, sizeof(struct _block_byref_i), 11 };
|
||||
|
||||
i.forwarding->captured_i = 11;
|
||||
|
||||
In the case of a Block reference variable being marked __block the helper code generated must use the _Block_object_assign and _Block_object_dispose routines supplied by the runtime to make the copies. For example:
|
||||
|
||||
__block void (voidBlock)(void) = blockA;
|
||||
voidBlock = blockB;
|
||||
|
||||
would translate into
|
||||
|
||||
struct _block_byref_voidBlock {
|
||||
void *isa;
|
||||
struct _block_byref_voidBlock *forwarding;
|
||||
int flags; //refcount;
|
||||
int size;
|
||||
void (*byref_keep)(struct _block_byref_voidBlock *dst, struct _block_byref_voidBlock *src);
|
||||
void (*byref_dispose)(struct _block_byref_voidBlock *);
|
||||
void (^captured_voidBlock)(void);
|
||||
};
|
||||
|
||||
void _block_byref_keep_helper(struct _block_byref_voidBlock *dst, struct _block_byref_voidBlock *src) {
|
||||
//_Block_copy_assign(&dst->captured_voidBlock, src->captured_voidBlock, 0);
|
||||
_Block_object_assign(&dst->captured_voidBlock, src->captured_voidBlock, BLOCK_FIELD_IS_BLOCK | BLOCK_BYREF_CALLER);
|
||||
}
|
||||
|
||||
void _block_byref_dispose_helper(struct _block_byref_voidBlock *param) {
|
||||
//_Block_destroy(param->captured_voidBlock, 0);
|
||||
_Block_object_dispose(param->captured_voidBlock, BLOCK_FIELD_IS_BLOCK | BLOCK_BYREF_CALLER)}
|
||||
|
||||
and
|
||||
struct _block_byref_voidBlock voidBlock = {( .forwarding=&voidBlock, .flags=(1<<25), .size=sizeof(struct _block_byref_voidBlock *),
|
||||
.byref_keep=_block_byref_keep_helper, .byref_dispose=_block_byref_dispose_helper,
|
||||
.captured_voidBlock=blockA };
|
||||
|
||||
voidBlock.forwarding->captured_voidBlock = blockB;
|
||||
|
||||
|
||||
2.3.3 Importing __block variables into Blocks
|
||||
|
||||
A Block that uses a __block variable in its compound statement body must import the variable and emit copy_helper and dispose_helper helper functions that, in turn, call back into the runtime to actually copy or release the byref data block using the functions _Block_object_assign and _Block_object_dispose.
|
||||
|
||||
For example:
|
||||
|
||||
int __block i = 2;
|
||||
functioncall(^{ i = 10; });
|
||||
|
||||
would translate to
|
||||
|
||||
struct _block_byref_i {
|
||||
void *isa; // set to NULL
|
||||
struct _block_byref_voidBlock *forwarding;
|
||||
int flags; //refcount;
|
||||
int size;
|
||||
void (*byref_keep)(struct _block_byref_i *dst, struct _block_byref_i *src);
|
||||
void (*byref_dispose)(struct _block_byref_i *);
|
||||
int captured_i;
|
||||
};
|
||||
|
||||
|
||||
struct __block_literal_5 {
|
||||
void *isa;
|
||||
int flags;
|
||||
int reserved;
|
||||
void (*invoke)(struct __block_literal_5 *);
|
||||
struct __block_descriptor_5 *descriptor;
|
||||
struct _block_byref_i *i_holder;
|
||||
};
|
||||
|
||||
void __block_invoke_5(struct __block_literal_5 *_block) {
|
||||
_block->forwarding->captured_i = 10;
|
||||
}
|
||||
|
||||
void __block_copy_5(struct __block_literal_5 *dst, struct __block_literal_5 *src) {
|
||||
//_Block_byref_assign_copy(&dst->captured_i, src->captured_i);
|
||||
_Block_object_assign(&dst->captured_i, src->captured_i, BLOCK_FIELD_IS_BYREF | BLOCK_BYREF_CALLER);
|
||||
}
|
||||
|
||||
void __block_dispose_5(struct __block_literal_5 *src) {
|
||||
//_Block_byref_release(src->captured_i);
|
||||
_Block_object_dispose(src->captured_i, BLOCK_FIELD_IS_BYREF | BLOCK_BYREF_CALLER);
|
||||
}
|
||||
|
||||
static struct __block_descriptor_5 {
|
||||
unsigned long int reserved;
|
||||
unsigned long int Block_size;
|
||||
void (*copy_helper)(struct __block_literal_5 *dst, struct __block_literal_5 *src);
|
||||
void (*dispose_helper)(struct __block_literal_5 *);
|
||||
} __block_descriptor_5 = { 0, sizeof(struct __block_literal_5) __block_copy_5, __block_dispose_5 };
|
||||
|
||||
and
|
||||
|
||||
struct _block_byref_i i = {( .forwarding=&i, .flags=0, .size=sizeof(struct _block_byref_i) )};
|
||||
struct __block_literal_5 _block_literal = {
|
||||
&_NSConcreteStackBlock,
|
||||
(1<<25)|(1<<29), <uninitialized>,
|
||||
__block_invoke_5,
|
||||
&__block_descriptor_5,
|
||||
2,
|
||||
};
|
||||
|
||||
2.3.4 Importing __attribute__((NSObject)) __block variables
|
||||
|
||||
A __block variable that is also marked __attribute__((NSObject)) should have byref_keep and byref_dispose helper functions that use _Block_object_assign and _Block_object_dispose.
|
||||
|
||||
2.3.5 __block escapes
|
||||
|
||||
Because Blocks referencing __block variables may have Block_copy() performed upon them the underlying storage for the variables may move to the heap. In Objective-C Garbage Collection Only compilation environments the heap used is the garbage collected one and no further action is required. Otherwise the compiler must issue a call to potentially release any heap storage for __block variables at all escapes or terminations of their scope.
|
||||
|
||||
|
||||
2.3.6 Nesting
|
||||
|
||||
Blocks may contain Block literal expressions. Any variables used within inner blocks are imported into all enclosing Block scopes even if the variables are not used. This includes const imports as well as __block variables.
|
||||
|
||||
3. Objective C Extensions to Blocks
|
||||
|
||||
3.1 Importing Objects
|
||||
|
||||
Objects should be treated as __attribute__((NSObject)) variables; all copy_helper, dispose_helper, byref_keep, and byref_dispose helper functions should use _Block_object_assign and _Block_object_dispose. There should be no code generated that uses -retain or -release methods.
|
||||
|
||||
|
||||
3.2 Blocks as Objects
|
||||
|
||||
The compiler will treat Blocks as objects when synthesizing property setters and getters, will characterize them as objects when generating garbage collection strong and weak layout information in the same manner as objects, and will issue strong and weak write-barrier assignments in the same manner as objects.
|
||||
|
||||
3.3 __weak __block Support
|
||||
|
||||
Objective-C (and Objective-C++) support the __weak attribute on __block variables. Under normal circumstances the compiler uses the Objective-C runtime helper support functions objc_assign_weak and objc_read_weak. Both should continue to be used for all reads and writes of __weak __block variables:
|
||||
objc_read_weak(&block->byref_i->forwarding->i)
|
||||
|
||||
The __weak variable is stored in a _block_byref_xxxx structure and the Block has copy and dispose helpers for this structure that call:
|
||||
_Block_object_assign(&dest->_block_byref_i, src-> _block_byref_i, BLOCK_FIELD_IS_WEAK | BLOCK_FIELD_IS_BYREF);
|
||||
and
|
||||
_Block_object_dispose(src->_block_byref_i, BLOCK_FIELD_IS_WEAK | BLOCK_FIELD_IS_BYREF);
|
||||
|
||||
|
||||
In turn, the block_byref copy support helpers distinguish between whether the __block variable is a Block or not and should either call:
|
||||
_Block_object_assign(&dest->_block_byref_i, src->_block_byref_i, BLOCK_FIELD_IS_WEAK | BLOCK_FIELD_IS_OBJECT | BLOCK_BYREF_CALLER);
|
||||
for something declared as an object or
|
||||
_Block_object_assign(&dest->_block_byref_i, src->_block_byref_i, BLOCK_FIELD_IS_WEAK | BLOCK_FIELD_IS_BLOCK | BLOCK_BYREF_CALLER);
|
||||
for something declared as a Block.
|
||||
|
||||
A full example follows:
|
||||
|
||||
|
||||
__block __weak id obj = <initialization expression>;
|
||||
functioncall(^{ [obj somemessage]; });
|
||||
|
||||
would translate to
|
||||
|
||||
struct _block_byref_obj {
|
||||
void *isa; // uninitialized
|
||||
struct _block_byref_obj *forwarding;
|
||||
int flags; //refcount;
|
||||
int size;
|
||||
void (*byref_keep)(struct _block_byref_i *dst, struct _block_byref_i *src);
|
||||
void (*byref_dispose)(struct _block_byref_i *);
|
||||
int captured_obj;
|
||||
};
|
||||
|
||||
void _block_byref_obj_keep(struct _block_byref_voidBlock *dst, struct _block_byref_voidBlock *src) {
|
||||
//_Block_copy_assign(&dst->captured_obj, src->captured_obj, 0);
|
||||
_Block_object_assign(&dst->captured_obj, src->captured_obj, BLOCK_FIELD_IS_OBJECT | BLOCK_FIELD_IS_WEAK | BLOCK_BYREF_CALLER);
|
||||
}
|
||||
|
||||
void _block_byref_obj_dispose(struct _block_byref_voidBlock *param) {
|
||||
//_Block_destroy(param->captured_obj, 0);
|
||||
_Block_object_dispose(param->captured_obj, BLOCK_FIELD_IS_OBJECT | BLOCK_FIELD_IS_WEAK | BLOCK_BYREF_CALLER);
|
||||
};
|
||||
|
||||
for the block byref part and
|
||||
|
||||
struct __block_literal_5 {
|
||||
void *isa;
|
||||
int flags;
|
||||
int reserved;
|
||||
void (*invoke)(struct __block_literal_5 *);
|
||||
struct __block_descriptor_5 *descriptor;
|
||||
struct _block_byref_obj *byref_obj;
|
||||
};
|
||||
|
||||
void __block_invoke_5(struct __block_literal_5 *_block) {
|
||||
[objc_read_weak(&_block->byref_obj->forwarding->captured_obj) somemessage];
|
||||
}
|
||||
|
||||
void __block_copy_5(struct __block_literal_5 *dst, struct __block_literal_5 *src) {
|
||||
//_Block_byref_assign_copy(&dst->byref_obj, src->byref_obj);
|
||||
_Block_object_assign(&dst->byref_obj, src->byref_obj, BLOCK_FIELD_IS_BYREF | BLOCK_FIELD_IS_WEAK);
|
||||
}
|
||||
|
||||
void __block_dispose_5(struct __block_literal_5 *src) {
|
||||
//_Block_byref_release(src->byref_obj);
|
||||
_Block_object_dispose(src->byref_obj, BLOCK_FIELD_IS_BYREF | BLOCK_FIELD_IS_WEAK);
|
||||
}
|
||||
|
||||
static struct __block_descriptor_5 {
|
||||
unsigned long int reserved;
|
||||
unsigned long int Block_size;
|
||||
void (*copy_helper)(struct __block_literal_5 *dst, struct __block_literal_5 *src);
|
||||
void (*dispose_helper)(struct __block_literal_5 *);
|
||||
} __block_descriptor_5 = { 0, sizeof(struct __block_literal_5), __block_copy_5, __block_dispose_5 };
|
||||
|
||||
and within the compound statement:
|
||||
|
||||
struct _block_byref_obj obj = {( .forwarding=&obj, .flags=(1<<25), .size=sizeof(struct _block_byref_obj),
|
||||
.byref_keep=_block_byref_obj_keep, .byref_dispose=_block_byref_obj_dispose,
|
||||
.captured_obj = <initialization expression> )};
|
||||
|
||||
struct __block_literal_5 _block_literal = {
|
||||
&_NSConcreteStackBlock,
|
||||
(1<<25)|(1<<29), <uninitialized>,
|
||||
__block_invoke_5,
|
||||
&__block_descriptor_5,
|
||||
&obj, // a reference to the on-stack structure containing "captured_obj"
|
||||
};
|
||||
|
||||
|
||||
functioncall(_block_literal->invoke(&_block_literal));
|
||||
|
||||
|
||||
4.0 C++ Support
|
||||
|
||||
Within a block stack based C++ objects are copied as const copies using the const copy constructor. It is an error if a stack based C++ object is used within a block if it does not have a const copy constructor. In addition both copy and destroy helper routines must be synthesized for the block to support the Block_copy() operation, and the flags work marked with the (1<<26) bit in addition to the (1<<25) bit. The copy helper should call the constructor using appropriate offsets of the variable within the supplied stack based block source and heap based destination for all const constructed copies, and similarly should call the destructor in the destroy routine.
|
||||
|
||||
As an example, suppose a C++ class FOO existed with a const copy constructor. Within a code block a stack version of a FOO object is declared and used within a Block literal expression:
|
||||
|
||||
{
|
||||
FOO foo;
|
||||
void (^block)(void) = ^{ printf("%d\n", foo.value()); };
|
||||
}
|
||||
|
||||
The compiler would synthesize
|
||||
|
||||
struct __block_literal_10 {
|
||||
void *isa;
|
||||
int flags;
|
||||
int reserved;
|
||||
void (*invoke)(struct __block_literal_10 *);
|
||||
struct __block_descriptor_10 *descriptor;
|
||||
const FOO foo;
|
||||
};
|
||||
|
||||
void __block_invoke_10(struct __block_literal_10 *_block) {
|
||||
printf("%d\n", _block->foo.value());
|
||||
}
|
||||
|
||||
void __block_literal_10(struct __block_literal_10 *dst, struct __block_literal_10 *src) {
|
||||
comp_ctor(&dst->foo, &src->foo);
|
||||
}
|
||||
|
||||
void __block_dispose_10(struct __block_literal_10 *src) {
|
||||
comp_dtor(&src->foo);
|
||||
}
|
||||
|
||||
static struct __block_descriptor_10 {
|
||||
unsigned long int reserved;
|
||||
unsigned long int Block_size;
|
||||
void (*copy_helper)(struct __block_literal_10 *dst, struct __block_literal_10 *src);
|
||||
void (*dispose_helper)(struct __block_literal_10 *);
|
||||
} __block_descriptor_10 = { 0, sizeof(struct __block_literal_10), __block_copy_10, __block_dispose_10 };
|
||||
|
||||
and the code would be:
|
||||
{
|
||||
FOO foo;
|
||||
comp_ctor(&foo); // default constructor
|
||||
struct __block_literal_10 _block_literal = {
|
||||
&_NSConcreteStackBlock,
|
||||
(1<<25)|(1<<26)|(1<<29), <uninitialized>,
|
||||
__block_invoke_10,
|
||||
&__block_descriptor_10,
|
||||
};
|
||||
comp_ctor(&_block_literal->foo, &foo); // const copy into stack version
|
||||
struct __block_literal_10 &block = &_block_literal; // assign literal to block variable
|
||||
block->invoke(block); // invoke block
|
||||
comp_dtor(&_block_literal->foo); // destroy stack version of const block copy
|
||||
comp_dtor(&foo); // destroy original version
|
||||
}
|
||||
|
||||
|
||||
C++ objects stored in __block storage start out on the stack in a block_byref data structure as do other variables. Such objects (if not const objects) must support a regular copy constructor. The block_byref data structure will have copy and destroy helper routines synthesized by the compiler. The copy helper will have code created to perform the copy constructor based on the initial stack block_byref data structure, and will also set the (1<<26) bit in addition to the (1<<25) bit. The destroy helper will have code to do the destructor on the object stored within the supplied block_byref heap data structure.
|
||||
|
||||
To support member variable and function access the compiler will synthesize a const pointer to a block version of the this pointer.
|
||||
|
||||
5.0 Runtime Helper Functions
|
||||
|
||||
The runtime helper functions are described in /usr/local/include/Block_private.h. To summarize their use, a block requires copy/dispose helpers if it imports any block variables, __block storage variables, __attribute__((NSObject)) variables, or C++ const copied objects with constructor/destructors. The (1<<26) bit is set and functions are generated.
|
||||
|
||||
The block copy helper function should, for each of the variables of the type mentioned above, call
|
||||
_Block_object_assign(&dst->target, src->target, BLOCK_FIELD_<appropo>);
|
||||
in the copy helper and
|
||||
_Block_object_dispose(->target, BLOCK_FIELD_<appropo>);
|
||||
in the dispose helper where
|
||||
<appropo> is
|
||||
|
||||
enum {
|
||||
BLOCK_FIELD_IS_OBJECT = 3, // id, NSObject, __attribute__((NSObject)), block, ...
|
||||
BLOCK_FIELD_IS_BLOCK = 7, // a block variable
|
||||
BLOCK_FIELD_IS_BYREF = 8, // the on stack structure holding the __block variable
|
||||
|
||||
BLOCK_FIELD_IS_WEAK = 16, // declared __weak
|
||||
|
||||
BLOCK_BYREF_CALLER = 128, // called from byref copy/dispose helpers
|
||||
};
|
||||
|
||||
and of course the CTORs/DTORs for const copied C++ objects.
|
||||
|
||||
The block_byref data structure similarly requires copy/dispose helpers for block variables, __attribute__((NSObject)) variables, or C++ const copied objects with constructor/destructors, and again the (1<<26) bit is set and functions are generated in the same manner.
|
||||
|
||||
Under ObjC we allow __weak as an attribute on __block variables, and this causes the addition of BLOCK_FIELD_IS_WEAK orred onto the BLOCK_FIELD_IS_BYREF flag when copying the block_byref structure in the block copy helper, and onto the BLOCK_FIELD_<appropo> field within the block_byref copy/dispose helper calls.
|
||||
|
||||
The prototypes, and summary, of the helper functions are
|
||||
|
||||
/* Certain field types require runtime assistance when being copied to the heap. The following function is used
|
||||
to copy fields of types: blocks, pointers to byref structures, and objects (including __attribute__((NSObject)) pointers.
|
||||
BLOCK_FIELD_IS_WEAK is orthogonal to the other choices which are mutually exclusive.
|
||||
Only in a Block copy helper will one see BLOCK_FIELD_IS_BYREF.
|
||||
*/
|
||||
void _Block_object_assign(void *destAddr, const void *object, const int flags);
|
||||
|
||||
/* Similarly a compiler generated dispose helper needs to call back for each field of the byref data structure.
|
||||
(Currently the implementation only packs one field into the byref structure but in principle there could be more).
|
||||
The same flags used in the copy helper should be used for each call generated to this function:
|
||||
*/
|
||||
void _Block_object_dispose(const void *object, const int flags);
|
||||
|
||||
The following functions have been used and will continue to be supported until new compiler support is complete.
|
||||
|
||||
// Obsolete functions.
|
||||
// Copy helper callback for copying a block imported into a Block
|
||||
// Called by copy_helper helper functions synthesized by the compiler.
|
||||
// The address in the destination block of an imported Block is provided as the first argument
|
||||
// and the value of the existing imported Block is the second.
|
||||
// Use: _Block_object_assign(dest, src, BLOCK_FIELD_IS_BLOCK {| BLOCK_FIELD_IS_WEAK});
|
||||
void _Block_copy_assign(struct Block_basic **dest, const struct Block_basic *src, const int flags);
|
||||
|
||||
// Destroy helper callback for releasing Blocks imported into a Block
|
||||
// Called by dispose_helper helper functions synthesized by the compiler.
|
||||
// The value of the imported Block variable is passed back.
|
||||
// Use: _Block_object_dispose(src, BLOCK_FIELD_IS_BLOCK {| BLOCK_FIELD_IS_WEAK});
|
||||
void _Block_destroy(const struct Block_basic *src, const int flags);
|
||||
|
||||
// Byref data block copy helper callback
|
||||
// Called by block copy helpers when copying __block structures
|
||||
// Use: _Block_object_assign(dest, src, BLOCK_FIELD_IS_BYREF {| BLOCK_FIELD_IS_WEAK});
|
||||
void _Block_byref_assign_copy(struct Block_byref **destp, struct Block_byref *src);
|
||||
|
||||
// Byref data block release helper callback
|
||||
// Called by block release helpers when releasing a Block
|
||||
// Called at escape points in scope where __block variables live (under non-GC-only conditions)
|
||||
// Use: _Block_object_dispose(src, BLOCK_FIELD_IS_BYREF {| BLOCK_FIELD_IS_WEAK});
|
||||
void §(struct Block_byref *shared_struct);
|
||||
|
||||
|
@ -1,165 +0,0 @@
|
||||
//===-- DeclNodes.def - Metadata about Decl AST nodes -----------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines the declaration nodes within the AST. The
|
||||
// description of the declaration nodes uses six macros:
|
||||
//
|
||||
// DECL(Derived, Base) describes a normal declaration type Derived
|
||||
// and specifies its base class. Note that Derived should not have
|
||||
// the Decl suffix on it, while Base should.
|
||||
//
|
||||
// LAST_DECL(Derived, Base) is like DECL, but is used for the last
|
||||
// declaration in the list.
|
||||
//
|
||||
// ABSTRACT_DECL(Derived, Base) describes an abstract class that is
|
||||
// used to specify a classification of declarations. For example,
|
||||
// TagDecl is an abstract class used to describe the various kinds of
|
||||
// "tag" declarations (unions, structs, classes, enums).
|
||||
//
|
||||
// DECL_CONTEXT(Decl) specifies that Decl is a kind of declaration
|
||||
// that is also a DeclContext.
|
||||
//
|
||||
// LAST_DECL_CONTEXT(Decl) is like DECL_CONTEXT, but is used for the
|
||||
// last declaration context.
|
||||
//
|
||||
// DECL_RANGE(CommonBase, Start, End) specifies a range of
|
||||
// declaration values that have a common (potentially indirect) base
|
||||
// class.
|
||||
//
|
||||
// LAST_DECL_RANGE(CommonBase, Start, End) is like DECL_RANGE, but is
|
||||
// used for the last declaration range.
|
||||
//
|
||||
// Note that, due to the use of ranges, the order of the these
|
||||
// declarations is significant. A declaration should be listed under
|
||||
// its base class.
|
||||
// ===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef DECL
|
||||
# define DECL(Derived, Base)
|
||||
#endif
|
||||
|
||||
#ifndef LAST_DECL
|
||||
# define LAST_DECL(Derived, Base) DECL(Derived, Base)
|
||||
#endif
|
||||
|
||||
#ifndef ABSTRACT_DECL
|
||||
# define ABSTRACT_DECL(Derived, Base)
|
||||
#endif
|
||||
|
||||
#ifndef DECL_CONTEXT
|
||||
# define DECL_CONTEXT(Decl)
|
||||
#endif
|
||||
|
||||
#ifndef DECL_CONTEXT_BASE
|
||||
# define DECL_CONTEXT_BASE(Decl) DECL_CONTEXT(Decl)
|
||||
#endif
|
||||
|
||||
#ifndef LAST_DECL_CONTEXT
|
||||
# define LAST_DECL_CONTEXT(Decl) DECL_CONTEXT(Decl)
|
||||
#endif
|
||||
|
||||
#ifndef DECL_RANGE
|
||||
# define DECL_RANGE(CommonBase, Start, End)
|
||||
#endif
|
||||
|
||||
#ifndef LAST_DECL_RANGE
|
||||
# define LAST_DECL_RANGE(CommonBase, Start, End) \
|
||||
DECL_RANGE(CommonBase, Start, End)
|
||||
#endif
|
||||
|
||||
DECL(TranslationUnit, Decl)
|
||||
ABSTRACT_DECL(Named, Decl)
|
||||
DECL(Namespace, NamedDecl)
|
||||
DECL(UsingDirective, NamedDecl)
|
||||
DECL(NamespaceAlias, NamedDecl)
|
||||
ABSTRACT_DECL(Type, NamedDecl)
|
||||
DECL(Typedef, TypeDecl)
|
||||
DECL(UnresolvedUsingTypename, TypeDecl)
|
||||
ABSTRACT_DECL(Tag, TypeDecl)
|
||||
DECL(Enum, TagDecl)
|
||||
DECL(Record, TagDecl)
|
||||
DECL(CXXRecord, RecordDecl)
|
||||
DECL(ClassTemplateSpecialization, CXXRecordDecl)
|
||||
DECL(ClassTemplatePartialSpecialization,
|
||||
ClassTemplateSpecializationDecl)
|
||||
DECL(TemplateTypeParm, TypeDecl)
|
||||
ABSTRACT_DECL(Value, NamedDecl)
|
||||
DECL(EnumConstant, ValueDecl)
|
||||
DECL(UnresolvedUsingValue, ValueDecl)
|
||||
ABSTRACT_DECL(Declarator, ValueDecl)
|
||||
DECL(Function, DeclaratorDecl)
|
||||
DECL(CXXMethod, FunctionDecl)
|
||||
DECL(CXXConstructor, CXXMethodDecl)
|
||||
DECL(CXXDestructor, CXXMethodDecl)
|
||||
DECL(CXXConversion, CXXMethodDecl)
|
||||
DECL(Field, DeclaratorDecl)
|
||||
DECL(ObjCIvar, FieldDecl)
|
||||
DECL(ObjCAtDefsField, FieldDecl)
|
||||
DECL(Var, DeclaratorDecl)
|
||||
DECL(ImplicitParam, VarDecl)
|
||||
DECL(ParmVar, VarDecl)
|
||||
DECL(NonTypeTemplateParm, VarDecl)
|
||||
ABSTRACT_DECL(Template, NamedDecl)
|
||||
DECL(FunctionTemplate, TemplateDecl)
|
||||
DECL(ClassTemplate, TemplateDecl)
|
||||
DECL(TemplateTemplateParm, TemplateDecl)
|
||||
DECL(Using, NamedDecl)
|
||||
DECL(UsingShadow, NamedDecl)
|
||||
DECL(ObjCMethod, NamedDecl)
|
||||
ABSTRACT_DECL(ObjCContainer, NamedDecl)
|
||||
DECL(ObjCCategory, ObjCContainerDecl)
|
||||
DECL(ObjCProtocol, ObjCContainerDecl)
|
||||
DECL(ObjCInterface, ObjCContainerDecl)
|
||||
ABSTRACT_DECL(ObjCImpl, ObjCContainerDecl)
|
||||
DECL(ObjCCategoryImpl, ObjCImplDecl)
|
||||
DECL(ObjCImplementation, ObjCImplDecl)
|
||||
DECL(ObjCProperty, NamedDecl)
|
||||
DECL(ObjCCompatibleAlias, NamedDecl)
|
||||
DECL(LinkageSpec, Decl)
|
||||
DECL(ObjCPropertyImpl, Decl)
|
||||
DECL(ObjCForwardProtocol, Decl)
|
||||
DECL(ObjCClass, Decl)
|
||||
DECL(FileScopeAsm, Decl)
|
||||
DECL(Friend, Decl)
|
||||
DECL(FriendTemplate, Decl)
|
||||
DECL(StaticAssert, Decl)
|
||||
LAST_DECL(Block, Decl)
|
||||
|
||||
// Declaration contexts. DECL_CONTEXT_BASE indicates that it has subclasses.
|
||||
DECL_CONTEXT(TranslationUnit)
|
||||
DECL_CONTEXT(Namespace)
|
||||
DECL_CONTEXT(LinkageSpec)
|
||||
DECL_CONTEXT(ObjCMethod)
|
||||
DECL_CONTEXT_BASE(Tag)
|
||||
DECL_CONTEXT_BASE(Function)
|
||||
DECL_CONTEXT_BASE(ObjCContainer)
|
||||
LAST_DECL_CONTEXT(Block)
|
||||
|
||||
// Declaration ranges
|
||||
DECL_RANGE(Named, Namespace, ObjCCompatibleAlias)
|
||||
DECL_RANGE(ObjCContainer, ObjCCategory, ObjCImplementation)
|
||||
DECL_RANGE(Field, Field, ObjCAtDefsField)
|
||||
DECL_RANGE(Type, Typedef, TemplateTypeParm)
|
||||
DECL_RANGE(Tag, Enum, ClassTemplatePartialSpecialization)
|
||||
DECL_RANGE(Record, Record, ClassTemplatePartialSpecialization)
|
||||
DECL_RANGE(Value, EnumConstant, NonTypeTemplateParm)
|
||||
DECL_RANGE(Declarator, Function, NonTypeTemplateParm)
|
||||
DECL_RANGE(Function, Function, CXXConversion)
|
||||
DECL_RANGE(Template, FunctionTemplate, TemplateTemplateParm)
|
||||
DECL_RANGE(ObjCImpl, ObjCCategoryImpl, ObjCImplementation)
|
||||
LAST_DECL_RANGE(Var, Var, NonTypeTemplateParm)
|
||||
|
||||
#undef LAST_DECL_RANGE
|
||||
#undef DECL_RANGE
|
||||
#undef LAST_DECL_CONTEXT
|
||||
#undef DECL_CONTEXT_BASE
|
||||
#undef DECL_CONTEXT
|
||||
#undef ABSTRACT_DECL
|
||||
#undef LAST_DECL
|
||||
#undef DECL
|
@ -1,165 +0,0 @@
|
||||
//===-- StmtNodes.def - Metadata about Stmt AST nodes -----------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines the AST Node info database.
|
||||
//
|
||||
//===---------------------------------------------------------------------===//
|
||||
|
||||
#ifndef FIRST_STMT
|
||||
#define FIRST_STMT(CLASS)
|
||||
#define LAST_STMT(CLASS)
|
||||
#endif
|
||||
|
||||
#ifndef FIRST_EXPR
|
||||
#define FIRST_EXPR(CLASS)
|
||||
#define LAST_EXPR(CLASS)
|
||||
#endif
|
||||
|
||||
#ifndef EXPR
|
||||
# define EXPR(Type, Base) STMT(Type, Base)
|
||||
#endif
|
||||
|
||||
#ifndef ABSTRACT_EXPR
|
||||
# define ABSTRACT_EXPR(Type, Base) EXPR(Type, Base)
|
||||
#endif
|
||||
|
||||
// Normal Statements.
|
||||
STMT(NullStmt , Stmt)
|
||||
FIRST_STMT(NullStmt)
|
||||
STMT(CompoundStmt , Stmt)
|
||||
STMT(CaseStmt , SwitchCase)
|
||||
STMT(DefaultStmt , SwitchCase)
|
||||
STMT(LabelStmt , Stmt)
|
||||
STMT(IfStmt , Stmt)
|
||||
STMT(SwitchStmt , Stmt)
|
||||
STMT(WhileStmt , Stmt)
|
||||
STMT(DoStmt , Stmt)
|
||||
STMT(ForStmt , Stmt)
|
||||
STMT(GotoStmt , Stmt)
|
||||
STMT(IndirectGotoStmt, Stmt)
|
||||
STMT(ContinueStmt , Stmt)
|
||||
STMT(BreakStmt , Stmt)
|
||||
STMT(ReturnStmt , Stmt)
|
||||
STMT(DeclStmt , Stmt)
|
||||
STMT(SwitchCase , Stmt)
|
||||
|
||||
// GNU Stmt Extensions
|
||||
STMT(AsmStmt , Stmt)
|
||||
|
||||
// Obj-C statements
|
||||
STMT(ObjCAtTryStmt , Stmt)
|
||||
STMT(ObjCAtCatchStmt , Stmt)
|
||||
STMT(ObjCAtFinallyStmt , Stmt)
|
||||
STMT(ObjCAtThrowStmt , Stmt)
|
||||
STMT(ObjCAtSynchronizedStmt , Stmt)
|
||||
// Obj-C2 statements
|
||||
STMT(ObjCForCollectionStmt, Stmt)
|
||||
|
||||
// C++ statements
|
||||
STMT(CXXCatchStmt, Stmt)
|
||||
STMT(CXXTryStmt , Stmt)
|
||||
|
||||
LAST_STMT(CXXTryStmt)
|
||||
|
||||
// Expressions.
|
||||
ABSTRACT_EXPR(Expr , Stmt)
|
||||
EXPR(PredefinedExpr , Expr)
|
||||
EXPR(DeclRefExpr , Expr)
|
||||
EXPR(IntegerLiteral , Expr)
|
||||
EXPR(FloatingLiteral , Expr)
|
||||
EXPR(ImaginaryLiteral , Expr)
|
||||
EXPR(StringLiteral , Expr)
|
||||
EXPR(CharacterLiteral , Expr)
|
||||
EXPR(ParenExpr , Expr)
|
||||
EXPR(UnaryOperator , Expr)
|
||||
EXPR(OffsetOfExpr , Expr)
|
||||
EXPR(SizeOfAlignOfExpr , Expr)
|
||||
EXPR(ArraySubscriptExpr , Expr)
|
||||
EXPR(CallExpr , Expr)
|
||||
EXPR(MemberExpr , Expr)
|
||||
ABSTRACT_EXPR(CastExpr , Expr)
|
||||
EXPR(BinaryOperator , Expr)
|
||||
EXPR(CompoundAssignOperator, BinaryOperator)
|
||||
EXPR(ConditionalOperator , Expr)
|
||||
EXPR(ImplicitCastExpr , CastExpr)
|
||||
ABSTRACT_EXPR(ExplicitCastExpr, CastExpr)
|
||||
EXPR(CStyleCastExpr , ExplicitCastExpr)
|
||||
EXPR(CompoundLiteralExpr , Expr)
|
||||
EXPR(ExtVectorElementExpr , Expr)
|
||||
EXPR(InitListExpr , Expr)
|
||||
EXPR(DesignatedInitExpr , Expr)
|
||||
EXPR(ImplicitValueInitExpr , Expr)
|
||||
EXPR(ParenListExpr , Expr)
|
||||
EXPR(VAArgExpr , Expr)
|
||||
|
||||
// GNU Extensions.
|
||||
EXPR(AddrLabelExpr , Expr)
|
||||
EXPR(StmtExpr , Expr)
|
||||
EXPR(TypesCompatibleExpr , Expr)
|
||||
EXPR(ChooseExpr , Expr)
|
||||
EXPR(GNUNullExpr , Expr)
|
||||
|
||||
// C++ Expressions.
|
||||
EXPR(CXXOperatorCallExpr , CallExpr)
|
||||
EXPR(CXXMemberCallExpr , CallExpr)
|
||||
ABSTRACT_EXPR(CXXNamedCastExpr , ExplicitCastExpr)
|
||||
EXPR(CXXStaticCastExpr , CXXNamedCastExpr)
|
||||
EXPR(CXXDynamicCastExpr , CXXNamedCastExpr)
|
||||
EXPR(CXXReinterpretCastExpr , CXXNamedCastExpr)
|
||||
EXPR(CXXConstCastExpr , CXXNamedCastExpr)
|
||||
EXPR(CXXFunctionalCastExpr , ExplicitCastExpr)
|
||||
EXPR(CXXTypeidExpr , Expr)
|
||||
EXPR(CXXBoolLiteralExpr , Expr)
|
||||
EXPR(CXXNullPtrLiteralExpr , Expr)
|
||||
EXPR(CXXThisExpr , Expr)
|
||||
EXPR(CXXThrowExpr , Expr)
|
||||
EXPR(CXXDefaultArgExpr , Expr)
|
||||
EXPR(CXXZeroInitValueExpr , Expr)
|
||||
EXPR(CXXNewExpr , Expr)
|
||||
EXPR(CXXDeleteExpr , Expr)
|
||||
EXPR(CXXPseudoDestructorExpr, Expr)
|
||||
EXPR(UnresolvedLookupExpr , Expr)
|
||||
EXPR(UnaryTypeTraitExpr , Expr)
|
||||
EXPR(DependentScopeDeclRefExpr , Expr)
|
||||
EXPR(CXXConstructExpr , Expr)
|
||||
EXPR(CXXBindTemporaryExpr , Expr)
|
||||
EXPR(CXXBindReferenceExpr , Expr)
|
||||
EXPR(CXXExprWithTemporaries , Expr)
|
||||
EXPR(CXXTemporaryObjectExpr , CXXConstructExpr)
|
||||
EXPR(CXXUnresolvedConstructExpr, Expr)
|
||||
EXPR(CXXDependentScopeMemberExpr, Expr)
|
||||
EXPR(UnresolvedMemberExpr , Expr)
|
||||
|
||||
// Obj-C Expressions.
|
||||
EXPR(ObjCStringLiteral , Expr)
|
||||
EXPR(ObjCEncodeExpr , Expr)
|
||||
EXPR(ObjCMessageExpr , Expr)
|
||||
EXPR(ObjCSelectorExpr , Expr)
|
||||
EXPR(ObjCProtocolExpr , Expr)
|
||||
EXPR(ObjCIvarRefExpr , Expr)
|
||||
EXPR(ObjCPropertyRefExpr , Expr)
|
||||
EXPR(ObjCImplicitSetterGetterRefExpr , Expr)
|
||||
EXPR(ObjCSuperExpr , Expr)
|
||||
EXPR(ObjCIsaExpr , Expr)
|
||||
|
||||
// Clang Extensions.
|
||||
EXPR(ShuffleVectorExpr , Expr)
|
||||
EXPR(BlockExpr , Expr)
|
||||
EXPR(BlockDeclRefExpr , Expr)
|
||||
|
||||
FIRST_EXPR(PredefinedExpr)
|
||||
LAST_EXPR(BlockDeclRefExpr)
|
||||
|
||||
#undef ABSTRACT_EXPR
|
||||
#undef EXPR
|
||||
#undef STMT
|
||||
#undef FIRST_STMT
|
||||
#undef LAST_STMT
|
||||
#undef FIRST_EXPR
|
||||
#undef LAST_EXPR
|
@ -1,537 +0,0 @@
|
||||
/*===---- arm_neon.h - NEON intrinsics --------------------------------------===
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*
|
||||
*===-----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef __ARM_NEON_H
|
||||
#define __ARM_NEON_H
|
||||
|
||||
#ifndef __ARM_NEON__
|
||||
#error "NEON support not enabled"
|
||||
#endif
|
||||
|
||||
// NEON document appears to be specified in terms of stdint types.
|
||||
#include <stdint.h>
|
||||
|
||||
// Define some NEON-specific scalar types for floats and polynomials.
|
||||
typedef float float32_t;
|
||||
typedef uint8_t poly8_t;
|
||||
|
||||
// FIXME: probably need a 'poly' attribute or something for correct codegen to
|
||||
// disambiguate from uint16_t.
|
||||
typedef uint16_t poly16_t;
|
||||
|
||||
typedef __attribute__(( __vector_size__(8) )) int8_t __neon_int8x8_t;
|
||||
typedef __attribute__(( __vector_size__(16) )) int8_t __neon_int8x16_t;
|
||||
typedef __attribute__(( __vector_size__(8) )) int16_t __neon_int16x4_t;
|
||||
typedef __attribute__(( __vector_size__(16) )) int16_t __neon_int16x8_t;
|
||||
typedef __attribute__(( __vector_size__(8) )) int32_t __neon_int32x2_t;
|
||||
typedef __attribute__(( __vector_size__(16) )) int32_t __neon_int32x4_t;
|
||||
typedef __attribute__(( __vector_size__(8) )) int64_t __neon_int64x1_t;
|
||||
typedef __attribute__(( __vector_size__(16) )) int64_t __neon_int64x2_t;
|
||||
typedef __attribute__(( __vector_size__(8) )) uint8_t __neon_uint8x8_t;
|
||||
typedef __attribute__(( __vector_size__(16) )) uint8_t __neon_uint8x16_t;
|
||||
typedef __attribute__(( __vector_size__(8) )) uint16_t __neon_uint16x4_t;
|
||||
typedef __attribute__(( __vector_size__(16) )) uint16_t __neon_uint16x8_t;
|
||||
typedef __attribute__(( __vector_size__(8) )) uint32_t __neon_uint32x2_t;
|
||||
typedef __attribute__(( __vector_size__(16) )) uint32_t __neon_uint32x4_t;
|
||||
typedef __attribute__(( __vector_size__(8) )) uint64_t __neon_uint64x1_t;
|
||||
typedef __attribute__(( __vector_size__(16) )) uint64_t __neon_uint64x2_t;
|
||||
typedef __attribute__(( __vector_size__(8) )) uint16_t __neon_float16x4_t;
|
||||
typedef __attribute__(( __vector_size__(16) )) uint16_t __neon_float16x8_t;
|
||||
typedef __attribute__(( __vector_size__(8) )) float32_t __neon_float32x2_t;
|
||||
typedef __attribute__(( __vector_size__(16) )) float32_t __neon_float32x4_t;
|
||||
typedef __attribute__(( __vector_size__(8) )) poly8_t __neon_poly8x8_t;
|
||||
typedef __attribute__(( __vector_size__(16) )) poly8_t __neon_poly8x16_t;
|
||||
typedef __attribute__(( __vector_size__(8) )) poly16_t __neon_poly16x4_t;
|
||||
typedef __attribute__(( __vector_size__(16) )) poly16_t __neon_poly16x8_t;
|
||||
|
||||
typedef struct __int8x8_t {
|
||||
__neon_int8x8_t val;
|
||||
} int8x8_t;
|
||||
|
||||
typedef struct __int8x16_t {
|
||||
__neon_int8x16_t val;
|
||||
} int8x16_t;
|
||||
|
||||
typedef struct __int16x4_t {
|
||||
__neon_int16x4_t val;
|
||||
} int16x4_t;
|
||||
|
||||
typedef struct __int16x8_t {
|
||||
__neon_int16x8_t val;
|
||||
} int16x8_t;
|
||||
|
||||
typedef struct __int32x2_t {
|
||||
__neon_int32x2_t val;
|
||||
} int32x2_t;
|
||||
|
||||
typedef struct __int32x4_t {
|
||||
__neon_int32x4_t val;
|
||||
} int32x4_t;
|
||||
|
||||
typedef struct __int64x1_t {
|
||||
__neon_int64x1_t val;
|
||||
} int64x1_t;
|
||||
|
||||
typedef struct __int64x2_t {
|
||||
__neon_int64x2_t val;
|
||||
} int64x2_t;
|
||||
|
||||
typedef struct __uint8x8_t {
|
||||
__neon_uint8x8_t val;
|
||||
} uint8x8_t;
|
||||
|
||||
typedef struct __uint8x16_t {
|
||||
__neon_uint8x16_t val;
|
||||
} uint8x16_t;
|
||||
|
||||
typedef struct __uint16x4_t {
|
||||
__neon_uint16x4_t val;
|
||||
} uint16x4_t;
|
||||
|
||||
typedef struct __uint16x8_t {
|
||||
__neon_uint16x8_t val;
|
||||
} uint16x8_t;
|
||||
|
||||
typedef struct __uint32x2_t {
|
||||
__neon_uint32x2_t val;
|
||||
} uint32x2_t;
|
||||
|
||||
typedef struct __uint32x4_t {
|
||||
__neon_uint32x4_t val;
|
||||
} uint32x4_t;
|
||||
|
||||
typedef struct __uint64x1_t {
|
||||
__neon_uint64x1_t val;
|
||||
} uint64x1_t;
|
||||
|
||||
typedef struct __uint64x2_t {
|
||||
__neon_uint64x2_t val;
|
||||
} uint64x2_t;
|
||||
|
||||
typedef struct __float16x4_t {
|
||||
__neon_float16x4_t val;
|
||||
} float16x4_t;
|
||||
|
||||
typedef struct __float16x8_t {
|
||||
__neon_float16x8_t val;
|
||||
} float16x8_t;
|
||||
|
||||
typedef struct __float32x2_t {
|
||||
__neon_float32x2_t val;
|
||||
} float32x2_t;
|
||||
|
||||
typedef struct __float32x4_t {
|
||||
__neon_float32x4_t val;
|
||||
} float32x4_t;
|
||||
|
||||
typedef struct __poly8x8_t {
|
||||
__neon_poly8x8_t val;
|
||||
} poly8x8_t;
|
||||
|
||||
typedef struct __poly8x16_t {
|
||||
__neon_poly8x16_t val;
|
||||
} poly8x16_t;
|
||||
|
||||
typedef struct __poly16x4_t {
|
||||
__neon_poly16x4_t val;
|
||||
} poly16x4_t;
|
||||
|
||||
typedef struct __poly16x8_t {
|
||||
__neon_poly16x8_t val;
|
||||
} poly16x8_t;
|
||||
|
||||
// FIXME: write tool to stamp out the structure-of-array types, possibly gen this whole file.
|
||||
|
||||
// Intrinsics, per ARM document DUI0348B
|
||||
#define __ai static __attribute__((__always_inline__))
|
||||
|
||||
#define INTTYPES_WIDE(op, builtin) \
|
||||
__ai int16x8_t op##_s8(int16x8_t a, int8x8_t b) { return (int16x8_t){ builtin(a.val, b.val) }; } \
|
||||
__ai int32x4_t op##_s16(int32x4_t a, int16x4_t b) { return (int32x4_t){ builtin(a.val, b.val) }; } \
|
||||
__ai int64x2_t op##_s32(int64x2_t a, int32x2_t b) { return (int64x2_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint16x8_t op##_u8(uint16x8_t a, uint8x8_t b) { return (uint16x8_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint32x4_t op##_u16(uint32x4_t a, uint16x4_t b) { return (uint32x4_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint64x2_t op##_u32(uint64x2_t a, uint32x2_t b) { return (uint64x2_t){ builtin(a.val, b.val) }; }
|
||||
|
||||
#define INTTYPES_WIDENING(op, builtin) \
|
||||
__ai int16x8_t op##_s8(int8x8_t a, int8x8_t b) { return (int16x8_t){ builtin(a.val, b.val) }; } \
|
||||
__ai int32x4_t op##_s16(int16x4_t a, int16x4_t b) { return (int32x4_t){ builtin(a.val, b.val) }; } \
|
||||
__ai int64x2_t op##_s32(int32x2_t a, int32x2_t b) { return (int64x2_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint16x8_t op##_u8(uint8x8_t a, uint8x8_t b) { return (uint16x8_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint32x4_t op##_u16(uint16x4_t a, uint16x4_t b) { return (uint32x4_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint64x2_t op##_u32(uint32x2_t a, uint32x2_t b) { return (uint64x2_t){ builtin(a.val, b.val) }; }
|
||||
|
||||
#define INTTYPES_WIDENING_MUL(op, builtin) \
|
||||
__ai int16x8_t op##_s8(int16x8_t a, int8x8_t b, int8x8_t c) { return (int16x8_t){ builtin(a.val, b.val, c.val) }; } \
|
||||
__ai int32x4_t op##_s16(int32x4_t a, int16x4_t b, int16x4_t c) { return (int32x4_t){ builtin(a.val, b.val, c.val) }; } \
|
||||
__ai int64x2_t op##_s32(int64x2_t a, int32x2_t b, int32x2_t c) { return (int64x2_t){ builtin(a.val, b.val, c.val) }; } \
|
||||
__ai uint16x8_t op##_u8(uint16x8_t a, uint8x8_t b, uint8x8_t c) { return (uint16x8_t){ builtin(a.val, b.val, c.val) }; } \
|
||||
__ai uint32x4_t op##_u16(uint32x4_t a, uint16x4_t b, uint16x4_t c) { return (uint32x4_t){ builtin(a.val, b.val, c.val) }; } \
|
||||
__ai uint64x2_t op##_u32(uint64x2_t a, uint32x2_t b, uint32x2_t c) { return (uint64x2_t){ builtin(a.val, b.val, c.val) }; }
|
||||
|
||||
#define INTTYPES_NARROWING(op, builtin) \
|
||||
__ai int8x8_t op##_s16(int16x8_t a, int16x8_t b) { return (int8x8_t){ builtin(a.val, b.val) }; } \
|
||||
__ai int16x4_t op##_s32(int32x4_t a, int32x4_t b) { return (int16x4_t){ builtin(a.val, b.val) }; } \
|
||||
__ai int32x2_t op##_s64(int64x2_t a, int64x2_t b) { return (int32x2_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint8x8_t op##_u16(uint16x8_t a, uint16x8_t b) { return (uint8x8_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint16x4_t op##_u32(uint32x4_t a, uint32x4_t b) { return (uint16x4_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint32x2_t op##_u64(uint64x2_t a, uint64x2_t b) { return (uint32x2_t){ builtin(a.val, b.val) }; }
|
||||
|
||||
#define INTTYPES_ADD_32(op, builtin) \
|
||||
__ai int8x8_t op##_s8(int8x8_t a, int8x8_t b) { return (int8x8_t){ builtin(a.val, b.val) }; } \
|
||||
__ai int16x4_t op##_s16(int16x4_t a, int16x4_t b) { return (int16x4_t){ builtin(a.val, b.val) }; } \
|
||||
__ai int32x2_t op##_s32(int32x2_t a, int32x2_t b) { return (int32x2_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint8x8_t op##_u8(uint8x8_t a, uint8x8_t b) { return (uint8x8_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint16x4_t op##_u16(uint16x4_t a, uint16x4_t b) { return (uint16x4_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint32x2_t op##_u32(uint32x2_t a, uint32x2_t b) { return (uint32x2_t){ builtin(a.val, b.val) }; } \
|
||||
__ai int8x16_t op##q_s8(int8x16_t a, int8x16_t b) { return (int8x16_t){ builtin(a.val, b.val) }; } \
|
||||
__ai int16x8_t op##q_s16(int16x8_t a, int16x8_t b) { return (int16x8_t){ builtin(a.val, b.val) }; } \
|
||||
__ai int32x4_t op##q_s32(int32x4_t a, int32x4_t b) { return (int32x4_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint8x16_t op##q_u8(uint8x16_t a, uint8x16_t b) { return (uint8x16_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint16x8_t op##q_u16(uint16x8_t a, uint16x8_t b) { return (uint16x8_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint32x4_t op##q_u32(uint32x4_t a, uint32x4_t b) { return (uint32x4_t){ builtin(a.val, b.val) }; }
|
||||
|
||||
#define INTTYPES_ADD_64(op, builtin) \
|
||||
__ai int64x1_t op##_s64(int64x1_t a, int64x1_t b) { return (int64x1_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint64x1_t op##_u64(uint64x1_t a, uint64x1_t b) { return (uint64x1_t){ builtin(a.val, b.val) }; } \
|
||||
__ai int64x2_t op##q_s64(int64x2_t a, int64x2_t b) { return (int64x2_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint64x2_t op##q_u64(uint64x2_t a, uint64x2_t b) { return (uint64x2_t){ builtin(a.val, b.val) }; }
|
||||
|
||||
#define FLOATTYPES_CMP(op, builtin) \
|
||||
__ai uint32x2_t op##_f32(float32x2_t a, float32x2_t b) { return (uint32x2_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint32x4_t op##q_f32(float32x4_t a, float32x4_t b) { return (uint32x4_t){ builtin(a.val, b.val) }; }
|
||||
|
||||
#define INT_FLOAT_CMP_OP(op, cc) \
|
||||
__ai uint8x8_t op##_s8(int8x8_t a, int8x8_t b) { return (uint8x8_t){(__neon_uint8x8_t)(a.val cc b.val)}; } \
|
||||
__ai uint16x4_t op##_s16(int16x4_t a, int16x4_t b) { return (uint16x4_t){(__neon_uint16x4_t)(a.val cc b.val)}; } \
|
||||
__ai uint32x2_t op##_s32(int32x2_t a, int32x2_t b) { return (uint32x2_t){(__neon_uint32x2_t)(a.val cc b.val)}; } \
|
||||
__ai uint32x2_t op##_f32(float32x2_t a, float32x2_t b) { return (uint32x2_t){(__neon_uint32x2_t)(a.val cc b.val)}; } \
|
||||
__ai uint8x8_t op##_u8(uint8x8_t a, uint8x8_t b) { return (uint8x8_t){a.val cc b.val}; } \
|
||||
__ai uint16x4_t op##_u16(uint16x4_t a, uint16x4_t b) { return (uint16x4_t){a.val cc b.val}; } \
|
||||
__ai uint32x2_t op##_u32(uint32x2_t a, uint32x2_t b) { return (uint32x2_t){a.val cc b.val}; } \
|
||||
__ai uint8x16_t op##q_s8(int8x16_t a, int8x16_t b) { return (uint8x16_t){(__neon_uint8x16_t)(a.val cc b.val)}; } \
|
||||
__ai uint16x8_t op##q_s16(int16x8_t a, int16x8_t b) { return (uint16x8_t){(__neon_uint16x8_t)(a.val cc b.val)}; } \
|
||||
__ai uint32x4_t op##q_s32(int32x4_t a, int32x4_t b) { return (uint32x4_t){(__neon_uint32x4_t)(a.val cc b.val)}; } \
|
||||
__ai uint32x4_t op##q_f32(float32x4_t a, float32x4_t b) { return (uint32x4_t){(__neon_uint32x4_t)(a.val cc b.val)}; } \
|
||||
__ai uint8x16_t op##q_u8(uint8x16_t a, uint8x16_t b) { return (uint8x16_t){a.val cc b.val}; } \
|
||||
__ai uint16x8_t op##q_u16(uint16x8_t a, uint16x8_t b) { return (uint16x8_t){a.val cc b.val}; } \
|
||||
__ai uint32x4_t op##q_u32(uint32x4_t a, uint32x4_t b) { return (uint32x4_t){a.val cc b.val}; }
|
||||
|
||||
#define INT_UNARY(op, builtin) \
|
||||
__ai int8x8_t op##_s8(int8x8_t a) { return (int8x8_t){ builtin(a.val) }; } \
|
||||
__ai int16x4_t op##_s16(int16x4_t a) { return (int16x4_t){ builtin(a.val) }; } \
|
||||
__ai int32x2_t op##_s32(int32x2_t a) { return (int32x2_t){ builtin(a.val) }; } \
|
||||
__ai int8x16_t op##q_s8(int8x16_t a) { return (int8x16_t){ builtin(a.val) }; } \
|
||||
__ai int16x8_t op##q_s16(int16x8_t a) { return (int16x8_t){ builtin(a.val) }; } \
|
||||
__ai int32x4_t op##q_s32(int32x4_t a) { return (int32x4_t){ builtin(a.val) }; }
|
||||
|
||||
#define FP_UNARY(op, builtin) \
|
||||
__ai float32x2_t op##_f32(float32x2_t a) { return (float32x2_t){ builtin(a.val) }; } \
|
||||
__ai float32x4_t op##q_f32(float32x4_t a) { return (float32x4_t){ builtin(a.val) }; }
|
||||
|
||||
#define FP_BINARY(op, builtin) \
|
||||
__ai float32x2_t op##_f32(float32x2_t a, float32x2_t b) { return (float32x2_t){ builtin(a.val, b.val) }; } \
|
||||
__ai float32x4_t op##q_f32(float32x4_t a, float32x4_t b) { return (float32x4_t){ builtin(a.val, b.val) }; }
|
||||
|
||||
#define INT_FP_PAIRWISE_ADD(op, builtin) \
|
||||
__ai int8x8_t op##_s8(int8x8_t a, int8x8_t b) { return (int8x8_t){ builtin(a.val, b.val) }; } \
|
||||
__ai int16x4_t op##_s16(int16x4_t a, int16x4_t b) { return (int16x4_t){ builtin(a.val, b.val) }; } \
|
||||
__ai int32x2_t op##_s32(int32x2_t a, int32x2_t b) { return (int32x2_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint8x8_t op##_u8(uint8x8_t a, uint8x8_t b) { return (uint8x8_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint16x4_t op##_u16(uint16x4_t a, uint16x4_t b) { return (uint16x4_t){ builtin(a.val, b.val) }; } \
|
||||
__ai uint32x2_t op##_u32(uint32x2_t a, uint32x2_t b) { return (uint32x2_t){ builtin(a.val, b.val) }; } \
|
||||
__ai float32x2_t op##_f32(float32x2_t a, float32x2_t b) { return (float32x2_t){ builtin(a.val, b.val) }; }
|
||||
|
||||
#define INT_LOGICAL_OP(op, lop) \
|
||||
__ai int8x8_t op##_s8(int8x8_t a, int8x8_t b) { return (int8x8_t){ a.val lop b.val }; } \
|
||||
__ai int16x4_t op##_s16(int16x4_t a, int16x4_t b) { return (int16x4_t){ a.val lop b.val }; } \
|
||||
__ai int32x2_t op##_s32(int32x2_t a, int32x2_t b) { return (int32x2_t){ a.val lop b.val }; } \
|
||||
__ai int64x1_t op##_s64(int64x1_t a, int64x1_t b) { return (int64x1_t){ a.val lop b.val }; } \
|
||||
__ai uint8x8_t op##_u8(uint8x8_t a, uint8x8_t b) { return (uint8x8_t){ a.val lop b.val }; } \
|
||||
__ai uint16x4_t op##_u16(uint16x4_t a, uint16x4_t b) { return (uint16x4_t){ a.val lop b.val }; } \
|
||||
__ai uint32x2_t op##_u32(uint32x2_t a, uint32x2_t b) { return (uint32x2_t){ a.val lop b.val }; } \
|
||||
__ai uint64x1_t op##_u64(uint64x1_t a, uint64x1_t b) { return (uint64x1_t){ a.val lop b.val }; } \
|
||||
__ai int8x16_t op##q_s8(int8x16_t a, int8x16_t b) { return (int8x16_t){ a.val lop b.val }; } \
|
||||
__ai int16x8_t op##q_s16(int16x8_t a, int16x8_t b) { return (int16x8_t){ a.val lop b.val }; } \
|
||||
__ai int32x4_t op##q_s32(int32x4_t a, int32x4_t b) { return (int32x4_t){ a.val lop b.val }; } \
|
||||
__ai int64x2_t op##q_s64(int64x2_t a, int64x2_t b) { return (int64x2_t){ a.val lop b.val }; } \
|
||||
__ai uint8x16_t op##q_u8(uint8x16_t a, uint8x16_t b) { return (uint8x16_t){ a.val lop b.val }; } \
|
||||
__ai uint16x8_t op##q_u16(uint16x8_t a, uint16x8_t b) { return (uint16x8_t){ a.val lop b.val }; } \
|
||||
__ai uint32x4_t op##q_u32(uint32x4_t a, uint32x4_t b) { return (uint32x4_t){ a.val lop b.val }; } \
|
||||
__ai uint64x2_t op##q_u64(uint64x2_t a, uint64x2_t b) { return (uint64x2_t){ a.val lop b.val }; }
|
||||
|
||||
// vector add
|
||||
__ai int8x8_t vadd_s8(int8x8_t a, int8x8_t b) { return (int8x8_t){a.val + b.val}; }
|
||||
__ai int16x4_t vadd_s16(int16x4_t a, int16x4_t b) { return (int16x4_t){a.val + b.val}; }
|
||||
__ai int32x2_t vadd_s32(int32x2_t a, int32x2_t b) { return (int32x2_t){a.val + b.val}; }
|
||||
__ai int64x1_t vadd_s64(int64x1_t a, int64x1_t b) { return (int64x1_t){a.val + b.val}; }
|
||||
__ai float32x2_t vadd_f32(float32x2_t a, float32x2_t b) { return (float32x2_t){a.val + b.val}; }
|
||||
__ai uint8x8_t vadd_u8(uint8x8_t a, uint8x8_t b) { return (uint8x8_t){a.val + b.val}; }
|
||||
__ai uint16x4_t vadd_u16(uint16x4_t a, uint16x4_t b) { return (uint16x4_t){a.val + b.val}; }
|
||||
__ai uint32x2_t vadd_u32(uint32x2_t a, uint32x2_t b) { return (uint32x2_t){a.val + b.val}; }
|
||||
__ai uint64x1_t vadd_u64(uint64x1_t a, uint64x1_t b) { return (uint64x1_t){a.val + b.val}; }
|
||||
__ai int8x16_t vaddq_s8(int8x16_t a, int8x16_t b) { return (int8x16_t){a.val + b.val}; }
|
||||
__ai int16x8_t vaddq_s16(int16x8_t a, int16x8_t b) { return (int16x8_t){a.val + b.val}; }
|
||||
__ai int32x4_t vaddq_s32(int32x4_t a, int32x4_t b) { return (int32x4_t){a.val + b.val}; }
|
||||
__ai int64x2_t vaddq_s64(int64x2_t a, int64x2_t b) { return (int64x2_t){a.val + b.val}; }
|
||||
__ai float32x4_t vaddq_f32(float32x4_t a, float32x4_t b) { return (float32x4_t){a.val + b.val}; }
|
||||
__ai uint8x16_t vaddq_u8(uint8x16_t a, uint8x16_t b) { return (uint8x16_t){a.val + b.val}; }
|
||||
__ai uint16x8_t vaddq_u16(uint16x8_t a, uint16x8_t b) { return (uint16x8_t){a.val + b.val}; }
|
||||
__ai uint32x4_t vaddq_u32(uint32x4_t a, uint32x4_t b) { return (uint32x4_t){a.val + b.val}; }
|
||||
__ai uint64x2_t vaddq_u64(uint64x2_t a, uint64x2_t b) { return (uint64x2_t){a.val + b.val}; }
|
||||
|
||||
// vector long add
|
||||
INTTYPES_WIDENING(vaddl, __builtin_neon_vaddl)
|
||||
|
||||
// vector wide add
|
||||
INTTYPES_WIDE(vaddw, __builtin_neon_vaddw)
|
||||
|
||||
// halving add
|
||||
// rounding halving add
|
||||
INTTYPES_ADD_32(vhadd, __builtin_neon_vhadd)
|
||||
INTTYPES_ADD_32(vrhadd, __builtin_neon_vrhadd)
|
||||
|
||||
// saturating add
|
||||
INTTYPES_ADD_32(vqadd, __builtin_neon_vqadd)
|
||||
INTTYPES_ADD_64(vqadd, __builtin_neon_vqadd)
|
||||
|
||||
// add high half
|
||||
// rounding add high half
|
||||
INTTYPES_NARROWING(vaddhn, __builtin_neon_vaddhn)
|
||||
INTTYPES_NARROWING(vraddhn, __builtin_neon_vraddhn)
|
||||
|
||||
// multiply
|
||||
// mul-poly
|
||||
|
||||
// multiple accumulate
|
||||
// multiple subtract
|
||||
|
||||
// multiple accumulate long
|
||||
// multiple subtract long
|
||||
INTTYPES_WIDENING_MUL(vmlal, __builtin_neon_vmlal)
|
||||
INTTYPES_WIDENING_MUL(vmlsl, __builtin_neon_vmlsl)
|
||||
|
||||
// saturating doubling multiply high
|
||||
// saturating rounding doubling multiply high
|
||||
|
||||
// saturating doubling multiply accumulate long
|
||||
// saturating doubling multiply subtract long
|
||||
|
||||
// long multiply
|
||||
// long multiply-poly
|
||||
INTTYPES_WIDENING(vmull, __builtin_neon_vmull)
|
||||
__ai poly16x8_t vmull_p8(poly8x8_t a, poly8x8_t b) { return (poly16x8_t){ __builtin_neon_vmull(a.val, b.val) }; }
|
||||
|
||||
// saturating doubling long multiply
|
||||
|
||||
// subtract
|
||||
|
||||
// long subtract
|
||||
INTTYPES_WIDENING(vsubl, __builtin_neon_vsubl)
|
||||
|
||||
// wide subtract
|
||||
INTTYPES_WIDE(vsubw, __builtin_neon_vsubw)
|
||||
|
||||
// saturating subtract
|
||||
INTTYPES_ADD_32(vqsub, __builtin_neon_vqsub)
|
||||
INTTYPES_ADD_64(vqsub, __builtin_neon_vqsub)
|
||||
|
||||
// halving subtract
|
||||
INTTYPES_ADD_32(vhsub, __builtin_neon_vhsub)
|
||||
|
||||
// subtract high half
|
||||
// rounding subtract high half
|
||||
INTTYPES_NARROWING(vsubhn, __builtin_neon_vsubhn)
|
||||
INTTYPES_NARROWING(vrsubhn, __builtin_neon_vrsubhn)
|
||||
|
||||
// compare eq
|
||||
// compare ge
|
||||
// compare le
|
||||
// compare gt
|
||||
// compare lt
|
||||
INT_FLOAT_CMP_OP(vceq, ==)
|
||||
INT_FLOAT_CMP_OP(vcge, >=)
|
||||
INT_FLOAT_CMP_OP(vcle, <=)
|
||||
INT_FLOAT_CMP_OP(vcgt, >)
|
||||
INT_FLOAT_CMP_OP(vclt, <)
|
||||
|
||||
// compare eq-poly
|
||||
|
||||
// compare abs ge
|
||||
// compare abs le
|
||||
// compare abs gt
|
||||
// compare abs lt
|
||||
FLOATTYPES_CMP(vcage, __builtin_neon_vcage)
|
||||
FLOATTYPES_CMP(vcale, __builtin_neon_vcale)
|
||||
FLOATTYPES_CMP(vcagt, __builtin_neon_vcagt)
|
||||
FLOATTYPES_CMP(vcalt, __builtin_neon_vcalt)
|
||||
|
||||
// test bits
|
||||
|
||||
// abs diff
|
||||
INTTYPES_ADD_32(vabd, __builtin_neon_vabd)
|
||||
FP_BINARY(vabd, __builtin_neon_vabd)
|
||||
|
||||
// abs diff long
|
||||
INTTYPES_WIDENING(vabdl, __builtin_neon_vabdl)
|
||||
|
||||
// abs diff accumulate
|
||||
// abs diff accumulate long
|
||||
|
||||
// max
|
||||
// min
|
||||
INTTYPES_ADD_32(vmax, __builtin_neon_vmax)
|
||||
FP_BINARY(vmax, __builtin_neon_vmax)
|
||||
INTTYPES_ADD_32(vmin, __builtin_neon_vmin)
|
||||
FP_BINARY(vmin, __builtin_neon_vmin)
|
||||
|
||||
// pairwise add
|
||||
// pairwise max
|
||||
// pairwise min
|
||||
INT_FP_PAIRWISE_ADD(vpadd, __builtin_neon_vpadd)
|
||||
INT_FP_PAIRWISE_ADD(vpmax, __builtin_neon_vpmax)
|
||||
INT_FP_PAIRWISE_ADD(vpmin, __builtin_neon_vpmin)
|
||||
|
||||
// long pairwise add
|
||||
// long pairwise add accumulate
|
||||
|
||||
// recip
|
||||
// recip sqrt
|
||||
FP_BINARY(vrecps, __builtin_neon_vrecps)
|
||||
FP_BINARY(vrsqrts, __builtin_neon_vrsqrts)
|
||||
|
||||
// shl by vec
|
||||
// saturating shl by vec
|
||||
// rounding shl by vec
|
||||
// saturating rounding shl by vec
|
||||
|
||||
// shr by constant
|
||||
// shl by constant
|
||||
// rounding shr by constant
|
||||
// shr by constant and accumulate
|
||||
// rounding shr by constant and accumulate
|
||||
// saturating shl by constant
|
||||
// s->u saturating shl by constant
|
||||
// narrowing saturating shr by constant
|
||||
// s->u narrowing saturating shr by constant
|
||||
// s->u rounding narrowing saturating shr by constant
|
||||
// narrowing saturating shr by constant
|
||||
// rounding narrowing shr by constant
|
||||
// rounding narrowing saturating shr by constant
|
||||
// widening shl by constant
|
||||
|
||||
// shr and insert
|
||||
// shl and insert
|
||||
|
||||
// loads and stores, single vector
|
||||
// loads and stores, lane
|
||||
// loads, dupe
|
||||
|
||||
// loads and stores, arrays
|
||||
|
||||
// vget,vgetq lane
|
||||
// vset, vsetq lane
|
||||
|
||||
// vcreate
|
||||
// vdup, vdupq
|
||||
// vmov, vmovq
|
||||
// vdup_lane, vdupq_lane
|
||||
// vcombine
|
||||
// vget_high, vget_low
|
||||
|
||||
// vcvt {u,s} <-> f, f <-> f16
|
||||
// narrow
|
||||
// long move (unpack)
|
||||
// saturating narrow
|
||||
// saturating narrow s->u
|
||||
|
||||
// table lookup
|
||||
// extended table lookup
|
||||
|
||||
// mla with scalar
|
||||
// widening mla with scalar
|
||||
// widening saturating doubling mla with scalar
|
||||
// mls with scalar
|
||||
// widening mls with scalar
|
||||
// widening saturating doubling mls with scalar
|
||||
// mul by scalar
|
||||
// long mul with scalar
|
||||
// long mul by scalar
|
||||
// saturating doubling long mul with scalar
|
||||
// saturating doubling long mul by scalar
|
||||
// saturating doubling mul high with scalar
|
||||
// saturating doubling mul high by scalar
|
||||
// saturating rounding doubling mul high with scalar
|
||||
// saturating rounding doubling mul high by scalar
|
||||
// mla with scalar
|
||||
// widening mla with sclar
|
||||
// widening saturating doubling mla with scalar
|
||||
// mls with scalar
|
||||
// widening mls with scalar
|
||||
// widening saturating doubling mls with scalar
|
||||
|
||||
// extract
|
||||
|
||||
// endian swap (vrev)
|
||||
|
||||
// negate
|
||||
|
||||
// abs
|
||||
// saturating abs
|
||||
// saturating negate
|
||||
// count leading signs
|
||||
INT_UNARY(vabs, __builtin_neon_vabs)
|
||||
FP_UNARY(vabs, __builtin_neon_vabs)
|
||||
INT_UNARY(vqabs, __builtin_neon_vqabs)
|
||||
INT_UNARY(vqneg, __builtin_neon_vqneg)
|
||||
INT_UNARY(vcls, __builtin_neon_vcls)
|
||||
|
||||
// count leading zeroes
|
||||
// popcount
|
||||
|
||||
// recip_est
|
||||
// recip_sqrt_est
|
||||
|
||||
// not-poly
|
||||
// not
|
||||
|
||||
// and
|
||||
// or
|
||||
// xor
|
||||
// andn
|
||||
// orn
|
||||
INT_LOGICAL_OP(vand, &)
|
||||
INT_LOGICAL_OP(vorr, |)
|
||||
INT_LOGICAL_OP(veor, ^)
|
||||
INT_LOGICAL_OP(vbic, &~)
|
||||
INT_LOGICAL_OP(vorn, |~)
|
||||
|
||||
// bitselect
|
||||
|
||||
// transpose elts
|
||||
// interleave elts
|
||||
// deinterleave elts
|
||||
|
||||
// vreinterpret
|
||||
|
||||
#endif /* __ARM_NEON_H */
|
@ -1,341 +0,0 @@
|
||||
//===--- arm_neon.td - ARM NEON compiler interface ------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines the TableGen definitions from which the ARM NEON header
|
||||
// file will be generated. See ARM document DUI0348B.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
class Op;
|
||||
|
||||
def OP_NONE : Op;
|
||||
def OP_ADD : Op;
|
||||
def OP_SUB : Op;
|
||||
def OP_MUL : Op;
|
||||
def OP_MLA : Op;
|
||||
def OP_MLS : Op;
|
||||
def OP_MUL_N : Op;
|
||||
def OP_MLA_N : Op;
|
||||
def OP_MLS_N : Op;
|
||||
def OP_EQ : Op;
|
||||
def OP_GE : Op;
|
||||
def OP_LE : Op;
|
||||
def OP_GT : Op;
|
||||
def OP_LT : Op;
|
||||
def OP_NEG : Op;
|
||||
def OP_NOT : Op;
|
||||
def OP_AND : Op;
|
||||
def OP_OR : Op;
|
||||
def OP_XOR : Op;
|
||||
def OP_ANDN : Op;
|
||||
def OP_ORN : Op;
|
||||
def OP_CAST : Op;
|
||||
def OP_HI : Op;
|
||||
def OP_LO : Op;
|
||||
def OP_CONC : Op;
|
||||
def OP_DUP : Op;
|
||||
def OP_SEL : Op;
|
||||
def OP_REV64 : Op;
|
||||
def OP_REV32 : Op;
|
||||
def OP_REV16 : Op;
|
||||
|
||||
class Inst <string p, string t, Op o> {
|
||||
string Prototype = p;
|
||||
string Types = t;
|
||||
Op Operand = o;
|
||||
bit isShift = 0;
|
||||
}
|
||||
|
||||
// Used to generate Builtins.def
|
||||
class SInst<string p, string t> : Inst<p, t, OP_NONE> {}
|
||||
class IInst<string p, string t> : Inst<p, t, OP_NONE> {}
|
||||
class WInst<string p, string t> : Inst<p, t, OP_NONE> {}
|
||||
|
||||
// prototype: return (arg, arg, ...)
|
||||
// v: void
|
||||
// t: best-fit integer (int/poly args)
|
||||
// x: signed integer (int/float args)
|
||||
// u: unsigned integer (int/float args)
|
||||
// f: float (int args)
|
||||
// d: default
|
||||
// w: double width elements, same num elts
|
||||
// n: double width elements, half num elts
|
||||
// h: half width elements, double num elts
|
||||
// e: half width elements, double num elts, unsigned
|
||||
// i: constant int
|
||||
// l: constant uint64
|
||||
// s: scalar of element type
|
||||
// a: scalar of element type (splat to vector type)
|
||||
// k: default elt width, double num elts
|
||||
// #: array of default vectors
|
||||
// p: pointer type
|
||||
// c: const pointer type
|
||||
|
||||
// sizes:
|
||||
// c: char
|
||||
// s: short
|
||||
// i: int
|
||||
// l: long
|
||||
// f: float
|
||||
// h: half-float
|
||||
|
||||
// size modifiers:
|
||||
// U: unsigned
|
||||
// Q: 128b
|
||||
// P: polynomial
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.1 Addition
|
||||
def VADD : Inst<"ddd", "csilfUcUsUiUlQcQsQiQlQfQUcQUsQUiQUl", OP_ADD>;
|
||||
def VADDL : SInst<"wdd", "csiUcUsUi">;
|
||||
def VADDW : SInst<"wwd", "csiUcUsUi">;
|
||||
def VHADD : SInst<"ddd", "csiUcUsUiQcQsQiQUcQUsQUi">;
|
||||
def VRHADD : SInst<"ddd", "csiUcUsUiQcQsQiQUcQUsQUi">;
|
||||
def VQADD : SInst<"ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">;
|
||||
def VADDHN : IInst<"dww", "csiUcUsUi">;
|
||||
def VRADDHN : IInst<"dww", "csiUcUsUi">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.2 Multiplication
|
||||
def VMUL : Inst<"ddd", "csifUcUsUiPcQcQsQiQfQUcQUsQUiQPc", OP_MUL>;
|
||||
def VMLA : Inst<"dddd", "csifUcUsUiQcQsQiQfQUcQUsQUi", OP_MLA>;
|
||||
def VMLAL : SInst<"wwdd", "csiUcUsUi">;
|
||||
def VMLS : Inst<"dddd", "csifUcUsUiQcQsQiQfQUcQUsQUi", OP_MLS>;
|
||||
def VMLSL : SInst<"wwdd", "csiUcUsUi">;
|
||||
def VQDMULH : SInst<"ddd", "siQsQi">;
|
||||
def VQRDMULH : SInst<"ddd", "siQsQi">;
|
||||
def VQDMLAL : SInst<"wwdd", "si">;
|
||||
def VQDMLSL : SInst<"wwdd", "si">;
|
||||
def VMULL : SInst<"wdd", "csiUcUsUiPc">;
|
||||
def VQDMULL : SInst<"wdd", "si">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.3 Subtraction
|
||||
def VSUB : Inst<"ddd", "csilfUcUsUiUlQcQsQiQlQfQUcQUsQUiQUl", OP_SUB>;
|
||||
def VSUBL : SInst<"wdd", "csiUcUsUi">;
|
||||
def VSUBW : SInst<"wwd", "csiUcUsUi">;
|
||||
def VQSUB : SInst<"ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">;
|
||||
def VHSUB : SInst<"ddd", "csiUcUsUiQcQsQiQUcQUsQUi">;
|
||||
def VSUBHN : IInst<"dww", "csiUcUsUi">;
|
||||
def VRSUBHN : IInst<"dww", "csiUcUsUi">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.4 Comparison
|
||||
def VCEQ : Inst<"udd", "csifUcUsUiPcQcQsQiQfQUcQUsQUiQPc", OP_EQ>;
|
||||
def VCGE : Inst<"udd", "csifUcUsUiQcQsQiQfQUcQUsQUi", OP_GE>;
|
||||
def VCLE : Inst<"udd", "csifUcUsUiQcQsQiQfQUcQUsQUi", OP_LE>;
|
||||
def VCGT : Inst<"udd", "csifUcUsUiQcQsQiQfQUcQUsQUi", OP_GT>;
|
||||
def VCLT : Inst<"udd", "csifUcUsUiQcQsQiQfQUcQUsQUi", OP_LT>;
|
||||
def VCAGE : IInst<"udd", "fQf">;
|
||||
def VCALE : IInst<"udd", "fQf">;
|
||||
def VCAGT : IInst<"udd", "fQf">;
|
||||
def VCALT : IInst<"udd", "fQf">;
|
||||
def VTST : WInst<"udd", "csiUcUsUiPcQcQsQiQUcQUsQUiQPc">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.5 Absolute Difference
|
||||
def VABD : SInst<"ddd", "csiUcUsUifQcQsQiQUcQUsQUiQf">;
|
||||
def VABDL : SInst<"wdd", "csiUcUsUi">;
|
||||
def VABA : SInst<"dddd", "csiUcUsUiQcQsQiQUcQUsQUi">;
|
||||
def VABAL : SInst<"wwdd", "csiUcUsUi">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.6 Max/Min
|
||||
def VMAX : SInst<"ddd", "csiUcUsUifQcQsQiQUcQUsQUiQf">;
|
||||
def VMIN : SInst<"ddd", "csiUcUsUifQcQsQiQUcQUsQUiQf">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.7 Pairdise Addition
|
||||
def VPADD : IInst<"ddd", "csiUcUsUif">;
|
||||
def VPADDL : SInst<"nd", "csiUcUsUiQcQsQiQUcQUsQUi">;
|
||||
def VPADAL : SInst<"nnd", "csiUcUsUiQcQsQiQUcQUsQUi">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.8-9 Folding Max/Min
|
||||
def VPMAX : SInst<"ddd", "csiUcUsUif">;
|
||||
def VPMIN : SInst<"ddd", "csiUcUsUif">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.10 Reciprocal/Sqrt
|
||||
def VRECPS : IInst<"ddd", "fQf">;
|
||||
def VRSQRTS : IInst<"ddd", "fQf">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.11 Shifts by signed variable
|
||||
def VSHL : SInst<"ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">;
|
||||
def VQSHL : SInst<"ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">;
|
||||
def VRSHL : SInst<"ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">;
|
||||
def VQRSHL : SInst<"ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.12 Shifts by constant
|
||||
let isShift = 1 in {
|
||||
def VSHR_N : SInst<"ddi", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">;
|
||||
def VSHL_N : IInst<"ddi", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">;
|
||||
def VRSHR_N : SInst<"ddi", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">;
|
||||
def VSRA_N : SInst<"dddi", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">;
|
||||
def VRSRA_N : SInst<"dddi", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">;
|
||||
def VQSHL_N : SInst<"ddi", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl">;
|
||||
def VQSHLU_N : SInst<"udi", "csilQcQsQiQl">;
|
||||
def VSHRN_N : IInst<"hki", "silUsUiUl">;
|
||||
def VQSHRUN_N : SInst<"eki", "sil">;
|
||||
def VQRSHRUN_N : SInst<"eki", "sil">;
|
||||
def VQSHRN_N : SInst<"hki", "silUsUiUl">;
|
||||
def VRSHRN_N : IInst<"hki", "silUsUiUl">;
|
||||
def VQRSHRN_N : SInst<"hki", "silUsUiUl">;
|
||||
def VSHLL_N : SInst<"wdi", "csiUcUsUi">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.13 Shifts with insert
|
||||
def VSRI_N : WInst<"dddi", "csilUcUsUiUlPcPsQcQsQiQlQUcQUsQUiQUlQPcQPs">;
|
||||
def VSLI_N : WInst<"dddi", "csilUcUsUiUlPcPsQcQsQiQlQUcQUsQUiQUlQPcQPs">;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.14 Loads and stores of a single vector
|
||||
def VLD1 : WInst<"dc", "QUcQUsQUiQUlQcQsQiQlQhQfQPcQPsUcUsUiUlcsilhfPcPs">;
|
||||
def VLD1_LANE : WInst<"dci", "QUcQUsQUiQUlQcQsQiQlQhQfQPcQPsUcUsUiUlcsilhfPcPs">;
|
||||
def VLD1_DUP : WInst<"dc", "QUcQUsQUiQUlQcQsQiQlQhQfQPcQPsUcUsUiUlcsilhfPcPs">;
|
||||
def VST1 : WInst<"vpd", "QUcQUsQUiQUlQcQsQiQlQhQfQPcQPsUcUsUiUlcsilhfPcPs">;
|
||||
def VST1_LANE : WInst<"vpdi", "QUcQUsQUiQUlQcQsQiQlQhQfQPcQPsUcUsUiUlcsilhfPcPs">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.15 Loads and stores of an N-element structure
|
||||
def VLD2 : WInst<"2c", "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPs">;
|
||||
def VLD3 : WInst<"3c", "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPs">;
|
||||
def VLD4 : WInst<"4c", "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPs">;
|
||||
def VLD2_DUP : WInst<"2c", "UcUsUiUlcsilhfPcPs">;
|
||||
def VLD3_DUP : WInst<"3c", "UcUsUiUlcsilhfPcPs">;
|
||||
def VLD4_DUP : WInst<"4c", "UcUsUiUlcsilhfPcPs">;
|
||||
def VLD2_LANE : WInst<"2ci", "QUsQUiQsQiQhQfQPsUcUsUicsihfPcPs">;
|
||||
def VLD3_LANE : WInst<"3ci", "QUsQUiQsQiQhQfQPsUcUsUicsihfPcPs">;
|
||||
def VLD4_LANE : WInst<"4ci", "QUsQUiQsQiQhQfQPsUcUsUicsihfPcPs">;
|
||||
def VST2 : WInst<"vp2", "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPs">;
|
||||
def VST3 : WInst<"vp3", "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPs">;
|
||||
def VST4 : WInst<"vp4", "QUcQUsQUiQcQsQiQhQfQPcQPsUcUsUiUlcsilhfPcPs">;
|
||||
def VST2_LANE : WInst<"vp2i", "QUsQUiQsQiQhQfQPsUcUsUicsihfPcPs">;
|
||||
def VST3_LANE : WInst<"vp3i", "QUsQUiQsQiQhQfQPsUcUsUicsihfPcPs">;
|
||||
def VST4_LANE : WInst<"vp4i", "QUsQUiQsQiQhQfQPsUcUsUicsihfPcPs">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.16 Extract lanes from a vector
|
||||
def VGET_LANE : IInst<"sdi", "UcUsUicsiPcPsfQUcQUsQUiQcQsQiQPcQPsQflUlQlQUl">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.17 Set lanes within a vector
|
||||
def VSET_LANE : IInst<"dsdi", "UcUsUicsiPcPsfQUcQUsQUiQcQsQiQPcQPsQflUlQlQUl">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.18 Initialize a vector from bit pattern
|
||||
def VCREATE: Inst<"dl", "csihfUcUsUiUlPcPsl", OP_CAST>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.19 Set all lanes to same value
|
||||
def VDUP_N : Inst<"ds", "UcUsUicsiPcPsfQUcQUsQUiQcQsQiQPcQPsQflUlQlQUl", OP_DUP>;
|
||||
def VMOV_N : Inst<"ds", "UcUsUicsiPcPsfQUcQUsQUiQcQsQiQPcQPsQflUlQlQUl", OP_DUP>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.20 Combining vectors
|
||||
def VCOMBINE : Inst<"kdd", "csilhfUcUsUiUlPcPs", OP_CONC>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.21 Splitting vectors
|
||||
def VGET_HIGH : Inst<"dk", "csilhfUcUsUiUlPcPs", OP_HI>;
|
||||
def VGET_LOW : Inst<"dk", "csilhfUcUsUiUlPcPs", OP_LO>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.22 Converting vectors
|
||||
def VCVT_S32 : SInst<"xd", "fQf">;
|
||||
def VCVT_U32 : SInst<"ud", "fQf">;
|
||||
def VCVT_F16 : SInst<"hk", "f">;
|
||||
def VCVT_N_S32 : SInst<"xdi", "fQf">;
|
||||
def VCVT_N_U32 : SInst<"udi", "fQf">;
|
||||
def VCVT_F32 : SInst<"fd", "iUiQiQUi">;
|
||||
def VCVT_F32_F16 : SInst<"kh", "f">;
|
||||
def VCVT_N_F32 : SInst<"fdi", "iUiQiQUi">;
|
||||
def VMOVN : IInst<"hk", "silUsUiUl">;
|
||||
def VMOVL : SInst<"wd", "csiUcUsUi">;
|
||||
def VQMOVN : SInst<"hk", "silUsUiUl">;
|
||||
def VQMOVUN : SInst<"ek", "sil">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.23-24 Table lookup, Extended table lookup
|
||||
def VTBL1 : WInst<"ddt", "UccPc">;
|
||||
def VTBL2 : WInst<"d2t", "UccPc">;
|
||||
def VTBL3 : WInst<"d3t", "UccPc">;
|
||||
def VTBL4 : WInst<"d4t", "UccPc">;
|
||||
def VTBX1 : WInst<"dddt", "UccPc">;
|
||||
def VTBX2 : WInst<"dd2t", "UccPc">;
|
||||
def VTBX3 : WInst<"dd3t", "UccPc">;
|
||||
def VTBX4 : WInst<"dd4t", "UccPc">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.25 Operations with a scalar value
|
||||
def VMLA_LANE : IInst<"ddddi", "siUsUifQsQiQUsQUiQf">;
|
||||
def VMLAL_LANE : SInst<"wwddi", "siUsUi">;
|
||||
def VQDMLAL_LANE : SInst<"wwddi", "si">;
|
||||
def VMLS_LANE : IInst<"ddddi", "siUsUifQsQiQUsQUiQf">;
|
||||
def VMLSL_LANE : SInst<"wwddi", "siUsUi">;
|
||||
def VQDMLSL_LANE : SInst<"wwddi", "si">;
|
||||
def VMUL_N : Inst<"dds", "sifUsUiQsQiQfQUsQUi", OP_MUL_N>;
|
||||
def VMULL_N : SInst<"wda", "siUsUi">;
|
||||
def VMULL_LANE : SInst<"wddi", "siUsUi">;
|
||||
def VQDMULL_N : SInst<"wda", "si">;
|
||||
def VQDMULL_LANE : SInst<"wddi", "si">;
|
||||
def VQDMULH_N : SInst<"dda", "siQsQi">;
|
||||
def VQDMULH_LANE : SInst<"dddi", "siQsQi">;
|
||||
def VQRDMULH_N : SInst<"dda", "siQsQi">;
|
||||
def VQRDMULH_LANE : SInst<"dddi", "siQsQi">;
|
||||
def VMLA_N : Inst<"ddda", "siUsUifQsQiQUsQUiQf", OP_MLA_N>;
|
||||
def VMLAL_N : SInst<"wwda", "siUsUi">;
|
||||
def VQDMLAL_N : SInst<"wwda", "si">;
|
||||
def VMLS_N : Inst<"ddds", "siUsUifQsQiQUsQUiQf", OP_MLS_N>;
|
||||
def VMLSL_N : SInst<"wwda", "siUsUi">;
|
||||
def VQDMLSL_N : SInst<"wwda", "si">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.26 Vector Extract
|
||||
def VEXT : WInst<"dddi", "cUcPcsUsPsiUilUlQcQUcQPcQsQUsQPsQiQUiQlQUl">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.27 Reverse vector elements (sdap endianness)
|
||||
def VREV64 : Inst<"dd", "csiUcUsUiPcPsfQcQsQiQUcQUsQUiQPcQPsQf", OP_REV64>;
|
||||
def VREV32 : Inst<"dd", "csUcUsPcQcQsQUcQUsQPc", OP_REV32>;
|
||||
def VREV16 : Inst<"dd", "cUcPcQcQUcQPc", OP_REV16>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.28 Other single operand arithmetic
|
||||
def VABS : SInst<"dd", "csifQcQsQiQf">;
|
||||
def VQABS : SInst<"dd", "csiQcQsQi">;
|
||||
def VNEG : Inst<"dd", "csifQcQsQiQf", OP_NEG>;
|
||||
def VQNEG : SInst<"dd", "csiQcQsQi">;
|
||||
def VCLS : SInst<"dd", "csiQcQsQi">;
|
||||
def VCLZ : IInst<"dd", "csiUcUsUiQcQsQiQUcQUsQUi">;
|
||||
def VCNT : WInst<"dd", "UccPcQUcQcQPc">;
|
||||
def VRECPE : SInst<"dd", "fUiQfQUi">;
|
||||
def VRSQRTE : SInst<"dd", "fUiQfQUi">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.29 Logical operations
|
||||
def VMVN : Inst<"dd", "csiUcUsUiPcQcQsQiQUcQUsQUiQPc", OP_NOT>;
|
||||
def VAND : Inst<"ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl", OP_AND>;
|
||||
def VORR : Inst<"ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl", OP_OR>;
|
||||
def VEOR : Inst<"ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl", OP_XOR>;
|
||||
def VBIC : Inst<"ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl", OP_ANDN>;
|
||||
def VORN : Inst<"ddd", "csilUcUsUiUlQcQsQiQlQUcQUsQUiQUl", OP_ORN>;
|
||||
def VBSL : Inst<"dudd", "csilUcUsUiUlfPcPsQcQsQiQlQUcQUsQUiQUlQfQPcQPs", OP_SEL>;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.30 Transposition operations
|
||||
def VTRN: WInst<"2dd", "csiUcUsUifPcPsQcQsQiQUcQUsQUiQfQPcQPs">;
|
||||
def VZIP: WInst<"2dd", "csUcUsfPcPsQcQsQiQUcQUsQUiQfQPcQPs">;
|
||||
def VUZP: WInst<"2dd", "csiUcUsUifPcPsQcQsQiQUcQUsQUiQfQPcQPs">;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// E.3.31 Vector reinterpret cast operations
|
File diff suppressed because it is too large
Load Diff
@ -1,81 +0,0 @@
|
||||
_clang_annotateTokens
|
||||
_clang_codeComplete
|
||||
_clang_codeCompleteGetDiagnostic
|
||||
_clang_codeCompleteGetNumDiagnostics
|
||||
_clang_constructUSR_ObjCCategory
|
||||
_clang_constructUSR_ObjCClass
|
||||
_clang_constructUSR_ObjCIvar
|
||||
_clang_constructUSR_ObjCMethod
|
||||
_clang_constructUSR_ObjCProperty
|
||||
_clang_constructUSR_ObjCProtocol
|
||||
_clang_createIndex
|
||||
_clang_createTranslationUnit
|
||||
_clang_createTranslationUnitFromSourceFile
|
||||
_clang_defaultDiagnosticDisplayOptions
|
||||
_clang_disposeCodeCompleteResults
|
||||
_clang_disposeDiagnostic
|
||||
_clang_disposeIndex
|
||||
_clang_disposeString
|
||||
_clang_disposeTokens
|
||||
_clang_disposeTranslationUnit
|
||||
_clang_enableStackTraces
|
||||
_clang_equalCursors
|
||||
_clang_equalLocations
|
||||
_clang_formatDiagnostic
|
||||
_clang_getCString
|
||||
_clang_getClangVersion
|
||||
_clang_getCompletionChunkCompletionString
|
||||
_clang_getCompletionChunkKind
|
||||
_clang_getCompletionChunkText
|
||||
_clang_getCursor
|
||||
_clang_getCursorDefinition
|
||||
_clang_getCursorExtent
|
||||
_clang_getCursorKind
|
||||
_clang_getCursorKindSpelling
|
||||
_clang_getCursorLanguage
|
||||
_clang_getCursorLinkage
|
||||
_clang_getCursorLocation
|
||||
_clang_getCursorReferenced
|
||||
_clang_getCursorSpelling
|
||||
_clang_getCursorUSR
|
||||
_clang_getDefinitionSpellingAndExtent
|
||||
_clang_getDiagnostic
|
||||
_clang_getDiagnosticFixIt
|
||||
_clang_getDiagnosticLocation
|
||||
_clang_getDiagnosticNumFixIts
|
||||
_clang_getDiagnosticNumRanges
|
||||
_clang_getDiagnosticRange
|
||||
_clang_getDiagnosticSeverity
|
||||
_clang_getDiagnosticSpelling
|
||||
_clang_getFile
|
||||
_clang_getFileName
|
||||
_clang_getFileTime
|
||||
_clang_getInclusions
|
||||
_clang_getInstantiationLocation
|
||||
_clang_getLocation
|
||||
_clang_getNullCursor
|
||||
_clang_getNullLocation
|
||||
_clang_getNullRange
|
||||
_clang_getNumCompletionChunks
|
||||
_clang_getNumDiagnostics
|
||||
_clang_getRange
|
||||
_clang_getRangeEnd
|
||||
_clang_getRangeStart
|
||||
_clang_getTokenExtent
|
||||
_clang_getTokenKind
|
||||
_clang_getTokenLocation
|
||||
_clang_getTokenSpelling
|
||||
_clang_getTranslationUnitCursor
|
||||
_clang_getTranslationUnitSpelling
|
||||
_clang_isCursorDefinition
|
||||
_clang_isDeclaration
|
||||
_clang_isExpression
|
||||
_clang_isInvalid
|
||||
_clang_isPreprocessing
|
||||
_clang_isReference
|
||||
_clang_isStatement
|
||||
_clang_isTranslationUnit
|
||||
_clang_isUnexposed
|
||||
_clang_setUseExternalASTGeneration
|
||||
_clang_tokenize
|
||||
_clang_visitChildren
|
@ -1,81 +0,0 @@
|
||||
clang_annotateTokens
|
||||
clang_codeComplete
|
||||
clang_codeCompleteGetDiagnostic
|
||||
clang_codeCompleteGetNumDiagnostics
|
||||
clang_constructUSR_ObjCCategory
|
||||
clang_constructUSR_ObjCClass
|
||||
clang_constructUSR_ObjCIvar
|
||||
clang_constructUSR_ObjCMethod
|
||||
clang_constructUSR_ObjCProperty
|
||||
clang_constructUSR_ObjCProtocol
|
||||
clang_createIndex
|
||||
clang_createTranslationUnit
|
||||
clang_createTranslationUnitFromSourceFile
|
||||
clang_defaultDiagnosticDisplayOptions
|
||||
clang_disposeCodeCompleteResults
|
||||
clang_disposeDiagnostic
|
||||
clang_disposeIndex
|
||||
clang_disposeString
|
||||
clang_disposeTokens
|
||||
clang_disposeTranslationUnit
|
||||
clang_enableStackTraces
|
||||
clang_equalCursors
|
||||
clang_equalLocations
|
||||
clang_formatDiagnostic
|
||||
clang_getCString
|
||||
clang_getClangVersion
|
||||
clang_getCompletionChunkCompletionString
|
||||
clang_getCompletionChunkKind
|
||||
clang_getCompletionChunkText
|
||||
clang_getCursor
|
||||
clang_getCursorDefinition
|
||||
clang_getCursorExtent
|
||||
clang_getCursorKind
|
||||
clang_getCursorKindSpelling
|
||||
clang_getCursorLanguage
|
||||
clang_getCursorLinkage
|
||||
clang_getCursorLocation
|
||||
clang_getCursorReferenced
|
||||
clang_getCursorSpelling
|
||||
clang_getCursorUSR
|
||||
clang_getDefinitionSpellingAndExtent
|
||||
clang_getDiagnostic
|
||||
clang_getDiagnosticFixIt
|
||||
clang_getDiagnosticLocation
|
||||
clang_getDiagnosticNumFixIts
|
||||
clang_getDiagnosticNumRanges
|
||||
clang_getDiagnosticRange
|
||||
clang_getDiagnosticSeverity
|
||||
clang_getDiagnosticSpelling
|
||||
clang_getFile
|
||||
clang_getFileName
|
||||
clang_getFileTime
|
||||
clang_getInclusions
|
||||
clang_getInstantiationLocation
|
||||
clang_getLocation
|
||||
clang_getNullCursor
|
||||
clang_getNullLocation
|
||||
clang_getNullRange
|
||||
clang_getNumCompletionChunks
|
||||
clang_getNumDiagnostics
|
||||
clang_getRange
|
||||
clang_getRangeEnd
|
||||
clang_getRangeStart
|
||||
clang_getTokenExtent
|
||||
clang_getTokenKind
|
||||
clang_getTokenLocation
|
||||
clang_getTokenSpelling
|
||||
clang_getTranslationUnitCursor
|
||||
clang_getTranslationUnitSpelling
|
||||
clang_isCursorDefinition
|
||||
clang_isDeclaration
|
||||
clang_isExpression
|
||||
clang_isInvalid
|
||||
clang_isPreprocessing
|
||||
clang_isReference
|
||||
clang_isStatement
|
||||
clang_isTranslationUnit
|
||||
clang_isUnexposed
|
||||
clang_setUseExternalASTGeneration
|
||||
clang_tokenize
|
||||
clang_visitChildren
|
@ -1,512 +0,0 @@
|
||||
//===- CIndexCodeCompletion.cpp - Code Completion API hooks ---------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file implements the Clang-C Source Indexing library hooks for
|
||||
// code completion.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "CIndexer.h"
|
||||
#include "CIndexDiagnostic.h"
|
||||
#include "clang/Basic/SourceManager.h"
|
||||
#include "clang/Basic/FileManager.h"
|
||||
#include "clang/Frontend/CompilerInstance.h"
|
||||
#include "clang/Frontend/FrontendDiagnostic.h"
|
||||
#include "clang/Sema/CodeCompleteConsumer.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include "llvm/System/Program.h"
|
||||
|
||||
#ifdef UDP_CODE_COMPLETION_LOGGER
|
||||
#include "clang/Basic/Version.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/Support/Timer.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
using namespace clang;
|
||||
using namespace clang::cxstring;
|
||||
|
||||
extern "C" {
|
||||
|
||||
enum CXCompletionChunkKind
|
||||
clang_getCompletionChunkKind(CXCompletionString completion_string,
|
||||
unsigned chunk_number) {
|
||||
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
|
||||
if (!CCStr || chunk_number >= CCStr->size())
|
||||
return CXCompletionChunk_Text;
|
||||
|
||||
switch ((*CCStr)[chunk_number].Kind) {
|
||||
case CodeCompletionString::CK_TypedText:
|
||||
return CXCompletionChunk_TypedText;
|
||||
case CodeCompletionString::CK_Text:
|
||||
return CXCompletionChunk_Text;
|
||||
case CodeCompletionString::CK_Optional:
|
||||
return CXCompletionChunk_Optional;
|
||||
case CodeCompletionString::CK_Placeholder:
|
||||
return CXCompletionChunk_Placeholder;
|
||||
case CodeCompletionString::CK_Informative:
|
||||
return CXCompletionChunk_Informative;
|
||||
case CodeCompletionString::CK_ResultType:
|
||||
return CXCompletionChunk_ResultType;
|
||||
case CodeCompletionString::CK_CurrentParameter:
|
||||
return CXCompletionChunk_CurrentParameter;
|
||||
case CodeCompletionString::CK_LeftParen:
|
||||
return CXCompletionChunk_LeftParen;
|
||||
case CodeCompletionString::CK_RightParen:
|
||||
return CXCompletionChunk_RightParen;
|
||||
case CodeCompletionString::CK_LeftBracket:
|
||||
return CXCompletionChunk_LeftBracket;
|
||||
case CodeCompletionString::CK_RightBracket:
|
||||
return CXCompletionChunk_RightBracket;
|
||||
case CodeCompletionString::CK_LeftBrace:
|
||||
return CXCompletionChunk_LeftBrace;
|
||||
case CodeCompletionString::CK_RightBrace:
|
||||
return CXCompletionChunk_RightBrace;
|
||||
case CodeCompletionString::CK_LeftAngle:
|
||||
return CXCompletionChunk_LeftAngle;
|
||||
case CodeCompletionString::CK_RightAngle:
|
||||
return CXCompletionChunk_RightAngle;
|
||||
case CodeCompletionString::CK_Comma:
|
||||
return CXCompletionChunk_Comma;
|
||||
case CodeCompletionString::CK_Colon:
|
||||
return CXCompletionChunk_Colon;
|
||||
case CodeCompletionString::CK_SemiColon:
|
||||
return CXCompletionChunk_SemiColon;
|
||||
case CodeCompletionString::CK_Equal:
|
||||
return CXCompletionChunk_Equal;
|
||||
case CodeCompletionString::CK_HorizontalSpace:
|
||||
return CXCompletionChunk_HorizontalSpace;
|
||||
case CodeCompletionString::CK_VerticalSpace:
|
||||
return CXCompletionChunk_VerticalSpace;
|
||||
}
|
||||
|
||||
// Should be unreachable, but let's be careful.
|
||||
return CXCompletionChunk_Text;
|
||||
}
|
||||
|
||||
CXString clang_getCompletionChunkText(CXCompletionString completion_string,
|
||||
unsigned chunk_number) {
|
||||
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
|
||||
if (!CCStr || chunk_number >= CCStr->size())
|
||||
return createCXString(0);
|
||||
|
||||
switch ((*CCStr)[chunk_number].Kind) {
|
||||
case CodeCompletionString::CK_TypedText:
|
||||
case CodeCompletionString::CK_Text:
|
||||
case CodeCompletionString::CK_Placeholder:
|
||||
case CodeCompletionString::CK_CurrentParameter:
|
||||
case CodeCompletionString::CK_Informative:
|
||||
case CodeCompletionString::CK_LeftParen:
|
||||
case CodeCompletionString::CK_RightParen:
|
||||
case CodeCompletionString::CK_LeftBracket:
|
||||
case CodeCompletionString::CK_RightBracket:
|
||||
case CodeCompletionString::CK_LeftBrace:
|
||||
case CodeCompletionString::CK_RightBrace:
|
||||
case CodeCompletionString::CK_LeftAngle:
|
||||
case CodeCompletionString::CK_RightAngle:
|
||||
case CodeCompletionString::CK_Comma:
|
||||
case CodeCompletionString::CK_ResultType:
|
||||
case CodeCompletionString::CK_Colon:
|
||||
case CodeCompletionString::CK_SemiColon:
|
||||
case CodeCompletionString::CK_Equal:
|
||||
case CodeCompletionString::CK_HorizontalSpace:
|
||||
case CodeCompletionString::CK_VerticalSpace:
|
||||
return createCXString((*CCStr)[chunk_number].Text, false);
|
||||
|
||||
case CodeCompletionString::CK_Optional:
|
||||
// Note: treated as an empty text block.
|
||||
return createCXString("");
|
||||
}
|
||||
|
||||
// Should be unreachable, but let's be careful.
|
||||
return createCXString(0);
|
||||
}
|
||||
|
||||
|
||||
CXCompletionString
|
||||
clang_getCompletionChunkCompletionString(CXCompletionString completion_string,
|
||||
unsigned chunk_number) {
|
||||
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
|
||||
if (!CCStr || chunk_number >= CCStr->size())
|
||||
return 0;
|
||||
|
||||
switch ((*CCStr)[chunk_number].Kind) {
|
||||
case CodeCompletionString::CK_TypedText:
|
||||
case CodeCompletionString::CK_Text:
|
||||
case CodeCompletionString::CK_Placeholder:
|
||||
case CodeCompletionString::CK_CurrentParameter:
|
||||
case CodeCompletionString::CK_Informative:
|
||||
case CodeCompletionString::CK_LeftParen:
|
||||
case CodeCompletionString::CK_RightParen:
|
||||
case CodeCompletionString::CK_LeftBracket:
|
||||
case CodeCompletionString::CK_RightBracket:
|
||||
case CodeCompletionString::CK_LeftBrace:
|
||||
case CodeCompletionString::CK_RightBrace:
|
||||
case CodeCompletionString::CK_LeftAngle:
|
||||
case CodeCompletionString::CK_RightAngle:
|
||||
case CodeCompletionString::CK_Comma:
|
||||
case CodeCompletionString::CK_ResultType:
|
||||
case CodeCompletionString::CK_Colon:
|
||||
case CodeCompletionString::CK_SemiColon:
|
||||
case CodeCompletionString::CK_Equal:
|
||||
case CodeCompletionString::CK_HorizontalSpace:
|
||||
case CodeCompletionString::CK_VerticalSpace:
|
||||
return 0;
|
||||
|
||||
case CodeCompletionString::CK_Optional:
|
||||
// Note: treated as an empty text block.
|
||||
return (*CCStr)[chunk_number].Optional;
|
||||
}
|
||||
|
||||
// Should be unreachable, but let's be careful.
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned clang_getNumCompletionChunks(CXCompletionString completion_string) {
|
||||
CodeCompletionString *CCStr = (CodeCompletionString *)completion_string;
|
||||
return CCStr? CCStr->size() : 0;
|
||||
}
|
||||
|
||||
static bool ReadUnsigned(const char *&Memory, const char *MemoryEnd,
|
||||
unsigned &Value) {
|
||||
if (Memory + sizeof(unsigned) > MemoryEnd)
|
||||
return true;
|
||||
|
||||
memmove(&Value, Memory, sizeof(unsigned));
|
||||
Memory += sizeof(unsigned);
|
||||
return false;
|
||||
}
|
||||
|
||||
/// \brief The CXCodeCompleteResults structure we allocate internally;
|
||||
/// the client only sees the initial CXCodeCompleteResults structure.
|
||||
struct AllocatedCXCodeCompleteResults : public CXCodeCompleteResults {
|
||||
AllocatedCXCodeCompleteResults();
|
||||
~AllocatedCXCodeCompleteResults();
|
||||
|
||||
/// \brief The memory buffer from which we parsed the results. We
|
||||
/// retain this buffer because the completion strings point into it.
|
||||
llvm::MemoryBuffer *Buffer;
|
||||
|
||||
/// \brief Diagnostics produced while performing code completion.
|
||||
llvm::SmallVector<StoredDiagnostic, 8> Diagnostics;
|
||||
|
||||
/// \brief Diag object
|
||||
Diagnostic Diag;
|
||||
|
||||
/// \brief Language options used to adjust source locations.
|
||||
LangOptions LangOpts;
|
||||
|
||||
/// \brief Source manager, used for diagnostics.
|
||||
SourceManager SourceMgr;
|
||||
|
||||
/// \brief File manager, used for diagnostics.
|
||||
FileManager FileMgr;
|
||||
|
||||
/// \brief Temporary files that should be removed once we have finished
|
||||
/// with the code-completion results.
|
||||
std::vector<llvm::sys::Path> TemporaryFiles;
|
||||
};
|
||||
|
||||
AllocatedCXCodeCompleteResults::AllocatedCXCodeCompleteResults()
|
||||
: CXCodeCompleteResults(), Buffer(0), SourceMgr(Diag) { }
|
||||
|
||||
AllocatedCXCodeCompleteResults::~AllocatedCXCodeCompleteResults() {
|
||||
for (unsigned I = 0, N = NumResults; I != N; ++I)
|
||||
delete (CodeCompletionString *)Results[I].CompletionString;
|
||||
delete [] Results;
|
||||
delete Buffer;
|
||||
|
||||
for (unsigned I = 0, N = TemporaryFiles.size(); I != N; ++I)
|
||||
TemporaryFiles[I].eraseFromDisk();
|
||||
}
|
||||
|
||||
CXCodeCompleteResults *clang_codeComplete(CXIndex CIdx,
|
||||
const char *source_filename,
|
||||
int num_command_line_args,
|
||||
const char **command_line_args,
|
||||
unsigned num_unsaved_files,
|
||||
struct CXUnsavedFile *unsaved_files,
|
||||
const char *complete_filename,
|
||||
unsigned complete_line,
|
||||
unsigned complete_column) {
|
||||
#ifdef UDP_CODE_COMPLETION_LOGGER
|
||||
#ifdef UDP_CODE_COMPLETION_LOGGER_PORT
|
||||
const llvm::TimeRecord &StartTime = llvm::TimeRecord::getCurrentTime();
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// The indexer, which is mainly used to determine where diagnostics go.
|
||||
CIndexer *CXXIdx = static_cast<CIndexer *>(CIdx);
|
||||
|
||||
// Configure the diagnostics.
|
||||
DiagnosticOptions DiagOpts;
|
||||
llvm::IntrusiveRefCntPtr<Diagnostic> Diags;
|
||||
Diags = CompilerInstance::createDiagnostics(DiagOpts, 0, 0);
|
||||
|
||||
// The set of temporary files that we've built.
|
||||
std::vector<llvm::sys::Path> TemporaryFiles;
|
||||
|
||||
// Build up the arguments for invoking 'clang'.
|
||||
std::vector<const char *> argv;
|
||||
|
||||
// First add the complete path to the 'clang' executable.
|
||||
llvm::sys::Path ClangPath = CXXIdx->getClangPath();
|
||||
argv.push_back(ClangPath.c_str());
|
||||
|
||||
// Add the '-fsyntax-only' argument so that we only perform a basic
|
||||
// syntax check of the code.
|
||||
argv.push_back("-fsyntax-only");
|
||||
|
||||
// Add the appropriate '-code-completion-at=file:line:column' argument
|
||||
// to perform code completion, with an "-Xclang" preceding it.
|
||||
std::string code_complete_at;
|
||||
code_complete_at += complete_filename;
|
||||
code_complete_at += ":";
|
||||
code_complete_at += llvm::utostr(complete_line);
|
||||
code_complete_at += ":";
|
||||
code_complete_at += llvm::utostr(complete_column);
|
||||
argv.push_back("-Xclang");
|
||||
argv.push_back("-code-completion-at");
|
||||
argv.push_back("-Xclang");
|
||||
argv.push_back(code_complete_at.c_str());
|
||||
argv.push_back("-Xclang");
|
||||
argv.push_back("-no-code-completion-debug-printer");
|
||||
argv.push_back("-Xclang");
|
||||
argv.push_back("-code-completion-macros");
|
||||
argv.push_back("-fdiagnostics-binary");
|
||||
|
||||
// Remap any unsaved files to temporary files.
|
||||
std::vector<std::string> RemapArgs;
|
||||
if (RemapFiles(num_unsaved_files, unsaved_files, RemapArgs, TemporaryFiles))
|
||||
return 0;
|
||||
|
||||
// The pointers into the elements of RemapArgs are stable because we
|
||||
// won't be adding anything to RemapArgs after this point.
|
||||
for (unsigned i = 0, e = RemapArgs.size(); i != e; ++i)
|
||||
argv.push_back(RemapArgs[i].c_str());
|
||||
|
||||
// Add the source file name (FIXME: later, we'll want to build temporary
|
||||
// file from the buffer, or just feed the source text via standard input).
|
||||
if (source_filename)
|
||||
argv.push_back(source_filename);
|
||||
|
||||
// Process the compiler options, stripping off '-o', '-c', '-fsyntax-only'.
|
||||
for (int i = 0; i < num_command_line_args; ++i)
|
||||
if (const char *arg = command_line_args[i]) {
|
||||
if (strcmp(arg, "-o") == 0) {
|
||||
++i; // Also skip the matching argument.
|
||||
continue;
|
||||
}
|
||||
if (strcmp(arg, "-emit-ast") == 0 ||
|
||||
strcmp(arg, "-c") == 0 ||
|
||||
strcmp(arg, "-fsyntax-only") == 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Keep the argument.
|
||||
argv.push_back(arg);
|
||||
}
|
||||
|
||||
// Add the null terminator.
|
||||
argv.push_back(NULL);
|
||||
|
||||
// Generate a temporary name for the code-completion results file.
|
||||
char tmpFile[L_tmpnam];
|
||||
char *tmpFileName = tmpnam(tmpFile);
|
||||
llvm::sys::Path ResultsFile(tmpFileName);
|
||||
TemporaryFiles.push_back(ResultsFile);
|
||||
|
||||
// Generate a temporary name for the diagnostics file.
|
||||
char tmpFileResults[L_tmpnam];
|
||||
char *tmpResultsFileName = tmpnam(tmpFileResults);
|
||||
llvm::sys::Path DiagnosticsFile(tmpResultsFileName);
|
||||
TemporaryFiles.push_back(DiagnosticsFile);
|
||||
|
||||
// Invoke 'clang'.
|
||||
llvm::sys::Path DevNull; // leave empty, causes redirection to /dev/null
|
||||
// on Unix or NUL (Windows).
|
||||
std::string ErrMsg;
|
||||
const llvm::sys::Path *Redirects[] = { &DevNull, &ResultsFile,
|
||||
&DiagnosticsFile, 0 };
|
||||
llvm::sys::Program::ExecuteAndWait(ClangPath, &argv[0], /* env */ NULL,
|
||||
/* redirects */ &Redirects[0],
|
||||
/* secondsToWait */ 0,
|
||||
/* memoryLimits */ 0, &ErrMsg);
|
||||
|
||||
if (!ErrMsg.empty()) {
|
||||
std::string AllArgs;
|
||||
for (std::vector<const char*>::iterator I = argv.begin(), E = argv.end();
|
||||
I != E; ++I) {
|
||||
AllArgs += ' ';
|
||||
if (*I)
|
||||
AllArgs += *I;
|
||||
}
|
||||
|
||||
Diags->Report(diag::err_fe_invoking) << AllArgs << ErrMsg;
|
||||
}
|
||||
|
||||
// Parse the resulting source file to find code-completion results.
|
||||
using llvm::MemoryBuffer;
|
||||
using llvm::StringRef;
|
||||
AllocatedCXCodeCompleteResults *Results = new AllocatedCXCodeCompleteResults;
|
||||
Results->Results = 0;
|
||||
Results->NumResults = 0;
|
||||
Results->Buffer = 0;
|
||||
// FIXME: Set Results->LangOpts!
|
||||
if (MemoryBuffer *F = MemoryBuffer::getFile(ResultsFile.c_str())) {
|
||||
llvm::SmallVector<CXCompletionResult, 4> CompletionResults;
|
||||
StringRef Buffer = F->getBuffer();
|
||||
for (const char *Str = Buffer.data(), *StrEnd = Str + Buffer.size();
|
||||
Str < StrEnd;) {
|
||||
unsigned KindValue;
|
||||
if (ReadUnsigned(Str, StrEnd, KindValue))
|
||||
break;
|
||||
|
||||
CodeCompletionString *CCStr
|
||||
= CodeCompletionString::Deserialize(Str, StrEnd);
|
||||
if (!CCStr)
|
||||
continue;
|
||||
|
||||
if (!CCStr->empty()) {
|
||||
// Vend the code-completion result to the caller.
|
||||
CXCompletionResult Result;
|
||||
Result.CursorKind = (CXCursorKind)KindValue;
|
||||
Result.CompletionString = CCStr;
|
||||
CompletionResults.push_back(Result);
|
||||
}
|
||||
};
|
||||
|
||||
// Allocate the results.
|
||||
Results->Results = new CXCompletionResult [CompletionResults.size()];
|
||||
Results->NumResults = CompletionResults.size();
|
||||
memcpy(Results->Results, CompletionResults.data(),
|
||||
CompletionResults.size() * sizeof(CXCompletionResult));
|
||||
Results->Buffer = F;
|
||||
}
|
||||
|
||||
LoadSerializedDiagnostics(DiagnosticsFile, num_unsaved_files, unsaved_files,
|
||||
Results->FileMgr, Results->SourceMgr,
|
||||
Results->Diagnostics);
|
||||
|
||||
// Make sure we delete temporary files when the code-completion results are
|
||||
// destroyed.
|
||||
Results->TemporaryFiles.swap(TemporaryFiles);
|
||||
|
||||
#ifdef UDP_CODE_COMPLETION_LOGGER
|
||||
#ifdef UDP_CODE_COMPLETION_LOGGER_PORT
|
||||
const llvm::TimeRecord &EndTime = llvm::TimeRecord::getCurrentTime();
|
||||
llvm::SmallString<256> LogResult;
|
||||
llvm::raw_svector_ostream os(LogResult);
|
||||
|
||||
// Figure out the language and whether or not it uses PCH.
|
||||
const char *lang = 0;
|
||||
bool usesPCH = false;
|
||||
|
||||
for (std::vector<const char*>::iterator I = argv.begin(), E = argv.end();
|
||||
I != E; ++I) {
|
||||
if (*I == 0)
|
||||
continue;
|
||||
if (strcmp(*I, "-x") == 0) {
|
||||
if (I + 1 != E) {
|
||||
lang = *(++I);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (strcmp(*I, "-include") == 0) {
|
||||
if (I+1 != E) {
|
||||
const char *arg = *(++I);
|
||||
llvm::SmallString<512> pchName;
|
||||
{
|
||||
llvm::raw_svector_ostream os(pchName);
|
||||
os << arg << ".pth";
|
||||
}
|
||||
pchName.push_back('\0');
|
||||
struct stat stat_results;
|
||||
if (stat(pchName.data(), &stat_results) == 0)
|
||||
usesPCH = true;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
os << "{ ";
|
||||
os << "\"wall\": " << (EndTime.getWallTime() - StartTime.getWallTime());
|
||||
os << ", \"numRes\": " << Results->NumResults;
|
||||
os << ", \"diags\": " << Results->Diagnostics.size();
|
||||
os << ", \"pch\": " << (usesPCH ? "true" : "false");
|
||||
os << ", \"lang\": \"" << (lang ? lang : "<unknown>") << '"';
|
||||
const char *name = getlogin();
|
||||
os << ", \"user\": \"" << (name ? name : "unknown") << '"';
|
||||
os << ", \"clangVer\": \"" << getClangFullVersion() << '"';
|
||||
os << " }";
|
||||
|
||||
llvm::StringRef res = os.str();
|
||||
if (res.size() > 0) {
|
||||
do {
|
||||
// Setup the UDP socket.
|
||||
struct sockaddr_in servaddr;
|
||||
bzero(&servaddr, sizeof(servaddr));
|
||||
servaddr.sin_family = AF_INET;
|
||||
servaddr.sin_port = htons(UDP_CODE_COMPLETION_LOGGER_PORT);
|
||||
if (inet_pton(AF_INET, UDP_CODE_COMPLETION_LOGGER,
|
||||
&servaddr.sin_addr) <= 0)
|
||||
break;
|
||||
|
||||
int sockfd = socket(AF_INET, SOCK_DGRAM, 0);
|
||||
if (sockfd < 0)
|
||||
break;
|
||||
|
||||
sendto(sockfd, res.data(), res.size(), 0,
|
||||
(struct sockaddr *)&servaddr, sizeof(servaddr));
|
||||
close(sockfd);
|
||||
}
|
||||
while (false);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
return Results;
|
||||
}
|
||||
|
||||
void clang_disposeCodeCompleteResults(CXCodeCompleteResults *ResultsIn) {
|
||||
if (!ResultsIn)
|
||||
return;
|
||||
|
||||
AllocatedCXCodeCompleteResults *Results
|
||||
= static_cast<AllocatedCXCodeCompleteResults*>(ResultsIn);
|
||||
delete Results;
|
||||
}
|
||||
|
||||
unsigned
|
||||
clang_codeCompleteGetNumDiagnostics(CXCodeCompleteResults *ResultsIn) {
|
||||
AllocatedCXCodeCompleteResults *Results
|
||||
= static_cast<AllocatedCXCodeCompleteResults*>(ResultsIn);
|
||||
if (!Results)
|
||||
return 0;
|
||||
|
||||
return Results->Diagnostics.size();
|
||||
}
|
||||
|
||||
CXDiagnostic
|
||||
clang_codeCompleteGetDiagnostic(CXCodeCompleteResults *ResultsIn,
|
||||
unsigned Index) {
|
||||
AllocatedCXCodeCompleteResults *Results
|
||||
= static_cast<AllocatedCXCodeCompleteResults*>(ResultsIn);
|
||||
if (!Results || Index >= Results->Diagnostics.size())
|
||||
return 0;
|
||||
|
||||
return new CXStoredDiagnostic(Results->Diagnostics[Index], Results->LangOpts);
|
||||
}
|
||||
|
||||
|
||||
} // end extern "C"
|
@ -1,285 +0,0 @@
|
||||
/*===-- CIndexDiagnostics.cpp - Diagnostics C Interface ---------*- C++ -*-===*\
|
||||
|* *|
|
||||
|* The LLVM Compiler Infrastructure *|
|
||||
|* *|
|
||||
|* This file is distributed under the University of Illinois Open Source *|
|
||||
|* License. See LICENSE.TXT for details. *|
|
||||
|* *|
|
||||
|*===----------------------------------------------------------------------===*|
|
||||
|* *|
|
||||
|* Implements the diagnostic functions of the Clang C interface. *|
|
||||
|* *|
|
||||
\*===----------------------------------------------------------------------===*/
|
||||
#include "CIndexDiagnostic.h"
|
||||
#include "CIndexer.h"
|
||||
#include "CXSourceLocation.h"
|
||||
|
||||
#include "clang/Frontend/ASTUnit.h"
|
||||
#include "clang/Frontend/FrontendDiagnostic.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/ADT/Twine.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
using namespace clang;
|
||||
using namespace clang::cxloc;
|
||||
using namespace clang::cxstring;
|
||||
using namespace llvm;
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// C Interface Routines
|
||||
//-----------------------------------------------------------------------------
|
||||
extern "C" {
|
||||
|
||||
unsigned clang_getNumDiagnostics(CXTranslationUnit Unit) {
|
||||
ASTUnit *CXXUnit = static_cast<ASTUnit *>(Unit);
|
||||
return CXXUnit? CXXUnit->stored_diag_size() : 0;
|
||||
}
|
||||
|
||||
CXDiagnostic clang_getDiagnostic(CXTranslationUnit Unit, unsigned Index) {
|
||||
ASTUnit *CXXUnit = static_cast<ASTUnit *>(Unit);
|
||||
if (!CXXUnit || Index >= CXXUnit->stored_diag_size())
|
||||
return 0;
|
||||
|
||||
return new CXStoredDiagnostic(CXXUnit->stored_diag_begin()[Index],
|
||||
CXXUnit->getASTContext().getLangOptions());
|
||||
}
|
||||
|
||||
void clang_disposeDiagnostic(CXDiagnostic Diagnostic) {
|
||||
CXStoredDiagnostic *Stored = static_cast<CXStoredDiagnostic *>(Diagnostic);
|
||||
delete Stored;
|
||||
}
|
||||
|
||||
CXString clang_formatDiagnostic(CXDiagnostic Diagnostic, unsigned Options) {
|
||||
if (!Diagnostic)
|
||||
return createCXString("");
|
||||
|
||||
CXDiagnosticSeverity Severity = clang_getDiagnosticSeverity(Diagnostic);
|
||||
|
||||
// Ignore diagnostics that should be ignored.
|
||||
if (Severity == CXDiagnostic_Ignored)
|
||||
return createCXString("");
|
||||
|
||||
llvm::SmallString<256> Str;
|
||||
llvm::raw_svector_ostream Out(Str);
|
||||
|
||||
if (Options & CXDiagnostic_DisplaySourceLocation) {
|
||||
// Print source location (file:line), along with optional column
|
||||
// and source ranges.
|
||||
CXFile File;
|
||||
unsigned Line, Column;
|
||||
clang_getInstantiationLocation(clang_getDiagnosticLocation(Diagnostic),
|
||||
&File, &Line, &Column, 0);
|
||||
if (File) {
|
||||
CXString FName = clang_getFileName(File);
|
||||
Out << clang_getCString(FName) << ":" << Line << ":";
|
||||
clang_disposeString(FName);
|
||||
if (Options & CXDiagnostic_DisplayColumn)
|
||||
Out << Column << ":";
|
||||
|
||||
if (Options & CXDiagnostic_DisplaySourceRanges) {
|
||||
unsigned N = clang_getDiagnosticNumRanges(Diagnostic);
|
||||
bool PrintedRange = false;
|
||||
for (unsigned I = 0; I != N; ++I) {
|
||||
CXFile StartFile, EndFile;
|
||||
CXSourceRange Range = clang_getDiagnosticRange(Diagnostic, I);
|
||||
|
||||
unsigned StartLine, StartColumn, EndLine, EndColumn;
|
||||
clang_getInstantiationLocation(clang_getRangeStart(Range),
|
||||
&StartFile, &StartLine, &StartColumn,
|
||||
0);
|
||||
clang_getInstantiationLocation(clang_getRangeEnd(Range),
|
||||
&EndFile, &EndLine, &EndColumn, 0);
|
||||
|
||||
if (StartFile != EndFile || StartFile != File)
|
||||
continue;
|
||||
|
||||
Out << "{" << StartLine << ":" << StartColumn << "-"
|
||||
<< EndLine << ":" << EndColumn << "}";
|
||||
PrintedRange = true;
|
||||
}
|
||||
if (PrintedRange)
|
||||
Out << ":";
|
||||
}
|
||||
}
|
||||
|
||||
Out << " ";
|
||||
}
|
||||
|
||||
/* Print warning/error/etc. */
|
||||
switch (Severity) {
|
||||
case CXDiagnostic_Ignored: assert(0 && "impossible"); break;
|
||||
case CXDiagnostic_Note: Out << "note: "; break;
|
||||
case CXDiagnostic_Warning: Out << "warning: "; break;
|
||||
case CXDiagnostic_Error: Out << "error: "; break;
|
||||
case CXDiagnostic_Fatal: Out << "fatal error: "; break;
|
||||
}
|
||||
|
||||
CXString Text = clang_getDiagnosticSpelling(Diagnostic);
|
||||
if (clang_getCString(Text))
|
||||
Out << clang_getCString(Text);
|
||||
else
|
||||
Out << "<no diagnostic text>";
|
||||
clang_disposeString(Text);
|
||||
return createCXString(Out.str(), true);
|
||||
}
|
||||
|
||||
unsigned clang_defaultDiagnosticDisplayOptions() {
|
||||
return CXDiagnostic_DisplaySourceLocation | CXDiagnostic_DisplayColumn;
|
||||
}
|
||||
|
||||
enum CXDiagnosticSeverity clang_getDiagnosticSeverity(CXDiagnostic Diag) {
|
||||
CXStoredDiagnostic *StoredDiag = static_cast<CXStoredDiagnostic *>(Diag);
|
||||
if (!StoredDiag)
|
||||
return CXDiagnostic_Ignored;
|
||||
|
||||
switch (StoredDiag->Diag.getLevel()) {
|
||||
case Diagnostic::Ignored: return CXDiagnostic_Ignored;
|
||||
case Diagnostic::Note: return CXDiagnostic_Note;
|
||||
case Diagnostic::Warning: return CXDiagnostic_Warning;
|
||||
case Diagnostic::Error: return CXDiagnostic_Error;
|
||||
case Diagnostic::Fatal: return CXDiagnostic_Fatal;
|
||||
}
|
||||
|
||||
llvm_unreachable("Invalid diagnostic level");
|
||||
return CXDiagnostic_Ignored;
|
||||
}
|
||||
|
||||
CXSourceLocation clang_getDiagnosticLocation(CXDiagnostic Diag) {
|
||||
CXStoredDiagnostic *StoredDiag = static_cast<CXStoredDiagnostic *>(Diag);
|
||||
if (!StoredDiag || StoredDiag->Diag.getLocation().isInvalid())
|
||||
return clang_getNullLocation();
|
||||
|
||||
return translateSourceLocation(StoredDiag->Diag.getLocation().getManager(),
|
||||
StoredDiag->LangOpts,
|
||||
StoredDiag->Diag.getLocation());
|
||||
}
|
||||
|
||||
CXString clang_getDiagnosticSpelling(CXDiagnostic Diag) {
|
||||
CXStoredDiagnostic *StoredDiag = static_cast<CXStoredDiagnostic *>(Diag);
|
||||
if (!StoredDiag)
|
||||
return createCXString("");
|
||||
|
||||
return createCXString(StoredDiag->Diag.getMessage(), false);
|
||||
}
|
||||
|
||||
unsigned clang_getDiagnosticNumRanges(CXDiagnostic Diag) {
|
||||
CXStoredDiagnostic *StoredDiag = static_cast<CXStoredDiagnostic *>(Diag);
|
||||
if (!StoredDiag || StoredDiag->Diag.getLocation().isInvalid())
|
||||
return 0;
|
||||
|
||||
return StoredDiag->Diag.range_size();
|
||||
}
|
||||
|
||||
CXSourceRange clang_getDiagnosticRange(CXDiagnostic Diag, unsigned Range) {
|
||||
CXStoredDiagnostic *StoredDiag = static_cast<CXStoredDiagnostic *>(Diag);
|
||||
if (!StoredDiag || Range >= StoredDiag->Diag.range_size() ||
|
||||
StoredDiag->Diag.getLocation().isInvalid())
|
||||
return clang_getNullRange();
|
||||
|
||||
return translateSourceRange(StoredDiag->Diag.getLocation().getManager(),
|
||||
StoredDiag->LangOpts,
|
||||
StoredDiag->Diag.range_begin()[Range]);
|
||||
}
|
||||
|
||||
unsigned clang_getDiagnosticNumFixIts(CXDiagnostic Diag) {
|
||||
CXStoredDiagnostic *StoredDiag = static_cast<CXStoredDiagnostic *>(Diag);
|
||||
if (!StoredDiag)
|
||||
return 0;
|
||||
|
||||
return StoredDiag->Diag.fixit_size();
|
||||
}
|
||||
|
||||
CXString clang_getDiagnosticFixIt(CXDiagnostic Diagnostic, unsigned FixIt,
|
||||
CXSourceRange *ReplacementRange) {
|
||||
CXStoredDiagnostic *StoredDiag
|
||||
= static_cast<CXStoredDiagnostic *>(Diagnostic);
|
||||
if (!StoredDiag || FixIt >= StoredDiag->Diag.fixit_size() ||
|
||||
StoredDiag->Diag.getLocation().isInvalid()) {
|
||||
if (ReplacementRange)
|
||||
*ReplacementRange = clang_getNullRange();
|
||||
|
||||
return createCXString("");
|
||||
}
|
||||
|
||||
const FixItHint &Hint = StoredDiag->Diag.fixit_begin()[FixIt];
|
||||
if (ReplacementRange) {
|
||||
if (Hint.RemoveRange.isInvalid()) {
|
||||
// Create an empty range that refers to a single source
|
||||
// location (which is the insertion point).
|
||||
CXSourceRange Range = {
|
||||
{ (void *)&StoredDiag->Diag.getLocation().getManager(),
|
||||
(void *)&StoredDiag->LangOpts },
|
||||
Hint.InsertionLoc.getRawEncoding(),
|
||||
Hint.InsertionLoc.getRawEncoding()
|
||||
};
|
||||
|
||||
*ReplacementRange = Range;
|
||||
} else {
|
||||
// Create a range that covers the entire replacement (or
|
||||
// removal) range, adjusting the end of the range to point to
|
||||
// the end of the token.
|
||||
*ReplacementRange
|
||||
= translateSourceRange(StoredDiag->Diag.getLocation().getManager(),
|
||||
StoredDiag->LangOpts,
|
||||
Hint.RemoveRange);
|
||||
}
|
||||
}
|
||||
|
||||
return createCXString(Hint.CodeToInsert);
|
||||
}
|
||||
|
||||
} // end extern "C"
|
||||
|
||||
void clang::LoadSerializedDiagnostics(const llvm::sys::Path &DiagnosticsPath,
|
||||
unsigned num_unsaved_files,
|
||||
struct CXUnsavedFile *unsaved_files,
|
||||
FileManager &FileMgr,
|
||||
SourceManager &SourceMgr,
|
||||
SmallVectorImpl<StoredDiagnostic> &Diags) {
|
||||
using llvm::MemoryBuffer;
|
||||
using llvm::StringRef;
|
||||
MemoryBuffer *F = MemoryBuffer::getFile(DiagnosticsPath.c_str());
|
||||
if (!F)
|
||||
return;
|
||||
|
||||
// Enter the unsaved files into the file manager.
|
||||
for (unsigned I = 0; I != num_unsaved_files; ++I) {
|
||||
const FileEntry *File = FileMgr.getVirtualFile(unsaved_files[I].Filename,
|
||||
unsaved_files[I].Length,
|
||||
0);
|
||||
if (!File) {
|
||||
// FIXME: Hard to localize when we have no diagnostics engine!
|
||||
Diags.push_back(StoredDiagnostic(Diagnostic::Fatal,
|
||||
(Twine("could not remap from missing file ") +
|
||||
unsaved_files[I].Filename).str()));
|
||||
delete F;
|
||||
return;
|
||||
}
|
||||
|
||||
MemoryBuffer *Buffer
|
||||
= MemoryBuffer::getMemBuffer(unsaved_files[I].Contents,
|
||||
unsaved_files[I].Contents + unsaved_files[I].Length);
|
||||
if (!Buffer) {
|
||||
delete F;
|
||||
return;
|
||||
}
|
||||
|
||||
SourceMgr.overrideFileContents(File, Buffer);
|
||||
SourceMgr.createFileID(File, SourceLocation(), SrcMgr::C_User);
|
||||
}
|
||||
|
||||
// Parse the diagnostics, emitting them one by one until we've
|
||||
// exhausted the data.
|
||||
StringRef Buffer = F->getBuffer();
|
||||
const char *Memory = Buffer.data(), *MemoryEnd = Memory + Buffer.size();
|
||||
while (Memory != MemoryEnd) {
|
||||
StoredDiagnostic Stored = StoredDiagnostic::Deserialize(FileMgr, SourceMgr,
|
||||
Memory, MemoryEnd);
|
||||
if (!Stored)
|
||||
break;
|
||||
|
||||
Diags.push_back(Stored);
|
||||
}
|
||||
delete F;
|
||||
}
|
@ -1,53 +0,0 @@
|
||||
/*===-- CIndexDiagnostic.h - Diagnostics C Interface ------------*- C++ -*-===*\
|
||||
|* *|
|
||||
|* The LLVM Compiler Infrastructure *|
|
||||
|* *|
|
||||
|* This file is distributed under the University of Illinois Open Source *|
|
||||
|* License. See LICENSE.TXT for details. *|
|
||||
|* *|
|
||||
|*===----------------------------------------------------------------------===*|
|
||||
|* *|
|
||||
|* Implements the diagnostic functions of the Clang C interface. *|
|
||||
|* *|
|
||||
\*===----------------------------------------------------------------------===*/
|
||||
#ifndef LLVM_CLANG_CINDEX_DIAGNOSTIC_H
|
||||
#define LLVM_CLANG_CINDEX_DIAGNOSTIC_H
|
||||
|
||||
struct CXUnsavedFile;
|
||||
|
||||
namespace llvm {
|
||||
template<typename T> class SmallVectorImpl;
|
||||
namespace sys { class Path; }
|
||||
}
|
||||
|
||||
namespace clang {
|
||||
|
||||
class Diagnostic;
|
||||
class FileManager;
|
||||
class LangOptions;
|
||||
class Preprocessor;
|
||||
class StoredDiagnostic;
|
||||
class SourceManager;
|
||||
|
||||
/// \brief The storage behind a CXDiagnostic
|
||||
struct CXStoredDiagnostic {
|
||||
const StoredDiagnostic &Diag;
|
||||
const LangOptions &LangOpts;
|
||||
|
||||
CXStoredDiagnostic(const StoredDiagnostic &Diag,
|
||||
const LangOptions &LangOpts)
|
||||
: Diag(Diag), LangOpts(LangOpts) { }
|
||||
};
|
||||
|
||||
/// \brief Given the path to a file that contains binary, serialized
|
||||
/// diagnostics produced by Clang, load those diagnostics.
|
||||
void LoadSerializedDiagnostics(const llvm::sys::Path &DiagnosticsPath,
|
||||
unsigned num_unsaved_files,
|
||||
struct CXUnsavedFile *unsaved_files,
|
||||
FileManager &FileMgr,
|
||||
SourceManager &SourceMgr,
|
||||
llvm::SmallVectorImpl<StoredDiagnostic> &Diags);
|
||||
|
||||
} // end namespace clang
|
||||
|
||||
#endif // LLVM_CLANG_CINDEX_DIAGNOSTIC_H
|
@ -1,67 +0,0 @@
|
||||
//===- CIndexInclusionStack.cpp - Clang-C Source Indexing Library ---------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines a callback mechanism for clients to get the inclusion
|
||||
// stack from a translation unit.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "CIndexer.h"
|
||||
#include "CXSourceLocation.h"
|
||||
#include "clang/AST/DeclVisitor.h"
|
||||
#include "clang/Frontend/ASTUnit.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
using namespace clang;
|
||||
|
||||
extern "C" {
|
||||
void clang_getInclusions(CXTranslationUnit TU, CXInclusionVisitor CB,
|
||||
CXClientData clientData) {
|
||||
|
||||
ASTUnit *CXXUnit = static_cast<ASTUnit *>(TU);
|
||||
SourceManager &SM = CXXUnit->getSourceManager();
|
||||
ASTContext &Ctx = CXXUnit->getASTContext();
|
||||
|
||||
llvm::SmallVector<CXSourceLocation, 10> InclusionStack;
|
||||
unsigned i = SM.sloc_loaded_entry_size();
|
||||
unsigned n = SM.sloc_entry_size();
|
||||
|
||||
// In the case where all the SLocEntries are in an external source, traverse
|
||||
// those SLocEntries as well. This is the case where we are looking
|
||||
// at the inclusion stack of an AST/PCH file.
|
||||
if (i >= n)
|
||||
i = 0;
|
||||
|
||||
for ( ; i < n ; ++i) {
|
||||
|
||||
const SrcMgr::SLocEntry &SL = SM.getSLocEntry(i);
|
||||
|
||||
if (!SL.isFile())
|
||||
continue;
|
||||
|
||||
const SrcMgr::FileInfo &FI = SL.getFile();
|
||||
if (!FI.getContentCache()->Entry)
|
||||
continue;
|
||||
|
||||
// Build the inclusion stack.
|
||||
SourceLocation L = FI.getIncludeLoc();
|
||||
InclusionStack.clear();
|
||||
while (L.isValid()) {
|
||||
PresumedLoc PLoc = SM.getPresumedLoc(L);
|
||||
InclusionStack.push_back(cxloc::translateSourceLocation(Ctx, L));
|
||||
L = PLoc.getIncludeLoc();
|
||||
}
|
||||
|
||||
// Callback to the client.
|
||||
// FIXME: We should have a function to construct CXFiles.
|
||||
CB((CXFile) FI.getContentCache()->Entry,
|
||||
InclusionStack.data(), InclusionStack.size(), clientData);
|
||||
}
|
||||
}
|
||||
} // end extern C
|
@ -1,469 +0,0 @@
|
||||
//===- CIndexUSR.cpp - Clang-C Source Indexing Library --------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file implements the generation and use of USRs from CXEntities.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "CIndexer.h"
|
||||
#include "CXCursor.h"
|
||||
#include "clang/AST/DeclVisitor.h"
|
||||
#include "clang/Frontend/ASTUnit.h"
|
||||
#include "clang/Lex/PreprocessingRecord.h"
|
||||
#include "llvm/ADT/SmallString.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
|
||||
using namespace clang;
|
||||
using namespace clang::cxstring;
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// USR generation.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
namespace {
|
||||
class USRGenerator : public DeclVisitor<USRGenerator> {
|
||||
llvm::raw_ostream &Out;
|
||||
bool IgnoreResults;
|
||||
ASTUnit *AU;
|
||||
public:
|
||||
USRGenerator(ASTUnit *au, llvm::raw_ostream &out)
|
||||
: Out(out), IgnoreResults(false), AU(au) {}
|
||||
|
||||
bool ignoreResults() const { return IgnoreResults; }
|
||||
|
||||
// Visitation methods from generating USRs from AST elements.
|
||||
void VisitBlockDecl(BlockDecl *D);
|
||||
void VisitDeclContext(DeclContext *D);
|
||||
void VisitFieldDecl(FieldDecl *D);
|
||||
void VisitFunctionDecl(FunctionDecl *D);
|
||||
void VisitNamedDecl(NamedDecl *D);
|
||||
void VisitNamespaceDecl(NamespaceDecl *D);
|
||||
void VisitObjCClassDecl(ObjCClassDecl *CD);
|
||||
void VisitObjCContainerDecl(ObjCContainerDecl *CD);
|
||||
void VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *P);
|
||||
void VisitObjCMethodDecl(ObjCMethodDecl *MD);
|
||||
void VisitObjCPropertyDecl(ObjCPropertyDecl *D);
|
||||
void VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D);
|
||||
void VisitTagDecl(TagDecl *D);
|
||||
void VisitTypedefDecl(TypedefDecl *D);
|
||||
void VisitVarDecl(VarDecl *D);
|
||||
|
||||
/// Generate the string component containing the location of the
|
||||
/// declaration.
|
||||
void GenLoc(const Decl *D);
|
||||
|
||||
/// String generation methods used both by the visitation methods
|
||||
/// and from other clients that want to directly generate USRs. These
|
||||
/// methods do not construct complete USRs (which incorporate the parents
|
||||
/// of an AST element), but only the fragments concerning the AST element
|
||||
/// itself.
|
||||
|
||||
/// Generate a USR fragment for a named declaration. This does
|
||||
/// not include the USR component for the parent.
|
||||
void GenNamedDecl(llvm::StringRef name);
|
||||
|
||||
/// Generate a USR for an Objective-C class.
|
||||
void GenObjCClass(llvm::StringRef cls);
|
||||
/// Generate a USR for an Objective-C class category.
|
||||
void GenObjCCategory(llvm::StringRef cls, llvm::StringRef cat);
|
||||
/// Generate a USR fragment for an Objective-C instance variable. The
|
||||
/// complete USR can be created by concatenating the USR for the
|
||||
/// encompassing class with this USR fragment.
|
||||
void GenObjCIvar(llvm::StringRef ivar);
|
||||
/// Generate a USR fragment for an Objective-C method.
|
||||
void GenObjCMethod(llvm::StringRef sel, bool isInstanceMethod);
|
||||
/// Generate a USR fragment for an Objective-C property.
|
||||
void GenObjCProperty(llvm::StringRef prop);
|
||||
/// Generate a USR for an Objective-C protocol.
|
||||
void GenObjCProtocol(llvm::StringRef prot);
|
||||
};
|
||||
|
||||
class StringUSRGenerator {
|
||||
private:
|
||||
llvm::SmallString<1024> StrBuf;
|
||||
llvm::raw_svector_ostream Out;
|
||||
USRGenerator UG;
|
||||
public:
|
||||
StringUSRGenerator(const CXCursor *C = 0)
|
||||
: Out(StrBuf), UG(C ? cxcursor::getCursorASTUnit(*C) : 0, Out) {
|
||||
// Add the USR space prefix.
|
||||
Out << "c:";
|
||||
}
|
||||
|
||||
llvm::StringRef str() {
|
||||
return Out.str();
|
||||
}
|
||||
|
||||
USRGenerator* operator->() { return &UG; }
|
||||
|
||||
template <typename T>
|
||||
llvm::raw_svector_ostream &operator<<(const T &x) {
|
||||
Out << x;
|
||||
return Out;
|
||||
}
|
||||
};
|
||||
|
||||
} // end anonymous namespace
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// Generating USRs from ASTS.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
void USRGenerator::VisitBlockDecl(BlockDecl *D) {
|
||||
VisitDeclContext(D->getDeclContext());
|
||||
// FIXME: Better support for anonymous blocks.
|
||||
Out << "@B@anon";
|
||||
}
|
||||
|
||||
void USRGenerator::VisitDeclContext(DeclContext *DC) {
|
||||
if (NamedDecl *D = dyn_cast<NamedDecl>(DC))
|
||||
Visit(D);
|
||||
}
|
||||
|
||||
void USRGenerator::VisitFieldDecl(FieldDecl *D) {
|
||||
const std::string &s = D->getNameAsString();
|
||||
if (s.empty()) {
|
||||
// Bit fields can be anonymous.
|
||||
IgnoreResults = true;
|
||||
return;
|
||||
}
|
||||
VisitDeclContext(D->getDeclContext());
|
||||
Out << (isa<ObjCIvarDecl>(D) ? "@" : "@FI@") << s;
|
||||
}
|
||||
|
||||
void USRGenerator::VisitFunctionDecl(FunctionDecl *D) {
|
||||
VisitDeclContext(D->getDeclContext());
|
||||
Out << "@F@" << D;
|
||||
}
|
||||
|
||||
void USRGenerator::VisitNamedDecl(NamedDecl *D) {
|
||||
VisitDeclContext(D->getDeclContext());
|
||||
const std::string &s = D->getNameAsString();
|
||||
// The string can be empty if the declaration has no name; e.g., it is
|
||||
// the ParmDecl with no name for declaration of a function pointer type, e.g.:
|
||||
// void (*f)(void *);
|
||||
// In this case, don't generate a USR.
|
||||
if (s.empty())
|
||||
IgnoreResults = true;
|
||||
else
|
||||
GenNamedDecl(s);
|
||||
}
|
||||
|
||||
void USRGenerator::VisitVarDecl(VarDecl *D) {
|
||||
// VarDecls can be declared 'extern' within a function or method body,
|
||||
// but their enclosing DeclContext is the function, not the TU. We need
|
||||
// to check the storage class to correctly generate the USR.
|
||||
if (!D->hasExternalStorage())
|
||||
VisitDeclContext(D->getDeclContext());
|
||||
|
||||
const std::string &s = D->getNameAsString();
|
||||
// The string can be empty if the declaration has no name; e.g., it is
|
||||
// the ParmDecl with no name for declaration of a function pointer type, e.g.:
|
||||
// void (*f)(void *);
|
||||
// In this case, don't generate a USR.
|
||||
if (s.empty())
|
||||
IgnoreResults = true;
|
||||
else
|
||||
GenNamedDecl(s);
|
||||
}
|
||||
|
||||
void USRGenerator::VisitNamespaceDecl(NamespaceDecl *D) {
|
||||
VisitDeclContext(D->getDeclContext());
|
||||
Out << "@N@" << D;
|
||||
}
|
||||
|
||||
void USRGenerator::VisitObjCMethodDecl(ObjCMethodDecl *D) {
|
||||
Visit(cast<Decl>(D->getDeclContext()));
|
||||
GenObjCMethod(DeclarationName(D->getSelector()).getAsString(),
|
||||
D->isInstanceMethod());
|
||||
}
|
||||
|
||||
void USRGenerator::VisitObjCClassDecl(ObjCClassDecl *D) {
|
||||
// FIXME: @class declarations can refer to multiple classes. We need
|
||||
// to be able to traverse these.
|
||||
IgnoreResults = true;
|
||||
}
|
||||
|
||||
void USRGenerator::VisitObjCForwardProtocolDecl(ObjCForwardProtocolDecl *D) {
|
||||
// FIXME: @protocol declarations can refer to multiple protocols. We need
|
||||
// to be able to traverse these.
|
||||
IgnoreResults = true;
|
||||
}
|
||||
|
||||
void USRGenerator::VisitObjCContainerDecl(ObjCContainerDecl *D) {
|
||||
switch (D->getKind()) {
|
||||
default:
|
||||
assert(false && "Invalid ObjC container.");
|
||||
case Decl::ObjCInterface:
|
||||
case Decl::ObjCImplementation:
|
||||
GenObjCClass(D->getName());
|
||||
break;
|
||||
case Decl::ObjCCategory: {
|
||||
ObjCCategoryDecl *CD = cast<ObjCCategoryDecl>(D);
|
||||
ObjCInterfaceDecl *ID = CD->getClassInterface();
|
||||
if (!ID) {
|
||||
// Handle invalid code where the @interface might not
|
||||
// have been specified.
|
||||
// FIXME: We should be able to generate this USR even if the
|
||||
// @interface isn't available.
|
||||
IgnoreResults = true;
|
||||
return;
|
||||
}
|
||||
GenObjCCategory(ID->getName(), CD->getName());
|
||||
break;
|
||||
}
|
||||
case Decl::ObjCCategoryImpl: {
|
||||
ObjCCategoryImplDecl *CD = cast<ObjCCategoryImplDecl>(D);
|
||||
ObjCInterfaceDecl *ID = CD->getClassInterface();
|
||||
if (!ID) {
|
||||
// Handle invalid code where the @interface might not
|
||||
// have been specified.
|
||||
// FIXME: We should be able to generate this USR even if the
|
||||
// @interface isn't available.
|
||||
IgnoreResults = true;
|
||||
return;
|
||||
}
|
||||
GenObjCCategory(ID->getName(), CD->getName());
|
||||
break;
|
||||
}
|
||||
case Decl::ObjCProtocol:
|
||||
GenObjCProtocol(cast<ObjCProtocolDecl>(D)->getName());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void USRGenerator::VisitObjCPropertyDecl(ObjCPropertyDecl *D) {
|
||||
Visit(cast<Decl>(D->getDeclContext()));
|
||||
GenObjCProperty(D->getName());
|
||||
}
|
||||
|
||||
void USRGenerator::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D) {
|
||||
if (ObjCPropertyDecl *PD = D->getPropertyDecl()) {
|
||||
VisitObjCPropertyDecl(PD);
|
||||
return;
|
||||
}
|
||||
|
||||
IgnoreResults = true;
|
||||
}
|
||||
|
||||
void USRGenerator::VisitTagDecl(TagDecl *D) {
|
||||
D = D->getCanonicalDecl();
|
||||
VisitDeclContext(D->getDeclContext());
|
||||
switch (D->getTagKind()) {
|
||||
case TagDecl::TK_struct: Out << "@S"; break;
|
||||
case TagDecl::TK_class: Out << "@C"; break;
|
||||
case TagDecl::TK_union: Out << "@U"; break;
|
||||
case TagDecl::TK_enum: Out << "@E"; break;
|
||||
}
|
||||
|
||||
const std::string &s = D->getNameAsString();
|
||||
const TypedefDecl *TD = 0;
|
||||
if (s.empty()) {
|
||||
TD = D->getTypedefForAnonDecl();
|
||||
Out << (TD ? 'A' : 'a');
|
||||
}
|
||||
|
||||
// Add the location of the tag decl to handle resolution across
|
||||
// translation units.
|
||||
if (D->getLinkage() == NoLinkage) {
|
||||
Out << '@';
|
||||
GenLoc(D);
|
||||
if (IgnoreResults)
|
||||
return;
|
||||
}
|
||||
|
||||
if (s.empty()) {
|
||||
if (TD)
|
||||
Out << '@' << TD;
|
||||
}
|
||||
else
|
||||
Out << '@' << s;
|
||||
}
|
||||
|
||||
void USRGenerator::VisitTypedefDecl(TypedefDecl *D) {
|
||||
DeclContext *DC = D->getDeclContext();
|
||||
if (NamedDecl *DCN = dyn_cast<NamedDecl>(DC))
|
||||
Visit(DCN);
|
||||
Out << "@T@";
|
||||
if (D->getLinkage() == NoLinkage) {
|
||||
GenLoc(D);
|
||||
if (IgnoreResults)
|
||||
return;
|
||||
Out << '@';
|
||||
}
|
||||
Out << D->getName();
|
||||
}
|
||||
|
||||
void USRGenerator::GenLoc(const Decl *D) {
|
||||
const SourceManager &SM = AU->getSourceManager();
|
||||
SourceLocation L = D->getLocStart();
|
||||
if (L.isInvalid()) {
|
||||
IgnoreResults = true;
|
||||
return;
|
||||
}
|
||||
L = SM.getInstantiationLoc(L);
|
||||
const std::pair<FileID, unsigned> &Decomposed = SM.getDecomposedLoc(L);
|
||||
const FileEntry *FE = SM.getFileEntryForID(Decomposed.first);
|
||||
if (FE) {
|
||||
llvm::sys::Path P(FE->getName());
|
||||
Out << P.getLast();
|
||||
}
|
||||
else {
|
||||
// This case really isn't interesting.
|
||||
IgnoreResults = true;
|
||||
return;
|
||||
}
|
||||
Out << '@'
|
||||
<< SM.getLineNumber(Decomposed.first, Decomposed.second) << ':'
|
||||
<< SM.getColumnNumber(Decomposed.first, Decomposed.second);
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// General purpose USR generation methods.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
void USRGenerator::GenNamedDecl(llvm::StringRef name) {
|
||||
Out << "@" << name;
|
||||
}
|
||||
|
||||
void USRGenerator::GenObjCClass(llvm::StringRef cls) {
|
||||
Out << "objc(cs)" << cls;
|
||||
}
|
||||
|
||||
void USRGenerator::GenObjCCategory(llvm::StringRef cls, llvm::StringRef cat) {
|
||||
Out << "objc(cy)" << cls << '@' << cat;
|
||||
}
|
||||
|
||||
void USRGenerator::GenObjCIvar(llvm::StringRef ivar) {
|
||||
GenNamedDecl(ivar);
|
||||
}
|
||||
|
||||
void USRGenerator::GenObjCMethod(llvm::StringRef meth, bool isInstanceMethod) {
|
||||
Out << (isInstanceMethod ? "(im)" : "(cm)") << meth;
|
||||
}
|
||||
|
||||
void USRGenerator::GenObjCProperty(llvm::StringRef prop) {
|
||||
Out << "(py)" << prop;
|
||||
}
|
||||
|
||||
void USRGenerator::GenObjCProtocol(llvm::StringRef prot) {
|
||||
Out << "objc(pl)" << prot;
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// API hooks.
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
static inline llvm::StringRef extractUSRSuffix(llvm::StringRef s) {
|
||||
return s.startswith("c:") ? s.substr(2) : "";
|
||||
}
|
||||
|
||||
static CXString getDeclCursorUSR(const CXCursor &C) {
|
||||
Decl *D = cxcursor::getCursorDecl(C);
|
||||
|
||||
// Don't generate USRs for things with invalid locations.
|
||||
if (!D || D->getLocStart().isInvalid())
|
||||
return createCXString("");
|
||||
|
||||
// Check if the cursor has 'NoLinkage'.
|
||||
if (const NamedDecl *ND = dyn_cast<NamedDecl>(D))
|
||||
switch (ND->getLinkage()) {
|
||||
case ExternalLinkage:
|
||||
// Generate USRs for all entities with external linkage.
|
||||
break;
|
||||
case NoLinkage:
|
||||
// We allow enums, typedefs, and structs that have no linkage to
|
||||
// have USRs that are anchored to the file they were defined in
|
||||
// (e.g., the header). This is a little gross, but in principal
|
||||
// enums/anonymous structs/etc. defined in a common header file
|
||||
// are referred to across multiple translation units.
|
||||
if (isa<TagDecl>(ND) || isa<TypedefDecl>(ND) ||
|
||||
isa<EnumConstantDecl>(ND) || isa<FieldDecl>(ND))
|
||||
break;
|
||||
// Fall-through.
|
||||
case InternalLinkage:
|
||||
case UniqueExternalLinkage:
|
||||
return createCXString("");
|
||||
}
|
||||
|
||||
StringUSRGenerator SUG(&C);
|
||||
SUG->Visit(D);
|
||||
|
||||
if (SUG->ignoreResults())
|
||||
return createCXString("");
|
||||
|
||||
// For development testing.
|
||||
// assert(SUG.str().size() > 2);
|
||||
|
||||
// Return a copy of the string that must be disposed by the caller.
|
||||
return createCXString(SUG.str(), true);
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
CXString clang_getCursorUSR(CXCursor C) {
|
||||
const CXCursorKind &K = clang_getCursorKind(C);
|
||||
|
||||
if (clang_isDeclaration(K))
|
||||
return getDeclCursorUSR(C);
|
||||
|
||||
if (K == CXCursor_MacroDefinition) {
|
||||
StringUSRGenerator SUG(&C);
|
||||
SUG << "macro@"
|
||||
<< cxcursor::getCursorMacroDefinition(C)->getName()->getNameStart();
|
||||
return createCXString(SUG.str(), true);
|
||||
}
|
||||
|
||||
return createCXString("");
|
||||
}
|
||||
|
||||
CXString clang_constructUSR_ObjCIvar(const char *name, CXString classUSR) {
|
||||
StringUSRGenerator SUG;
|
||||
SUG << extractUSRSuffix(clang_getCString(classUSR));
|
||||
SUG->GenObjCIvar(name);
|
||||
return createCXString(SUG.str(), true);
|
||||
}
|
||||
|
||||
CXString clang_constructUSR_ObjCMethod(const char *name,
|
||||
unsigned isInstanceMethod,
|
||||
CXString classUSR) {
|
||||
StringUSRGenerator SUG;
|
||||
SUG << extractUSRSuffix(clang_getCString(classUSR));
|
||||
SUG->GenObjCMethod(name, isInstanceMethod);
|
||||
return createCXString(SUG.str(), true);
|
||||
}
|
||||
|
||||
CXString clang_constructUSR_ObjCClass(const char *name) {
|
||||
StringUSRGenerator SUG;
|
||||
SUG->GenObjCClass(name);
|
||||
return createCXString(SUG.str(), true);
|
||||
}
|
||||
|
||||
CXString clang_constructUSR_ObjCProtocol(const char *name) {
|
||||
StringUSRGenerator SUG;
|
||||
SUG->GenObjCProtocol(name);
|
||||
return createCXString(SUG.str(), true);
|
||||
}
|
||||
|
||||
CXString clang_constructUSR_ObjCCategory(const char *class_name,
|
||||
const char *category_name) {
|
||||
StringUSRGenerator SUG;
|
||||
SUG->GenObjCCategory(class_name, category_name);
|
||||
return createCXString(SUG.str(), true);
|
||||
}
|
||||
|
||||
CXString clang_constructUSR_ObjCProperty(const char *property,
|
||||
CXString classUSR) {
|
||||
StringUSRGenerator SUG;
|
||||
SUG << extractUSRSuffix(clang_getCString(classUSR));
|
||||
SUG->GenObjCProperty(property);
|
||||
return createCXString(SUG.str(), true);
|
||||
}
|
||||
|
||||
} // end extern "C"
|
@ -1,154 +0,0 @@
|
||||
//===- CIndex.cpp - Clang-C Source Indexing Library -----------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file implements the Clang-C Source Indexing library.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "CIndexer.h"
|
||||
|
||||
#include "clang/AST/Decl.h"
|
||||
#include "clang/AST/DeclVisitor.h"
|
||||
#include "clang/AST/StmtVisitor.h"
|
||||
#include "clang/Basic/FileManager.h"
|
||||
#include "clang/Basic/SourceManager.h"
|
||||
#include "clang/Basic/Version.h"
|
||||
#include "clang/Sema/CodeCompleteConsumer.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/Config/config.h"
|
||||
#include "llvm/Support/Compiler.h"
|
||||
#include "llvm/Support/MemoryBuffer.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/System/Program.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
|
||||
#ifdef LLVM_ON_WIN32
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
using namespace clang;
|
||||
|
||||
const llvm::sys::Path& CIndexer::getClangPath() {
|
||||
// Did we already compute the path?
|
||||
if (!ClangPath.empty())
|
||||
return ClangPath;
|
||||
|
||||
// Find the location where this library lives (libCIndex.dylib).
|
||||
#ifdef LLVM_ON_WIN32
|
||||
MEMORY_BASIC_INFORMATION mbi;
|
||||
char path[MAX_PATH];
|
||||
VirtualQuery((void *)(uintptr_t)clang_createTranslationUnit, &mbi,
|
||||
sizeof(mbi));
|
||||
GetModuleFileNameA((HINSTANCE)mbi.AllocationBase, path, MAX_PATH);
|
||||
|
||||
llvm::sys::Path CIndexPath(path);
|
||||
|
||||
CIndexPath.eraseComponent();
|
||||
CIndexPath.appendComponent("clang");
|
||||
CIndexPath.appendSuffix("exe");
|
||||
CIndexPath.makeAbsolute();
|
||||
#else
|
||||
// This silly cast below avoids a C++ warning.
|
||||
Dl_info info;
|
||||
if (dladdr((void *)(uintptr_t)clang_createTranslationUnit, &info) == 0)
|
||||
assert(0 && "Call to dladdr() failed");
|
||||
|
||||
llvm::sys::Path CIndexPath(info.dli_fname);
|
||||
|
||||
// We now have the CIndex directory, locate clang relative to it.
|
||||
CIndexPath.eraseComponent();
|
||||
CIndexPath.appendComponent("..");
|
||||
CIndexPath.appendComponent("bin");
|
||||
CIndexPath.appendComponent("clang");
|
||||
#endif
|
||||
|
||||
// Cache our result.
|
||||
ClangPath = CIndexPath;
|
||||
return ClangPath;
|
||||
}
|
||||
|
||||
std::string CIndexer::getClangResourcesPath() {
|
||||
llvm::sys::Path P = getClangPath();
|
||||
|
||||
if (!P.empty()) {
|
||||
P.eraseComponent(); // Remove /clang from foo/bin/clang
|
||||
P.eraseComponent(); // Remove /bin from foo/bin
|
||||
|
||||
// Get foo/lib/clang/<version>/include
|
||||
P.appendComponent("lib");
|
||||
P.appendComponent("clang");
|
||||
P.appendComponent(CLANG_VERSION_STRING);
|
||||
}
|
||||
|
||||
return P.str();
|
||||
}
|
||||
|
||||
static llvm::sys::Path GetTemporaryPath() {
|
||||
// FIXME: This is lame; sys::Path should provide this function (in particular,
|
||||
// it should know how to find the temporary files dir).
|
||||
std::string Error;
|
||||
const char *TmpDir = ::getenv("TMPDIR");
|
||||
if (!TmpDir)
|
||||
TmpDir = ::getenv("TEMP");
|
||||
if (!TmpDir)
|
||||
TmpDir = ::getenv("TMP");
|
||||
if (!TmpDir)
|
||||
TmpDir = "/tmp";
|
||||
llvm::sys::Path P(TmpDir);
|
||||
P.appendComponent("remap");
|
||||
if (P.makeUnique(false, &Error))
|
||||
return llvm::sys::Path("");
|
||||
|
||||
// FIXME: Grumble, makeUnique sometimes leaves the file around!? PR3837.
|
||||
P.eraseFromDisk(false, 0);
|
||||
|
||||
return P;
|
||||
}
|
||||
|
||||
bool clang::RemapFiles(unsigned num_unsaved_files,
|
||||
struct CXUnsavedFile *unsaved_files,
|
||||
std::vector<std::string> &RemapArgs,
|
||||
std::vector<llvm::sys::Path> &TemporaryFiles) {
|
||||
for (unsigned i = 0; i != num_unsaved_files; ++i) {
|
||||
// Write the contents of this unsaved file into the temporary file.
|
||||
llvm::sys::Path SavedFile(GetTemporaryPath());
|
||||
if (SavedFile.empty())
|
||||
return true;
|
||||
|
||||
std::string ErrorInfo;
|
||||
llvm::raw_fd_ostream OS(SavedFile.c_str(), ErrorInfo);
|
||||
if (!ErrorInfo.empty())
|
||||
return true;
|
||||
|
||||
OS.write(unsaved_files[i].Contents, unsaved_files[i].Length);
|
||||
OS.close();
|
||||
if (OS.has_error()) {
|
||||
SavedFile.eraseFromDisk();
|
||||
return true;
|
||||
}
|
||||
|
||||
// Remap the file.
|
||||
std::string RemapArg = unsaved_files[i].Filename;
|
||||
RemapArg += ';';
|
||||
RemapArg += SavedFile.str();
|
||||
RemapArgs.push_back("-Xclang");
|
||||
RemapArgs.push_back("-remap-file");
|
||||
RemapArgs.push_back("-Xclang");
|
||||
RemapArgs.push_back(RemapArg);
|
||||
TemporaryFiles.push_back(SavedFile);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -1,78 +0,0 @@
|
||||
//===- CIndexer.h - Clang-C Source Indexing Library -----------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines CIndexer, a subclass of Indexer that provides extra
|
||||
// functionality needed by the CIndex library.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_CLANG_CINDEXER_H
|
||||
#define LLVM_CLANG_CINDEXER_H
|
||||
|
||||
#include "clang-c/Index.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
#include "llvm/System/Path.h"
|
||||
#include <vector>
|
||||
|
||||
namespace clang {
|
||||
namespace cxstring {
|
||||
CXString createCXString(const char *String, bool DupString = false);
|
||||
CXString createCXString(llvm::StringRef String, bool DupString = true);
|
||||
}
|
||||
}
|
||||
|
||||
class CIndexer {
|
||||
bool UseExternalASTGeneration;
|
||||
bool OnlyLocalDecls;
|
||||
bool DisplayDiagnostics;
|
||||
|
||||
llvm::sys::Path ClangPath;
|
||||
|
||||
public:
|
||||
CIndexer()
|
||||
: UseExternalASTGeneration(false), OnlyLocalDecls(false),
|
||||
DisplayDiagnostics(false) { }
|
||||
|
||||
/// \brief Whether we only want to see "local" declarations (that did not
|
||||
/// come from a previous precompiled header). If false, we want to see all
|
||||
/// declarations.
|
||||
bool getOnlyLocalDecls() const { return OnlyLocalDecls; }
|
||||
void setOnlyLocalDecls(bool Local = true) { OnlyLocalDecls = Local; }
|
||||
|
||||
bool getDisplayDiagnostics() const { return DisplayDiagnostics; }
|
||||
void setDisplayDiagnostics(bool Display = true) {
|
||||
DisplayDiagnostics = Display;
|
||||
}
|
||||
|
||||
bool getUseExternalASTGeneration() const { return UseExternalASTGeneration; }
|
||||
void setUseExternalASTGeneration(bool Value) {
|
||||
UseExternalASTGeneration = Value;
|
||||
}
|
||||
|
||||
/// \brief Get the path of the clang binary.
|
||||
const llvm::sys::Path& getClangPath();
|
||||
|
||||
/// \brief Get the path of the clang resource files.
|
||||
std::string getClangResourcesPath();
|
||||
};
|
||||
|
||||
namespace clang {
|
||||
/**
|
||||
* \brief Given a set of "unsaved" files, create temporary files and
|
||||
* construct the clang -cc1 argument list needed to perform the remapping.
|
||||
*
|
||||
* \returns true if an error occurred.
|
||||
*/
|
||||
bool RemapFiles(unsigned num_unsaved_files,
|
||||
struct CXUnsavedFile *unsaved_files,
|
||||
std::vector<std::string> &RemapArgs,
|
||||
std::vector<llvm::sys::Path> &TemporaryFiles);
|
||||
}
|
||||
|
||||
#endif
|
@ -1,56 +0,0 @@
|
||||
set(SHARED_LIBRARY TRUE)
|
||||
|
||||
set(LLVM_NO_RTTI 1)
|
||||
|
||||
set(LLVM_USED_LIBS
|
||||
clangFrontend
|
||||
clangDriver
|
||||
clangSema
|
||||
clangAnalysis
|
||||
clangAST
|
||||
clangParse
|
||||
clangLex
|
||||
clangBasic)
|
||||
|
||||
set( LLVM_LINK_COMPONENTS
|
||||
bitreader
|
||||
mc
|
||||
core
|
||||
)
|
||||
|
||||
add_clang_library(CIndex
|
||||
CIndex.cpp
|
||||
CIndexCodeCompletion.cpp
|
||||
CIndexDiagnostic.cpp
|
||||
CIndexInclusionStack.cpp
|
||||
CIndexUSRs.cpp
|
||||
CIndexer.cpp
|
||||
CXCursor.cpp
|
||||
../../include/clang-c/Index.h
|
||||
)
|
||||
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
# FIXME: Deal with LLVM_SUBMIT_VERSION?
|
||||
|
||||
# FIXME: This uses a special darwin-specific exports file in order to
|
||||
# get underscore-prefixed names. It would be better to have build rules
|
||||
# which know how to produce a darwin-suitable exports file from the
|
||||
# regular exports file.
|
||||
set_target_properties(CIndex
|
||||
PROPERTIES
|
||||
LINK_FLAGS "-avoid-version -Wl,-exported_symbols_list -Wl,${CMAKE_CURRENT_SOURCE_DIR}/CIndex.darwin.exports -Wl,-dead_strip -Wl,-seg1addr -Wl,0xE0000000"
|
||||
INSTALL_NAME_DIR "@executable_path/../lib"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(MSVC)
|
||||
# windows.h doesn't compile with /Za
|
||||
get_target_property(NON_ANSI_COMPILE_FLAGS CIndex COMPILE_FLAGS)
|
||||
string(REPLACE /Za "" NON_ANSI_COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
|
||||
set_target_properties(CIndex PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
|
||||
endif(MSVC)
|
||||
|
||||
set_target_properties(CIndex
|
||||
PROPERTIES
|
||||
LINKER_LANGUAGE CXX
|
||||
DEFINE_SYMBOL _CINDEX_LIB_)
|
@ -1,369 +0,0 @@
|
||||
//===- CXCursor.cpp - Routines for manipulating CXCursors -----------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines routines for manipulating CXCursors. It should be the
|
||||
// only file that has internal knowledge of the encoding of the data in
|
||||
// CXCursor.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "CXCursor.h"
|
||||
#include "clang/Frontend/ASTUnit.h"
|
||||
#include "clang/AST/Decl.h"
|
||||
#include "clang/AST/DeclObjC.h"
|
||||
#include "clang/AST/Expr.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
|
||||
using namespace clang;
|
||||
|
||||
CXCursor cxcursor::MakeCXCursorInvalid(CXCursorKind K) {
|
||||
assert(K >= CXCursor_FirstInvalid && K <= CXCursor_LastInvalid);
|
||||
CXCursor C = { K, { 0, 0, 0 } };
|
||||
return C;
|
||||
}
|
||||
|
||||
static CXCursorKind GetCursorKind(Decl *D) {
|
||||
assert(D && "Invalid arguments!");
|
||||
switch (D->getKind()) {
|
||||
case Decl::Enum: return CXCursor_EnumDecl;
|
||||
case Decl::EnumConstant: return CXCursor_EnumConstantDecl;
|
||||
case Decl::Field: return CXCursor_FieldDecl;
|
||||
case Decl::Function:
|
||||
return CXCursor_FunctionDecl;
|
||||
case Decl::ObjCCategory: return CXCursor_ObjCCategoryDecl;
|
||||
case Decl::ObjCCategoryImpl: return CXCursor_ObjCCategoryImplDecl;
|
||||
case Decl::ObjCClass:
|
||||
// FIXME
|
||||
return CXCursor_UnexposedDecl;
|
||||
case Decl::ObjCForwardProtocol:
|
||||
// FIXME
|
||||
return CXCursor_UnexposedDecl;
|
||||
case Decl::ObjCImplementation: return CXCursor_ObjCImplementationDecl;
|
||||
case Decl::ObjCInterface: return CXCursor_ObjCInterfaceDecl;
|
||||
case Decl::ObjCIvar: return CXCursor_ObjCIvarDecl;
|
||||
case Decl::ObjCMethod:
|
||||
return cast<ObjCMethodDecl>(D)->isInstanceMethod()
|
||||
? CXCursor_ObjCInstanceMethodDecl : CXCursor_ObjCClassMethodDecl;
|
||||
case Decl::CXXMethod: return CXCursor_CXXMethod;
|
||||
case Decl::ObjCProperty: return CXCursor_ObjCPropertyDecl;
|
||||
case Decl::ObjCProtocol: return CXCursor_ObjCProtocolDecl;
|
||||
case Decl::ParmVar: return CXCursor_ParmDecl;
|
||||
case Decl::Typedef: return CXCursor_TypedefDecl;
|
||||
case Decl::Var: return CXCursor_VarDecl;
|
||||
default:
|
||||
if (TagDecl *TD = dyn_cast<TagDecl>(D)) {
|
||||
switch (TD->getTagKind()) {
|
||||
case TagDecl::TK_struct: return CXCursor_StructDecl;
|
||||
case TagDecl::TK_class: return CXCursor_ClassDecl;
|
||||
case TagDecl::TK_union: return CXCursor_UnionDecl;
|
||||
case TagDecl::TK_enum: return CXCursor_EnumDecl;
|
||||
}
|
||||
}
|
||||
|
||||
return CXCursor_UnexposedDecl;
|
||||
}
|
||||
|
||||
llvm_unreachable("Invalid Decl");
|
||||
return CXCursor_NotImplemented;
|
||||
}
|
||||
|
||||
static CXCursorKind GetCursorKind(const Attr *A) {
|
||||
assert(A && "Invalid arguments!");
|
||||
switch (A->getKind()) {
|
||||
default: break;
|
||||
case Attr::IBActionKind: return CXCursor_IBActionAttr;
|
||||
case Attr::IBOutletKind: return CXCursor_IBOutletAttr;
|
||||
}
|
||||
|
||||
return CXCursor_UnexposedAttr;
|
||||
}
|
||||
|
||||
CXCursor cxcursor::MakeCXCursor(const Attr *A, Decl *Parent, ASTUnit *TU) {
|
||||
assert(A && Parent && TU && "Invalid arguments!");
|
||||
CXCursor C = { GetCursorKind(A), { Parent, (void*)A, TU } };
|
||||
return C;
|
||||
}
|
||||
|
||||
CXCursor cxcursor::MakeCXCursor(Decl *D, ASTUnit *TU) {
|
||||
assert(D && TU && "Invalid arguments!");
|
||||
CXCursor C = { GetCursorKind(D), { D, 0, TU } };
|
||||
return C;
|
||||
}
|
||||
|
||||
CXCursor cxcursor::MakeCXCursor(Stmt *S, Decl *Parent, ASTUnit *TU) {
|
||||
assert(S && TU && "Invalid arguments!");
|
||||
CXCursorKind K = CXCursor_NotImplemented;
|
||||
|
||||
switch (S->getStmtClass()) {
|
||||
case Stmt::NoStmtClass:
|
||||
break;
|
||||
|
||||
case Stmt::NullStmtClass:
|
||||
case Stmt::CompoundStmtClass:
|
||||
case Stmt::CaseStmtClass:
|
||||
case Stmt::DefaultStmtClass:
|
||||
case Stmt::LabelStmtClass:
|
||||
case Stmt::IfStmtClass:
|
||||
case Stmt::SwitchStmtClass:
|
||||
case Stmt::WhileStmtClass:
|
||||
case Stmt::DoStmtClass:
|
||||
case Stmt::ForStmtClass:
|
||||
case Stmt::GotoStmtClass:
|
||||
case Stmt::IndirectGotoStmtClass:
|
||||
case Stmt::ContinueStmtClass:
|
||||
case Stmt::BreakStmtClass:
|
||||
case Stmt::ReturnStmtClass:
|
||||
case Stmt::DeclStmtClass:
|
||||
case Stmt::SwitchCaseClass:
|
||||
case Stmt::AsmStmtClass:
|
||||
case Stmt::ObjCAtTryStmtClass:
|
||||
case Stmt::ObjCAtCatchStmtClass:
|
||||
case Stmt::ObjCAtFinallyStmtClass:
|
||||
case Stmt::ObjCAtThrowStmtClass:
|
||||
case Stmt::ObjCAtSynchronizedStmtClass:
|
||||
case Stmt::ObjCForCollectionStmtClass:
|
||||
case Stmt::CXXCatchStmtClass:
|
||||
case Stmt::CXXTryStmtClass:
|
||||
K = CXCursor_UnexposedStmt;
|
||||
break;
|
||||
|
||||
case Stmt::PredefinedExprClass:
|
||||
case Stmt::IntegerLiteralClass:
|
||||
case Stmt::FloatingLiteralClass:
|
||||
case Stmt::ImaginaryLiteralClass:
|
||||
case Stmt::StringLiteralClass:
|
||||
case Stmt::CharacterLiteralClass:
|
||||
case Stmt::ParenExprClass:
|
||||
case Stmt::UnaryOperatorClass:
|
||||
case Stmt::SizeOfAlignOfExprClass:
|
||||
case Stmt::ArraySubscriptExprClass:
|
||||
case Stmt::BinaryOperatorClass:
|
||||
case Stmt::CompoundAssignOperatorClass:
|
||||
case Stmt::ConditionalOperatorClass:
|
||||
case Stmt::ImplicitCastExprClass:
|
||||
case Stmt::CStyleCastExprClass:
|
||||
case Stmt::CompoundLiteralExprClass:
|
||||
case Stmt::ExtVectorElementExprClass:
|
||||
case Stmt::InitListExprClass:
|
||||
case Stmt::DesignatedInitExprClass:
|
||||
case Stmt::ImplicitValueInitExprClass:
|
||||
case Stmt::ParenListExprClass:
|
||||
case Stmt::VAArgExprClass:
|
||||
case Stmt::AddrLabelExprClass:
|
||||
case Stmt::StmtExprClass:
|
||||
case Stmt::TypesCompatibleExprClass:
|
||||
case Stmt::ChooseExprClass:
|
||||
case Stmt::GNUNullExprClass:
|
||||
case Stmt::CXXStaticCastExprClass:
|
||||
case Stmt::CXXDynamicCastExprClass:
|
||||
case Stmt::CXXReinterpretCastExprClass:
|
||||
case Stmt::CXXConstCastExprClass:
|
||||
case Stmt::CXXFunctionalCastExprClass:
|
||||
case Stmt::CXXTypeidExprClass:
|
||||
case Stmt::CXXBoolLiteralExprClass:
|
||||
case Stmt::CXXNullPtrLiteralExprClass:
|
||||
case Stmt::CXXThisExprClass:
|
||||
case Stmt::CXXThrowExprClass:
|
||||
case Stmt::CXXDefaultArgExprClass:
|
||||
case Stmt::CXXZeroInitValueExprClass:
|
||||
case Stmt::CXXNewExprClass:
|
||||
case Stmt::CXXDeleteExprClass:
|
||||
case Stmt::CXXPseudoDestructorExprClass:
|
||||
case Stmt::UnresolvedLookupExprClass:
|
||||
case Stmt::UnaryTypeTraitExprClass:
|
||||
case Stmt::DependentScopeDeclRefExprClass:
|
||||
case Stmt::CXXBindTemporaryExprClass:
|
||||
case Stmt::CXXBindReferenceExprClass:
|
||||
case Stmt::CXXExprWithTemporariesClass:
|
||||
case Stmt::CXXUnresolvedConstructExprClass:
|
||||
case Stmt::CXXDependentScopeMemberExprClass:
|
||||
case Stmt::UnresolvedMemberExprClass:
|
||||
case Stmt::ObjCStringLiteralClass:
|
||||
case Stmt::ObjCEncodeExprClass:
|
||||
case Stmt::ObjCSelectorExprClass:
|
||||
case Stmt::ObjCProtocolExprClass:
|
||||
case Stmt::ObjCImplicitSetterGetterRefExprClass:
|
||||
case Stmt::ObjCSuperExprClass:
|
||||
case Stmt::ObjCIsaExprClass:
|
||||
case Stmt::ShuffleVectorExprClass:
|
||||
case Stmt::BlockExprClass:
|
||||
K = CXCursor_UnexposedExpr;
|
||||
break;
|
||||
case Stmt::DeclRefExprClass:
|
||||
case Stmt::BlockDeclRefExprClass:
|
||||
// FIXME: UnresolvedLookupExpr?
|
||||
// FIXME: DependentScopeDeclRefExpr?
|
||||
K = CXCursor_DeclRefExpr;
|
||||
break;
|
||||
|
||||
case Stmt::MemberExprClass:
|
||||
case Stmt::ObjCIvarRefExprClass:
|
||||
case Stmt::ObjCPropertyRefExprClass:
|
||||
// FIXME: UnresolvedMemberExpr?
|
||||
// FIXME: CXXDependentScopeMemberExpr?
|
||||
K = CXCursor_MemberRefExpr;
|
||||
break;
|
||||
|
||||
case Stmt::CallExprClass:
|
||||
case Stmt::CXXOperatorCallExprClass:
|
||||
case Stmt::CXXMemberCallExprClass:
|
||||
case Stmt::CXXConstructExprClass:
|
||||
case Stmt::CXXTemporaryObjectExprClass:
|
||||
// FIXME: CXXUnresolvedConstructExpr
|
||||
// FIXME: ObjCImplicitSetterGetterRefExpr?
|
||||
K = CXCursor_CallExpr;
|
||||
break;
|
||||
|
||||
case Stmt::ObjCMessageExprClass:
|
||||
K = CXCursor_ObjCMessageExpr;
|
||||
break;
|
||||
}
|
||||
|
||||
CXCursor C = { K, { Parent, S, TU } };
|
||||
return C;
|
||||
}
|
||||
|
||||
CXCursor cxcursor::MakeCursorObjCSuperClassRef(ObjCInterfaceDecl *Super,
|
||||
SourceLocation Loc,
|
||||
ASTUnit *TU) {
|
||||
assert(Super && TU && "Invalid arguments!");
|
||||
void *RawLoc = reinterpret_cast<void *>(Loc.getRawEncoding());
|
||||
CXCursor C = { CXCursor_ObjCSuperClassRef, { Super, RawLoc, TU } };
|
||||
return C;
|
||||
}
|
||||
|
||||
std::pair<ObjCInterfaceDecl *, SourceLocation>
|
||||
cxcursor::getCursorObjCSuperClassRef(CXCursor C) {
|
||||
assert(C.kind == CXCursor_ObjCSuperClassRef);
|
||||
return std::make_pair(static_cast<ObjCInterfaceDecl *>(C.data[0]),
|
||||
SourceLocation::getFromRawEncoding(
|
||||
reinterpret_cast<uintptr_t>(C.data[1])));
|
||||
}
|
||||
|
||||
CXCursor cxcursor::MakeCursorObjCProtocolRef(ObjCProtocolDecl *Super,
|
||||
SourceLocation Loc,
|
||||
ASTUnit *TU) {
|
||||
assert(Super && TU && "Invalid arguments!");
|
||||
void *RawLoc = reinterpret_cast<void *>(Loc.getRawEncoding());
|
||||
CXCursor C = { CXCursor_ObjCProtocolRef, { Super, RawLoc, TU } };
|
||||
return C;
|
||||
}
|
||||
|
||||
std::pair<ObjCProtocolDecl *, SourceLocation>
|
||||
cxcursor::getCursorObjCProtocolRef(CXCursor C) {
|
||||
assert(C.kind == CXCursor_ObjCProtocolRef);
|
||||
return std::make_pair(static_cast<ObjCProtocolDecl *>(C.data[0]),
|
||||
SourceLocation::getFromRawEncoding(
|
||||
reinterpret_cast<uintptr_t>(C.data[1])));
|
||||
}
|
||||
|
||||
CXCursor cxcursor::MakeCursorObjCClassRef(ObjCInterfaceDecl *Class,
|
||||
SourceLocation Loc,
|
||||
ASTUnit *TU) {
|
||||
// 'Class' can be null for invalid code.
|
||||
if (!Class)
|
||||
return MakeCXCursorInvalid(CXCursor_InvalidCode);
|
||||
assert(TU && "Invalid arguments!");
|
||||
void *RawLoc = reinterpret_cast<void *>(Loc.getRawEncoding());
|
||||
CXCursor C = { CXCursor_ObjCClassRef, { Class, RawLoc, TU } };
|
||||
return C;
|
||||
}
|
||||
|
||||
std::pair<ObjCInterfaceDecl *, SourceLocation>
|
||||
cxcursor::getCursorObjCClassRef(CXCursor C) {
|
||||
assert(C.kind == CXCursor_ObjCClassRef);
|
||||
return std::make_pair(static_cast<ObjCInterfaceDecl *>(C.data[0]),
|
||||
SourceLocation::getFromRawEncoding(
|
||||
reinterpret_cast<uintptr_t>(C.data[1])));
|
||||
}
|
||||
|
||||
CXCursor cxcursor::MakeCursorTypeRef(TypeDecl *Type, SourceLocation Loc,
|
||||
ASTUnit *TU) {
|
||||
assert(Type && TU && "Invalid arguments!");
|
||||
void *RawLoc = reinterpret_cast<void *>(Loc.getRawEncoding());
|
||||
CXCursor C = { CXCursor_TypeRef, { Type, RawLoc, TU } };
|
||||
return C;
|
||||
}
|
||||
|
||||
std::pair<TypeDecl *, SourceLocation>
|
||||
cxcursor::getCursorTypeRef(CXCursor C) {
|
||||
assert(C.kind == CXCursor_TypeRef);
|
||||
return std::make_pair(static_cast<TypeDecl *>(C.data[0]),
|
||||
SourceLocation::getFromRawEncoding(
|
||||
reinterpret_cast<uintptr_t>(C.data[1])));
|
||||
}
|
||||
|
||||
CXCursor cxcursor::MakePreprocessingDirectiveCursor(SourceRange Range,
|
||||
ASTUnit *TU) {
|
||||
CXCursor C = { CXCursor_PreprocessingDirective,
|
||||
{ reinterpret_cast<void *>(Range.getBegin().getRawEncoding()),
|
||||
reinterpret_cast<void *>(Range.getEnd().getRawEncoding()),
|
||||
TU }
|
||||
};
|
||||
return C;
|
||||
}
|
||||
|
||||
SourceRange cxcursor::getCursorPreprocessingDirective(CXCursor C) {
|
||||
assert(C.kind == CXCursor_PreprocessingDirective);
|
||||
return SourceRange(SourceLocation::getFromRawEncoding(
|
||||
reinterpret_cast<uintptr_t> (C.data[0])),
|
||||
SourceLocation::getFromRawEncoding(
|
||||
reinterpret_cast<uintptr_t> (C.data[1])));
|
||||
}
|
||||
|
||||
CXCursor cxcursor::MakeMacroDefinitionCursor(MacroDefinition *MI, ASTUnit *TU) {
|
||||
CXCursor C = { CXCursor_MacroDefinition, { MI, 0, TU } };
|
||||
return C;
|
||||
}
|
||||
|
||||
MacroDefinition *cxcursor::getCursorMacroDefinition(CXCursor C) {
|
||||
assert(C.kind == CXCursor_MacroDefinition);
|
||||
return static_cast<MacroDefinition *>(C.data[0]);
|
||||
}
|
||||
|
||||
CXCursor cxcursor::MakeMacroInstantiationCursor(MacroInstantiation *MI,
|
||||
ASTUnit *TU) {
|
||||
CXCursor C = { CXCursor_MacroInstantiation, { MI, 0, TU } };
|
||||
return C;
|
||||
}
|
||||
|
||||
MacroInstantiation *cxcursor::getCursorMacroInstantiation(CXCursor C) {
|
||||
assert(C.kind == CXCursor_MacroInstantiation);
|
||||
return static_cast<MacroInstantiation *>(C.data[0]);
|
||||
}
|
||||
|
||||
Decl *cxcursor::getCursorDecl(CXCursor Cursor) {
|
||||
return (Decl *)Cursor.data[0];
|
||||
}
|
||||
|
||||
Expr *cxcursor::getCursorExpr(CXCursor Cursor) {
|
||||
return dyn_cast_or_null<Expr>(getCursorStmt(Cursor));
|
||||
}
|
||||
|
||||
Stmt *cxcursor::getCursorStmt(CXCursor Cursor) {
|
||||
if (Cursor.kind == CXCursor_ObjCSuperClassRef ||
|
||||
Cursor.kind == CXCursor_ObjCProtocolRef ||
|
||||
Cursor.kind == CXCursor_ObjCClassRef)
|
||||
return 0;
|
||||
|
||||
return (Stmt *)Cursor.data[1];
|
||||
}
|
||||
|
||||
ASTContext &cxcursor::getCursorContext(CXCursor Cursor) {
|
||||
return getCursorASTUnit(Cursor)->getASTContext();
|
||||
}
|
||||
|
||||
ASTUnit *cxcursor::getCursorASTUnit(CXCursor Cursor) {
|
||||
return static_cast<ASTUnit *>(Cursor.data[2]);
|
||||
}
|
||||
|
||||
bool cxcursor::operator==(CXCursor X, CXCursor Y) {
|
||||
return X.kind == Y.kind && X.data[0] == Y.data[0] && X.data[1] == Y.data[1] &&
|
||||
X.data[2] == Y.data[2];
|
||||
}
|
@ -1,112 +0,0 @@
|
||||
//===- CXCursor.h - Routines for manipulating CXCursors -------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines routines for manipulating CXCursors.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_CLANG_CXCURSOR_H
|
||||
#define LLVM_CLANG_CXCURSOR_H
|
||||
|
||||
#include "clang-c/Index.h"
|
||||
#include "clang/Basic/SourceLocation.h"
|
||||
#include <utility>
|
||||
|
||||
namespace clang {
|
||||
|
||||
class ASTContext;
|
||||
class ASTUnit;
|
||||
class Attr;
|
||||
class Decl;
|
||||
class Expr;
|
||||
class MacroDefinition;
|
||||
class MacroInstantiation;
|
||||
class NamedDecl;
|
||||
class ObjCInterfaceDecl;
|
||||
class ObjCProtocolDecl;
|
||||
class Stmt;
|
||||
class TypeDecl;
|
||||
|
||||
namespace cxcursor {
|
||||
|
||||
CXCursor MakeCXCursor(const clang::Attr *A, clang::Decl *Parent, ASTUnit *TU);
|
||||
CXCursor MakeCXCursor(clang::Decl *D, ASTUnit *TU);
|
||||
CXCursor MakeCXCursor(clang::Stmt *S, clang::Decl *Parent, ASTUnit *TU);
|
||||
CXCursor MakeCXCursorInvalid(CXCursorKind K);
|
||||
|
||||
/// \brief Create an Objective-C superclass reference at the given location.
|
||||
CXCursor MakeCursorObjCSuperClassRef(ObjCInterfaceDecl *Super,
|
||||
SourceLocation Loc,
|
||||
ASTUnit *TU);
|
||||
|
||||
/// \brief Unpack an ObjCSuperClassRef cursor into the interface it references
|
||||
/// and optionally the location where the reference occurred.
|
||||
std::pair<ObjCInterfaceDecl *, SourceLocation>
|
||||
getCursorObjCSuperClassRef(CXCursor C);
|
||||
|
||||
/// \brief Create an Objective-C protocol reference at the given location.
|
||||
CXCursor MakeCursorObjCProtocolRef(ObjCProtocolDecl *Proto, SourceLocation Loc,
|
||||
ASTUnit *TU);
|
||||
|
||||
/// \brief Unpack an ObjCProtocolRef cursor into the protocol it references
|
||||
/// and optionally the location where the reference occurred.
|
||||
std::pair<ObjCProtocolDecl *, SourceLocation>
|
||||
getCursorObjCProtocolRef(CXCursor C);
|
||||
|
||||
/// \brief Create an Objective-C class reference at the given location.
|
||||
CXCursor MakeCursorObjCClassRef(ObjCInterfaceDecl *Class, SourceLocation Loc,
|
||||
ASTUnit *TU);
|
||||
|
||||
/// \brief Unpack an ObjCClassRef cursor into the class it references
|
||||
/// and optionally the location where the reference occurred.
|
||||
std::pair<ObjCInterfaceDecl *, SourceLocation>
|
||||
getCursorObjCClassRef(CXCursor C);
|
||||
|
||||
/// \brief Create a type reference at the given location.
|
||||
CXCursor MakeCursorTypeRef(TypeDecl *Type, SourceLocation Loc, ASTUnit *TU);
|
||||
|
||||
/// \brief Unpack a TypeRef cursor into the class it references
|
||||
/// and optionally the location where the reference occurred.
|
||||
std::pair<TypeDecl *, SourceLocation> getCursorTypeRef(CXCursor C);
|
||||
|
||||
/// \brief Create a preprocessing directive cursor.
|
||||
CXCursor MakePreprocessingDirectiveCursor(SourceRange Range, ASTUnit *TU);
|
||||
|
||||
/// \brief Unpack a given preprocessing directive to retrieve its source range.
|
||||
SourceRange getCursorPreprocessingDirective(CXCursor C);
|
||||
|
||||
/// \brief Create a macro definition cursor.
|
||||
CXCursor MakeMacroDefinitionCursor(MacroDefinition *, ASTUnit *TU);
|
||||
|
||||
/// \brief Unpack a given macro definition cursor to retrieve its
|
||||
/// source range.
|
||||
MacroDefinition *getCursorMacroDefinition(CXCursor C);
|
||||
|
||||
/// \brief Create a macro instantiation cursor.
|
||||
CXCursor MakeMacroInstantiationCursor(MacroInstantiation *, ASTUnit *TU);
|
||||
|
||||
/// \brief Unpack a given macro instantiation cursor to retrieve its
|
||||
/// source range.
|
||||
MacroInstantiation *getCursorMacroInstantiation(CXCursor C);
|
||||
|
||||
Decl *getCursorDecl(CXCursor Cursor);
|
||||
Expr *getCursorExpr(CXCursor Cursor);
|
||||
Stmt *getCursorStmt(CXCursor Cursor);
|
||||
ASTContext &getCursorContext(CXCursor Cursor);
|
||||
ASTUnit *getCursorASTUnit(CXCursor Cursor);
|
||||
|
||||
bool operator==(CXCursor X, CXCursor Y);
|
||||
|
||||
inline bool operator!=(CXCursor X, CXCursor Y) {
|
||||
return !(X == Y);
|
||||
}
|
||||
|
||||
}} // end namespace: clang::cxcursor
|
||||
|
||||
#endif
|
@ -1,75 +0,0 @@
|
||||
//===- CXSourceLocation.h - CXSourceLocations Utilities ---------*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines routines for manipulating CXSourceLocations.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_CLANG_CXSOURCELOCATION_H
|
||||
#define LLVM_CLANG_CXSOURCELOCATION_H
|
||||
|
||||
#include "clang-c/Index.h"
|
||||
#include "clang/Basic/SourceLocation.h"
|
||||
#include "clang/Basic/LangOptions.h"
|
||||
#include "clang/AST/ASTContext.h"
|
||||
|
||||
namespace clang {
|
||||
|
||||
class SourceManager;
|
||||
|
||||
namespace cxloc {
|
||||
|
||||
/// \brief Translate a Clang source location into a CIndex source location.
|
||||
static inline CXSourceLocation
|
||||
translateSourceLocation(const SourceManager &SM, const LangOptions &LangOpts,
|
||||
SourceLocation Loc) {
|
||||
CXSourceLocation Result = { { (void*) &SM, (void*) &LangOpts, },
|
||||
Loc.getRawEncoding() };
|
||||
return Result;
|
||||
}
|
||||
|
||||
/// \brief Translate a Clang source location into a CIndex source location.
|
||||
static inline CXSourceLocation translateSourceLocation(ASTContext &Context,
|
||||
SourceLocation Loc) {
|
||||
return translateSourceLocation(Context.getSourceManager(),
|
||||
Context.getLangOptions(),
|
||||
Loc);
|
||||
}
|
||||
|
||||
/// \brief Translate a Clang source range into a CIndex source range.
|
||||
///
|
||||
/// Clang internally represents ranges where the end location points to the
|
||||
/// start of the token at the end. However, for external clients it is more
|
||||
/// useful to have a CXSourceRange be a proper half-open interval. This routine
|
||||
/// does the appropriate translation.
|
||||
CXSourceRange translateSourceRange(const SourceManager &SM,
|
||||
const LangOptions &LangOpts,
|
||||
SourceRange R);
|
||||
|
||||
/// \brief Translate a Clang source range into a CIndex source range.
|
||||
static inline CXSourceRange translateSourceRange(ASTContext &Context,
|
||||
SourceRange R) {
|
||||
return translateSourceRange(Context.getSourceManager(),
|
||||
Context.getLangOptions(),
|
||||
R);
|
||||
}
|
||||
|
||||
static inline SourceLocation translateSourceLocation(CXSourceLocation L) {
|
||||
return SourceLocation::getFromRawEncoding(L.int_data);
|
||||
}
|
||||
|
||||
static inline SourceRange translateCXSourceRange(CXSourceRange R) {
|
||||
return SourceRange(SourceLocation::getFromRawEncoding(R.begin_int_data),
|
||||
SourceLocation::getFromRawEncoding(R.end_int_data));
|
||||
}
|
||||
|
||||
|
||||
}} // end namespace: clang::cxloc
|
||||
|
||||
#endif
|
@ -1,55 +0,0 @@
|
||||
##===- tools/CIndex/Makefile -------------------------------*- Makefile -*-===##
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is distributed under the University of Illinois Open Source
|
||||
# License. See LICENSE.TXT for details.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
LEVEL = ../../../..
|
||||
LIBRARYNAME = CIndex
|
||||
|
||||
EXPORTED_SYMBOL_FILE = $(PROJ_SRC_DIR)/CIndex.exports
|
||||
|
||||
CPP.Flags += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
|
||||
|
||||
# Include this here so we can get the configuration of the targets
|
||||
# that have been configured for construction. We have to do this
|
||||
# early so we can set up LINK_COMPONENTS before including Makefile.rules
|
||||
include $(LEVEL)/Makefile.config
|
||||
|
||||
LINK_LIBS_IN_SHARED = 1
|
||||
SHARED_LIBRARY = 1
|
||||
|
||||
LINK_COMPONENTS := bitreader mc core
|
||||
USEDLIBS = clangFrontend.a clangDriver.a clangSema.a \
|
||||
clangAnalysis.a clangAST.a clangParse.a clangLex.a clangBasic.a
|
||||
|
||||
include $(LEVEL)/Makefile.common
|
||||
|
||||
##===----------------------------------------------------------------------===##
|
||||
# FIXME: This is copied from the 'lto' makefile. Should we share this?
|
||||
##===----------------------------------------------------------------------===##
|
||||
|
||||
ifeq ($(HOST_OS),Darwin)
|
||||
# set dylib internal version number to llvmCore submission number
|
||||
ifdef LLVM_SUBMIT_VERSION
|
||||
LLVMLibsOptions := $(LLVMLibsOptions) -Wl,-current_version \
|
||||
-Wl,$(LLVM_SUBMIT_VERSION).$(LLVM_SUBMIT_SUBVERSION) \
|
||||
-Wl,-compatibility_version -Wl,1
|
||||
endif
|
||||
# extra options to override libtool defaults
|
||||
LLVMLibsOptions := $(LLVMLibsOptions) \
|
||||
-avoid-version \
|
||||
-Wl,-dead_strip \
|
||||
-Wl,-seg1addr -Wl,0xE0000000
|
||||
|
||||
# Mac OS X 10.4 and earlier tools do not allow a second -install_name on command line
|
||||
DARWIN_VERS := $(shell echo $(TARGET_TRIPLE) | sed 's/.*darwin\([0-9]*\).*/\1/')
|
||||
ifneq ($(DARWIN_VERS),8)
|
||||
LLVMLibsOptions := $(LLVMLibsOptions) \
|
||||
-no-undefined -Wl,-install_name \
|
||||
-Wl,"@executable_path/../lib/lib$(LIBRARYNAME)$(SHLIBEXT)"
|
||||
endif
|
||||
endif
|
@ -1,23 +0,0 @@
|
||||
set(LLVM_NO_RTTI 1)
|
||||
|
||||
set( LLVM_USED_LIBS
|
||||
clangIndex
|
||||
clangFrontend
|
||||
clangDriver
|
||||
clangSema
|
||||
clangAnalysis
|
||||
clangAST
|
||||
clangParse
|
||||
clangLex
|
||||
clangBasic
|
||||
)
|
||||
|
||||
set( LLVM_LINK_COMPONENTS
|
||||
bitreader
|
||||
mc
|
||||
core
|
||||
)
|
||||
|
||||
add_clang_executable(index-test
|
||||
index-test.cpp
|
||||
)
|
@ -1,25 +0,0 @@
|
||||
##===- tools/index-test/Makefile ---------------------------*- Makefile -*-===##
|
||||
#
|
||||
# The LLVM Compiler Infrastructure
|
||||
#
|
||||
# This file is distributed under the University of Illinois Open Source
|
||||
# License. See LICENSE.TXT for details.
|
||||
#
|
||||
##===----------------------------------------------------------------------===##
|
||||
LEVEL = ../../../..
|
||||
|
||||
TOOLNAME = index-test
|
||||
CPPFLAGS += -I$(PROJ_SRC_DIR)/../../include -I$(PROJ_OBJ_DIR)/../../include
|
||||
CXXFLAGS = -fno-rtti
|
||||
NO_INSTALL = 1
|
||||
|
||||
# No plugins, optimize startup time.
|
||||
TOOL_NO_EXPORTS = 1
|
||||
|
||||
include $(LEVEL)/Makefile.config
|
||||
|
||||
LINK_COMPONENTS := bitreader mc core
|
||||
USEDLIBS = clangIndex.a clangFrontend.a clangDriver.a clangSema.a \
|
||||
clangAnalysis.a clangAST.a clangParse.a clangLex.a clangBasic.a
|
||||
|
||||
include $(LLVM_SRC_ROOT)/Makefile.rules
|
@ -1,334 +0,0 @@
|
||||
//===--- index-test.cpp - Indexing test bed -------------------------------===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This utility may be invoked in the following manner:
|
||||
// index-test --help - Output help info.
|
||||
// index-test [options] - Read from stdin.
|
||||
// index-test [options] file - Read from "file".
|
||||
// index-test [options] file1 file2 - Read these files.
|
||||
//
|
||||
// Files must be AST files.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// -point-at [file:line:column]
|
||||
// Point at a declaration/statement/expression. If no other operation is
|
||||
// specified, prints some info about it.
|
||||
//
|
||||
// -print-refs
|
||||
// Print ASTLocations that reference the -point-at node
|
||||
//
|
||||
// -print-defs
|
||||
// Print ASTLocations that define the -point-at node
|
||||
//
|
||||
// -print-decls
|
||||
// Print ASTLocations that declare the -point-at node
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "clang/Index/Program.h"
|
||||
#include "clang/Index/Indexer.h"
|
||||
#include "clang/Index/Entity.h"
|
||||
#include "clang/Index/TranslationUnit.h"
|
||||
#include "clang/Index/ASTLocation.h"
|
||||
#include "clang/Index/DeclReferenceMap.h"
|
||||
#include "clang/Index/SelectorMap.h"
|
||||
#include "clang/Index/Handlers.h"
|
||||
#include "clang/Index/Analyzer.h"
|
||||
#include "clang/Index/Utils.h"
|
||||
#include "clang/Frontend/ASTUnit.h"
|
||||
#include "clang/Frontend/CompilerInstance.h"
|
||||
#include "clang/Frontend/CompilerInvocation.h"
|
||||
#include "clang/Frontend/DiagnosticOptions.h"
|
||||
#include "clang/Frontend/TextDiagnosticPrinter.h"
|
||||
#include "clang/Frontend/CommandLineSourceLoc.h"
|
||||
#include "clang/AST/DeclObjC.h"
|
||||
#include "clang/AST/ExprObjC.h"
|
||||
#include "clang/Basic/FileManager.h"
|
||||
#include "clang/Basic/SourceManager.h"
|
||||
#include "llvm/Support/CommandLine.h"
|
||||
#include "llvm/Support/ManagedStatic.h"
|
||||
#include "llvm/Support/PrettyStackTrace.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/System/Signals.h"
|
||||
using namespace clang;
|
||||
using namespace idx;
|
||||
|
||||
class TUnit : public TranslationUnit {
|
||||
public:
|
||||
TUnit(ASTUnit *ast, const std::string &filename)
|
||||
: AST(ast), Filename(filename),
|
||||
DeclRefMap(ast->getASTContext()),
|
||||
SelMap(ast->getASTContext()) { }
|
||||
|
||||
virtual ASTContext &getASTContext() { return AST->getASTContext(); }
|
||||
virtual DeclReferenceMap &getDeclReferenceMap() { return DeclRefMap; }
|
||||
virtual SelectorMap &getSelectorMap() { return SelMap; }
|
||||
|
||||
llvm::OwningPtr<ASTUnit> AST;
|
||||
std::string Filename;
|
||||
DeclReferenceMap DeclRefMap;
|
||||
SelectorMap SelMap;
|
||||
};
|
||||
|
||||
static llvm::cl::list<ParsedSourceLocation>
|
||||
PointAtLocation("point-at", llvm::cl::Optional,
|
||||
llvm::cl::value_desc("source-location"),
|
||||
llvm::cl::desc("Point at the given source location of the first AST file"));
|
||||
|
||||
enum ProgActions {
|
||||
PrintPoint, // Just print the point-at node
|
||||
PrintRefs, // Print references of the point-at node
|
||||
PrintDefs, // Print definitions of the point-at node
|
||||
PrintDecls // Print declarations of the point-at node
|
||||
};
|
||||
|
||||
static llvm::cl::opt<ProgActions>
|
||||
ProgAction(
|
||||
llvm::cl::desc("Choose action to perform on the pointed-at AST node:"),
|
||||
llvm::cl::ZeroOrMore,
|
||||
llvm::cl::init(PrintPoint),
|
||||
llvm::cl::values(
|
||||
clEnumValN(PrintRefs, "print-refs",
|
||||
"Print references"),
|
||||
clEnumValN(PrintDefs, "print-defs",
|
||||
"Print definitions"),
|
||||
clEnumValN(PrintDecls, "print-decls",
|
||||
"Print declarations"),
|
||||
clEnumValEnd));
|
||||
|
||||
static llvm::cl::opt<bool>
|
||||
DisableFree("disable-free",
|
||||
llvm::cl::desc("Disable freeing of memory on exit"),
|
||||
llvm::cl::init(false));
|
||||
|
||||
static bool HadErrors = false;
|
||||
|
||||
static void ProcessObjCMessage(ObjCMessageExpr *Msg, Indexer &Idxer) {
|
||||
llvm::raw_ostream &OS = llvm::outs();
|
||||
typedef Storing<TULocationHandler> ResultsTy;
|
||||
ResultsTy Results;
|
||||
|
||||
Analyzer Analyz(Idxer.getProgram(), Idxer);
|
||||
|
||||
switch (ProgAction) {
|
||||
default: assert(0);
|
||||
case PrintRefs:
|
||||
llvm::errs() << "Error: Cannot -print-refs on a ObjC message expression\n";
|
||||
HadErrors = true;
|
||||
return;
|
||||
|
||||
case PrintDecls: {
|
||||
Analyz.FindObjCMethods(Msg, Results);
|
||||
for (ResultsTy::iterator
|
||||
I = Results.begin(), E = Results.end(); I != E; ++I)
|
||||
I->print(OS);
|
||||
break;
|
||||
}
|
||||
|
||||
case PrintDefs: {
|
||||
Analyz.FindObjCMethods(Msg, Results);
|
||||
for (ResultsTy::iterator
|
||||
I = Results.begin(), E = Results.end(); I != E; ++I) {
|
||||
const ObjCMethodDecl *D = cast<ObjCMethodDecl>(I->AsDecl());
|
||||
if (D->isThisDeclarationADefinition())
|
||||
I->print(OS);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static void ProcessASTLocation(ASTLocation ASTLoc, Indexer &Idxer) {
|
||||
assert(ASTLoc.isValid());
|
||||
|
||||
if (ObjCMessageExpr *Msg =
|
||||
dyn_cast_or_null<ObjCMessageExpr>(ASTLoc.dyn_AsStmt()))
|
||||
return ProcessObjCMessage(Msg, Idxer);
|
||||
|
||||
Decl *D = ASTLoc.getReferencedDecl();
|
||||
if (D == 0) {
|
||||
llvm::errs() << "Error: Couldn't get referenced Decl for the ASTLocation\n";
|
||||
HadErrors = true;
|
||||
return;
|
||||
}
|
||||
|
||||
llvm::raw_ostream &OS = llvm::outs();
|
||||
typedef Storing<TULocationHandler> ResultsTy;
|
||||
ResultsTy Results;
|
||||
|
||||
Analyzer Analyz(Idxer.getProgram(), Idxer);
|
||||
|
||||
switch (ProgAction) {
|
||||
default: assert(0);
|
||||
case PrintRefs: {
|
||||
Analyz.FindReferences(D, Results);
|
||||
for (ResultsTy::iterator
|
||||
I = Results.begin(), E = Results.end(); I != E; ++I)
|
||||
I->print(OS);
|
||||
break;
|
||||
}
|
||||
|
||||
case PrintDecls: {
|
||||
Analyz.FindDeclarations(D, Results);
|
||||
for (ResultsTy::iterator
|
||||
I = Results.begin(), E = Results.end(); I != E; ++I)
|
||||
I->print(OS);
|
||||
break;
|
||||
}
|
||||
|
||||
case PrintDefs: {
|
||||
Analyz.FindDeclarations(D, Results);
|
||||
for (ResultsTy::iterator
|
||||
I = Results.begin(), E = Results.end(); I != E; ++I) {
|
||||
const Decl *D = I->AsDecl();
|
||||
bool isDef = false;
|
||||
if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D))
|
||||
isDef = FD->isThisDeclarationADefinition();
|
||||
else if (const VarDecl *VD = dyn_cast<VarDecl>(D))
|
||||
isDef = VD->getInit() != 0;
|
||||
else if (const ObjCMethodDecl *MD = dyn_cast<ObjCMethodDecl>(D))
|
||||
isDef = MD->isThisDeclarationADefinition();
|
||||
|
||||
if (isDef)
|
||||
I->print(OS);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static llvm::cl::opt<bool>
|
||||
ASTFromSource("ast-from-source",
|
||||
llvm::cl::desc("Treat the inputs as source files to parse"));
|
||||
|
||||
static llvm::cl::list<std::string>
|
||||
CompilerArgs("arg", llvm::cl::desc("Extra arguments to use during parsing"));
|
||||
|
||||
static llvm::cl::list<std::string>
|
||||
InputFilenames(llvm::cl::Positional, llvm::cl::desc("<input AST files>"));
|
||||
|
||||
ASTUnit *CreateFromSource(const std::string &Filename, Diagnostic &Diags,
|
||||
const char *Argv0) {
|
||||
llvm::SmallVector<const char *, 16> Args;
|
||||
Args.push_back(Filename.c_str());
|
||||
for (unsigned i = 0, e = CompilerArgs.size(); i != e; ++i)
|
||||
Args.push_back(CompilerArgs[i].c_str());
|
||||
|
||||
void *MainAddr = (void*) (intptr_t) CreateFromSource;
|
||||
std::string ResourceDir =
|
||||
CompilerInvocation::GetResourcesPath(Argv0, MainAddr);
|
||||
return ASTUnit::LoadFromCommandLine(Args.data(), Args.data() + Args.size(),
|
||||
Diags, ResourceDir);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
llvm::sys::PrintStackTraceOnErrorSignal();
|
||||
llvm::PrettyStackTraceProgram X(argc, argv);
|
||||
llvm::cl::ParseCommandLineOptions(argc, argv,
|
||||
"LLVM 'Clang' Indexing Test Bed: http://clang.llvm.org\n");
|
||||
|
||||
Program Prog;
|
||||
Indexer Idxer(Prog);
|
||||
llvm::SmallVector<TUnit*, 4> TUnits;
|
||||
|
||||
DiagnosticOptions DiagOpts;
|
||||
llvm::OwningPtr<Diagnostic> Diags(
|
||||
CompilerInstance::createDiagnostics(DiagOpts, argc, argv));
|
||||
|
||||
// If no input was specified, read from stdin.
|
||||
if (InputFilenames.empty())
|
||||
InputFilenames.push_back("-");
|
||||
|
||||
for (unsigned i = 0, e = InputFilenames.size(); i != e; ++i) {
|
||||
const std::string &InFile = InputFilenames[i];
|
||||
llvm::OwningPtr<ASTUnit> AST;
|
||||
if (ASTFromSource)
|
||||
AST.reset(CreateFromSource(InFile, *Diags, argv[0]));
|
||||
else
|
||||
AST.reset(ASTUnit::LoadFromPCHFile(InFile, *Diags));
|
||||
if (!AST)
|
||||
return 1;
|
||||
|
||||
TUnit *TU = new TUnit(AST.take(), InFile);
|
||||
TUnits.push_back(TU);
|
||||
|
||||
Idxer.IndexAST(TU);
|
||||
}
|
||||
|
||||
ASTLocation ASTLoc;
|
||||
const std::string &FirstFile = TUnits[0]->Filename;
|
||||
ASTUnit *FirstAST = TUnits[0]->AST.get();
|
||||
|
||||
if (!PointAtLocation.empty()) {
|
||||
const std::string &Filename = PointAtLocation[0].FileName;
|
||||
const FileEntry *File = FirstAST->getFileManager().getFile(Filename);
|
||||
if (File == 0) {
|
||||
llvm::errs() << "File '" << Filename << "' does not exist\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Safety check. Using an out-of-date AST file will only lead to crashes
|
||||
// or incorrect results.
|
||||
// FIXME: Check all the source files that make up the AST file.
|
||||
const FileEntry *ASTFile = FirstAST->getFileManager().getFile(FirstFile);
|
||||
if (File->getModificationTime() > ASTFile->getModificationTime()) {
|
||||
llvm::errs() << "[" << FirstFile << "] Error: " <<
|
||||
"Pointing at a source file which was modified after creating "
|
||||
"the AST file\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
unsigned Line = PointAtLocation[0].Line;
|
||||
unsigned Col = PointAtLocation[0].Column;
|
||||
|
||||
SourceLocation Loc =
|
||||
FirstAST->getSourceManager().getLocation(File, Line, Col);
|
||||
if (Loc.isInvalid()) {
|
||||
llvm::errs() << "[" << FirstFile << "] Error: " <<
|
||||
"Couldn't resolve source location (invalid location)\n";
|
||||
return 1;
|
||||
}
|
||||
|
||||
ASTLoc = ResolveLocationInAST(FirstAST->getASTContext(), Loc);
|
||||
if (ASTLoc.isInvalid()) {
|
||||
llvm::errs() << "[" << FirstFile << "] Error: " <<
|
||||
"Couldn't resolve source location (no declaration found)\n";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (ASTLoc.isValid()) {
|
||||
if (ProgAction == PrintPoint) {
|
||||
llvm::raw_ostream &OS = llvm::outs();
|
||||
ASTLoc.print(OS);
|
||||
if (const char *Comment =
|
||||
FirstAST->getASTContext().getCommentForDecl(ASTLoc.dyn_AsDecl()))
|
||||
OS << "Comment associated with this declaration:\n" << Comment << "\n";
|
||||
} else {
|
||||
ProcessASTLocation(ASTLoc, Idxer);
|
||||
}
|
||||
}
|
||||
|
||||
if (HadErrors)
|
||||
return 1;
|
||||
|
||||
if (!DisableFree) {
|
||||
for (int i=0, e=TUnits.size(); i != e; ++i)
|
||||
delete TUnits[i];
|
||||
}
|
||||
|
||||
// Managed static deconstruction. Useful for making things like
|
||||
// -time-passes usable.
|
||||
llvm::llvm_shutdown();
|
||||
|
||||
return 0;
|
||||
}
|
@ -1,61 +0,0 @@
|
||||
#!/usr/bin/perl -w
|
||||
|
||||
# This tiny little script, which should be run from the clang
|
||||
# directory (with clang-cc in your patch), tries to take each
|
||||
# compilable Clang test and build a PCH file from that test, then read
|
||||
# and dump the contents of the PCH file just created.
|
||||
use POSIX;
|
||||
|
||||
$exitcode = 0;
|
||||
sub testfiles($$) {
|
||||
my $suffix = shift;
|
||||
my $language = shift;
|
||||
my $passed = 0;
|
||||
my $failed = 0;
|
||||
my $skipped = 0;
|
||||
|
||||
@files = `ls test/*/*.$suffix`;
|
||||
foreach $file (@files) {
|
||||
chomp($file);
|
||||
my $code = system("clang-cc -fsyntax-only -x $language $file > /dev/null 2>&1");
|
||||
if ($code == 0) {
|
||||
print(".");
|
||||
$code = system("clang-cc -emit-pch -x $language -o $file.pch $file > /dev/null 2>&1");
|
||||
if ($code == 0) {
|
||||
$code = system("clang-cc -include-pch $file.pch -x $language -ast-dump /dev/null > /dev/null 2>&1");
|
||||
if ($code == 0) {
|
||||
$passed++;
|
||||
} elsif (($code & 0xFF) == SIGINT) {
|
||||
exit($exitcode);
|
||||
} else {
|
||||
print("\n---Failed to dump AST file for \"$file\"---\n");
|
||||
$exitcode = 1;
|
||||
$failed++;
|
||||
}
|
||||
unlink "$file.pch";
|
||||
} elsif (($code & 0xFF) == SIGINT) {
|
||||
exit($exitcode);
|
||||
} else {
|
||||
print("\n---Failed to build PCH file for \"$file\"---\n");
|
||||
$exitcode = 1;
|
||||
$failed++;
|
||||
}
|
||||
} elsif (($code & 0xFF) == SIGINT) {
|
||||
exit($exitcode);
|
||||
} else {
|
||||
print("x");
|
||||
$skipped++;
|
||||
}
|
||||
}
|
||||
|
||||
print("\n\n$passed tests passed\n");
|
||||
print("$failed tests failed\n");
|
||||
print("$skipped tests skipped ('x')\n")
|
||||
}
|
||||
|
||||
printf("-----Testing precompiled headers for C-----\n");
|
||||
testfiles("c", "c");
|
||||
printf("\n-----Testing precompiled headers for Objective-C-----\n");
|
||||
testfiles("m", "objective-c");
|
||||
print("\n");
|
||||
exit($exitcode);
|
@ -1,347 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="clangAST"
|
||||
ProjectGUID="{5125C3DB-FBD6-4BF8-8D8B-CE51D6E93BCD}"
|
||||
RootNamespace="clangAST"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="..\Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4146"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="..\Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4146"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\APValue.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\ASTConsumer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\ASTContext.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\Builtins.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\CFG.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\Decl.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\DeclarationName.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\DeclBase.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\DeclCXX.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\DeclGroup.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\DeclObjC.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\DeclSerialization.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\Expr.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\ExprConstant.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\ExprCXX.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\InheritViz.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\ParentMap.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\Stmt.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\StmtDumper.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\StmtIterator.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\StmtPrinter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\StmtSerialization.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\StmtViz.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\TranslationUnit.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\Type.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\AST\TypeSerialization.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\AST.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\ASTConsumer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\ASTContext.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\Builtins.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\CFG.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\Decl.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\DeclCXX.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\DeclObjC.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\Expr.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\ExprCXX.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\ParentMap.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\PrettyPrinter.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\RecordLayout.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\Stmt.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\StmtGraphTraits.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\StmtIterator.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\StmtVisitor.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\Type.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\AST\TypeOrdering.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,351 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="clangAnalysis"
|
||||
ProjectGUID="{6C98551A-4C36-4E74-8419-4D3EEEC9D8E0}"
|
||||
RootNamespace="clangAnalysis"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="..\Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4146"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="..\Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4146"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\BasicConstraintManager.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\BasicObjCFoundationChecks.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\BasicObjCFoundationChecks.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\BasicStore.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\BasicValueFactory.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\BugReporter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\CFRefCount.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\CheckDeadStores.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\CheckNSError.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\CheckObjCDealloc.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\CheckObjCInstMethSignature.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\CheckObjCUnusedIVars.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\Environment.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\ExplodedGraph.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\GRBlockCounter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\GRCoreEngine.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\GRExprEngine.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\GRExprEngineInternalChecks.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\GRSimpleVals.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\GRSimpleVals.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\GRState.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\GRTransferFuncs.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\LiveVariables.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\MemRegion.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\PathDiagnostic.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\RegionStore.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\SVals.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\SymbolManager.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Analysis\UninitializedValues.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Analysis\ExprDeclBitVector.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Analysis\LiveVariables.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Analysis\LocalCheckers.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Analysis\ProgramEdge.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Analysis\UninitializedValues.h"
|
||||
>
|
||||
</File>
|
||||
<Filter
|
||||
Name="Visitors"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Analysis\Visitors\CFGRecStmtDeclVisitor.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Analysis\Visitors\CFGRecStmtVisitor.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Analysis\Visitors\CFGStmtVisitor.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Analysis\Visitors\CFGVarDeclVisitor.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="ADT"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Analysis\ADT\PersistentMap.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Support"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Analysis\Support\IntrusiveSPtr.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="FlowSensitive"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Analysis\FlowSensitive\DataflowSolver.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Analysis\FlowSensitive\DataflowValues.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,236 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="clangBasic"
|
||||
ProjectGUID="{298B4876-6EF1-4E80-85D7-72F80693BBEB}"
|
||||
RootNamespace="Basic"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="..\Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\clangBasic.pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)\clangBasic.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="..\Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\clangBasic.pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4355,4146,4800"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
OutputFile="$(OutDir)\clangBasic.lib"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\lib\Basic\Diagnostic.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Basic\FileManager.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Basic\IdentifierTable.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Basic\LangOptions.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Basic\SourceLocation.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Basic\SourceManager.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Basic\TargetInfo.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Basic\Targets.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Basic\TokenKinds.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Basic\Diagnostic.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Basic\FileManager.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Basic\IdentifierTable.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Basic\LangOptions.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Basic\SourceLocation.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Basic\SourceManager.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Basic\TargetInfo.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Basic\TokenKinds.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,271 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8,00"
|
||||
Name="clangCodeGen"
|
||||
ProjectGUID="{4CEC5897-D957-47E7-A6AE-2021D4F44A8F}"
|
||||
RootNamespace="clangCodeGen"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="..\Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4146"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="..\Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4146"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGBuiltin.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGCall.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGCXX.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGDebugInfo.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGDecl.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGExpr.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGExprAgg.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGExprComplex.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGExprConstant.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGExprScalar.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGObjC.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGObjCGNU.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGObjCMac.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGStmt.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CodeGenFunction.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CodeGenModule.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CodeGenTypes.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\ModuleBuilder.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGCall.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGDebugInfo.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGObjCRuntime.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CGValue.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CodeGenFunction.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CodeGenModule.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\CodeGen\CodeGenTypes.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\CodeGen\ModuleBuilder.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,270 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="clangDriver"
|
||||
ProjectGUID="{7E7DA455-C276-4B93-8D02-8F7E2F629BAF}"
|
||||
RootNamespace="clangDriver"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="..\Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
ManagedExtensions="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4355,4146,4800"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)\clang.exe"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(TargetDir)/clang.pdb"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="mkdir "%DSTROOT%\AppleInternal\Bin"
copy "$(TargetDir)$(TargetName).exe" "%DSTROOT%\AppleInternal\Bin"
"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="..\Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="1"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4355,4146,4800"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
OutputFile="$(OutDir)\clang.exe"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(TargetDir)/clang.pdb"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebDeploymentTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
CommandLine="mkdir "%DSTROOT%\AppleInternal\Bin"
copy "$(TargetDir)$(TargetName).exe" "%DSTROOT%\AppleInternal\Bin"
"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\Driver\AnalysisConsumer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\ASTConsumers.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\Backend.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\CacheTokens.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\clang-cc.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\DependencyFile.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\DiagChecker.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\HTMLPrint.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\PrintParserCallbacks.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\PrintPreprocessedOutput.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\RewriteBlocks.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\RewriteMacros.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\RewriteObjC.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\SerializationTest.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\Driver\AnalysisConsumer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\ASTConsumers.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\clang-cc.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,283 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="clangLex"
|
||||
ProjectGUID="{030F6909-B2FA-4E53-BEA7-9A559CFC2F73}"
|
||||
RootNamespace="clangLex"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="..\Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4146"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="..\Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4146"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\HeaderMap.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\HeaderSearch.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\Lexer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\LiteralSupport.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\MacroArgs.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\MacroInfo.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\PPCaching.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\PPDirectives.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\PPExpressions.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\PPLexerChange.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\PPMacroExpansion.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\Pragma.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\Preprocessor.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\PreprocessorLexer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\PTHLexer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\ScratchBuffer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Lex\TokenLexer.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Lex\DirectoryLookup.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Lex\HeaderSearch.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Lex\Lexer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Lex\LiteralSupport.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Lex\MacroExpander.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Lex\MacroInfo.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Lex\MultipleIncludeOpt.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Lex\PPCallbacks.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Lex\Pragma.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Lex\Preprocessor.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Lex\ScratchBuffer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Lex\Token.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,205 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="clangLibDriver"
|
||||
ProjectGUID="{AECB78DF-C319-4D49-B2FD-F98F62EBBDF4}"
|
||||
RootNamespace="clangLibDriver"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\lib\Driver\HTMLDiagnostics.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Driver\InitHeaderSearch.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Driver\ManagerRegistry.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Driver\PlistDiagnostics.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\Driver\RewriteTest.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Driver\TextDiagnosticBuffer.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Driver\TextDiagnosticPrinter.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Driver\HTMLDiagnostics.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Driver\InitHeaderSearch.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Driver\TextDiagnosticBuffer.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Driver\TextDiagnosticPrinter.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,248 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="clangParse"
|
||||
ProjectGUID="{05DF3074-11AF-491A-B078-83BD2EDC31F6}"
|
||||
RootNamespace="clangParse"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="..\Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
DisableLanguageExtensions="true"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4146"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="..\Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4146"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\lib\Parse\AttributeList.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Parse\DeclSpec.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Parse\MinimalAction.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Parse\ParseCXXInlineMethods.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Parse\ParseDecl.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Parse\ParseDeclCXX.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Parse\ParseExpr.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Parse\ParseExprCXX.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Parse\ParseInit.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Parse\ParseObjc.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Parse\ParsePragma.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Parse\Parser.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Parse\ParseStmt.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Parse\ParseTemplate.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Parse\ParseTentative.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Parse\Action.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Parse\AttributeList.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Parse\DeclSpec.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Parse\Parser.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Parse\Scope.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,191 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="clangRewrite"
|
||||
ProjectGUID="{F9FBDDA2-9EE1-473C-A456-BE20B7B2439D}"
|
||||
RootNamespace="clangRewrite"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="..\Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="..\Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\lib\Rewrite\DeltaTree.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Rewrite\HTMLRewrite.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Rewrite\Rewriter.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Rewrite\RewriteRope.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Rewrite\TokenRewriter.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Rewrite\Rewriter.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\include\clang\Rewrite\RewriteRope.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,263 +0,0 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="8.00"
|
||||
Name="clangSema"
|
||||
ProjectGUID="{4727E8B7-AA99-41C9-AB09-A8A862595DB7}"
|
||||
RootNamespace="clangSema"
|
||||
Keyword="Win32Proj"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="..\Debug"
|
||||
IntermediateDirectory="Debug"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4146"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="..\Release"
|
||||
IntermediateDirectory="Release"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\..\..\..\win32\common.vsprops"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalIncludeDirectories="..\..\include;..\..\..\..\include;..\..\..\..\win32"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_WARNINGS;__STDC_LIMIT_MACROS"
|
||||
RuntimeLibrary="2"
|
||||
UsePrecompiledHeader="0"
|
||||
ProgramDataBaseFileName="$(OutDir)\$(ProjectName).pdb"
|
||||
WarningLevel="3"
|
||||
Detect64BitPortabilityProblems="false"
|
||||
DebugInformationFormat="3"
|
||||
DisableSpecificWarnings="4146"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\IdentifierResolver.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\ParseAST.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\Sema.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaChecking.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaCXXScopeSpec.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaDecl.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaDeclAttr.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaDeclCXX.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaDeclObjC.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaExpr.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaExprCXX.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaExprObjC.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaInherit.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaInit.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaLookup.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaNamedCast.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaOverload.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaStmt.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaTemplate.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaType.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\CXXFieldCollector.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\IdentifierResolver.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\Sema.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\lib\Sema\SemaUtil.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
@ -1,17 +0,0 @@
|
||||
startList = function() {
|
||||
if (document.all&&document.getElementById) {
|
||||
navRoot = document.getElementById("nav");
|
||||
for (i=0; i<navRoot.childNodes.length; i++) {
|
||||
node = navRoot.childNodes[i];
|
||||
if (node.nodeName=="LI") {
|
||||
node.onmouseover=function() {
|
||||
this.className+=" over";
|
||||
}
|
||||
node.onmouseout=function() {
|
||||
this.className=this.className.replace(" over", "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
window.onload=startList;
|
Loading…
Reference in New Issue
Block a user