Пример #1
0
/*
	Legacy API to retrieve the file, line, column, and offset represented
	by the given source location.

	This interface has been replaced by the newer interface
	#clang_getExpansionLocation(). See that interface's documentation for
	details.
*/
func (sl SourceLocation) InstantiationLocation() (File, uint32, uint32, uint32) {
	var file File
	var line C.uint
	var column C.uint
	var offset C.uint

	C.clang_getInstantiationLocation(sl.c, &file.c, &line, &column, &offset)

	return file, uint32(line), uint32(column), uint32(offset)
}
Пример #2
0
// ExpansionLocation returns the file, line, column, and offset represented by
// the given source location.
//
// If the location refers into a macro expansion, retrieves the
// location of the macro expansion.
//
// file: if non-NULL, will be set to the file to which the given
// source location points.
//
// line: if non-NULL, will be set to the line to which the given
// source location points.
//
// column: if non-NULL, will be set to the column to which the given
// source location points.
//
// offset: if non-NULL, will be set to the offset into the
// buffer to which the given source location points.
func (l SourceLocation) ExpansionLocation() (f File, line, column, offset uint) {
	cline := C.uint(0)
	ccol := C.uint(0)
	coff := C.uint(0)
	// FIXME: undefined reference to `clang_getExpansionLocation'
	C.clang_getInstantiationLocation(l.c, &f.c, &cline, &ccol, &coff)
	line = uint(cline)
	column = uint(ccol)
	offset = uint(coff)

	return
}
Пример #3
0
/**
 * \brief Legacy API to retrieve the file, line, column, and offset represented
 * by the given source location.
 *
 * This interface has been replaced by the newer interface
 * \see clang_getExpansionLocation(). See that interface's documentation for
 * details.
 */
func (l SourceLocation) InstantiationLocation() (file File, line, column, offset uint) {

	cline := C.uint(0)
	ccol := C.uint(0)
	coff := C.uint(0)
	C.clang_getInstantiationLocation(l.c,
		&file.c,
		&cline,
		&ccol,
		&coff)
	line = uint(cline)
	column = uint(ccol)
	offset = uint(coff)
	return
}