hexsha
stringlengths 40
40
| repo
stringlengths 5
105
| path
stringlengths 3
173
| license
sequence | language
stringclasses 1
value | identifier
stringlengths 1
438
| return_type
stringlengths 1
106
⌀ | original_string
stringlengths 21
40.7k
| original_docstring
stringlengths 18
13.4k
| docstring
stringlengths 11
3.24k
| docstring_tokens
sequence | code
stringlengths 14
20.4k
| code_tokens
sequence | short_docstring
stringlengths 0
4.36k
| short_docstring_tokens
sequence | comment
sequence | parameters
list | docstring_params
dict |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14e8203adec69bd7a6a347e22e586f5273457413 | atrens/DragonFlyBSD-src | usr.bin/m4/manual_tokenizer.c | [
"BSD-3-Clause"
] | C | yypop_buffer_state | void | void yypop_buffer_state (void)
{
if (!YY_CURRENT_BUFFER)
return;
yy_delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
if ((yy_buffer_stack_top) > 0)
--(yy_buffer_stack_top);
if (YY_CURRENT_BUFFER) {
yy_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
} | /** Removes and deletes the top of the stack, if present.
* The next element becomes the new top.
*
*/ | Removes and deletes the top of the stack, if present.
The next element becomes the new top. | [
"Removes",
"and",
"deletes",
"the",
"top",
"of",
"the",
"stack",
"if",
"present",
".",
"The",
"next",
"element",
"becomes",
"the",
"new",
"top",
"."
] | void yypop_buffer_state (void)
{
if (!YY_CURRENT_BUFFER)
return;
yy_delete_buffer(YY_CURRENT_BUFFER );
YY_CURRENT_BUFFER_LVALUE = NULL;
if ((yy_buffer_stack_top) > 0)
--(yy_buffer_stack_top);
if (YY_CURRENT_BUFFER) {
yy_load_buffer_state( );
(yy_did_buffer_switch_on_eof) = 1;
}
} | [
"void",
"yypop_buffer_state",
"(",
"void",
")",
"{",
"if",
"(",
"!",
"YY_CURRENT_BUFFER",
")",
"return",
";",
"yy_delete_buffer",
"(",
"YY_CURRENT_BUFFER",
")",
";",
"YY_CURRENT_BUFFER_LVALUE",
"=",
"NULL",
";",
"if",
"(",
"(",
"yy_buffer_stack_top",
")",
">",
"0",
")",
"--",
"(",
"yy_buffer_stack_top",
")",
";",
"if",
"(",
"YY_CURRENT_BUFFER",
")",
"{",
"yy_load_buffer_state",
"(",
")",
";",
"(",
"yy_did_buffer_switch_on_eof",
")",
"=",
"1",
";",
"}",
"}"
] | Removes and deletes the top of the stack, if present. | [
"Removes",
"and",
"deletes",
"the",
"top",
"of",
"the",
"stack",
"if",
"present",
"."
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
af801c80d2db82a6855a7973a492ab33a1e3d19e | atrens/DragonFlyBSD-src | sys/netgraph7/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c | [
"BSD-3-Clause"
] | C | ubtbcmfw_probe | int | static int
ubtbcmfw_probe(device_t dev)
{
static const STRUCT_USB_HOST_ID devs[] = {
/* Broadcom BCM2033 devices only */
{ USB_VPI(USB_VENDOR_BROADCOM, USB_PRODUCT_BROADCOM_BCM2033, 0) },
};
struct usb_attach_arg *uaa = device_get_ivars(dev);
if (uaa->usb_mode != USB_MODE_HOST)
return (ENXIO);
if (uaa->info.bIfaceIndex != 0)
return (ENXIO);
return (usbd_lookup_id_by_uaa(devs, sizeof(devs), uaa));
} | /*
* Probe for a USB Bluetooth device
*/ | Probe for a USB Bluetooth device | [
"Probe",
"for",
"a",
"USB",
"Bluetooth",
"device"
] | static int
ubtbcmfw_probe(device_t dev)
{
static const STRUCT_USB_HOST_ID devs[] = {
{ USB_VPI(USB_VENDOR_BROADCOM, USB_PRODUCT_BROADCOM_BCM2033, 0) },
};
struct usb_attach_arg *uaa = device_get_ivars(dev);
if (uaa->usb_mode != USB_MODE_HOST)
return (ENXIO);
if (uaa->info.bIfaceIndex != 0)
return (ENXIO);
return (usbd_lookup_id_by_uaa(devs, sizeof(devs), uaa));
} | [
"static",
"int",
"ubtbcmfw_probe",
"(",
"device_t",
"dev",
")",
"{",
"static",
"const",
"STRUCT_USB_HOST_ID",
"devs",
"[",
"]",
"=",
"{",
"{",
"USB_VPI",
"(",
"USB_VENDOR_BROADCOM",
",",
"USB_PRODUCT_BROADCOM_BCM2033",
",",
"0",
")",
"}",
",",
"}",
";",
"struct",
"usb_attach_arg",
"*",
"uaa",
"=",
"device_get_ivars",
"(",
"dev",
")",
";",
"if",
"(",
"uaa",
"->",
"usb_mode",
"!=",
"USB_MODE_HOST",
")",
"return",
"(",
"ENXIO",
")",
";",
"if",
"(",
"uaa",
"->",
"info",
".",
"bIfaceIndex",
"!=",
"0",
")",
"return",
"(",
"ENXIO",
")",
";",
"return",
"(",
"usbd_lookup_id_by_uaa",
"(",
"devs",
",",
"sizeof",
"(",
"devs",
")",
",",
"uaa",
")",
")",
";",
"}"
] | Probe for a USB Bluetooth device | [
"Probe",
"for",
"a",
"USB",
"Bluetooth",
"device"
] | [
"/* Broadcom BCM2033 devices only */"
] | [
{
"param": "dev",
"type": "device_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "dev",
"type": "device_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af801c80d2db82a6855a7973a492ab33a1e3d19e | atrens/DragonFlyBSD-src | sys/netgraph7/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c | [
"BSD-3-Clause"
] | C | ubtbcmfw_start_read | void | static void
ubtbcmfw_start_read(struct usb_fifo *fifo)
{
struct ubtbcmfw_softc *sc = usb_fifo_softc(fifo);
usbd_transfer_start(sc->sc_xfer[UBTBCMFW_INTR_DT_RD]);
} | /*
* Called when we about to start read()ing from the device
*/ | Called when we about to start read()ing from the device | [
"Called",
"when",
"we",
"about",
"to",
"start",
"read",
"()",
"ing",
"from",
"the",
"device"
] | static void
ubtbcmfw_start_read(struct usb_fifo *fifo)
{
struct ubtbcmfw_softc *sc = usb_fifo_softc(fifo);
usbd_transfer_start(sc->sc_xfer[UBTBCMFW_INTR_DT_RD]);
} | [
"static",
"void",
"ubtbcmfw_start_read",
"(",
"struct",
"usb_fifo",
"*",
"fifo",
")",
"{",
"struct",
"ubtbcmfw_softc",
"*",
"sc",
"=",
"usb_fifo_softc",
"(",
"fifo",
")",
";",
"usbd_transfer_start",
"(",
"sc",
"->",
"sc_xfer",
"[",
"UBTBCMFW_INTR_DT_RD",
"]",
")",
";",
"}"
] | Called when we about to start read()ing from the device | [
"Called",
"when",
"we",
"about",
"to",
"start",
"read",
"()",
"ing",
"from",
"the",
"device"
] | [] | [
{
"param": "fifo",
"type": "struct usb_fifo"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "fifo",
"type": "struct usb_fifo",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af801c80d2db82a6855a7973a492ab33a1e3d19e | atrens/DragonFlyBSD-src | sys/netgraph7/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c | [
"BSD-3-Clause"
] | C | ubtbcmfw_stop_read | void | static void
ubtbcmfw_stop_read(struct usb_fifo *fifo)
{
struct ubtbcmfw_softc *sc = usb_fifo_softc(fifo);
usbd_transfer_stop(sc->sc_xfer[UBTBCMFW_INTR_DT_RD]);
} | /*
* Called when we about to stop reading (i.e. closing fifo)
*/ | Called when we about to stop reading | [
"Called",
"when",
"we",
"about",
"to",
"stop",
"reading"
] | static void
ubtbcmfw_stop_read(struct usb_fifo *fifo)
{
struct ubtbcmfw_softc *sc = usb_fifo_softc(fifo);
usbd_transfer_stop(sc->sc_xfer[UBTBCMFW_INTR_DT_RD]);
} | [
"static",
"void",
"ubtbcmfw_stop_read",
"(",
"struct",
"usb_fifo",
"*",
"fifo",
")",
"{",
"struct",
"ubtbcmfw_softc",
"*",
"sc",
"=",
"usb_fifo_softc",
"(",
"fifo",
")",
";",
"usbd_transfer_stop",
"(",
"sc",
"->",
"sc_xfer",
"[",
"UBTBCMFW_INTR_DT_RD",
"]",
")",
";",
"}"
] | Called when we about to stop reading (i.e. | [
"Called",
"when",
"we",
"about",
"to",
"stop",
"reading",
"(",
"i",
".",
"e",
"."
] | [] | [
{
"param": "fifo",
"type": "struct usb_fifo"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "fifo",
"type": "struct usb_fifo",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af801c80d2db82a6855a7973a492ab33a1e3d19e | atrens/DragonFlyBSD-src | sys/netgraph7/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c | [
"BSD-3-Clause"
] | C | ubtbcmfw_start_write | void | static void
ubtbcmfw_start_write(struct usb_fifo *fifo)
{
struct ubtbcmfw_softc *sc = usb_fifo_softc(fifo);
usbd_transfer_start(sc->sc_xfer[UBTBCMFW_BULK_DT_WR]);
} | /*
* Called when we about to start write()ing to the device, poll()ing
* for write or flushing fifo
*/ | Called when we about to start write()ing to the device, poll()ing
for write or flushing fifo | [
"Called",
"when",
"we",
"about",
"to",
"start",
"write",
"()",
"ing",
"to",
"the",
"device",
"poll",
"()",
"ing",
"for",
"write",
"or",
"flushing",
"fifo"
] | static void
ubtbcmfw_start_write(struct usb_fifo *fifo)
{
struct ubtbcmfw_softc *sc = usb_fifo_softc(fifo);
usbd_transfer_start(sc->sc_xfer[UBTBCMFW_BULK_DT_WR]);
} | [
"static",
"void",
"ubtbcmfw_start_write",
"(",
"struct",
"usb_fifo",
"*",
"fifo",
")",
"{",
"struct",
"ubtbcmfw_softc",
"*",
"sc",
"=",
"usb_fifo_softc",
"(",
"fifo",
")",
";",
"usbd_transfer_start",
"(",
"sc",
"->",
"sc_xfer",
"[",
"UBTBCMFW_BULK_DT_WR",
"]",
")",
";",
"}"
] | Called when we about to start write()ing to the device, poll()ing
for write or flushing fifo | [
"Called",
"when",
"we",
"about",
"to",
"start",
"write",
"()",
"ing",
"to",
"the",
"device",
"poll",
"()",
"ing",
"for",
"write",
"or",
"flushing",
"fifo"
] | [] | [
{
"param": "fifo",
"type": "struct usb_fifo"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "fifo",
"type": "struct usb_fifo",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af801c80d2db82a6855a7973a492ab33a1e3d19e | atrens/DragonFlyBSD-src | sys/netgraph7/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c | [
"BSD-3-Clause"
] | C | ubtbcmfw_stop_write | void | static void
ubtbcmfw_stop_write(struct usb_fifo *fifo)
{
struct ubtbcmfw_softc *sc = usb_fifo_softc(fifo);
usbd_transfer_stop(sc->sc_xfer[UBTBCMFW_BULK_DT_WR]);
} | /*
* Called when we about to stop writing (i.e. closing fifo)
*/ | Called when we about to stop writing | [
"Called",
"when",
"we",
"about",
"to",
"stop",
"writing"
] | static void
ubtbcmfw_stop_write(struct usb_fifo *fifo)
{
struct ubtbcmfw_softc *sc = usb_fifo_softc(fifo);
usbd_transfer_stop(sc->sc_xfer[UBTBCMFW_BULK_DT_WR]);
} | [
"static",
"void",
"ubtbcmfw_stop_write",
"(",
"struct",
"usb_fifo",
"*",
"fifo",
")",
"{",
"struct",
"ubtbcmfw_softc",
"*",
"sc",
"=",
"usb_fifo_softc",
"(",
"fifo",
")",
";",
"usbd_transfer_stop",
"(",
"sc",
"->",
"sc_xfer",
"[",
"UBTBCMFW_BULK_DT_WR",
"]",
")",
";",
"}"
] | Called when we about to stop writing (i.e. | [
"Called",
"when",
"we",
"about",
"to",
"stop",
"writing",
"(",
"i",
".",
"e",
"."
] | [] | [
{
"param": "fifo",
"type": "struct usb_fifo"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "fifo",
"type": "struct usb_fifo",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af801c80d2db82a6855a7973a492ab33a1e3d19e | atrens/DragonFlyBSD-src | sys/netgraph7/bluetooth/drivers/ubtbcmfw/ubtbcmfw.c | [
"BSD-3-Clause"
] | C | ubtbcmfw_ioctl | int | static int
ubtbcmfw_ioctl(struct usb_fifo *fifo, u_long cmd, void *data,
int fflags)
{
struct ubtbcmfw_softc *sc = usb_fifo_softc(fifo);
int error = 0;
switch (cmd) {
case USB_GET_DEVICE_DESC:
memcpy(data, usbd_get_device_descriptor(sc->sc_udev),
sizeof(struct usb_device_descriptor));
break;
default:
error = EINVAL;
break;
}
return (error);
} | /*
* Process ioctl() on USB device
*/ | Process ioctl() on USB device | [
"Process",
"ioctl",
"()",
"on",
"USB",
"device"
] | static int
ubtbcmfw_ioctl(struct usb_fifo *fifo, u_long cmd, void *data,
int fflags)
{
struct ubtbcmfw_softc *sc = usb_fifo_softc(fifo);
int error = 0;
switch (cmd) {
case USB_GET_DEVICE_DESC:
memcpy(data, usbd_get_device_descriptor(sc->sc_udev),
sizeof(struct usb_device_descriptor));
break;
default:
error = EINVAL;
break;
}
return (error);
} | [
"static",
"int",
"ubtbcmfw_ioctl",
"(",
"struct",
"usb_fifo",
"*",
"fifo",
",",
"u_long",
"cmd",
",",
"void",
"*",
"data",
",",
"int",
"fflags",
")",
"{",
"struct",
"ubtbcmfw_softc",
"*",
"sc",
"=",
"usb_fifo_softc",
"(",
"fifo",
")",
";",
"int",
"error",
"=",
"0",
";",
"switch",
"(",
"cmd",
")",
"{",
"case",
"USB_GET_DEVICE_DESC",
":",
"memcpy",
"(",
"data",
",",
"usbd_get_device_descriptor",
"(",
"sc",
"->",
"sc_udev",
")",
",",
"sizeof",
"(",
"struct",
"usb_device_descriptor",
")",
")",
";",
"break",
";",
"default",
":",
"error",
"=",
"EINVAL",
";",
"break",
";",
"}",
"return",
"(",
"error",
")",
";",
"}"
] | Process ioctl() on USB device | [
"Process",
"ioctl",
"()",
"on",
"USB",
"device"
] | [] | [
{
"param": "fifo",
"type": "struct usb_fifo"
},
{
"param": "cmd",
"type": "u_long"
},
{
"param": "data",
"type": "void"
},
{
"param": "fflags",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "fifo",
"type": "struct usb_fifo",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cmd",
"type": "u_long",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "fflags",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f293ed69e68a616475b513fc04bfb5f27484f01e | atrens/DragonFlyBSD-src | sys/vfs/ntfs/ntfs_vfsops.c | [
"BSD-3-Clause"
] | C | ntfs_checkexp | int | static int
ntfs_checkexp(struct mount *mp, struct sockaddr *nam,
int *exflagsp, struct ucred **credanonp)
{
struct netcred *np;
struct ntfsmount *ntm = VFSTONTFS(mp);
/*
* Get the export permission structure for this <mp, client> tuple.
*/
np = vfs_export_lookup(mp, &ntm->ntm_export, nam);
if (np == NULL)
return (EACCES);
*exflagsp = np->netc_exflags;
*credanonp = &np->netc_anon;
return (0);
} | /*
* Verify a remote client has export rights and return these rights via.
* exflagsp and credanonp.
*/ | Verify a remote client has export rights and return these rights via.
exflagsp and credanonp. | [
"Verify",
"a",
"remote",
"client",
"has",
"export",
"rights",
"and",
"return",
"these",
"rights",
"via",
".",
"exflagsp",
"and",
"credanonp",
"."
] | static int
ntfs_checkexp(struct mount *mp, struct sockaddr *nam,
int *exflagsp, struct ucred **credanonp)
{
struct netcred *np;
struct ntfsmount *ntm = VFSTONTFS(mp);
np = vfs_export_lookup(mp, &ntm->ntm_export, nam);
if (np == NULL)
return (EACCES);
*exflagsp = np->netc_exflags;
*credanonp = &np->netc_anon;
return (0);
} | [
"static",
"int",
"ntfs_checkexp",
"(",
"struct",
"mount",
"*",
"mp",
",",
"struct",
"sockaddr",
"*",
"nam",
",",
"int",
"*",
"exflagsp",
",",
"struct",
"ucred",
"*",
"*",
"credanonp",
")",
"{",
"struct",
"netcred",
"*",
"np",
";",
"struct",
"ntfsmount",
"*",
"ntm",
"=",
"VFSTONTFS",
"(",
"mp",
")",
";",
"np",
"=",
"vfs_export_lookup",
"(",
"mp",
",",
"&",
"ntm",
"->",
"ntm_export",
",",
"nam",
")",
";",
"if",
"(",
"np",
"==",
"NULL",
")",
"return",
"(",
"EACCES",
")",
";",
"*",
"exflagsp",
"=",
"np",
"->",
"netc_exflags",
";",
"*",
"credanonp",
"=",
"&",
"np",
"->",
"netc_anon",
";",
"return",
"(",
"0",
")",
";",
"}"
] | Verify a remote client has export rights and return these rights via. | [
"Verify",
"a",
"remote",
"client",
"has",
"export",
"rights",
"and",
"return",
"these",
"rights",
"via",
"."
] | [
"/*\n\t * Get the export permission structure for this <mp, client> tuple.\n\t */"
] | [
{
"param": "mp",
"type": "struct mount"
},
{
"param": "nam",
"type": "struct sockaddr"
},
{
"param": "exflagsp",
"type": "int"
},
{
"param": "credanonp",
"type": "struct ucred"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "mp",
"type": "struct mount",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "nam",
"type": "struct sockaddr",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "exflagsp",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "credanonp",
"type": "struct ucred",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
338fa88ddf3fb3d55fa083ce4cbd72274b1caedf | atrens/DragonFlyBSD-src | games/rogue/pack.c | [
"BSD-3-Clause"
] | C | pick_up | object | object *
pick_up(int row, int col, short *status)
{
object *obj;
*status = 1;
if (levitate) {
message("you're floating in the air!", 0);
return(NULL);
}
obj = object_at(&level_objects, row, col);
if (!obj) {
message("pick_up(): inconsistent", 1);
return(obj);
}
if ( (obj->what_is == SCROL) &&
(obj->which_kind == SCARE_MONSTER) &&
obj->picked_up) {
message("the scroll turns to dust as you pick it up", 0);
dungeon[row][col] &= (~OBJECT);
vanish(obj, 0, &level_objects);
*status = 0;
if (id_scrolls[SCARE_MONSTER].id_status == UNIDENTIFIED) {
id_scrolls[SCARE_MONSTER].id_status = IDENTIFIED;
}
return(NULL);
}
if (obj->what_is == GOLD) {
rogue.gold += obj->quantity;
dungeon[row][col] &= ~(OBJECT);
take_from_pack(obj, &level_objects);
print_stats(STAT_GOLD);
return(obj); /* obj will be free_object()ed in caller */
}
if (pack_count(obj) >= MAX_PACK_COUNT) {
message("pack too full", 1);
return(NULL);
}
dungeon[row][col] &= ~(OBJECT);
take_from_pack(obj, &level_objects);
obj = add_to_pack(obj, &rogue.pack, 1);
obj->picked_up = 1;
return(obj);
} | /* Note: *status is set to 0 if the rogue attempts to pick up a scroll
* of scare-monster and it turns to dust. *status is otherwise set to 1.
*/ | *status is set to 0 if the rogue attempts to pick up a scroll
of scare-monster and it turns to dust. *status is otherwise set to 1. | [
"*",
"status",
"is",
"set",
"to",
"0",
"if",
"the",
"rogue",
"attempts",
"to",
"pick",
"up",
"a",
"scroll",
"of",
"scare",
"-",
"monster",
"and",
"it",
"turns",
"to",
"dust",
".",
"*",
"status",
"is",
"otherwise",
"set",
"to",
"1",
"."
] | object *
pick_up(int row, int col, short *status)
{
object *obj;
*status = 1;
if (levitate) {
message("you're floating in the air!", 0);
return(NULL);
}
obj = object_at(&level_objects, row, col);
if (!obj) {
message("pick_up(): inconsistent", 1);
return(obj);
}
if ( (obj->what_is == SCROL) &&
(obj->which_kind == SCARE_MONSTER) &&
obj->picked_up) {
message("the scroll turns to dust as you pick it up", 0);
dungeon[row][col] &= (~OBJECT);
vanish(obj, 0, &level_objects);
*status = 0;
if (id_scrolls[SCARE_MONSTER].id_status == UNIDENTIFIED) {
id_scrolls[SCARE_MONSTER].id_status = IDENTIFIED;
}
return(NULL);
}
if (obj->what_is == GOLD) {
rogue.gold += obj->quantity;
dungeon[row][col] &= ~(OBJECT);
take_from_pack(obj, &level_objects);
print_stats(STAT_GOLD);
return(obj);
}
if (pack_count(obj) >= MAX_PACK_COUNT) {
message("pack too full", 1);
return(NULL);
}
dungeon[row][col] &= ~(OBJECT);
take_from_pack(obj, &level_objects);
obj = add_to_pack(obj, &rogue.pack, 1);
obj->picked_up = 1;
return(obj);
} | [
"object",
"*",
"pick_up",
"(",
"int",
"row",
",",
"int",
"col",
",",
"short",
"*",
"status",
")",
"{",
"object",
"*",
"obj",
";",
"*",
"status",
"=",
"1",
";",
"if",
"(",
"levitate",
")",
"{",
"message",
"(",
"\"",
"\"",
",",
"0",
")",
";",
"return",
"(",
"NULL",
")",
";",
"}",
"obj",
"=",
"object_at",
"(",
"&",
"level_objects",
",",
"row",
",",
"col",
")",
";",
"if",
"(",
"!",
"obj",
")",
"{",
"message",
"(",
"\"",
"\"",
",",
"1",
")",
";",
"return",
"(",
"obj",
")",
";",
"}",
"if",
"(",
"(",
"obj",
"->",
"what_is",
"==",
"SCROL",
")",
"&&",
"(",
"obj",
"->",
"which_kind",
"==",
"SCARE_MONSTER",
")",
"&&",
"obj",
"->",
"picked_up",
")",
"{",
"message",
"(",
"\"",
"\"",
",",
"0",
")",
";",
"dungeon",
"[",
"row",
"]",
"[",
"col",
"]",
"&=",
"(",
"~",
"OBJECT",
")",
";",
"vanish",
"(",
"obj",
",",
"0",
",",
"&",
"level_objects",
")",
";",
"*",
"status",
"=",
"0",
";",
"if",
"(",
"id_scrolls",
"[",
"SCARE_MONSTER",
"]",
".",
"id_status",
"==",
"UNIDENTIFIED",
")",
"{",
"id_scrolls",
"[",
"SCARE_MONSTER",
"]",
".",
"id_status",
"=",
"IDENTIFIED",
";",
"}",
"return",
"(",
"NULL",
")",
";",
"}",
"if",
"(",
"obj",
"->",
"what_is",
"==",
"GOLD",
")",
"{",
"rogue",
".",
"gold",
"+=",
"obj",
"->",
"quantity",
";",
"dungeon",
"[",
"row",
"]",
"[",
"col",
"]",
"&=",
"~",
"(",
"OBJECT",
")",
";",
"take_from_pack",
"(",
"obj",
",",
"&",
"level_objects",
")",
";",
"print_stats",
"(",
"STAT_GOLD",
")",
";",
"return",
"(",
"obj",
")",
";",
"}",
"if",
"(",
"pack_count",
"(",
"obj",
")",
">=",
"MAX_PACK_COUNT",
")",
"{",
"message",
"(",
"\"",
"\"",
",",
"1",
")",
";",
"return",
"(",
"NULL",
")",
";",
"}",
"dungeon",
"[",
"row",
"]",
"[",
"col",
"]",
"&=",
"~",
"(",
"OBJECT",
")",
";",
"take_from_pack",
"(",
"obj",
",",
"&",
"level_objects",
")",
";",
"obj",
"=",
"add_to_pack",
"(",
"obj",
",",
"&",
"rogue",
".",
"pack",
",",
"1",
")",
";",
"obj",
"->",
"picked_up",
"=",
"1",
";",
"return",
"(",
"obj",
")",
";",
"}"
] | Note: *status is set to 0 if the rogue attempts to pick up a scroll
of scare-monster and it turns to dust. | [
"Note",
":",
"*",
"status",
"is",
"set",
"to",
"0",
"if",
"the",
"rogue",
"attempts",
"to",
"pick",
"up",
"a",
"scroll",
"of",
"scare",
"-",
"monster",
"and",
"it",
"turns",
"to",
"dust",
"."
] | [
"/* obj will be free_object()ed in caller */"
] | [
{
"param": "row",
"type": "int"
},
{
"param": "col",
"type": "int"
},
{
"param": "status",
"type": "short"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "row",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "col",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "status",
"type": "short",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
87cdcfd52a9272af7e5a84ff0e2d442cfcc41cc5 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/libgomp/team.c | [
"BSD-3-Clause"
] | C | gomp_thread_start | void | static void *
gomp_thread_start (void *xdata)
{
struct gomp_thread_start_data *data = xdata;
struct gomp_thread *thr;
struct gomp_thread_pool *pool;
void (*local_fn) (void *);
void *local_data;
#if defined HAVE_TLS || defined USE_EMUTLS
thr = &gomp_tls_data;
#else
struct gomp_thread local_thr;
thr = &local_thr;
pthread_setspecific (gomp_tls_key, thr);
#endif
gomp_sem_init (&thr->release, 0);
/* Extract what we need from data. */
local_fn = data->fn;
local_data = data->fn_data;
thr->thread_pool = data->thread_pool;
thr->ts = data->ts;
thr->task = data->task;
thr->place = data->place;
thr->ts.team->ordered_release[thr->ts.team_id] = &thr->release;
/* Make thread pool local. */
pool = thr->thread_pool;
if (data->nested)
{
struct gomp_team *team = thr->ts.team;
struct gomp_task *task = thr->task;
gomp_barrier_wait (&team->barrier);
local_fn (local_data);
gomp_team_barrier_wait_final (&team->barrier);
gomp_finish_task (task);
gomp_barrier_wait_last (&team->barrier);
}
else
{
pool->threads[thr->ts.team_id] = thr;
gomp_simple_barrier_wait (&pool->threads_dock);
do
{
struct gomp_team *team = thr->ts.team;
struct gomp_task *task = thr->task;
local_fn (local_data);
gomp_team_barrier_wait_final (&team->barrier);
gomp_finish_task (task);
gomp_simple_barrier_wait (&pool->threads_dock);
local_fn = thr->fn;
local_data = thr->data;
thr->fn = NULL;
}
while (local_fn);
}
gomp_sem_destroy (&thr->release);
thr->thread_pool = NULL;
thr->task = NULL;
return NULL;
} | /* This function is a pthread_create entry point. This contains the idle
loop in which a thread waits to be called up to become part of a team. */ | This function is a pthread_create entry point. This contains the idle
loop in which a thread waits to be called up to become part of a team. | [
"This",
"function",
"is",
"a",
"pthread_create",
"entry",
"point",
".",
"This",
"contains",
"the",
"idle",
"loop",
"in",
"which",
"a",
"thread",
"waits",
"to",
"be",
"called",
"up",
"to",
"become",
"part",
"of",
"a",
"team",
"."
] | static void *
gomp_thread_start (void *xdata)
{
struct gomp_thread_start_data *data = xdata;
struct gomp_thread *thr;
struct gomp_thread_pool *pool;
void (*local_fn) (void *);
void *local_data;
#if defined HAVE_TLS || defined USE_EMUTLS
thr = &gomp_tls_data;
#else
struct gomp_thread local_thr;
thr = &local_thr;
pthread_setspecific (gomp_tls_key, thr);
#endif
gomp_sem_init (&thr->release, 0);
local_fn = data->fn;
local_data = data->fn_data;
thr->thread_pool = data->thread_pool;
thr->ts = data->ts;
thr->task = data->task;
thr->place = data->place;
thr->ts.team->ordered_release[thr->ts.team_id] = &thr->release;
pool = thr->thread_pool;
if (data->nested)
{
struct gomp_team *team = thr->ts.team;
struct gomp_task *task = thr->task;
gomp_barrier_wait (&team->barrier);
local_fn (local_data);
gomp_team_barrier_wait_final (&team->barrier);
gomp_finish_task (task);
gomp_barrier_wait_last (&team->barrier);
}
else
{
pool->threads[thr->ts.team_id] = thr;
gomp_simple_barrier_wait (&pool->threads_dock);
do
{
struct gomp_team *team = thr->ts.team;
struct gomp_task *task = thr->task;
local_fn (local_data);
gomp_team_barrier_wait_final (&team->barrier);
gomp_finish_task (task);
gomp_simple_barrier_wait (&pool->threads_dock);
local_fn = thr->fn;
local_data = thr->data;
thr->fn = NULL;
}
while (local_fn);
}
gomp_sem_destroy (&thr->release);
thr->thread_pool = NULL;
thr->task = NULL;
return NULL;
} | [
"static",
"void",
"*",
"gomp_thread_start",
"(",
"void",
"*",
"xdata",
")",
"{",
"struct",
"gomp_thread_start_data",
"*",
"data",
"=",
"xdata",
";",
"struct",
"gomp_thread",
"*",
"thr",
";",
"struct",
"gomp_thread_pool",
"*",
"pool",
";",
"void",
"(",
"*",
"local_fn",
")",
"(",
"void",
"*",
")",
";",
"void",
"*",
"local_data",
";",
"#if",
"defined",
"HAVE_TLS",
"||",
"defined",
"USE_EMUTLS",
"\n",
"thr",
"=",
"&",
"gomp_tls_data",
";",
"#else",
"struct",
"gomp_thread",
"local_thr",
";",
"thr",
"=",
"&",
"local_thr",
";",
"pthread_setspecific",
"(",
"gomp_tls_key",
",",
"thr",
")",
";",
"#endif",
"gomp_sem_init",
"(",
"&",
"thr",
"->",
"release",
",",
"0",
")",
";",
"local_fn",
"=",
"data",
"->",
"fn",
";",
"local_data",
"=",
"data",
"->",
"fn_data",
";",
"thr",
"->",
"thread_pool",
"=",
"data",
"->",
"thread_pool",
";",
"thr",
"->",
"ts",
"=",
"data",
"->",
"ts",
";",
"thr",
"->",
"task",
"=",
"data",
"->",
"task",
";",
"thr",
"->",
"place",
"=",
"data",
"->",
"place",
";",
"thr",
"->",
"ts",
".",
"team",
"->",
"ordered_release",
"[",
"thr",
"->",
"ts",
".",
"team_id",
"]",
"=",
"&",
"thr",
"->",
"release",
";",
"pool",
"=",
"thr",
"->",
"thread_pool",
";",
"if",
"(",
"data",
"->",
"nested",
")",
"{",
"struct",
"gomp_team",
"*",
"team",
"=",
"thr",
"->",
"ts",
".",
"team",
";",
"struct",
"gomp_task",
"*",
"task",
"=",
"thr",
"->",
"task",
";",
"gomp_barrier_wait",
"(",
"&",
"team",
"->",
"barrier",
")",
";",
"local_fn",
"(",
"local_data",
")",
";",
"gomp_team_barrier_wait_final",
"(",
"&",
"team",
"->",
"barrier",
")",
";",
"gomp_finish_task",
"(",
"task",
")",
";",
"gomp_barrier_wait_last",
"(",
"&",
"team",
"->",
"barrier",
")",
";",
"}",
"else",
"{",
"pool",
"->",
"threads",
"[",
"thr",
"->",
"ts",
".",
"team_id",
"]",
"=",
"thr",
";",
"gomp_simple_barrier_wait",
"(",
"&",
"pool",
"->",
"threads_dock",
")",
";",
"do",
"{",
"struct",
"gomp_team",
"*",
"team",
"=",
"thr",
"->",
"ts",
".",
"team",
";",
"struct",
"gomp_task",
"*",
"task",
"=",
"thr",
"->",
"task",
";",
"local_fn",
"(",
"local_data",
")",
";",
"gomp_team_barrier_wait_final",
"(",
"&",
"team",
"->",
"barrier",
")",
";",
"gomp_finish_task",
"(",
"task",
")",
";",
"gomp_simple_barrier_wait",
"(",
"&",
"pool",
"->",
"threads_dock",
")",
";",
"local_fn",
"=",
"thr",
"->",
"fn",
";",
"local_data",
"=",
"thr",
"->",
"data",
";",
"thr",
"->",
"fn",
"=",
"NULL",
";",
"}",
"while",
"(",
"local_fn",
")",
";",
"}",
"gomp_sem_destroy",
"(",
"&",
"thr",
"->",
"release",
")",
";",
"thr",
"->",
"thread_pool",
"=",
"NULL",
";",
"thr",
"->",
"task",
"=",
"NULL",
";",
"return",
"NULL",
";",
"}"
] | This function is a pthread_create entry point. | [
"This",
"function",
"is",
"a",
"pthread_create",
"entry",
"point",
"."
] | [
"/* Extract what we need from data. */",
"/* Make thread pool local. */"
] | [
{
"param": "xdata",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "xdata",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
87cdcfd52a9272af7e5a84ff0e2d442cfcc41cc5 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/libgomp/team.c | [
"BSD-3-Clause"
] | C | gomp_new_team | null | struct gomp_team *
gomp_new_team (unsigned nthreads)
{
struct gomp_team *team;
int i;
team = get_last_team (nthreads);
if (team == NULL)
{
size_t extra = sizeof (team->ordered_release[0])
+ sizeof (team->implicit_task[0]);
team = gomp_malloc (sizeof (*team) + nthreads * extra);
#ifndef HAVE_SYNC_BUILTINS
gomp_mutex_init (&team->work_share_list_free_lock);
#endif
gomp_barrier_init (&team->barrier, nthreads);
gomp_mutex_init (&team->task_lock);
team->nthreads = nthreads;
}
team->work_share_chunk = 8;
#ifdef HAVE_SYNC_BUILTINS
team->single_count = 0;
#endif
team->work_shares_to_free = &team->work_shares[0];
gomp_init_work_share (&team->work_shares[0], false, nthreads);
team->work_shares[0].next_alloc = NULL;
team->work_share_list_free = NULL;
team->work_share_list_alloc = &team->work_shares[1];
for (i = 1; i < 7; i++)
team->work_shares[i].next_free = &team->work_shares[i + 1];
team->work_shares[i].next_free = NULL;
gomp_sem_init (&team->master_release, 0);
team->ordered_release = (void *) &team->implicit_task[nthreads];
team->ordered_release[0] = &team->master_release;
priority_queue_init (&team->task_queue);
team->task_count = 0;
team->task_queued_count = 0;
team->task_running_count = 0;
team->work_share_cancelled = 0;
team->team_cancelled = 0;
return team;
} | /* Create a new team data structure. */ | Create a new team data structure. | [
"Create",
"a",
"new",
"team",
"data",
"structure",
"."
] | struct gomp_team *
gomp_new_team (unsigned nthreads)
{
struct gomp_team *team;
int i;
team = get_last_team (nthreads);
if (team == NULL)
{
size_t extra = sizeof (team->ordered_release[0])
+ sizeof (team->implicit_task[0]);
team = gomp_malloc (sizeof (*team) + nthreads * extra);
#ifndef HAVE_SYNC_BUILTINS
gomp_mutex_init (&team->work_share_list_free_lock);
#endif
gomp_barrier_init (&team->barrier, nthreads);
gomp_mutex_init (&team->task_lock);
team->nthreads = nthreads;
}
team->work_share_chunk = 8;
#ifdef HAVE_SYNC_BUILTINS
team->single_count = 0;
#endif
team->work_shares_to_free = &team->work_shares[0];
gomp_init_work_share (&team->work_shares[0], false, nthreads);
team->work_shares[0].next_alloc = NULL;
team->work_share_list_free = NULL;
team->work_share_list_alloc = &team->work_shares[1];
for (i = 1; i < 7; i++)
team->work_shares[i].next_free = &team->work_shares[i + 1];
team->work_shares[i].next_free = NULL;
gomp_sem_init (&team->master_release, 0);
team->ordered_release = (void *) &team->implicit_task[nthreads];
team->ordered_release[0] = &team->master_release;
priority_queue_init (&team->task_queue);
team->task_count = 0;
team->task_queued_count = 0;
team->task_running_count = 0;
team->work_share_cancelled = 0;
team->team_cancelled = 0;
return team;
} | [
"struct",
"gomp_team",
"*",
"gomp_new_team",
"(",
"unsigned",
"nthreads",
")",
"{",
"struct",
"gomp_team",
"*",
"team",
";",
"int",
"i",
";",
"team",
"=",
"get_last_team",
"(",
"nthreads",
")",
";",
"if",
"(",
"team",
"==",
"NULL",
")",
"{",
"size_t",
"extra",
"=",
"sizeof",
"(",
"team",
"->",
"ordered_release",
"[",
"0",
"]",
")",
"+",
"sizeof",
"(",
"team",
"->",
"implicit_task",
"[",
"0",
"]",
")",
";",
"team",
"=",
"gomp_malloc",
"(",
"sizeof",
"(",
"*",
"team",
")",
"+",
"nthreads",
"*",
"extra",
")",
";",
"#ifndef",
"HAVE_SYNC_BUILTINS",
"gomp_mutex_init",
"(",
"&",
"team",
"->",
"work_share_list_free_lock",
")",
";",
"#endif",
"gomp_barrier_init",
"(",
"&",
"team",
"->",
"barrier",
",",
"nthreads",
")",
";",
"gomp_mutex_init",
"(",
"&",
"team",
"->",
"task_lock",
")",
";",
"team",
"->",
"nthreads",
"=",
"nthreads",
";",
"}",
"team",
"->",
"work_share_chunk",
"=",
"8",
";",
"#ifdef",
"HAVE_SYNC_BUILTINS",
"team",
"->",
"single_count",
"=",
"0",
";",
"#endif",
"team",
"->",
"work_shares_to_free",
"=",
"&",
"team",
"->",
"work_shares",
"[",
"0",
"]",
";",
"gomp_init_work_share",
"(",
"&",
"team",
"->",
"work_shares",
"[",
"0",
"]",
",",
"false",
",",
"nthreads",
")",
";",
"team",
"->",
"work_shares",
"[",
"0",
"]",
".",
"next_alloc",
"=",
"NULL",
";",
"team",
"->",
"work_share_list_free",
"=",
"NULL",
";",
"team",
"->",
"work_share_list_alloc",
"=",
"&",
"team",
"->",
"work_shares",
"[",
"1",
"]",
";",
"for",
"(",
"i",
"=",
"1",
";",
"i",
"<",
"7",
";",
"i",
"++",
")",
"team",
"->",
"work_shares",
"[",
"i",
"]",
".",
"next_free",
"=",
"&",
"team",
"->",
"work_shares",
"[",
"i",
"+",
"1",
"]",
";",
"team",
"->",
"work_shares",
"[",
"i",
"]",
".",
"next_free",
"=",
"NULL",
";",
"gomp_sem_init",
"(",
"&",
"team",
"->",
"master_release",
",",
"0",
")",
";",
"team",
"->",
"ordered_release",
"=",
"(",
"void",
"*",
")",
"&",
"team",
"->",
"implicit_task",
"[",
"nthreads",
"]",
";",
"team",
"->",
"ordered_release",
"[",
"0",
"]",
"=",
"&",
"team",
"->",
"master_release",
";",
"priority_queue_init",
"(",
"&",
"team",
"->",
"task_queue",
")",
";",
"team",
"->",
"task_count",
"=",
"0",
";",
"team",
"->",
"task_queued_count",
"=",
"0",
";",
"team",
"->",
"task_running_count",
"=",
"0",
";",
"team",
"->",
"work_share_cancelled",
"=",
"0",
";",
"team",
"->",
"team_cancelled",
"=",
"0",
";",
"return",
"team",
";",
"}"
] | Create a new team data structure. | [
"Create",
"a",
"new",
"team",
"data",
"structure",
"."
] | [] | [
{
"param": "nthreads",
"type": "unsigned"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "nthreads",
"type": "unsigned",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
87cdcfd52a9272af7e5a84ff0e2d442cfcc41cc5 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/libgomp/team.c | [
"BSD-3-Clause"
] | C | free_team | void | static void
free_team (struct gomp_team *team)
{
#ifndef HAVE_SYNC_BUILTINS
gomp_mutex_destroy (&team->work_share_list_free_lock);
#endif
gomp_barrier_destroy (&team->barrier);
gomp_mutex_destroy (&team->task_lock);
priority_queue_free (&team->task_queue);
free (team);
} | /* Free a team data structure. */ | Free a team data structure. | [
"Free",
"a",
"team",
"data",
"structure",
"."
] | static void
free_team (struct gomp_team *team)
{
#ifndef HAVE_SYNC_BUILTINS
gomp_mutex_destroy (&team->work_share_list_free_lock);
#endif
gomp_barrier_destroy (&team->barrier);
gomp_mutex_destroy (&team->task_lock);
priority_queue_free (&team->task_queue);
free (team);
} | [
"static",
"void",
"free_team",
"(",
"struct",
"gomp_team",
"*",
"team",
")",
"{",
"#ifndef",
"HAVE_SYNC_BUILTINS",
"gomp_mutex_destroy",
"(",
"&",
"team",
"->",
"work_share_list_free_lock",
")",
";",
"#endif",
"gomp_barrier_destroy",
"(",
"&",
"team",
"->",
"barrier",
")",
";",
"gomp_mutex_destroy",
"(",
"&",
"team",
"->",
"task_lock",
")",
";",
"priority_queue_free",
"(",
"&",
"team",
"->",
"task_queue",
")",
";",
"free",
"(",
"team",
")",
";",
"}"
] | Free a team data structure. | [
"Free",
"a",
"team",
"data",
"structure",
"."
] | [] | [
{
"param": "team",
"type": "struct gomp_team"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "team",
"type": "struct gomp_team",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
87cdcfd52a9272af7e5a84ff0e2d442cfcc41cc5 | atrens/DragonFlyBSD-src | contrib/gcc-8.0/libgomp/team.c | [
"BSD-3-Clause"
] | C | gomp_team_end | void | void
gomp_team_end (void)
{
struct gomp_thread *thr = gomp_thread ();
struct gomp_team *team = thr->ts.team;
/* This barrier handles all pending explicit threads.
As #pragma omp cancel parallel might get awaited count in
team->barrier in a inconsistent state, we need to use a different
counter here. */
gomp_team_barrier_wait_final (&team->barrier);
if (__builtin_expect (team->team_cancelled, 0))
{
struct gomp_work_share *ws = team->work_shares_to_free;
do
{
struct gomp_work_share *next_ws = gomp_ptrlock_get (&ws->next_ws);
if (next_ws == NULL)
gomp_ptrlock_set (&ws->next_ws, ws);
gomp_fini_work_share (ws);
ws = next_ws;
}
while (ws != NULL);
}
else
gomp_fini_work_share (thr->ts.work_share);
gomp_end_task ();
thr->ts = team->prev_ts;
if (__builtin_expect (thr->ts.team != NULL, 0))
{
#ifdef HAVE_SYNC_BUILTINS
__sync_fetch_and_add (&gomp_managed_threads, 1L - team->nthreads);
#else
gomp_mutex_lock (&gomp_managed_threads_lock);
gomp_managed_threads -= team->nthreads - 1L;
gomp_mutex_unlock (&gomp_managed_threads_lock);
#endif
/* This barrier has gomp_barrier_wait_last counterparts
and ensures the team can be safely destroyed. */
gomp_barrier_wait (&team->barrier);
}
if (__builtin_expect (team->work_shares[0].next_alloc != NULL, 0))
{
struct gomp_work_share *ws = team->work_shares[0].next_alloc;
do
{
struct gomp_work_share *next_ws = ws->next_alloc;
free (ws);
ws = next_ws;
}
while (ws != NULL);
}
gomp_sem_destroy (&team->master_release);
if (__builtin_expect (thr->ts.team != NULL, 0)
|| __builtin_expect (team->nthreads == 1, 0))
free_team (team);
else
{
struct gomp_thread_pool *pool = thr->thread_pool;
if (pool->last_team)
free_team (pool->last_team);
pool->last_team = team;
gomp_release_thread_pool (pool);
}
} | /* Terminate the current team. This is only to be called by the master
thread. We assume that we must wait for the other threads. */ | Terminate the current team. This is only to be called by the master
thread. We assume that we must wait for the other threads. | [
"Terminate",
"the",
"current",
"team",
".",
"This",
"is",
"only",
"to",
"be",
"called",
"by",
"the",
"master",
"thread",
".",
"We",
"assume",
"that",
"we",
"must",
"wait",
"for",
"the",
"other",
"threads",
"."
] | void
gomp_team_end (void)
{
struct gomp_thread *thr = gomp_thread ();
struct gomp_team *team = thr->ts.team;
gomp_team_barrier_wait_final (&team->barrier);
if (__builtin_expect (team->team_cancelled, 0))
{
struct gomp_work_share *ws = team->work_shares_to_free;
do
{
struct gomp_work_share *next_ws = gomp_ptrlock_get (&ws->next_ws);
if (next_ws == NULL)
gomp_ptrlock_set (&ws->next_ws, ws);
gomp_fini_work_share (ws);
ws = next_ws;
}
while (ws != NULL);
}
else
gomp_fini_work_share (thr->ts.work_share);
gomp_end_task ();
thr->ts = team->prev_ts;
if (__builtin_expect (thr->ts.team != NULL, 0))
{
#ifdef HAVE_SYNC_BUILTINS
__sync_fetch_and_add (&gomp_managed_threads, 1L - team->nthreads);
#else
gomp_mutex_lock (&gomp_managed_threads_lock);
gomp_managed_threads -= team->nthreads - 1L;
gomp_mutex_unlock (&gomp_managed_threads_lock);
#endif
gomp_barrier_wait (&team->barrier);
}
if (__builtin_expect (team->work_shares[0].next_alloc != NULL, 0))
{
struct gomp_work_share *ws = team->work_shares[0].next_alloc;
do
{
struct gomp_work_share *next_ws = ws->next_alloc;
free (ws);
ws = next_ws;
}
while (ws != NULL);
}
gomp_sem_destroy (&team->master_release);
if (__builtin_expect (thr->ts.team != NULL, 0)
|| __builtin_expect (team->nthreads == 1, 0))
free_team (team);
else
{
struct gomp_thread_pool *pool = thr->thread_pool;
if (pool->last_team)
free_team (pool->last_team);
pool->last_team = team;
gomp_release_thread_pool (pool);
}
} | [
"void",
"gomp_team_end",
"(",
"void",
")",
"{",
"struct",
"gomp_thread",
"*",
"thr",
"=",
"gomp_thread",
"(",
")",
";",
"struct",
"gomp_team",
"*",
"team",
"=",
"thr",
"->",
"ts",
".",
"team",
";",
"gomp_team_barrier_wait_final",
"(",
"&",
"team",
"->",
"barrier",
")",
";",
"if",
"(",
"__builtin_expect",
"(",
"team",
"->",
"team_cancelled",
",",
"0",
")",
")",
"{",
"struct",
"gomp_work_share",
"*",
"ws",
"=",
"team",
"->",
"work_shares_to_free",
";",
"do",
"{",
"struct",
"gomp_work_share",
"*",
"next_ws",
"=",
"gomp_ptrlock_get",
"(",
"&",
"ws",
"->",
"next_ws",
")",
";",
"if",
"(",
"next_ws",
"==",
"NULL",
")",
"gomp_ptrlock_set",
"(",
"&",
"ws",
"->",
"next_ws",
",",
"ws",
")",
";",
"gomp_fini_work_share",
"(",
"ws",
")",
";",
"ws",
"=",
"next_ws",
";",
"}",
"while",
"(",
"ws",
"!=",
"NULL",
")",
";",
"}",
"else",
"gomp_fini_work_share",
"(",
"thr",
"->",
"ts",
".",
"work_share",
")",
";",
"gomp_end_task",
"(",
")",
";",
"thr",
"->",
"ts",
"=",
"team",
"->",
"prev_ts",
";",
"if",
"(",
"__builtin_expect",
"(",
"thr",
"->",
"ts",
".",
"team",
"!=",
"NULL",
",",
"0",
")",
")",
"{",
"#ifdef",
"HAVE_SYNC_BUILTINS",
"__sync_fetch_and_add",
"(",
"&",
"gomp_managed_threads",
",",
"1L",
"-",
"team",
"->",
"nthreads",
")",
";",
"#else",
"gomp_mutex_lock",
"(",
"&",
"gomp_managed_threads_lock",
")",
";",
"gomp_managed_threads",
"-=",
"team",
"->",
"nthreads",
"-",
"1L",
";",
"gomp_mutex_unlock",
"(",
"&",
"gomp_managed_threads_lock",
")",
";",
"#endif",
"gomp_barrier_wait",
"(",
"&",
"team",
"->",
"barrier",
")",
";",
"}",
"if",
"(",
"__builtin_expect",
"(",
"team",
"->",
"work_shares",
"[",
"0",
"]",
".",
"next_alloc",
"!=",
"NULL",
",",
"0",
")",
")",
"{",
"struct",
"gomp_work_share",
"*",
"ws",
"=",
"team",
"->",
"work_shares",
"[",
"0",
"]",
".",
"next_alloc",
";",
"do",
"{",
"struct",
"gomp_work_share",
"*",
"next_ws",
"=",
"ws",
"->",
"next_alloc",
";",
"free",
"(",
"ws",
")",
";",
"ws",
"=",
"next_ws",
";",
"}",
"while",
"(",
"ws",
"!=",
"NULL",
")",
";",
"}",
"gomp_sem_destroy",
"(",
"&",
"team",
"->",
"master_release",
")",
";",
"if",
"(",
"__builtin_expect",
"(",
"thr",
"->",
"ts",
".",
"team",
"!=",
"NULL",
",",
"0",
")",
"||",
"__builtin_expect",
"(",
"team",
"->",
"nthreads",
"==",
"1",
",",
"0",
")",
")",
"free_team",
"(",
"team",
")",
";",
"else",
"{",
"struct",
"gomp_thread_pool",
"*",
"pool",
"=",
"thr",
"->",
"thread_pool",
";",
"if",
"(",
"pool",
"->",
"last_team",
")",
"free_team",
"(",
"pool",
"->",
"last_team",
")",
";",
"pool",
"->",
"last_team",
"=",
"team",
";",
"gomp_release_thread_pool",
"(",
"pool",
")",
";",
"}",
"}"
] | Terminate the current team. | [
"Terminate",
"the",
"current",
"team",
"."
] | [
"/* This barrier handles all pending explicit threads.\n As #pragma omp cancel parallel might get awaited count in\n team->barrier in a inconsistent state, we need to use a different\n counter here. */",
"/* This barrier has gomp_barrier_wait_last counterparts\n\t and ensures the team can be safely destroyed. */"
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
8152b701eaeb3babe143a485bed4148b800e5a0e | atrens/DragonFlyBSD-src | sys/netgraph/lmi/ng_lmi.c | [
"BSD-3-Clause"
] | C | nglmi_newhook | int | static int
nglmi_newhook(node_p node, hook_p hook, const char *name)
{
sc_p sc = node->private;
if (strcmp(name, NG_LMI_HOOK_DEBUG) == 0) {
hook->private = NULL;
return (0);
}
if (sc->flags & SCF_CONNECTED) {
/* already connected, return an error */
return (EINVAL);
}
if (strcmp(name, NG_LMI_HOOK_ANNEXA) == 0) {
sc->lmi_annexA = hook;
hook->private = node->private;
sc->protoID = 8;
SETLMITYPE(sc, SCF_ANNEX_A);
sc->protoname = NAME_ANNEXA;
nglmi_startup_fixed(sc, hook);
} else if (strcmp(name, NG_LMI_HOOK_ANNEXD) == 0) {
sc->lmi_annexD = hook;
hook->private = node->private;
sc->protoID = 8;
SETLMITYPE(sc, SCF_ANNEX_D);
sc->protoname = NAME_ANNEXD;
nglmi_startup_fixed(sc, hook);
} else if (strcmp(name, NG_LMI_HOOK_GROUPOF4) == 0) {
sc->lmi_group4 = hook;
hook->private = node->private;
sc->protoID = 9;
SETLMITYPE(sc, SCF_GROUP4);
sc->protoname = NAME_GROUP4;
nglmi_startup_fixed(sc, hook);
} else if (strcmp(name, NG_LMI_HOOK_AUTO0) == 0) {
/* Note this, and if B is already installed, we're complete */
sc->lmi_channel0 = hook;
sc->protoname = NAME_NONE;
hook->private = node->private;
if (sc->lmi_channel1023)
nglmi_startup_auto(sc);
} else if (strcmp(name, NG_LMI_HOOK_AUTO1023) == 0) {
/* Note this, and if A is already installed, we're complete */
sc->lmi_channel1023 = hook;
sc->protoname = NAME_NONE;
hook->private = node->private;
if (sc->lmi_channel0)
nglmi_startup_auto(sc);
} else
return (EINVAL); /* unknown hook */
return (0);
} | /*
* The LMI channel has a private pointer which is the same as the
* node private pointer. The debug channel has a NULL private pointer.
*/ | The LMI channel has a private pointer which is the same as the
node private pointer. The debug channel has a NULL private pointer. | [
"The",
"LMI",
"channel",
"has",
"a",
"private",
"pointer",
"which",
"is",
"the",
"same",
"as",
"the",
"node",
"private",
"pointer",
".",
"The",
"debug",
"channel",
"has",
"a",
"NULL",
"private",
"pointer",
"."
] | static int
nglmi_newhook(node_p node, hook_p hook, const char *name)
{
sc_p sc = node->private;
if (strcmp(name, NG_LMI_HOOK_DEBUG) == 0) {
hook->private = NULL;
return (0);
}
if (sc->flags & SCF_CONNECTED) {
return (EINVAL);
}
if (strcmp(name, NG_LMI_HOOK_ANNEXA) == 0) {
sc->lmi_annexA = hook;
hook->private = node->private;
sc->protoID = 8;
SETLMITYPE(sc, SCF_ANNEX_A);
sc->protoname = NAME_ANNEXA;
nglmi_startup_fixed(sc, hook);
} else if (strcmp(name, NG_LMI_HOOK_ANNEXD) == 0) {
sc->lmi_annexD = hook;
hook->private = node->private;
sc->protoID = 8;
SETLMITYPE(sc, SCF_ANNEX_D);
sc->protoname = NAME_ANNEXD;
nglmi_startup_fixed(sc, hook);
} else if (strcmp(name, NG_LMI_HOOK_GROUPOF4) == 0) {
sc->lmi_group4 = hook;
hook->private = node->private;
sc->protoID = 9;
SETLMITYPE(sc, SCF_GROUP4);
sc->protoname = NAME_GROUP4;
nglmi_startup_fixed(sc, hook);
} else if (strcmp(name, NG_LMI_HOOK_AUTO0) == 0) {
sc->lmi_channel0 = hook;
sc->protoname = NAME_NONE;
hook->private = node->private;
if (sc->lmi_channel1023)
nglmi_startup_auto(sc);
} else if (strcmp(name, NG_LMI_HOOK_AUTO1023) == 0) {
sc->lmi_channel1023 = hook;
sc->protoname = NAME_NONE;
hook->private = node->private;
if (sc->lmi_channel0)
nglmi_startup_auto(sc);
} else
return (EINVAL);
return (0);
} | [
"static",
"int",
"nglmi_newhook",
"(",
"node_p",
"node",
",",
"hook_p",
"hook",
",",
"const",
"char",
"*",
"name",
")",
"{",
"sc_p",
"sc",
"=",
"node",
"->",
"private",
";",
"if",
"(",
"strcmp",
"(",
"name",
",",
"NG_LMI_HOOK_DEBUG",
")",
"==",
"0",
")",
"{",
"hook",
"->",
"private",
"=",
"NULL",
";",
"return",
"(",
"0",
")",
";",
"}",
"if",
"(",
"sc",
"->",
"flags",
"&",
"SCF_CONNECTED",
")",
"{",
"return",
"(",
"EINVAL",
")",
";",
"}",
"if",
"(",
"strcmp",
"(",
"name",
",",
"NG_LMI_HOOK_ANNEXA",
")",
"==",
"0",
")",
"{",
"sc",
"->",
"lmi_annexA",
"=",
"hook",
";",
"hook",
"->",
"private",
"=",
"node",
"->",
"private",
";",
"sc",
"->",
"protoID",
"=",
"8",
";",
"SETLMITYPE",
"(",
"sc",
",",
"SCF_ANNEX_A",
")",
";",
"sc",
"->",
"protoname",
"=",
"NAME_ANNEXA",
";",
"nglmi_startup_fixed",
"(",
"sc",
",",
"hook",
")",
";",
"}",
"else",
"if",
"(",
"strcmp",
"(",
"name",
",",
"NG_LMI_HOOK_ANNEXD",
")",
"==",
"0",
")",
"{",
"sc",
"->",
"lmi_annexD",
"=",
"hook",
";",
"hook",
"->",
"private",
"=",
"node",
"->",
"private",
";",
"sc",
"->",
"protoID",
"=",
"8",
";",
"SETLMITYPE",
"(",
"sc",
",",
"SCF_ANNEX_D",
")",
";",
"sc",
"->",
"protoname",
"=",
"NAME_ANNEXD",
";",
"nglmi_startup_fixed",
"(",
"sc",
",",
"hook",
")",
";",
"}",
"else",
"if",
"(",
"strcmp",
"(",
"name",
",",
"NG_LMI_HOOK_GROUPOF4",
")",
"==",
"0",
")",
"{",
"sc",
"->",
"lmi_group4",
"=",
"hook",
";",
"hook",
"->",
"private",
"=",
"node",
"->",
"private",
";",
"sc",
"->",
"protoID",
"=",
"9",
";",
"SETLMITYPE",
"(",
"sc",
",",
"SCF_GROUP4",
")",
";",
"sc",
"->",
"protoname",
"=",
"NAME_GROUP4",
";",
"nglmi_startup_fixed",
"(",
"sc",
",",
"hook",
")",
";",
"}",
"else",
"if",
"(",
"strcmp",
"(",
"name",
",",
"NG_LMI_HOOK_AUTO0",
")",
"==",
"0",
")",
"{",
"sc",
"->",
"lmi_channel0",
"=",
"hook",
";",
"sc",
"->",
"protoname",
"=",
"NAME_NONE",
";",
"hook",
"->",
"private",
"=",
"node",
"->",
"private",
";",
"if",
"(",
"sc",
"->",
"lmi_channel1023",
")",
"nglmi_startup_auto",
"(",
"sc",
")",
";",
"}",
"else",
"if",
"(",
"strcmp",
"(",
"name",
",",
"NG_LMI_HOOK_AUTO1023",
")",
"==",
"0",
")",
"{",
"sc",
"->",
"lmi_channel1023",
"=",
"hook",
";",
"sc",
"->",
"protoname",
"=",
"NAME_NONE",
";",
"hook",
"->",
"private",
"=",
"node",
"->",
"private",
";",
"if",
"(",
"sc",
"->",
"lmi_channel0",
")",
"nglmi_startup_auto",
"(",
"sc",
")",
";",
"}",
"else",
"return",
"(",
"EINVAL",
")",
";",
"return",
"(",
"0",
")",
";",
"}"
] | The LMI channel has a private pointer which is the same as the
node private pointer. | [
"The",
"LMI",
"channel",
"has",
"a",
"private",
"pointer",
"which",
"is",
"the",
"same",
"as",
"the",
"node",
"private",
"pointer",
"."
] | [
"/* already connected, return an error */",
"/* Note this, and if B is already installed, we're complete */",
"/* Note this, and if A is already installed, we're complete */",
"/* unknown hook */"
] | [
{
"param": "node",
"type": "node_p"
},
{
"param": "hook",
"type": "hook_p"
},
{
"param": "name",
"type": "char"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "node",
"type": "node_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "hook",
"type": "hook_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
8152b701eaeb3babe143a485bed4148b800e5a0e | atrens/DragonFlyBSD-src | sys/netgraph/lmi/ng_lmi.c | [
"BSD-3-Clause"
] | C | LMI_ticker | void | static void
LMI_ticker(void *arg)
{
sc_p sc = arg;
crit_enter();
if (sc->flags & SCF_AUTO) {
ngauto_state_machine(sc);
callout_reset(&sc->timeout, NG_LMI_POLL_RATE * hz,
LMI_ticker, sc);
} else {
if (sc->livs++ >= sc->liv_per_full) {
nglmi_inquire(sc, 1);
/* sc->livs = 0; *//* do this when we get the answer! */
} else {
nglmi_inquire(sc, 0);
}
callout_reset(&sc->timeout, sc->liv_rate * hz, LMI_ticker, sc);
}
crit_exit();
} | /*
* We have just attached to a live (we hope) node.
* Fire out a LMI inquiry, and then start up the timers.
*/ | We have just attached to a live (we hope) node.
Fire out a LMI inquiry, and then start up the timers. | [
"We",
"have",
"just",
"attached",
"to",
"a",
"live",
"(",
"we",
"hope",
")",
"node",
".",
"Fire",
"out",
"a",
"LMI",
"inquiry",
"and",
"then",
"start",
"up",
"the",
"timers",
"."
] | static void
LMI_ticker(void *arg)
{
sc_p sc = arg;
crit_enter();
if (sc->flags & SCF_AUTO) {
ngauto_state_machine(sc);
callout_reset(&sc->timeout, NG_LMI_POLL_RATE * hz,
LMI_ticker, sc);
} else {
if (sc->livs++ >= sc->liv_per_full) {
nglmi_inquire(sc, 1);
} else {
nglmi_inquire(sc, 0);
}
callout_reset(&sc->timeout, sc->liv_rate * hz, LMI_ticker, sc);
}
crit_exit();
} | [
"static",
"void",
"LMI_ticker",
"(",
"void",
"*",
"arg",
")",
"{",
"sc_p",
"sc",
"=",
"arg",
";",
"crit_enter",
"(",
")",
";",
"if",
"(",
"sc",
"->",
"flags",
"&",
"SCF_AUTO",
")",
"{",
"ngauto_state_machine",
"(",
"sc",
")",
";",
"callout_reset",
"(",
"&",
"sc",
"->",
"timeout",
",",
"NG_LMI_POLL_RATE",
"*",
"hz",
",",
"LMI_ticker",
",",
"sc",
")",
";",
"}",
"else",
"{",
"if",
"(",
"sc",
"->",
"livs",
"++",
">=",
"sc",
"->",
"liv_per_full",
")",
"{",
"nglmi_inquire",
"(",
"sc",
",",
"1",
")",
";",
"}",
"else",
"{",
"nglmi_inquire",
"(",
"sc",
",",
"0",
")",
";",
"}",
"callout_reset",
"(",
"&",
"sc",
"->",
"timeout",
",",
"sc",
"->",
"liv_rate",
"*",
"hz",
",",
"LMI_ticker",
",",
"sc",
")",
";",
"}",
"crit_exit",
"(",
")",
";",
"}"
] | We have just attached to a live (we hope) node. | [
"We",
"have",
"just",
"attached",
"to",
"a",
"live",
"(",
"we",
"hope",
")",
"node",
"."
] | [
"/* sc->livs = 0; */",
"/* do this when we get the answer! */"
] | [
{
"param": "arg",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "arg",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
8152b701eaeb3babe143a485bed4148b800e5a0e | atrens/DragonFlyBSD-src | sys/netgraph/lmi/ng_lmi.c | [
"BSD-3-Clause"
] | C | nglmi_rcvmsg | int | static int
nglmi_rcvmsg(node_p node, struct ng_mesg *msg, const char *retaddr,
struct ng_mesg **resp)
{
int error = 0;
sc_p sc = node->private;
switch (msg->header.typecookie) {
case NGM_GENERIC_COOKIE:
switch (msg->header.cmd) {
case NGM_TEXT_STATUS:
{
char *arg;
int pos, count;
NG_MKRESPONSE(*resp, msg, NG_TEXTRESPONSE, M_NOWAIT);
if (*resp == NULL) {
error = ENOMEM;
break;
}
arg = (*resp)->data;
pos = ksprintf(arg, "protocol %s ", sc->protoname);
if (sc->flags & SCF_FIXED)
pos += ksprintf(arg + pos, "fixed\n");
else if (sc->flags & SCF_AUTO)
pos += ksprintf(arg + pos, "auto-detecting\n");
else
pos += ksprintf(arg + pos, "auto on dlci %d\n",
(sc->lmi_channel == sc->lmi_channel0) ?
0 : 1023);
pos += ksprintf(arg + pos,
"keepalive period: %d seconds\n", sc->liv_rate);
pos += ksprintf(arg + pos,
"unacknowledged keepalives: %ld\n",
sc->seq_retries);
for (count = 0;
((count <= MAXDLCI)
&& (pos < (NG_TEXTRESPONSE - 20)));
count++) {
if (sc->dlci_state[count]) {
pos += ksprintf(arg + pos,
"dlci %d %s\n", count,
(sc->dlci_state[count]
== DLCI_UP) ? "up" : "down");
}
}
(*resp)->header.arglen = pos + 1;
break;
}
default:
error = EINVAL;
break;
}
break;
case NGM_LMI_COOKIE:
switch (msg->header.cmd) {
case NGM_LMI_GET_STATUS:
{
struct nglmistat *stat;
int k;
NG_MKRESPONSE(*resp, msg, sizeof(*stat), M_NOWAIT);
if (!*resp) {
error = ENOMEM;
break;
}
stat = (struct nglmistat *) (*resp)->data;
strncpy(stat->proto,
sc->protoname, sizeof(stat->proto) - 1);
strncpy(stat->hook,
sc->protoname, sizeof(stat->hook) - 1);
stat->autod = !!(sc->flags & SCF_AUTO);
stat->fixed = !!(sc->flags & SCF_FIXED);
for (k = 0; k <= MAXDLCI; k++) {
switch (sc->dlci_state[k]) {
case DLCI_UP:
stat->up[k / 8] |= (1 << (k % 8));
/* fall through */
case DLCI_DOWN:
stat->seen[k / 8] |= (1 << (k % 8));
break;
}
}
break;
}
default:
error = EINVAL;
break;
}
break;
default:
error = EINVAL;
break;
}
kfree(msg, M_NETGRAPH);
return (error);
} | /*
* Receive a netgraph control message.
*/ | Receive a netgraph control message. | [
"Receive",
"a",
"netgraph",
"control",
"message",
"."
] | static int
nglmi_rcvmsg(node_p node, struct ng_mesg *msg, const char *retaddr,
struct ng_mesg **resp)
{
int error = 0;
sc_p sc = node->private;
switch (msg->header.typecookie) {
case NGM_GENERIC_COOKIE:
switch (msg->header.cmd) {
case NGM_TEXT_STATUS:
{
char *arg;
int pos, count;
NG_MKRESPONSE(*resp, msg, NG_TEXTRESPONSE, M_NOWAIT);
if (*resp == NULL) {
error = ENOMEM;
break;
}
arg = (*resp)->data;
pos = ksprintf(arg, "protocol %s ", sc->protoname);
if (sc->flags & SCF_FIXED)
pos += ksprintf(arg + pos, "fixed\n");
else if (sc->flags & SCF_AUTO)
pos += ksprintf(arg + pos, "auto-detecting\n");
else
pos += ksprintf(arg + pos, "auto on dlci %d\n",
(sc->lmi_channel == sc->lmi_channel0) ?
0 : 1023);
pos += ksprintf(arg + pos,
"keepalive period: %d seconds\n", sc->liv_rate);
pos += ksprintf(arg + pos,
"unacknowledged keepalives: %ld\n",
sc->seq_retries);
for (count = 0;
((count <= MAXDLCI)
&& (pos < (NG_TEXTRESPONSE - 20)));
count++) {
if (sc->dlci_state[count]) {
pos += ksprintf(arg + pos,
"dlci %d %s\n", count,
(sc->dlci_state[count]
== DLCI_UP) ? "up" : "down");
}
}
(*resp)->header.arglen = pos + 1;
break;
}
default:
error = EINVAL;
break;
}
break;
case NGM_LMI_COOKIE:
switch (msg->header.cmd) {
case NGM_LMI_GET_STATUS:
{
struct nglmistat *stat;
int k;
NG_MKRESPONSE(*resp, msg, sizeof(*stat), M_NOWAIT);
if (!*resp) {
error = ENOMEM;
break;
}
stat = (struct nglmistat *) (*resp)->data;
strncpy(stat->proto,
sc->protoname, sizeof(stat->proto) - 1);
strncpy(stat->hook,
sc->protoname, sizeof(stat->hook) - 1);
stat->autod = !!(sc->flags & SCF_AUTO);
stat->fixed = !!(sc->flags & SCF_FIXED);
for (k = 0; k <= MAXDLCI; k++) {
switch (sc->dlci_state[k]) {
case DLCI_UP:
stat->up[k / 8] |= (1 << (k % 8));
case DLCI_DOWN:
stat->seen[k / 8] |= (1 << (k % 8));
break;
}
}
break;
}
default:
error = EINVAL;
break;
}
break;
default:
error = EINVAL;
break;
}
kfree(msg, M_NETGRAPH);
return (error);
} | [
"static",
"int",
"nglmi_rcvmsg",
"(",
"node_p",
"node",
",",
"struct",
"ng_mesg",
"*",
"msg",
",",
"const",
"char",
"*",
"retaddr",
",",
"struct",
"ng_mesg",
"*",
"*",
"resp",
")",
"{",
"int",
"error",
"=",
"0",
";",
"sc_p",
"sc",
"=",
"node",
"->",
"private",
";",
"switch",
"(",
"msg",
"->",
"header",
".",
"typecookie",
")",
"{",
"case",
"NGM_GENERIC_COOKIE",
":",
"switch",
"(",
"msg",
"->",
"header",
".",
"cmd",
")",
"{",
"case",
"NGM_TEXT_STATUS",
":",
"{",
"char",
"*",
"arg",
";",
"int",
"pos",
",",
"count",
";",
"NG_MKRESPONSE",
"(",
"*",
"resp",
",",
"msg",
",",
"NG_TEXTRESPONSE",
",",
"M_NOWAIT",
")",
";",
"if",
"(",
"*",
"resp",
"==",
"NULL",
")",
"{",
"error",
"=",
"ENOMEM",
";",
"break",
";",
"}",
"arg",
"=",
"(",
"*",
"resp",
")",
"->",
"data",
";",
"pos",
"=",
"ksprintf",
"(",
"arg",
",",
"\"",
"\"",
",",
"sc",
"->",
"protoname",
")",
";",
"if",
"(",
"sc",
"->",
"flags",
"&",
"SCF_FIXED",
")",
"pos",
"+=",
"ksprintf",
"(",
"arg",
"+",
"pos",
",",
"\"",
"\\n",
"\"",
")",
";",
"else",
"if",
"(",
"sc",
"->",
"flags",
"&",
"SCF_AUTO",
")",
"pos",
"+=",
"ksprintf",
"(",
"arg",
"+",
"pos",
",",
"\"",
"\\n",
"\"",
")",
";",
"else",
"pos",
"+=",
"ksprintf",
"(",
"arg",
"+",
"pos",
",",
"\"",
"\\n",
"\"",
",",
"(",
"sc",
"->",
"lmi_channel",
"==",
"sc",
"->",
"lmi_channel0",
")",
"?",
"0",
":",
"1023",
")",
";",
"pos",
"+=",
"ksprintf",
"(",
"arg",
"+",
"pos",
",",
"\"",
"\\n",
"\"",
",",
"sc",
"->",
"liv_rate",
")",
";",
"pos",
"+=",
"ksprintf",
"(",
"arg",
"+",
"pos",
",",
"\"",
"\\n",
"\"",
",",
"sc",
"->",
"seq_retries",
")",
";",
"for",
"(",
"count",
"=",
"0",
";",
"(",
"(",
"count",
"<=",
"MAXDLCI",
")",
"&&",
"(",
"pos",
"<",
"(",
"NG_TEXTRESPONSE",
"-",
"20",
")",
")",
")",
";",
"count",
"++",
")",
"{",
"if",
"(",
"sc",
"->",
"dlci_state",
"[",
"count",
"]",
")",
"{",
"pos",
"+=",
"ksprintf",
"(",
"arg",
"+",
"pos",
",",
"\"",
"\\n",
"\"",
",",
"count",
",",
"(",
"sc",
"->",
"dlci_state",
"[",
"count",
"]",
"==",
"DLCI_UP",
")",
"?",
"\"",
"\"",
":",
"\"",
"\"",
")",
";",
"}",
"}",
"(",
"*",
"resp",
")",
"->",
"header",
".",
"arglen",
"=",
"pos",
"+",
"1",
";",
"break",
";",
"}",
"default",
":",
"error",
"=",
"EINVAL",
";",
"break",
";",
"}",
"break",
";",
"case",
"NGM_LMI_COOKIE",
":",
"switch",
"(",
"msg",
"->",
"header",
".",
"cmd",
")",
"{",
"case",
"NGM_LMI_GET_STATUS",
":",
"{",
"struct",
"nglmistat",
"*",
"stat",
";",
"int",
"k",
";",
"NG_MKRESPONSE",
"(",
"*",
"resp",
",",
"msg",
",",
"sizeof",
"(",
"*",
"stat",
")",
",",
"M_NOWAIT",
")",
";",
"if",
"(",
"!",
"*",
"resp",
")",
"{",
"error",
"=",
"ENOMEM",
";",
"break",
";",
"}",
"stat",
"=",
"(",
"struct",
"nglmistat",
"*",
")",
"(",
"*",
"resp",
")",
"->",
"data",
";",
"strncpy",
"(",
"stat",
"->",
"proto",
",",
"sc",
"->",
"protoname",
",",
"sizeof",
"(",
"stat",
"->",
"proto",
")",
"-",
"1",
")",
";",
"strncpy",
"(",
"stat",
"->",
"hook",
",",
"sc",
"->",
"protoname",
",",
"sizeof",
"(",
"stat",
"->",
"hook",
")",
"-",
"1",
")",
";",
"stat",
"->",
"autod",
"=",
"!",
"!",
"(",
"sc",
"->",
"flags",
"&",
"SCF_AUTO",
")",
";",
"stat",
"->",
"fixed",
"=",
"!",
"!",
"(",
"sc",
"->",
"flags",
"&",
"SCF_FIXED",
")",
";",
"for",
"(",
"k",
"=",
"0",
";",
"k",
"<=",
"MAXDLCI",
";",
"k",
"++",
")",
"{",
"switch",
"(",
"sc",
"->",
"dlci_state",
"[",
"k",
"]",
")",
"{",
"case",
"DLCI_UP",
":",
"stat",
"->",
"up",
"[",
"k",
"/",
"8",
"]",
"|=",
"(",
"1",
"<<",
"(",
"k",
"%",
"8",
")",
")",
";",
"case",
"DLCI_DOWN",
":",
"stat",
"->",
"seen",
"[",
"k",
"/",
"8",
"]",
"|=",
"(",
"1",
"<<",
"(",
"k",
"%",
"8",
")",
")",
";",
"break",
";",
"}",
"}",
"break",
";",
"}",
"default",
":",
"error",
"=",
"EINVAL",
";",
"break",
";",
"}",
"break",
";",
"default",
":",
"error",
"=",
"EINVAL",
";",
"break",
";",
"}",
"kfree",
"(",
"msg",
",",
"M_NETGRAPH",
")",
";",
"return",
"(",
"error",
")",
";",
"}"
] | Receive a netgraph control message. | [
"Receive",
"a",
"netgraph",
"control",
"message",
"."
] | [
"/* fall through */"
] | [
{
"param": "node",
"type": "node_p"
},
{
"param": "msg",
"type": "struct ng_mesg"
},
{
"param": "retaddr",
"type": "char"
},
{
"param": "resp",
"type": "struct ng_mesg"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "node",
"type": "node_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "msg",
"type": "struct ng_mesg",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "retaddr",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "resp",
"type": "struct ng_mesg",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
8152b701eaeb3babe143a485bed4148b800e5a0e | atrens/DragonFlyBSD-src | sys/netgraph/lmi/ng_lmi.c | [
"BSD-3-Clause"
] | C | nglmi_rmnode | int | static int
nglmi_rmnode(node_p node)
{
const sc_p sc = node->private;
node->flags |= NG_INVALID;
ng_cutlinks(node);
ng_unname(node);
node->private = NULL;
ng_unref(sc->node);
kfree(sc, M_NETGRAPH);
return (0);
} | /*
* Do local shutdown processing..
* Cut any remaining links and free our local resources.
*/ | Do local shutdown processing
Cut any remaining links and free our local resources. | [
"Do",
"local",
"shutdown",
"processing",
"Cut",
"any",
"remaining",
"links",
"and",
"free",
"our",
"local",
"resources",
"."
] | static int
nglmi_rmnode(node_p node)
{
const sc_p sc = node->private;
node->flags |= NG_INVALID;
ng_cutlinks(node);
ng_unname(node);
node->private = NULL;
ng_unref(sc->node);
kfree(sc, M_NETGRAPH);
return (0);
} | [
"static",
"int",
"nglmi_rmnode",
"(",
"node_p",
"node",
")",
"{",
"const",
"sc_p",
"sc",
"=",
"node",
"->",
"private",
";",
"node",
"->",
"flags",
"|=",
"NG_INVALID",
";",
"ng_cutlinks",
"(",
"node",
")",
";",
"ng_unname",
"(",
"node",
")",
";",
"node",
"->",
"private",
"=",
"NULL",
";",
"ng_unref",
"(",
"sc",
"->",
"node",
")",
";",
"kfree",
"(",
"sc",
",",
"M_NETGRAPH",
")",
";",
"return",
"(",
"0",
")",
";",
"}"
] | Do local shutdown processing..
Cut any remaining links and free our local resources. | [
"Do",
"local",
"shutdown",
"processing",
"..",
"Cut",
"any",
"remaining",
"links",
"and",
"free",
"our",
"local",
"resources",
"."
] | [] | [
{
"param": "node",
"type": "node_p"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "node",
"type": "node_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
8152b701eaeb3babe143a485bed4148b800e5a0e | atrens/DragonFlyBSD-src | sys/netgraph/lmi/ng_lmi.c | [
"BSD-3-Clause"
] | C | nglmi_disconnect | int | static int
nglmi_disconnect(hook_p hook)
{
const sc_p sc = hook->node->private;
/* OK to remove debug hook(s) */
if (hook->private == NULL)
return (0);
/* Stop timer if it's currently active */
if (sc->flags & SCF_CONNECTED)
callout_stop(&sc->timeout);
/* Self-destruct */
ng_rmnode(hook->node);
return (0);
} | /*
* Hook disconnection
* For this type, removal of any link except "debug" destroys the node.
*/ | Hook disconnection
For this type, removal of any link except "debug" destroys the node. | [
"Hook",
"disconnection",
"For",
"this",
"type",
"removal",
"of",
"any",
"link",
"except",
"\"",
"debug",
"\"",
"destroys",
"the",
"node",
"."
] | static int
nglmi_disconnect(hook_p hook)
{
const sc_p sc = hook->node->private;
if (hook->private == NULL)
return (0);
if (sc->flags & SCF_CONNECTED)
callout_stop(&sc->timeout);
ng_rmnode(hook->node);
return (0);
} | [
"static",
"int",
"nglmi_disconnect",
"(",
"hook_p",
"hook",
")",
"{",
"const",
"sc_p",
"sc",
"=",
"hook",
"->",
"node",
"->",
"private",
";",
"if",
"(",
"hook",
"->",
"private",
"==",
"NULL",
")",
"return",
"(",
"0",
")",
";",
"if",
"(",
"sc",
"->",
"flags",
"&",
"SCF_CONNECTED",
")",
"callout_stop",
"(",
"&",
"sc",
"->",
"timeout",
")",
";",
"ng_rmnode",
"(",
"hook",
"->",
"node",
")",
";",
"return",
"(",
"0",
")",
";",
"}"
] | Hook disconnection
For this type, removal of any link except "debug" destroys the node. | [
"Hook",
"disconnection",
"For",
"this",
"type",
"removal",
"of",
"any",
"link",
"except",
"\"",
"debug",
"\"",
"destroys",
"the",
"node",
"."
] | [
"/* OK to remove debug hook(s) */",
"/* Stop timer if it's currently active */",
"/* Self-destruct */"
] | [
{
"param": "hook",
"type": "hook_p"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "hook",
"type": "hook_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
af6b86decd02c1fe45537d49de87998f1fd57613 | atrens/DragonFlyBSD-src | libexec/ypxfr/ypxfr_misc.c | [
"BSD-3-Clause"
] | C | ypxfr_get_master | char | char *
ypxfr_get_master(char *domain, char *map, char *source, const int yplib)
{
static char mastername[MAXPATHLEN + 2];
bzero((char *)&mastername, sizeof(mastername));
if (yplib) {
int res;
char *master;
if ((res = yp_master(domain, map, &master))) {
switch (res) {
case YPERR_DOMAIN:
yp_errno = YPXFR_NODOM;
break;
case YPERR_MAP:
yp_errno = YPXFR_NOMAP;
break;
case YPERR_YPERR:
default:
yp_errno = YPXFR_YPERR;
break;
}
return(NULL);
} else {
snprintf(mastername, sizeof(mastername), "%s", master);
free(master);
return((char *)&mastername);
}
} else {
CLIENT *clnt;
ypresp_master *resp;
ypreq_nokey req;
if ((clnt = clnt_create(source,YPPROG,YPVERS,"udp")) == NULL) {
yp_error("%s",clnt_spcreateerror("failed to \
create udp handle to ypserv"));
yp_errno = YPXFR_RPC;
return(NULL);
}
req.map = map;
req.domain = domain;
if ((resp = ypproc_master_2(&req, clnt)) == NULL) {
yp_error("%s",clnt_sperror(clnt,"YPPROC_MASTER \
failed"));
clnt_destroy(clnt);
yp_errno = YPXFR_RPC;
return(NULL);
}
clnt_destroy(clnt);
if (resp->stat != YP_TRUE) {
switch (resp->stat) {
case YP_NODOM:
yp_errno = YPXFR_NODOM;
break;
case YP_NOMAP:
yp_errno = YPXFR_NOMAP;
break;
case YP_YPERR:
default:
yp_errno = YPXFR_YPERR;
break;
}
return(NULL);
}
snprintf(mastername, sizeof(mastername), "%s", resp->peer);
/* xdr_free(xdr_ypresp_master, (char *)&resp); */
return((char *)&mastername);
}
} | /*
* Careful: yp_master() returns a pointer to a dynamically allocated
* buffer. Calling ypproc_master_2() ourselves also returns a pointer
* to dynamically allocated memory, though this time it's memory
* allocated by the XDR routines. We have to rememver to free() or
* xdr_free() the memory as required to avoid leaking memory.
*/ | yp_master() returns a pointer to a dynamically allocated
buffer. Calling ypproc_master_2() ourselves also returns a pointer
to dynamically allocated memory, though this time it's memory
allocated by the XDR routines. We have to rememver to free() or
xdr_free() the memory as required to avoid leaking memory. | [
"yp_master",
"()",
"returns",
"a",
"pointer",
"to",
"a",
"dynamically",
"allocated",
"buffer",
".",
"Calling",
"ypproc_master_2",
"()",
"ourselves",
"also",
"returns",
"a",
"pointer",
"to",
"dynamically",
"allocated",
"memory",
"though",
"this",
"time",
"it",
"'",
"s",
"memory",
"allocated",
"by",
"the",
"XDR",
"routines",
".",
"We",
"have",
"to",
"rememver",
"to",
"free",
"()",
"or",
"xdr_free",
"()",
"the",
"memory",
"as",
"required",
"to",
"avoid",
"leaking",
"memory",
"."
] | char *
ypxfr_get_master(char *domain, char *map, char *source, const int yplib)
{
static char mastername[MAXPATHLEN + 2];
bzero((char *)&mastername, sizeof(mastername));
if (yplib) {
int res;
char *master;
if ((res = yp_master(domain, map, &master))) {
switch (res) {
case YPERR_DOMAIN:
yp_errno = YPXFR_NODOM;
break;
case YPERR_MAP:
yp_errno = YPXFR_NOMAP;
break;
case YPERR_YPERR:
default:
yp_errno = YPXFR_YPERR;
break;
}
return(NULL);
} else {
snprintf(mastername, sizeof(mastername), "%s", master);
free(master);
return((char *)&mastername);
}
} else {
CLIENT *clnt;
ypresp_master *resp;
ypreq_nokey req;
if ((clnt = clnt_create(source,YPPROG,YPVERS,"udp")) == NULL) {
yp_error("%s",clnt_spcreateerror("failed to \
create udp handle to ypserv"));
yp_errno = YPXFR_RPC;
return(NULL);
}
req.map = map;
req.domain = domain;
if ((resp = ypproc_master_2(&req, clnt)) == NULL) {
yp_error("%s",clnt_sperror(clnt,"YPPROC_MASTER \
failed"));
clnt_destroy(clnt);
yp_errno = YPXFR_RPC;
return(NULL);
}
clnt_destroy(clnt);
if (resp->stat != YP_TRUE) {
switch (resp->stat) {
case YP_NODOM:
yp_errno = YPXFR_NODOM;
break;
case YP_NOMAP:
yp_errno = YPXFR_NOMAP;
break;
case YP_YPERR:
default:
yp_errno = YPXFR_YPERR;
break;
}
return(NULL);
}
snprintf(mastername, sizeof(mastername), "%s", resp->peer);
return((char *)&mastername);
}
} | [
"char",
"*",
"ypxfr_get_master",
"(",
"char",
"*",
"domain",
",",
"char",
"*",
"map",
",",
"char",
"*",
"source",
",",
"const",
"int",
"yplib",
")",
"{",
"static",
"char",
"mastername",
"[",
"MAXPATHLEN",
"+",
"2",
"]",
";",
"bzero",
"(",
"(",
"char",
"*",
")",
"&",
"mastername",
",",
"sizeof",
"(",
"mastername",
")",
")",
";",
"if",
"(",
"yplib",
")",
"{",
"int",
"res",
";",
"char",
"*",
"master",
";",
"if",
"(",
"(",
"res",
"=",
"yp_master",
"(",
"domain",
",",
"map",
",",
"&",
"master",
")",
")",
")",
"{",
"switch",
"(",
"res",
")",
"{",
"case",
"YPERR_DOMAIN",
":",
"yp_errno",
"=",
"YPXFR_NODOM",
";",
"break",
";",
"case",
"YPERR_MAP",
":",
"yp_errno",
"=",
"YPXFR_NOMAP",
";",
"break",
";",
"case",
"YPERR_YPERR",
":",
"default",
":",
"yp_errno",
"=",
"YPXFR_YPERR",
";",
"break",
";",
"}",
"return",
"(",
"NULL",
")",
";",
"}",
"else",
"{",
"snprintf",
"(",
"mastername",
",",
"sizeof",
"(",
"mastername",
")",
",",
"\"",
"\"",
",",
"master",
")",
";",
"free",
"(",
"master",
")",
";",
"return",
"(",
"(",
"char",
"*",
")",
"&",
"mastername",
")",
";",
"}",
"}",
"else",
"{",
"CLIENT",
"*",
"clnt",
";",
"ypresp_master",
"*",
"resp",
";",
"ypreq_nokey",
"req",
";",
"if",
"(",
"(",
"clnt",
"=",
"clnt_create",
"(",
"source",
",",
"YPPROG",
",",
"YPVERS",
",",
"\"",
"\"",
")",
")",
"==",
"NULL",
")",
"{",
"yp_error",
"(",
"\"",
"\"",
",",
"clnt_spcreateerror",
"(",
"\"",
"\\\n",
"\"",
")",
")",
";",
"yp_errno",
"=",
"YPXFR_RPC",
";",
"return",
"(",
"NULL",
")",
";",
"}",
"req",
".",
"map",
"=",
"map",
";",
"req",
".",
"domain",
"=",
"domain",
";",
"if",
"(",
"(",
"resp",
"=",
"ypproc_master_2",
"(",
"&",
"req",
",",
"clnt",
")",
")",
"==",
"NULL",
")",
"{",
"yp_error",
"(",
"\"",
"\"",
",",
"clnt_sperror",
"(",
"clnt",
",",
"\"",
"\\\n",
"\"",
")",
")",
";",
"clnt_destroy",
"(",
"clnt",
")",
";",
"yp_errno",
"=",
"YPXFR_RPC",
";",
"return",
"(",
"NULL",
")",
";",
"}",
"clnt_destroy",
"(",
"clnt",
")",
";",
"if",
"(",
"resp",
"->",
"stat",
"!=",
"YP_TRUE",
")",
"{",
"switch",
"(",
"resp",
"->",
"stat",
")",
"{",
"case",
"YP_NODOM",
":",
"yp_errno",
"=",
"YPXFR_NODOM",
";",
"break",
";",
"case",
"YP_NOMAP",
":",
"yp_errno",
"=",
"YPXFR_NOMAP",
";",
"break",
";",
"case",
"YP_YPERR",
":",
"default",
":",
"yp_errno",
"=",
"YPXFR_YPERR",
";",
"break",
";",
"}",
"return",
"(",
"NULL",
")",
";",
"}",
"snprintf",
"(",
"mastername",
",",
"sizeof",
"(",
"mastername",
")",
",",
"\"",
"\"",
",",
"resp",
"->",
"peer",
")",
";",
"return",
"(",
"(",
"char",
"*",
")",
"&",
"mastername",
")",
";",
"}",
"}"
] | Careful: yp_master() returns a pointer to a dynamically allocated
buffer. | [
"Careful",
":",
"yp_master",
"()",
"returns",
"a",
"pointer",
"to",
"a",
"dynamically",
"allocated",
"buffer",
"."
] | [
"/*\t\txdr_free(xdr_ypresp_master, (char *)&resp); */"
] | [
{
"param": "domain",
"type": "char"
},
{
"param": "map",
"type": "char"
},
{
"param": "source",
"type": "char"
},
{
"param": "yplib",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "domain",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "map",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "source",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "yplib",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a4fee01418b01444e70dbe463d115fada2ece1a1 | atrens/DragonFlyBSD-src | contrib/mpfr/src/factorial.c | [
"BSD-3-Clause"
] | C | mpfr_fac_ui | int | int
mpfr_fac_ui (mpfr_ptr y, unsigned long int x, mpfr_rnd_t rnd_mode)
{
mpfr_t t; /* Variable of Intermediary Calculation*/
unsigned long i;
int round, inexact;
mpfr_prec_t Ny; /* Precision of output variable */
mpfr_prec_t Nt; /* Precision of Intermediary Calculation variable */
mpfr_prec_t err; /* Precision of error */
mpfr_rnd_t rnd;
MPFR_SAVE_EXPO_DECL (expo);
MPFR_ZIV_DECL (loop);
/***** test x = 0 and x == 1******/
if (MPFR_UNLIKELY (x <= 1))
return mpfr_set_ui (y, 1, rnd_mode); /* 0! = 1 and 1! = 1 */
MPFR_SAVE_EXPO_MARK (expo);
/* Initialisation of the Precision */
Ny = MPFR_PREC (y);
/* compute the size of intermediary variable */
Nt = Ny + 2 * MPFR_INT_CEIL_LOG2 (x) + 7;
mpfr_init2 (t, Nt); /* initialise of intermediary variable */
rnd = MPFR_RNDZ;
MPFR_ZIV_INIT (loop, Nt);
for (;;)
{
/* compute factorial */
inexact = mpfr_set_ui (t, 1, rnd);
for (i = 2 ; i <= x ; i++)
{
round = mpfr_mul_ui (t, t, i, rnd);
/* assume the first inexact product gives the sign
of difference: is that always correct? */
if (inexact == 0)
inexact = round;
}
err = Nt - 1 - MPFR_INT_CEIL_LOG2 (Nt);
round = !inexact || mpfr_can_round (t, err, rnd, MPFR_RNDZ,
Ny + (rnd_mode == MPFR_RNDN));
if (MPFR_LIKELY (round))
{
/* If inexact = 0, then t is exactly x!, so round is the
correct inexact flag.
Otherwise, t != x! since we rounded to zero or away. */
round = mpfr_set (y, t, rnd_mode);
if (inexact == 0)
{
inexact = round;
break;
}
else if ((inexact < 0 && round <= 0)
|| (inexact > 0 && round >= 0))
break;
else /* inexact and round have opposite signs: we cannot
compute the inexact flag. Restart using the
symmetric rounding. */
rnd = (rnd == MPFR_RNDZ) ? MPFR_RNDU : MPFR_RNDZ;
}
MPFR_ZIV_NEXT (loop, Nt);
mpfr_set_prec (t, Nt);
}
MPFR_ZIV_FREE (loop);
mpfr_clear (t);
MPFR_SAVE_EXPO_FREE (expo);
return mpfr_check_range (y, inexact, rnd_mode);
} | /* FIXME: efficient problems with large arguments; see comments in gamma.c. */ | efficient problems with large arguments; see comments in gamma.c. | [
"efficient",
"problems",
"with",
"large",
"arguments",
";",
"see",
"comments",
"in",
"gamma",
".",
"c",
"."
] | int
mpfr_fac_ui (mpfr_ptr y, unsigned long int x, mpfr_rnd_t rnd_mode)
{
mpfr_t t;
unsigned long i;
int round, inexact;
mpfr_prec_t Ny;
mpfr_prec_t Nt;
mpfr_prec_t err;
mpfr_rnd_t rnd;
MPFR_SAVE_EXPO_DECL (expo);
MPFR_ZIV_DECL (loop);
if (MPFR_UNLIKELY (x <= 1))
return mpfr_set_ui (y, 1, rnd_mode);
MPFR_SAVE_EXPO_MARK (expo);
Ny = MPFR_PREC (y);
Nt = Ny + 2 * MPFR_INT_CEIL_LOG2 (x) + 7;
mpfr_init2 (t, Nt);
rnd = MPFR_RNDZ;
MPFR_ZIV_INIT (loop, Nt);
for (;;)
{
inexact = mpfr_set_ui (t, 1, rnd);
for (i = 2 ; i <= x ; i++)
{
round = mpfr_mul_ui (t, t, i, rnd);
if (inexact == 0)
inexact = round;
}
err = Nt - 1 - MPFR_INT_CEIL_LOG2 (Nt);
round = !inexact || mpfr_can_round (t, err, rnd, MPFR_RNDZ,
Ny + (rnd_mode == MPFR_RNDN));
if (MPFR_LIKELY (round))
{
round = mpfr_set (y, t, rnd_mode);
if (inexact == 0)
{
inexact = round;
break;
}
else if ((inexact < 0 && round <= 0)
|| (inexact > 0 && round >= 0))
break;
else
rnd = (rnd == MPFR_RNDZ) ? MPFR_RNDU : MPFR_RNDZ;
}
MPFR_ZIV_NEXT (loop, Nt);
mpfr_set_prec (t, Nt);
}
MPFR_ZIV_FREE (loop);
mpfr_clear (t);
MPFR_SAVE_EXPO_FREE (expo);
return mpfr_check_range (y, inexact, rnd_mode);
} | [
"int",
"mpfr_fac_ui",
"(",
"mpfr_ptr",
"y",
",",
"unsigned",
"long",
"int",
"x",
",",
"mpfr_rnd_t",
"rnd_mode",
")",
"{",
"mpfr_t",
"t",
";",
"unsigned",
"long",
"i",
";",
"int",
"round",
",",
"inexact",
";",
"mpfr_prec_t",
"Ny",
";",
"mpfr_prec_t",
"Nt",
";",
"mpfr_prec_t",
"err",
";",
"mpfr_rnd_t",
"rnd",
";",
"MPFR_SAVE_EXPO_DECL",
"(",
"expo",
")",
";",
"MPFR_ZIV_DECL",
"(",
"loop",
")",
";",
"if",
"(",
"MPFR_UNLIKELY",
"(",
"x",
"<=",
"1",
")",
")",
"return",
"mpfr_set_ui",
"(",
"y",
",",
"1",
",",
"rnd_mode",
")",
";",
"MPFR_SAVE_EXPO_MARK",
"(",
"expo",
")",
";",
"Ny",
"=",
"MPFR_PREC",
"(",
"y",
")",
";",
"Nt",
"=",
"Ny",
"+",
"2",
"*",
"MPFR_INT_CEIL_LOG2",
"(",
"x",
")",
"+",
"7",
";",
"mpfr_init2",
"(",
"t",
",",
"Nt",
")",
";",
"rnd",
"=",
"MPFR_RNDZ",
";",
"MPFR_ZIV_INIT",
"(",
"loop",
",",
"Nt",
")",
";",
"for",
"(",
";",
";",
")",
"{",
"inexact",
"=",
"mpfr_set_ui",
"(",
"t",
",",
"1",
",",
"rnd",
")",
";",
"for",
"(",
"i",
"=",
"2",
";",
"i",
"<=",
"x",
";",
"i",
"++",
")",
"{",
"round",
"=",
"mpfr_mul_ui",
"(",
"t",
",",
"t",
",",
"i",
",",
"rnd",
")",
";",
"if",
"(",
"inexact",
"==",
"0",
")",
"inexact",
"=",
"round",
";",
"}",
"err",
"=",
"Nt",
"-",
"1",
"-",
"MPFR_INT_CEIL_LOG2",
"(",
"Nt",
")",
";",
"round",
"=",
"!",
"inexact",
"||",
"mpfr_can_round",
"(",
"t",
",",
"err",
",",
"rnd",
",",
"MPFR_RNDZ",
",",
"Ny",
"+",
"(",
"rnd_mode",
"==",
"MPFR_RNDN",
")",
")",
";",
"if",
"(",
"MPFR_LIKELY",
"(",
"round",
")",
")",
"{",
"round",
"=",
"mpfr_set",
"(",
"y",
",",
"t",
",",
"rnd_mode",
")",
";",
"if",
"(",
"inexact",
"==",
"0",
")",
"{",
"inexact",
"=",
"round",
";",
"break",
";",
"}",
"else",
"if",
"(",
"(",
"inexact",
"<",
"0",
"&&",
"round",
"<=",
"0",
")",
"||",
"(",
"inexact",
">",
"0",
"&&",
"round",
">=",
"0",
")",
")",
"break",
";",
"else",
"rnd",
"=",
"(",
"rnd",
"==",
"MPFR_RNDZ",
")",
"?",
"MPFR_RNDU",
":",
"MPFR_RNDZ",
";",
"}",
"MPFR_ZIV_NEXT",
"(",
"loop",
",",
"Nt",
")",
";",
"mpfr_set_prec",
"(",
"t",
",",
"Nt",
")",
";",
"}",
"MPFR_ZIV_FREE",
"(",
"loop",
")",
";",
"mpfr_clear",
"(",
"t",
")",
";",
"MPFR_SAVE_EXPO_FREE",
"(",
"expo",
")",
";",
"return",
"mpfr_check_range",
"(",
"y",
",",
"inexact",
",",
"rnd_mode",
")",
";",
"}"
] | FIXME: efficient problems with large arguments; see comments in gamma.c. | [
"FIXME",
":",
"efficient",
"problems",
"with",
"large",
"arguments",
";",
"see",
"comments",
"in",
"gamma",
".",
"c",
"."
] | [
"/* Variable of Intermediary Calculation*/",
"/* Precision of output variable */",
"/* Precision of Intermediary Calculation variable */",
"/* Precision of error */",
"/***** test x = 0 and x == 1******/",
"/* 0! = 1 and 1! = 1 */",
"/* Initialisation of the Precision */",
"/* compute the size of intermediary variable */",
"/* initialise of intermediary variable */",
"/* compute factorial */",
"/* assume the first inexact product gives the sign\n of difference: is that always correct? */",
"/* If inexact = 0, then t is exactly x!, so round is the\n correct inexact flag.\n Otherwise, t != x! since we rounded to zero or away. */",
"/* inexact and round have opposite signs: we cannot\n compute the inexact flag. Restart using the\n symmetric rounding. */"
] | [
{
"param": "y",
"type": "mpfr_ptr"
},
{
"param": "x",
"type": "unsigned long int"
},
{
"param": "rnd_mode",
"type": "mpfr_rnd_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "y",
"type": "mpfr_ptr",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "x",
"type": "unsigned long int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "rnd_mode",
"type": "mpfr_rnd_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a71a50c07807bcb02374d0c04e88d93efdd72d73 | atrens/DragonFlyBSD-src | lib/libc/rpc/des_soft.c | [
"BSD-3-Clause"
] | C | des_setparity | void | void
des_setparity(char *p)
{
int i;
for (i = 0; i < 8; i++) {
*p = partab[*p & 0x7f];
p++;
}
} | /*
* Add odd parity to low bit of 8 byte key
*/ | Add odd parity to low bit of 8 byte key | [
"Add",
"odd",
"parity",
"to",
"low",
"bit",
"of",
"8",
"byte",
"key"
] | void
des_setparity(char *p)
{
int i;
for (i = 0; i < 8; i++) {
*p = partab[*p & 0x7f];
p++;
}
} | [
"void",
"des_setparity",
"(",
"char",
"*",
"p",
")",
"{",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"8",
";",
"i",
"++",
")",
"{",
"*",
"p",
"=",
"partab",
"[",
"*",
"p",
"&",
"0x7f",
"]",
";",
"p",
"++",
";",
"}",
"}"
] | Add odd parity to low bit of 8 byte key | [
"Add",
"odd",
"parity",
"to",
"low",
"bit",
"of",
"8",
"byte",
"key"
] | [] | [
{
"param": "p",
"type": "char"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "p",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e7bcee4068728a9630da9fbba402336ff2b4597 | atrens/DragonFlyBSD-src | games/larn/store.c | [
"BSD-3-Clause"
] | C | dnditem | void | static void
dnditem(int i)
{
int j, k;
if (i >= maxitm)
return;
cursor((j = (i & 1) * 40 + 1), (k = ((i % 26) >> 1) + 5));
if (itm_[i].qty == 0) {
lprintf("%39s", "");
return;
}
lprintf("%c) ", (i % 26) + 'a');
if (itm_[i].obj == OPOTION) {
lprcat("potion of ");
lprintf("%s", potionhide[itm_[i].arg]);
} else if (itm_[i].obj == OSCROLL) {
lprcat("scroll of ");
lprintf("%s", scrollhide[itm_[i].arg]);
} else
lprintf("%s", objectname[itm_[i].obj]);
cursor(j + 31, k);
lprintf("%6d", (long)(itm_[i].price * 10));
} | /*
dnditem(index)
to print the item list; used in dndstore() enter with the index into itm_
*/ | dnditem(index)
to print the item list; used in dndstore() enter with the index into itm_ | [
"dnditem",
"(",
"index",
")",
"to",
"print",
"the",
"item",
"list",
";",
"used",
"in",
"dndstore",
"()",
"enter",
"with",
"the",
"index",
"into",
"itm_"
] | static void
dnditem(int i)
{
int j, k;
if (i >= maxitm)
return;
cursor((j = (i & 1) * 40 + 1), (k = ((i % 26) >> 1) + 5));
if (itm_[i].qty == 0) {
lprintf("%39s", "");
return;
}
lprintf("%c) ", (i % 26) + 'a');
if (itm_[i].obj == OPOTION) {
lprcat("potion of ");
lprintf("%s", potionhide[itm_[i].arg]);
} else if (itm_[i].obj == OSCROLL) {
lprcat("scroll of ");
lprintf("%s", scrollhide[itm_[i].arg]);
} else
lprintf("%s", objectname[itm_[i].obj]);
cursor(j + 31, k);
lprintf("%6d", (long)(itm_[i].price * 10));
} | [
"static",
"void",
"dnditem",
"(",
"int",
"i",
")",
"{",
"int",
"j",
",",
"k",
";",
"if",
"(",
"i",
">=",
"maxitm",
")",
"return",
";",
"cursor",
"(",
"(",
"j",
"=",
"(",
"i",
"&",
"1",
")",
"*",
"40",
"+",
"1",
")",
",",
"(",
"k",
"=",
"(",
"(",
"i",
"%",
"26",
")",
">>",
"1",
")",
"+",
"5",
")",
")",
";",
"if",
"(",
"itm_",
"[",
"i",
"]",
".",
"qty",
"==",
"0",
")",
"{",
"lprintf",
"(",
"\"",
"\"",
",",
"\"",
"\"",
")",
";",
"return",
";",
"}",
"lprintf",
"(",
"\"",
"\"",
",",
"(",
"i",
"%",
"26",
")",
"+",
"'",
"'",
")",
";",
"if",
"(",
"itm_",
"[",
"i",
"]",
".",
"obj",
"==",
"OPOTION",
")",
"{",
"lprcat",
"(",
"\"",
"\"",
")",
";",
"lprintf",
"(",
"\"",
"\"",
",",
"potionhide",
"[",
"itm_",
"[",
"i",
"]",
".",
"arg",
"]",
")",
";",
"}",
"else",
"if",
"(",
"itm_",
"[",
"i",
"]",
".",
"obj",
"==",
"OSCROLL",
")",
"{",
"lprcat",
"(",
"\"",
"\"",
")",
";",
"lprintf",
"(",
"\"",
"\"",
",",
"scrollhide",
"[",
"itm_",
"[",
"i",
"]",
".",
"arg",
"]",
")",
";",
"}",
"else",
"lprintf",
"(",
"\"",
"\"",
",",
"objectname",
"[",
"itm_",
"[",
"i",
"]",
".",
"obj",
"]",
")",
";",
"cursor",
"(",
"j",
"+",
"31",
",",
"k",
")",
";",
"lprintf",
"(",
"\"",
"\"",
",",
"(",
"long",
")",
"(",
"itm_",
"[",
"i",
"]",
".",
"price",
"*",
"10",
")",
")",
";",
"}"
] | dnditem(index)
to print the item list; used in dndstore() enter with the index into itm_ | [
"dnditem",
"(",
"index",
")",
"to",
"print",
"the",
"item",
"list",
";",
"used",
"in",
"dndstore",
"()",
"enter",
"with",
"the",
"index",
"into",
"itm_"
] | [] | [
{
"param": "i",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "i",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e7bcee4068728a9630da9fbba402336ff2b4597 | atrens/DragonFlyBSD-src | games/larn/store.c | [
"BSD-3-Clause"
] | C | sch_hed | void | static void
sch_hed(void)
{
clear();
lprcat("The College of Larn offers the exciting opportunity of higher education to\n");
lprcat("all inhabitants of the caves. Here is a list of the class schedule:\n\n\n");
lprcat("\t\t Course Name \t Time Needed\n\n");
if (course[0] == 0)
lprcat("\t\ta) Fighters Training I 10 mobuls"); /* line 7 of crt */
lprc('\n');
if (course[1] == 0)
lprcat("\t\tb) Fighters Training II 15 mobuls");
lprc('\n');
if (course[2] == 0)
lprcat("\t\tc) Introduction to Wizardry 10 mobuls");
lprc('\n');
if (course[3] == 0)
lprcat("\t\td) Applied Wizardry 20 mobuls");
lprc('\n');
if (course[4] == 0)
lprcat("\t\te) Behavioral Psychology 10 mobuls");
lprc('\n');
if (course[5] == 0)
lprcat("\t\tf) Faith for Today 10 mobuls");
lprc('\n');
if (course[6] == 0)
lprcat("\t\tg) Contemporary Dance 10 mobuls");
lprc('\n');
if (course[7] == 0)
lprcat("\t\th) History of Larn 5 mobuls");
lprcat("\n\n\t\tAll courses cost 250 gold pieces.");
cursor(30, 18);
lprcat("You are presently carrying ");
} | /*
function to display the header info for the school
*/ | function to display the header info for the school | [
"function",
"to",
"display",
"the",
"header",
"info",
"for",
"the",
"school"
] | static void
sch_hed(void)
{
clear();
lprcat("The College of Larn offers the exciting opportunity of higher education to\n");
lprcat("all inhabitants of the caves. Here is a list of the class schedule:\n\n\n");
lprcat("\t\t Course Name \t Time Needed\n\n");
if (course[0] == 0)
lprcat("\t\ta) Fighters Training I 10 mobuls");
lprc('\n');
if (course[1] == 0)
lprcat("\t\tb) Fighters Training II 15 mobuls");
lprc('\n');
if (course[2] == 0)
lprcat("\t\tc) Introduction to Wizardry 10 mobuls");
lprc('\n');
if (course[3] == 0)
lprcat("\t\td) Applied Wizardry 20 mobuls");
lprc('\n');
if (course[4] == 0)
lprcat("\t\te) Behavioral Psychology 10 mobuls");
lprc('\n');
if (course[5] == 0)
lprcat("\t\tf) Faith for Today 10 mobuls");
lprc('\n');
if (course[6] == 0)
lprcat("\t\tg) Contemporary Dance 10 mobuls");
lprc('\n');
if (course[7] == 0)
lprcat("\t\th) History of Larn 5 mobuls");
lprcat("\n\n\t\tAll courses cost 250 gold pieces.");
cursor(30, 18);
lprcat("You are presently carrying ");
} | [
"static",
"void",
"sch_hed",
"(",
"void",
")",
"{",
"clear",
"(",
")",
";",
"lprcat",
"(",
"\"",
"\\n",
"\"",
")",
";",
"lprcat",
"(",
"\"",
"\\n",
"\\n",
"\\n",
"\"",
")",
";",
"lprcat",
"(",
"\"",
"\\t",
"\\t",
"\\t",
"\\n",
"\\n",
"\"",
")",
";",
"if",
"(",
"course",
"[",
"0",
"]",
"==",
"0",
")",
"lprcat",
"(",
"\"",
"\\t",
"\\t",
"\"",
")",
";",
"lprc",
"(",
"'",
"\\n",
"'",
")",
";",
"if",
"(",
"course",
"[",
"1",
"]",
"==",
"0",
")",
"lprcat",
"(",
"\"",
"\\t",
"\\t",
"\"",
")",
";",
"lprc",
"(",
"'",
"\\n",
"'",
")",
";",
"if",
"(",
"course",
"[",
"2",
"]",
"==",
"0",
")",
"lprcat",
"(",
"\"",
"\\t",
"\\t",
"\"",
")",
";",
"lprc",
"(",
"'",
"\\n",
"'",
")",
";",
"if",
"(",
"course",
"[",
"3",
"]",
"==",
"0",
")",
"lprcat",
"(",
"\"",
"\\t",
"\\t",
"\"",
")",
";",
"lprc",
"(",
"'",
"\\n",
"'",
")",
";",
"if",
"(",
"course",
"[",
"4",
"]",
"==",
"0",
")",
"lprcat",
"(",
"\"",
"\\t",
"\\t",
"\"",
")",
";",
"lprc",
"(",
"'",
"\\n",
"'",
")",
";",
"if",
"(",
"course",
"[",
"5",
"]",
"==",
"0",
")",
"lprcat",
"(",
"\"",
"\\t",
"\\t",
"\"",
")",
";",
"lprc",
"(",
"'",
"\\n",
"'",
")",
";",
"if",
"(",
"course",
"[",
"6",
"]",
"==",
"0",
")",
"lprcat",
"(",
"\"",
"\\t",
"\\t",
"\"",
")",
";",
"lprc",
"(",
"'",
"\\n",
"'",
")",
";",
"if",
"(",
"course",
"[",
"7",
"]",
"==",
"0",
")",
"lprcat",
"(",
"\"",
"\\t",
"\\t",
"\"",
")",
";",
"lprcat",
"(",
"\"",
"\\n",
"\\n",
"\\t",
"\\t",
"\"",
")",
";",
"cursor",
"(",
"30",
",",
"18",
")",
";",
"lprcat",
"(",
"\"",
"\"",
")",
";",
"}"
] | function to display the header info for the school | [
"function",
"to",
"display",
"the",
"header",
"info",
"for",
"the",
"school"
] | [
"/* line 7 of crt */"
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
1e7bcee4068728a9630da9fbba402336ff2b4597 | atrens/DragonFlyBSD-src | games/larn/store.c | [
"BSD-3-Clause"
] | C | obank | void | void
obank(void)
{
banktitle(" Welcome to the First National Bank of Larn.");
} | /* last time he was in bank */ | last time he was in bank | [
"last",
"time",
"he",
"was",
"in",
"bank"
] | void
obank(void)
{
banktitle(" Welcome to the First National Bank of Larn.");
} | [
"void",
"obank",
"(",
"void",
")",
"{",
"banktitle",
"(",
"\"",
"\"",
")",
";",
"}"
] | last time he was in bank | [
"last",
"time",
"he",
"was",
"in",
"bank"
] | [] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
1e7bcee4068728a9630da9fbba402336ff2b4597 | atrens/DragonFlyBSD-src | games/larn/store.c | [
"BSD-3-Clause"
] | C | ointerest | void | void
ointerest(void)
{
int i;
if (c[BANKACCOUNT] < 0)
c[BANKACCOUNT] = 0;
else if ((c[BANKACCOUNT] > 0) && (c[BANKACCOUNT] < 500000)) {
i = (gtime - lasttime) / 100; /* # mobuls elapsed */
while ((i-- > 0) && (c[BANKACCOUNT] < 500000))
c[BANKACCOUNT] += c[BANKACCOUNT] / 250;
if (c[BANKACCOUNT] > 500000)
c[BANKACCOUNT] = 500000; /* interest limit */
}
lasttime = rounddown(gtime, 100);
} | /*
* function to put interest on your bank account
*/ | function to put interest on your bank account | [
"function",
"to",
"put",
"interest",
"on",
"your",
"bank",
"account"
] | void
ointerest(void)
{
int i;
if (c[BANKACCOUNT] < 0)
c[BANKACCOUNT] = 0;
else if ((c[BANKACCOUNT] > 0) && (c[BANKACCOUNT] < 500000)) {
i = (gtime - lasttime) / 100;
while ((i-- > 0) && (c[BANKACCOUNT] < 500000))
c[BANKACCOUNT] += c[BANKACCOUNT] / 250;
if (c[BANKACCOUNT] > 500000)
c[BANKACCOUNT] = 500000;
}
lasttime = rounddown(gtime, 100);
} | [
"void",
"ointerest",
"(",
"void",
")",
"{",
"int",
"i",
";",
"if",
"(",
"c",
"[",
"BANKACCOUNT",
"]",
"<",
"0",
")",
"c",
"[",
"BANKACCOUNT",
"]",
"=",
"0",
";",
"else",
"if",
"(",
"(",
"c",
"[",
"BANKACCOUNT",
"]",
">",
"0",
")",
"&&",
"(",
"c",
"[",
"BANKACCOUNT",
"]",
"<",
"500000",
")",
")",
"{",
"i",
"=",
"(",
"gtime",
"-",
"lasttime",
")",
"/",
"100",
";",
"while",
"(",
"(",
"i",
"--",
">",
"0",
")",
"&&",
"(",
"c",
"[",
"BANKACCOUNT",
"]",
"<",
"500000",
")",
")",
"c",
"[",
"BANKACCOUNT",
"]",
"+=",
"c",
"[",
"BANKACCOUNT",
"]",
"/",
"250",
";",
"if",
"(",
"c",
"[",
"BANKACCOUNT",
"]",
">",
"500000",
")",
"c",
"[",
"BANKACCOUNT",
"]",
"=",
"500000",
";",
"}",
"lasttime",
"=",
"rounddown",
"(",
"gtime",
",",
"100",
")",
";",
"}"
] | function to put interest on your bank account | [
"function",
"to",
"put",
"interest",
"on",
"your",
"bank",
"account"
] | [
"/* # mobuls elapsed */",
"/* interest limit */"
] | [] | {
"returns": [],
"raises": [],
"params": [],
"outlier_params": [],
"others": []
} |
1e4b4d0e7c5e631e0d5f17d746ac74fb56290128 | atrens/DragonFlyBSD-src | sys/netgraph7/rfc1490/ng_rfc1490.c | [
"BSD-3-Clause"
] | C | ng_rfc1490_newhook | int | static int
ng_rfc1490_newhook(node_p node, hook_p hook, const char *name)
{
const priv_p priv = NG_NODE_PRIVATE(node);
if (!strcmp(name, NG_RFC1490_HOOK_DOWNSTREAM)) {
if (priv->downlink)
return (EISCONN);
priv->downlink = hook;
} else if (!strcmp(name, NG_RFC1490_HOOK_PPP)) {
if (priv->ppp)
return (EISCONN);
priv->ppp = hook;
} else if (!strcmp(name, NG_RFC1490_HOOK_INET)) {
if (priv->inet)
return (EISCONN);
priv->inet = hook;
} else if (!strcmp(name, NG_RFC1490_HOOK_ETHERNET)) {
if (priv->ethernet)
return (EISCONN);
priv->ethernet = hook;
} else
return (EINVAL);
return (0);
} | /*
* Give our ok for a hook to be added
*/ | Give our ok for a hook to be added | [
"Give",
"our",
"ok",
"for",
"a",
"hook",
"to",
"be",
"added"
] | static int
ng_rfc1490_newhook(node_p node, hook_p hook, const char *name)
{
const priv_p priv = NG_NODE_PRIVATE(node);
if (!strcmp(name, NG_RFC1490_HOOK_DOWNSTREAM)) {
if (priv->downlink)
return (EISCONN);
priv->downlink = hook;
} else if (!strcmp(name, NG_RFC1490_HOOK_PPP)) {
if (priv->ppp)
return (EISCONN);
priv->ppp = hook;
} else if (!strcmp(name, NG_RFC1490_HOOK_INET)) {
if (priv->inet)
return (EISCONN);
priv->inet = hook;
} else if (!strcmp(name, NG_RFC1490_HOOK_ETHERNET)) {
if (priv->ethernet)
return (EISCONN);
priv->ethernet = hook;
} else
return (EINVAL);
return (0);
} | [
"static",
"int",
"ng_rfc1490_newhook",
"(",
"node_p",
"node",
",",
"hook_p",
"hook",
",",
"const",
"char",
"*",
"name",
")",
"{",
"const",
"priv_p",
"priv",
"=",
"NG_NODE_PRIVATE",
"(",
"node",
")",
";",
"if",
"(",
"!",
"strcmp",
"(",
"name",
",",
"NG_RFC1490_HOOK_DOWNSTREAM",
")",
")",
"{",
"if",
"(",
"priv",
"->",
"downlink",
")",
"return",
"(",
"EISCONN",
")",
";",
"priv",
"->",
"downlink",
"=",
"hook",
";",
"}",
"else",
"if",
"(",
"!",
"strcmp",
"(",
"name",
",",
"NG_RFC1490_HOOK_PPP",
")",
")",
"{",
"if",
"(",
"priv",
"->",
"ppp",
")",
"return",
"(",
"EISCONN",
")",
";",
"priv",
"->",
"ppp",
"=",
"hook",
";",
"}",
"else",
"if",
"(",
"!",
"strcmp",
"(",
"name",
",",
"NG_RFC1490_HOOK_INET",
")",
")",
"{",
"if",
"(",
"priv",
"->",
"inet",
")",
"return",
"(",
"EISCONN",
")",
";",
"priv",
"->",
"inet",
"=",
"hook",
";",
"}",
"else",
"if",
"(",
"!",
"strcmp",
"(",
"name",
",",
"NG_RFC1490_HOOK_ETHERNET",
")",
")",
"{",
"if",
"(",
"priv",
"->",
"ethernet",
")",
"return",
"(",
"EISCONN",
")",
";",
"priv",
"->",
"ethernet",
"=",
"hook",
";",
"}",
"else",
"return",
"(",
"EINVAL",
")",
";",
"return",
"(",
"0",
")",
";",
"}"
] | Give our ok for a hook to be added | [
"Give",
"our",
"ok",
"for",
"a",
"hook",
"to",
"be",
"added"
] | [] | [
{
"param": "node",
"type": "node_p"
},
{
"param": "hook",
"type": "hook_p"
},
{
"param": "name",
"type": "char"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "node",
"type": "node_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "hook",
"type": "hook_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a706fb5ded225cef7fcfd1a89749138fbf88a5b0 | atrens/DragonFlyBSD-src | sys/bus/smbus/ichiic/ig4_iic.c | [
"BSD-3-Clause"
] | C | wait_status | int | static
int
wait_status(ig4iic_softc_t *sc, uint32_t status)
{
uint32_t v;
int error;
int txlvl = -1;
sysclock_t count;
sysclock_t limit;
error = SMB_ETIMEOUT;
count = sys_cputimer->count();
limit = sys_cputimer->freq / 40;
for (;;) {
/*
* Check requested status
*/
v = reg_read(sc, IG4_REG_I2C_STA);
if (v & status) {
error = 0;
break;
}
/*
* When waiting for receive data break-out if the interrupt
* loaded data into the FIFO.
*/
if (status & IG4_STATUS_RX_NOTEMPTY) {
if (sc->rpos != sc->rnext) {
error = 0;
break;
}
}
/*
* When waiting for the transmit FIFO to become empty,
* reset the timeout if we see a change in the transmit
* FIFO level as progress is being made.
*/
if (status & IG4_STATUS_TX_EMPTY) {
v = reg_read(sc, IG4_REG_TXFLR) & IG4_FIFOLVL_MASK;
if (txlvl != v) {
txlvl = v;
count = sys_cputimer->count();
}
}
/*
* Stop if we've run out of time.
*/
if (sys_cputimer->count() - count > limit)
break;
/*
* When waiting for receive data let the interrupt do its
* work, otherwise poll with the serializer held.
*/
if (status & IG4_STATUS_RX_NOTEMPTY) {
set_intr_mask(sc, IG4_INTR_STOP_DET | IG4_INTR_RX_FULL);
zsleep(sc, &sc->slz, 0, "i2cwait", (hz + 99) / 100);
set_intr_mask(sc, 0);
} else {
DELAY(25);
}
}
return error;
} | /*
* Wait up to 25ms for the requested status using a 25uS polling loop.
*/ | Wait up to 25ms for the requested status using a 25uS polling loop. | [
"Wait",
"up",
"to",
"25ms",
"for",
"the",
"requested",
"status",
"using",
"a",
"25uS",
"polling",
"loop",
"."
] | static
int
wait_status(ig4iic_softc_t *sc, uint32_t status)
{
uint32_t v;
int error;
int txlvl = -1;
sysclock_t count;
sysclock_t limit;
error = SMB_ETIMEOUT;
count = sys_cputimer->count();
limit = sys_cputimer->freq / 40;
for (;;) {
v = reg_read(sc, IG4_REG_I2C_STA);
if (v & status) {
error = 0;
break;
}
if (status & IG4_STATUS_RX_NOTEMPTY) {
if (sc->rpos != sc->rnext) {
error = 0;
break;
}
}
if (status & IG4_STATUS_TX_EMPTY) {
v = reg_read(sc, IG4_REG_TXFLR) & IG4_FIFOLVL_MASK;
if (txlvl != v) {
txlvl = v;
count = sys_cputimer->count();
}
}
if (sys_cputimer->count() - count > limit)
break;
if (status & IG4_STATUS_RX_NOTEMPTY) {
set_intr_mask(sc, IG4_INTR_STOP_DET | IG4_INTR_RX_FULL);
zsleep(sc, &sc->slz, 0, "i2cwait", (hz + 99) / 100);
set_intr_mask(sc, 0);
} else {
DELAY(25);
}
}
return error;
} | [
"static",
"int",
"wait_status",
"(",
"ig4iic_softc_t",
"*",
"sc",
",",
"uint32_t",
"status",
")",
"{",
"uint32_t",
"v",
";",
"int",
"error",
";",
"int",
"txlvl",
"=",
"-1",
";",
"sysclock_t",
"count",
";",
"sysclock_t",
"limit",
";",
"error",
"=",
"SMB_ETIMEOUT",
";",
"count",
"=",
"sys_cputimer",
"->",
"count",
"(",
")",
";",
"limit",
"=",
"sys_cputimer",
"->",
"freq",
"/",
"40",
";",
"for",
"(",
";",
";",
")",
"{",
"v",
"=",
"reg_read",
"(",
"sc",
",",
"IG4_REG_I2C_STA",
")",
";",
"if",
"(",
"v",
"&",
"status",
")",
"{",
"error",
"=",
"0",
";",
"break",
";",
"}",
"if",
"(",
"status",
"&",
"IG4_STATUS_RX_NOTEMPTY",
")",
"{",
"if",
"(",
"sc",
"->",
"rpos",
"!=",
"sc",
"->",
"rnext",
")",
"{",
"error",
"=",
"0",
";",
"break",
";",
"}",
"}",
"if",
"(",
"status",
"&",
"IG4_STATUS_TX_EMPTY",
")",
"{",
"v",
"=",
"reg_read",
"(",
"sc",
",",
"IG4_REG_TXFLR",
")",
"&",
"IG4_FIFOLVL_MASK",
";",
"if",
"(",
"txlvl",
"!=",
"v",
")",
"{",
"txlvl",
"=",
"v",
";",
"count",
"=",
"sys_cputimer",
"->",
"count",
"(",
")",
";",
"}",
"}",
"if",
"(",
"sys_cputimer",
"->",
"count",
"(",
")",
"-",
"count",
">",
"limit",
")",
"break",
";",
"if",
"(",
"status",
"&",
"IG4_STATUS_RX_NOTEMPTY",
")",
"{",
"set_intr_mask",
"(",
"sc",
",",
"IG4_INTR_STOP_DET",
"|",
"IG4_INTR_RX_FULL",
")",
";",
"zsleep",
"(",
"sc",
",",
"&",
"sc",
"->",
"slz",
",",
"0",
",",
"\"",
"\"",
",",
"(",
"hz",
"+",
"99",
")",
"/",
"100",
")",
";",
"set_intr_mask",
"(",
"sc",
",",
"0",
")",
";",
"}",
"else",
"{",
"DELAY",
"(",
"25",
")",
";",
"}",
"}",
"return",
"error",
";",
"}"
] | Wait up to 25ms for the requested status using a 25uS polling loop. | [
"Wait",
"up",
"to",
"25ms",
"for",
"the",
"requested",
"status",
"using",
"a",
"25uS",
"polling",
"loop",
"."
] | [
"/*\n\t\t * Check requested status\n\t\t */",
"/*\n\t\t * When waiting for receive data break-out if the interrupt\n\t\t * loaded data into the FIFO.\n\t\t */",
"/*\n\t\t * When waiting for the transmit FIFO to become empty,\n\t\t * reset the timeout if we see a change in the transmit\n\t\t * FIFO level as progress is being made.\n\t\t */",
"/*\n\t\t * Stop if we've run out of time.\n\t\t */",
"/*\n\t\t * When waiting for receive data let the interrupt do its\n\t\t * work, otherwise poll with the serializer held.\n\t\t */"
] | [
{
"param": "sc",
"type": "ig4iic_softc_t"
},
{
"param": "status",
"type": "uint32_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "sc",
"type": "ig4iic_softc_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "status",
"type": "uint32_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a706fb5ded225cef7fcfd1a89749138fbf88a5b0 | atrens/DragonFlyBSD-src | sys/bus/smbus/ichiic/ig4_iic.c | [
"BSD-3-Clause"
] | C | data_read | uint8_t | static
uint8_t
data_read(ig4iic_softc_t *sc)
{
uint8_t c;
if (sc->rpos == sc->rnext) {
c = (uint8_t)reg_read(sc, IG4_REG_DATA_CMD);
} else {
c = sc->rbuf[sc->rpos & IG4_RBUFMASK];
++sc->rpos;
}
return c;
} | /*
* Read I2C data. The data might have already been read by
* the interrupt code, otherwise it is sitting in the data
* register.
*/ | Read I2C data. The data might have already been read by
the interrupt code, otherwise it is sitting in the data
register. | [
"Read",
"I2C",
"data",
".",
"The",
"data",
"might",
"have",
"already",
"been",
"read",
"by",
"the",
"interrupt",
"code",
"otherwise",
"it",
"is",
"sitting",
"in",
"the",
"data",
"register",
"."
] | static
uint8_t
data_read(ig4iic_softc_t *sc)
{
uint8_t c;
if (sc->rpos == sc->rnext) {
c = (uint8_t)reg_read(sc, IG4_REG_DATA_CMD);
} else {
c = sc->rbuf[sc->rpos & IG4_RBUFMASK];
++sc->rpos;
}
return c;
} | [
"static",
"uint8_t",
"data_read",
"(",
"ig4iic_softc_t",
"*",
"sc",
")",
"{",
"uint8_t",
"c",
";",
"if",
"(",
"sc",
"->",
"rpos",
"==",
"sc",
"->",
"rnext",
")",
"{",
"c",
"=",
"(",
"uint8_t",
")",
"reg_read",
"(",
"sc",
",",
"IG4_REG_DATA_CMD",
")",
";",
"}",
"else",
"{",
"c",
"=",
"sc",
"->",
"rbuf",
"[",
"sc",
"->",
"rpos",
"&",
"IG4_RBUFMASK",
"]",
";",
"++",
"sc",
"->",
"rpos",
";",
"}",
"return",
"c",
";",
"}"
] | Read I2C data. | [
"Read",
"I2C",
"data",
"."
] | [] | [
{
"param": "sc",
"type": "ig4iic_softc_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "sc",
"type": "ig4iic_softc_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a706fb5ded225cef7fcfd1a89749138fbf88a5b0 | atrens/DragonFlyBSD-src | sys/bus/smbus/ichiic/ig4_iic.c | [
"BSD-3-Clause"
] | C | ig4iic_smb_recvb | int | int
ig4iic_smb_recvb(device_t dev, u_char slave, char *byte)
{
ig4iic_softc_t *sc = device_get_softc(dev);
int error;
lwkt_serialize_enter(&sc->slz);
set_slave_addr(sc, slave, 0);
reg_write(sc, IG4_REG_DATA_CMD, IG4_DATA_COMMAND_RD);
if (wait_status(sc, IG4_STATUS_RX_NOTEMPTY) == 0) {
*byte = data_read(sc);
error = 0;
} else {
*byte = 0;
error = SMB_ETIMEOUT;
}
lwkt_serialize_exit(&sc->slz);
return error;
} | /*
* Incremental receive byte without stop (?). It is unclear why the slave
* address is specified if this presumably is used in combination with
* ig4iic_smb_quick().
*/ | Incremental receive byte without stop (?). It is unclear why the slave
address is specified if this presumably is used in combination with
ig4iic_smb_quick(). | [
"Incremental",
"receive",
"byte",
"without",
"stop",
"(",
"?",
")",
".",
"It",
"is",
"unclear",
"why",
"the",
"slave",
"address",
"is",
"specified",
"if",
"this",
"presumably",
"is",
"used",
"in",
"combination",
"with",
"ig4iic_smb_quick",
"()",
"."
] | int
ig4iic_smb_recvb(device_t dev, u_char slave, char *byte)
{
ig4iic_softc_t *sc = device_get_softc(dev);
int error;
lwkt_serialize_enter(&sc->slz);
set_slave_addr(sc, slave, 0);
reg_write(sc, IG4_REG_DATA_CMD, IG4_DATA_COMMAND_RD);
if (wait_status(sc, IG4_STATUS_RX_NOTEMPTY) == 0) {
*byte = data_read(sc);
error = 0;
} else {
*byte = 0;
error = SMB_ETIMEOUT;
}
lwkt_serialize_exit(&sc->slz);
return error;
} | [
"int",
"ig4iic_smb_recvb",
"(",
"device_t",
"dev",
",",
"u_char",
"slave",
",",
"char",
"*",
"byte",
")",
"{",
"ig4iic_softc_t",
"*",
"sc",
"=",
"device_get_softc",
"(",
"dev",
")",
";",
"int",
"error",
";",
"lwkt_serialize_enter",
"(",
"&",
"sc",
"->",
"slz",
")",
";",
"set_slave_addr",
"(",
"sc",
",",
"slave",
",",
"0",
")",
";",
"reg_write",
"(",
"sc",
",",
"IG4_REG_DATA_CMD",
",",
"IG4_DATA_COMMAND_RD",
")",
";",
"if",
"(",
"wait_status",
"(",
"sc",
",",
"IG4_STATUS_RX_NOTEMPTY",
")",
"==",
"0",
")",
"{",
"*",
"byte",
"=",
"data_read",
"(",
"sc",
")",
";",
"error",
"=",
"0",
";",
"}",
"else",
"{",
"*",
"byte",
"=",
"0",
";",
"error",
"=",
"SMB_ETIMEOUT",
";",
"}",
"lwkt_serialize_exit",
"(",
"&",
"sc",
"->",
"slz",
")",
";",
"return",
"error",
";",
"}"
] | Incremental receive byte without stop (?). | [
"Incremental",
"receive",
"byte",
"without",
"stop",
"(",
"?",
")",
"."
] | [] | [
{
"param": "dev",
"type": "device_t"
},
{
"param": "slave",
"type": "u_char"
},
{
"param": "byte",
"type": "char"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "dev",
"type": "device_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "slave",
"type": "u_char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "byte",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a706fb5ded225cef7fcfd1a89749138fbf88a5b0 | atrens/DragonFlyBSD-src | sys/bus/smbus/ichiic/ig4_iic.c | [
"BSD-3-Clause"
] | C | ig4iic_smb_writeb | int | int
ig4iic_smb_writeb(device_t dev, u_char slave, char cmd, char byte)
{
ig4iic_softc_t *sc = device_get_softc(dev);
int error;
lwkt_serialize_enter(&sc->slz);
set_slave_addr(sc, slave, 0);
error = smb_transaction(sc, cmd, SMB_TRANS_NOCNT,
&byte, 1, NULL, 0, NULL);
lwkt_serialize_exit(&sc->slz);
return error;
} | /*
* Write command and single byte in transaction.
*/ | Write command and single byte in transaction. | [
"Write",
"command",
"and",
"single",
"byte",
"in",
"transaction",
"."
] | int
ig4iic_smb_writeb(device_t dev, u_char slave, char cmd, char byte)
{
ig4iic_softc_t *sc = device_get_softc(dev);
int error;
lwkt_serialize_enter(&sc->slz);
set_slave_addr(sc, slave, 0);
error = smb_transaction(sc, cmd, SMB_TRANS_NOCNT,
&byte, 1, NULL, 0, NULL);
lwkt_serialize_exit(&sc->slz);
return error;
} | [
"int",
"ig4iic_smb_writeb",
"(",
"device_t",
"dev",
",",
"u_char",
"slave",
",",
"char",
"cmd",
",",
"char",
"byte",
")",
"{",
"ig4iic_softc_t",
"*",
"sc",
"=",
"device_get_softc",
"(",
"dev",
")",
";",
"int",
"error",
";",
"lwkt_serialize_enter",
"(",
"&",
"sc",
"->",
"slz",
")",
";",
"set_slave_addr",
"(",
"sc",
",",
"slave",
",",
"0",
")",
";",
"error",
"=",
"smb_transaction",
"(",
"sc",
",",
"cmd",
",",
"SMB_TRANS_NOCNT",
",",
"&",
"byte",
",",
"1",
",",
"NULL",
",",
"0",
",",
"NULL",
")",
";",
"lwkt_serialize_exit",
"(",
"&",
"sc",
"->",
"slz",
")",
";",
"return",
"error",
";",
"}"
] | Write command and single byte in transaction. | [
"Write",
"command",
"and",
"single",
"byte",
"in",
"transaction",
"."
] | [] | [
{
"param": "dev",
"type": "device_t"
},
{
"param": "slave",
"type": "u_char"
},
{
"param": "cmd",
"type": "char"
},
{
"param": "byte",
"type": "char"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "dev",
"type": "device_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "slave",
"type": "u_char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cmd",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "byte",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a706fb5ded225cef7fcfd1a89749138fbf88a5b0 | atrens/DragonFlyBSD-src | sys/bus/smbus/ichiic/ig4_iic.c | [
"BSD-3-Clause"
] | C | ig4iic_smb_writew | int | int
ig4iic_smb_writew(device_t dev, u_char slave, char cmd, short word)
{
ig4iic_softc_t *sc = device_get_softc(dev);
char buf[2];
int error;
lwkt_serialize_enter(&sc->slz);
set_slave_addr(sc, slave, 0);
buf[0] = word & 0xFF;
buf[1] = word >> 8;
error = smb_transaction(sc, cmd, SMB_TRANS_NOCNT,
buf, 2, NULL, 0, NULL);
lwkt_serialize_exit(&sc->slz);
return error;
} | /*
* Write command and single word in transaction.
*/ | Write command and single word in transaction. | [
"Write",
"command",
"and",
"single",
"word",
"in",
"transaction",
"."
] | int
ig4iic_smb_writew(device_t dev, u_char slave, char cmd, short word)
{
ig4iic_softc_t *sc = device_get_softc(dev);
char buf[2];
int error;
lwkt_serialize_enter(&sc->slz);
set_slave_addr(sc, slave, 0);
buf[0] = word & 0xFF;
buf[1] = word >> 8;
error = smb_transaction(sc, cmd, SMB_TRANS_NOCNT,
buf, 2, NULL, 0, NULL);
lwkt_serialize_exit(&sc->slz);
return error;
} | [
"int",
"ig4iic_smb_writew",
"(",
"device_t",
"dev",
",",
"u_char",
"slave",
",",
"char",
"cmd",
",",
"short",
"word",
")",
"{",
"ig4iic_softc_t",
"*",
"sc",
"=",
"device_get_softc",
"(",
"dev",
")",
";",
"char",
"buf",
"[",
"2",
"]",
";",
"int",
"error",
";",
"lwkt_serialize_enter",
"(",
"&",
"sc",
"->",
"slz",
")",
";",
"set_slave_addr",
"(",
"sc",
",",
"slave",
",",
"0",
")",
";",
"buf",
"[",
"0",
"]",
"=",
"word",
"&",
"0xFF",
";",
"buf",
"[",
"1",
"]",
"=",
"word",
">>",
"8",
";",
"error",
"=",
"smb_transaction",
"(",
"sc",
",",
"cmd",
",",
"SMB_TRANS_NOCNT",
",",
"buf",
",",
"2",
",",
"NULL",
",",
"0",
",",
"NULL",
")",
";",
"lwkt_serialize_exit",
"(",
"&",
"sc",
"->",
"slz",
")",
";",
"return",
"error",
";",
"}"
] | Write command and single word in transaction. | [
"Write",
"command",
"and",
"single",
"word",
"in",
"transaction",
"."
] | [] | [
{
"param": "dev",
"type": "device_t"
},
{
"param": "slave",
"type": "u_char"
},
{
"param": "cmd",
"type": "char"
},
{
"param": "word",
"type": "short"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "dev",
"type": "device_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "slave",
"type": "u_char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cmd",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "word",
"type": "short",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a706fb5ded225cef7fcfd1a89749138fbf88a5b0 | atrens/DragonFlyBSD-src | sys/bus/smbus/ichiic/ig4_iic.c | [
"BSD-3-Clause"
] | C | ig4iic_smb_readb | int | int
ig4iic_smb_readb(device_t dev, u_char slave, char cmd, char *byte)
{
ig4iic_softc_t *sc = device_get_softc(dev);
int error;
lwkt_serialize_enter(&sc->slz);
set_slave_addr(sc, slave, 0);
error = smb_transaction(sc, cmd, SMB_TRANS_NOCNT,
NULL, 0, byte, 1, NULL);
lwkt_serialize_exit(&sc->slz);
return error;
} | /*
* write command and read single byte in transaction.
*/ | write command and read single byte in transaction. | [
"write",
"command",
"and",
"read",
"single",
"byte",
"in",
"transaction",
"."
] | int
ig4iic_smb_readb(device_t dev, u_char slave, char cmd, char *byte)
{
ig4iic_softc_t *sc = device_get_softc(dev);
int error;
lwkt_serialize_enter(&sc->slz);
set_slave_addr(sc, slave, 0);
error = smb_transaction(sc, cmd, SMB_TRANS_NOCNT,
NULL, 0, byte, 1, NULL);
lwkt_serialize_exit(&sc->slz);
return error;
} | [
"int",
"ig4iic_smb_readb",
"(",
"device_t",
"dev",
",",
"u_char",
"slave",
",",
"char",
"cmd",
",",
"char",
"*",
"byte",
")",
"{",
"ig4iic_softc_t",
"*",
"sc",
"=",
"device_get_softc",
"(",
"dev",
")",
";",
"int",
"error",
";",
"lwkt_serialize_enter",
"(",
"&",
"sc",
"->",
"slz",
")",
";",
"set_slave_addr",
"(",
"sc",
",",
"slave",
",",
"0",
")",
";",
"error",
"=",
"smb_transaction",
"(",
"sc",
",",
"cmd",
",",
"SMB_TRANS_NOCNT",
",",
"NULL",
",",
"0",
",",
"byte",
",",
"1",
",",
"NULL",
")",
";",
"lwkt_serialize_exit",
"(",
"&",
"sc",
"->",
"slz",
")",
";",
"return",
"error",
";",
"}"
] | write command and read single byte in transaction. | [
"write",
"command",
"and",
"read",
"single",
"byte",
"in",
"transaction",
"."
] | [] | [
{
"param": "dev",
"type": "device_t"
},
{
"param": "slave",
"type": "u_char"
},
{
"param": "cmd",
"type": "char"
},
{
"param": "byte",
"type": "char"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "dev",
"type": "device_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "slave",
"type": "u_char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cmd",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "byte",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a706fb5ded225cef7fcfd1a89749138fbf88a5b0 | atrens/DragonFlyBSD-src | sys/bus/smbus/ichiic/ig4_iic.c | [
"BSD-3-Clause"
] | C | ig4iic_smb_readw | int | int
ig4iic_smb_readw(device_t dev, u_char slave, char cmd, short *word)
{
ig4iic_softc_t *sc = device_get_softc(dev);
char buf[2];
int error;
lwkt_serialize_enter(&sc->slz);
set_slave_addr(sc, slave, 0);
if ((error = smb_transaction(sc, cmd, SMB_TRANS_NOCNT,
NULL, 0, buf, 2, NULL)) == 0) {
*word = (u_char)buf[0] | ((u_char)buf[1] << 8);
}
lwkt_serialize_exit(&sc->slz);
return error;
} | /*
* write command and read word in transaction.
*/ | write command and read word in transaction. | [
"write",
"command",
"and",
"read",
"word",
"in",
"transaction",
"."
] | int
ig4iic_smb_readw(device_t dev, u_char slave, char cmd, short *word)
{
ig4iic_softc_t *sc = device_get_softc(dev);
char buf[2];
int error;
lwkt_serialize_enter(&sc->slz);
set_slave_addr(sc, slave, 0);
if ((error = smb_transaction(sc, cmd, SMB_TRANS_NOCNT,
NULL, 0, buf, 2, NULL)) == 0) {
*word = (u_char)buf[0] | ((u_char)buf[1] << 8);
}
lwkt_serialize_exit(&sc->slz);
return error;
} | [
"int",
"ig4iic_smb_readw",
"(",
"device_t",
"dev",
",",
"u_char",
"slave",
",",
"char",
"cmd",
",",
"short",
"*",
"word",
")",
"{",
"ig4iic_softc_t",
"*",
"sc",
"=",
"device_get_softc",
"(",
"dev",
")",
";",
"char",
"buf",
"[",
"2",
"]",
";",
"int",
"error",
";",
"lwkt_serialize_enter",
"(",
"&",
"sc",
"->",
"slz",
")",
";",
"set_slave_addr",
"(",
"sc",
",",
"slave",
",",
"0",
")",
";",
"if",
"(",
"(",
"error",
"=",
"smb_transaction",
"(",
"sc",
",",
"cmd",
",",
"SMB_TRANS_NOCNT",
",",
"NULL",
",",
"0",
",",
"buf",
",",
"2",
",",
"NULL",
")",
")",
"==",
"0",
")",
"{",
"*",
"word",
"=",
"(",
"u_char",
")",
"buf",
"[",
"0",
"]",
"|",
"(",
"(",
"u_char",
")",
"buf",
"[",
"1",
"]",
"<<",
"8",
")",
";",
"}",
"lwkt_serialize_exit",
"(",
"&",
"sc",
"->",
"slz",
")",
";",
"return",
"error",
";",
"}"
] | write command and read word in transaction. | [
"write",
"command",
"and",
"read",
"word",
"in",
"transaction",
"."
] | [] | [
{
"param": "dev",
"type": "device_t"
},
{
"param": "slave",
"type": "u_char"
},
{
"param": "cmd",
"type": "char"
},
{
"param": "word",
"type": "short"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "dev",
"type": "device_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "slave",
"type": "u_char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cmd",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "word",
"type": "short",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
a706fb5ded225cef7fcfd1a89749138fbf88a5b0 | atrens/DragonFlyBSD-src | sys/bus/smbus/ichiic/ig4_iic.c | [
"BSD-3-Clause"
] | C | ig4iic_smb_pcall | int | int
ig4iic_smb_pcall(device_t dev, u_char slave, char cmd,
short sdata, short *rdata)
{
ig4iic_softc_t *sc = device_get_softc(dev);
char rbuf[2];
char wbuf[2];
int error;
lwkt_serialize_enter(&sc->slz);
set_slave_addr(sc, slave, 0);
wbuf[0] = sdata & 0xFF;
wbuf[1] = sdata >> 8;
if ((error = smb_transaction(sc, cmd, SMB_TRANS_NOCNT,
wbuf, 2, rbuf, 2, NULL)) == 0) {
*rdata = (u_char)rbuf[0] | ((u_char)rbuf[1] << 8);
}
lwkt_serialize_exit(&sc->slz);
return error;
} | /*
* write command and word and read word in transaction
*/ | write command and word and read word in transaction | [
"write",
"command",
"and",
"word",
"and",
"read",
"word",
"in",
"transaction"
] | int
ig4iic_smb_pcall(device_t dev, u_char slave, char cmd,
short sdata, short *rdata)
{
ig4iic_softc_t *sc = device_get_softc(dev);
char rbuf[2];
char wbuf[2];
int error;
lwkt_serialize_enter(&sc->slz);
set_slave_addr(sc, slave, 0);
wbuf[0] = sdata & 0xFF;
wbuf[1] = sdata >> 8;
if ((error = smb_transaction(sc, cmd, SMB_TRANS_NOCNT,
wbuf, 2, rbuf, 2, NULL)) == 0) {
*rdata = (u_char)rbuf[0] | ((u_char)rbuf[1] << 8);
}
lwkt_serialize_exit(&sc->slz);
return error;
} | [
"int",
"ig4iic_smb_pcall",
"(",
"device_t",
"dev",
",",
"u_char",
"slave",
",",
"char",
"cmd",
",",
"short",
"sdata",
",",
"short",
"*",
"rdata",
")",
"{",
"ig4iic_softc_t",
"*",
"sc",
"=",
"device_get_softc",
"(",
"dev",
")",
";",
"char",
"rbuf",
"[",
"2",
"]",
";",
"char",
"wbuf",
"[",
"2",
"]",
";",
"int",
"error",
";",
"lwkt_serialize_enter",
"(",
"&",
"sc",
"->",
"slz",
")",
";",
"set_slave_addr",
"(",
"sc",
",",
"slave",
",",
"0",
")",
";",
"wbuf",
"[",
"0",
"]",
"=",
"sdata",
"&",
"0xFF",
";",
"wbuf",
"[",
"1",
"]",
"=",
"sdata",
">>",
"8",
";",
"if",
"(",
"(",
"error",
"=",
"smb_transaction",
"(",
"sc",
",",
"cmd",
",",
"SMB_TRANS_NOCNT",
",",
"wbuf",
",",
"2",
",",
"rbuf",
",",
"2",
",",
"NULL",
")",
")",
"==",
"0",
")",
"{",
"*",
"rdata",
"=",
"(",
"u_char",
")",
"rbuf",
"[",
"0",
"]",
"|",
"(",
"(",
"u_char",
")",
"rbuf",
"[",
"1",
"]",
"<<",
"8",
")",
";",
"}",
"lwkt_serialize_exit",
"(",
"&",
"sc",
"->",
"slz",
")",
";",
"return",
"error",
";",
"}"
] | write command and word and read word in transaction | [
"write",
"command",
"and",
"word",
"and",
"read",
"word",
"in",
"transaction"
] | [] | [
{
"param": "dev",
"type": "device_t"
},
{
"param": "slave",
"type": "u_char"
},
{
"param": "cmd",
"type": "char"
},
{
"param": "sdata",
"type": "short"
},
{
"param": "rdata",
"type": "short"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "dev",
"type": "device_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "slave",
"type": "u_char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "cmd",
"type": "char",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "sdata",
"type": "short",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "rdata",
"type": "short",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
14dfe2ab3bd65d185900aa7ba1ee2f072014cdef | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-ssa-phiprop.c | [
"BSD-3-Clause"
] | C | phivn_valid_p | bool | static bool
phivn_valid_p (struct phiprop_d *phivn, tree name, basic_block bb)
{
tree vuse = phivn[SSA_NAME_VERSION (name)].vuse;
gimple *use_stmt;
imm_use_iterator ui2;
bool ok = true;
/* The def stmts of the virtual uses need to be dominated by bb. */
gcc_assert (vuse != NULL_TREE);
FOR_EACH_IMM_USE_STMT (use_stmt, ui2, vuse)
{
/* If BB does not dominate a VDEF, the value is invalid. */
if ((gimple_vdef (use_stmt) != NULL_TREE
|| gimple_code (use_stmt) == GIMPLE_PHI)
&& !dominated_by_p (CDI_DOMINATORS, gimple_bb (use_stmt), bb))
{
ok = false;
BREAK_FROM_IMM_USE_STMT (ui2);
}
}
return ok;
} | /* Verify if the value recorded for NAME in PHIVN is still valid at
the start of basic block BB. */ | Verify if the value recorded for NAME in PHIVN is still valid at
the start of basic block BB. | [
"Verify",
"if",
"the",
"value",
"recorded",
"for",
"NAME",
"in",
"PHIVN",
"is",
"still",
"valid",
"at",
"the",
"start",
"of",
"basic",
"block",
"BB",
"."
] | static bool
phivn_valid_p (struct phiprop_d *phivn, tree name, basic_block bb)
{
tree vuse = phivn[SSA_NAME_VERSION (name)].vuse;
gimple *use_stmt;
imm_use_iterator ui2;
bool ok = true;
gcc_assert (vuse != NULL_TREE);
FOR_EACH_IMM_USE_STMT (use_stmt, ui2, vuse)
{
if ((gimple_vdef (use_stmt) != NULL_TREE
|| gimple_code (use_stmt) == GIMPLE_PHI)
&& !dominated_by_p (CDI_DOMINATORS, gimple_bb (use_stmt), bb))
{
ok = false;
BREAK_FROM_IMM_USE_STMT (ui2);
}
}
return ok;
} | [
"static",
"bool",
"phivn_valid_p",
"(",
"struct",
"phiprop_d",
"*",
"phivn",
",",
"tree",
"name",
",",
"basic_block",
"bb",
")",
"{",
"tree",
"vuse",
"=",
"phivn",
"[",
"SSA_NAME_VERSION",
"(",
"name",
")",
"]",
".",
"vuse",
";",
"gimple",
"*",
"use_stmt",
";",
"imm_use_iterator",
"ui2",
";",
"bool",
"ok",
"=",
"true",
";",
"gcc_assert",
"(",
"vuse",
"!=",
"NULL_TREE",
")",
";",
"FOR_EACH_IMM_USE_STMT",
"(",
"use_stmt",
",",
"ui2",
",",
"vuse",
")",
"",
"{",
"if",
"(",
"(",
"gimple_vdef",
"(",
"use_stmt",
")",
"!=",
"NULL_TREE",
"||",
"gimple_code",
"(",
"use_stmt",
")",
"==",
"GIMPLE_PHI",
")",
"&&",
"!",
"dominated_by_p",
"(",
"CDI_DOMINATORS",
",",
"gimple_bb",
"(",
"use_stmt",
")",
",",
"bb",
")",
")",
"{",
"ok",
"=",
"false",
";",
"BREAK_FROM_IMM_USE_STMT",
"(",
"ui2",
")",
";",
"}",
"}",
"return",
"ok",
";",
"}"
] | Verify if the value recorded for NAME in PHIVN is still valid at
the start of basic block BB. | [
"Verify",
"if",
"the",
"value",
"recorded",
"for",
"NAME",
"in",
"PHIVN",
"is",
"still",
"valid",
"at",
"the",
"start",
"of",
"basic",
"block",
"BB",
"."
] | [
"/* The def stmts of the virtual uses need to be dominated by bb. */",
"/* If BB does not dominate a VDEF, the value is invalid. */"
] | [
{
"param": "phivn",
"type": "struct phiprop_d"
},
{
"param": "name",
"type": "tree"
},
{
"param": "bb",
"type": "basic_block"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "phivn",
"type": "struct phiprop_d",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "name",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "bb",
"type": "basic_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
14dfe2ab3bd65d185900aa7ba1ee2f072014cdef | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-ssa-phiprop.c | [
"BSD-3-Clause"
] | C | phiprop_insert_phi | tree | static tree
phiprop_insert_phi (basic_block bb, gphi *phi, gimple *use_stmt,
struct phiprop_d *phivn, size_t n)
{
tree res;
gphi *new_phi = NULL;
edge_iterator ei;
edge e;
gcc_assert (is_gimple_assign (use_stmt)
&& gimple_assign_rhs_code (use_stmt) == MEM_REF);
/* Build a new PHI node to replace the definition of
the indirect reference lhs. */
res = gimple_assign_lhs (use_stmt);
if (TREE_CODE (res) == SSA_NAME)
new_phi = create_phi_node (res, bb);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Inserting PHI for result of load ");
print_gimple_stmt (dump_file, use_stmt, 0);
}
/* Add PHI arguments for each edge inserting loads of the
addressable operands. */
FOR_EACH_EDGE (e, ei, bb->preds)
{
tree old_arg, new_var;
gassign *tmp;
source_location locus;
old_arg = PHI_ARG_DEF_FROM_EDGE (phi, e);
locus = gimple_phi_arg_location_from_edge (phi, e);
while (TREE_CODE (old_arg) == SSA_NAME
&& (SSA_NAME_VERSION (old_arg) >= n
|| phivn[SSA_NAME_VERSION (old_arg)].value == NULL_TREE))
{
gimple *def_stmt = SSA_NAME_DEF_STMT (old_arg);
old_arg = gimple_assign_rhs1 (def_stmt);
locus = gimple_location (def_stmt);
}
if (TREE_CODE (old_arg) == SSA_NAME)
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " for edge defining ");
print_generic_expr (dump_file, PHI_ARG_DEF_FROM_EDGE (phi, e));
fprintf (dump_file, " reusing PHI result ");
print_generic_expr (dump_file,
phivn[SSA_NAME_VERSION (old_arg)].value);
fprintf (dump_file, "\n");
}
/* Reuse a formerly created dereference. */
new_var = phivn[SSA_NAME_VERSION (old_arg)].value;
}
else
{
tree rhs = gimple_assign_rhs1 (use_stmt);
gcc_assert (TREE_CODE (old_arg) == ADDR_EXPR);
if (TREE_CODE (res) == SSA_NAME)
new_var = make_ssa_name (TREE_TYPE (rhs));
else
new_var = unshare_expr (res);
if (!is_gimple_min_invariant (old_arg))
old_arg = PHI_ARG_DEF_FROM_EDGE (phi, e);
else
old_arg = unshare_expr (old_arg);
tmp = gimple_build_assign (new_var,
fold_build2 (MEM_REF, TREE_TYPE (rhs),
old_arg,
TREE_OPERAND (rhs, 1)));
gimple_set_location (tmp, locus);
gsi_insert_on_edge (e, tmp);
update_stmt (tmp);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " for edge defining ");
print_generic_expr (dump_file, PHI_ARG_DEF_FROM_EDGE (phi, e));
fprintf (dump_file, " inserting load ");
print_gimple_stmt (dump_file, tmp, 0);
}
}
if (new_phi)
add_phi_arg (new_phi, new_var, e, locus);
}
if (new_phi)
{
update_stmt (new_phi);
if (dump_file && (dump_flags & TDF_DETAILS))
print_gimple_stmt (dump_file, new_phi, 0);
}
return res;
} | /* Insert a new phi node for the dereference of PHI at basic_block
BB with the virtual operands from USE_STMT. */ | Insert a new phi node for the dereference of PHI at basic_block
BB with the virtual operands from USE_STMT. | [
"Insert",
"a",
"new",
"phi",
"node",
"for",
"the",
"dereference",
"of",
"PHI",
"at",
"basic_block",
"BB",
"with",
"the",
"virtual",
"operands",
"from",
"USE_STMT",
"."
] | static tree
phiprop_insert_phi (basic_block bb, gphi *phi, gimple *use_stmt,
struct phiprop_d *phivn, size_t n)
{
tree res;
gphi *new_phi = NULL;
edge_iterator ei;
edge e;
gcc_assert (is_gimple_assign (use_stmt)
&& gimple_assign_rhs_code (use_stmt) == MEM_REF);
res = gimple_assign_lhs (use_stmt);
if (TREE_CODE (res) == SSA_NAME)
new_phi = create_phi_node (res, bb);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Inserting PHI for result of load ");
print_gimple_stmt (dump_file, use_stmt, 0);
}
FOR_EACH_EDGE (e, ei, bb->preds)
{
tree old_arg, new_var;
gassign *tmp;
source_location locus;
old_arg = PHI_ARG_DEF_FROM_EDGE (phi, e);
locus = gimple_phi_arg_location_from_edge (phi, e);
while (TREE_CODE (old_arg) == SSA_NAME
&& (SSA_NAME_VERSION (old_arg) >= n
|| phivn[SSA_NAME_VERSION (old_arg)].value == NULL_TREE))
{
gimple *def_stmt = SSA_NAME_DEF_STMT (old_arg);
old_arg = gimple_assign_rhs1 (def_stmt);
locus = gimple_location (def_stmt);
}
if (TREE_CODE (old_arg) == SSA_NAME)
{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " for edge defining ");
print_generic_expr (dump_file, PHI_ARG_DEF_FROM_EDGE (phi, e));
fprintf (dump_file, " reusing PHI result ");
print_generic_expr (dump_file,
phivn[SSA_NAME_VERSION (old_arg)].value);
fprintf (dump_file, "\n");
}
new_var = phivn[SSA_NAME_VERSION (old_arg)].value;
}
else
{
tree rhs = gimple_assign_rhs1 (use_stmt);
gcc_assert (TREE_CODE (old_arg) == ADDR_EXPR);
if (TREE_CODE (res) == SSA_NAME)
new_var = make_ssa_name (TREE_TYPE (rhs));
else
new_var = unshare_expr (res);
if (!is_gimple_min_invariant (old_arg))
old_arg = PHI_ARG_DEF_FROM_EDGE (phi, e);
else
old_arg = unshare_expr (old_arg);
tmp = gimple_build_assign (new_var,
fold_build2 (MEM_REF, TREE_TYPE (rhs),
old_arg,
TREE_OPERAND (rhs, 1)));
gimple_set_location (tmp, locus);
gsi_insert_on_edge (e, tmp);
update_stmt (tmp);
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, " for edge defining ");
print_generic_expr (dump_file, PHI_ARG_DEF_FROM_EDGE (phi, e));
fprintf (dump_file, " inserting load ");
print_gimple_stmt (dump_file, tmp, 0);
}
}
if (new_phi)
add_phi_arg (new_phi, new_var, e, locus);
}
if (new_phi)
{
update_stmt (new_phi);
if (dump_file && (dump_flags & TDF_DETAILS))
print_gimple_stmt (dump_file, new_phi, 0);
}
return res;
} | [
"static",
"tree",
"phiprop_insert_phi",
"(",
"basic_block",
"bb",
",",
"gphi",
"*",
"phi",
",",
"gimple",
"*",
"use_stmt",
",",
"struct",
"phiprop_d",
"*",
"phivn",
",",
"size_t",
"n",
")",
"{",
"tree",
"res",
";",
"gphi",
"*",
"new_phi",
"=",
"NULL",
";",
"edge_iterator",
"ei",
";",
"edge",
"e",
";",
"gcc_assert",
"(",
"is_gimple_assign",
"(",
"use_stmt",
")",
"&&",
"gimple_assign_rhs_code",
"(",
"use_stmt",
")",
"==",
"MEM_REF",
")",
";",
"res",
"=",
"gimple_assign_lhs",
"(",
"use_stmt",
")",
";",
"if",
"(",
"TREE_CODE",
"(",
"res",
")",
"==",
"SSA_NAME",
")",
"new_phi",
"=",
"create_phi_node",
"(",
"res",
",",
"bb",
")",
";",
"if",
"(",
"dump_file",
"&&",
"(",
"dump_flags",
"&",
"TDF_DETAILS",
")",
")",
"{",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\"",
")",
";",
"print_gimple_stmt",
"(",
"dump_file",
",",
"use_stmt",
",",
"0",
")",
";",
"}",
"FOR_EACH_EDGE",
"(",
"e",
",",
"ei",
",",
"bb",
"->",
"preds",
")",
"",
"{",
"tree",
"old_arg",
",",
"new_var",
";",
"gassign",
"*",
"tmp",
";",
"source_location",
"locus",
";",
"old_arg",
"=",
"PHI_ARG_DEF_FROM_EDGE",
"(",
"phi",
",",
"e",
")",
";",
"locus",
"=",
"gimple_phi_arg_location_from_edge",
"(",
"phi",
",",
"e",
")",
";",
"while",
"(",
"TREE_CODE",
"(",
"old_arg",
")",
"==",
"SSA_NAME",
"&&",
"(",
"SSA_NAME_VERSION",
"(",
"old_arg",
")",
">=",
"n",
"||",
"phivn",
"[",
"SSA_NAME_VERSION",
"(",
"old_arg",
")",
"]",
".",
"value",
"==",
"NULL_TREE",
")",
")",
"{",
"gimple",
"*",
"def_stmt",
"=",
"SSA_NAME_DEF_STMT",
"(",
"old_arg",
")",
";",
"old_arg",
"=",
"gimple_assign_rhs1",
"(",
"def_stmt",
")",
";",
"locus",
"=",
"gimple_location",
"(",
"def_stmt",
")",
";",
"}",
"if",
"(",
"TREE_CODE",
"(",
"old_arg",
")",
"==",
"SSA_NAME",
")",
"{",
"if",
"(",
"dump_file",
"&&",
"(",
"dump_flags",
"&",
"TDF_DETAILS",
")",
")",
"{",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\"",
")",
";",
"print_generic_expr",
"(",
"dump_file",
",",
"PHI_ARG_DEF_FROM_EDGE",
"(",
"phi",
",",
"e",
")",
")",
";",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\"",
")",
";",
"print_generic_expr",
"(",
"dump_file",
",",
"phivn",
"[",
"SSA_NAME_VERSION",
"(",
"old_arg",
")",
"]",
".",
"value",
")",
";",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\\n",
"\"",
")",
";",
"}",
"new_var",
"=",
"phivn",
"[",
"SSA_NAME_VERSION",
"(",
"old_arg",
")",
"]",
".",
"value",
";",
"}",
"else",
"{",
"tree",
"rhs",
"=",
"gimple_assign_rhs1",
"(",
"use_stmt",
")",
";",
"gcc_assert",
"(",
"TREE_CODE",
"(",
"old_arg",
")",
"==",
"ADDR_EXPR",
")",
";",
"if",
"(",
"TREE_CODE",
"(",
"res",
")",
"==",
"SSA_NAME",
")",
"new_var",
"=",
"make_ssa_name",
"(",
"TREE_TYPE",
"(",
"rhs",
")",
")",
";",
"else",
"new_var",
"=",
"unshare_expr",
"(",
"res",
")",
";",
"if",
"(",
"!",
"is_gimple_min_invariant",
"(",
"old_arg",
")",
")",
"old_arg",
"=",
"PHI_ARG_DEF_FROM_EDGE",
"(",
"phi",
",",
"e",
")",
";",
"else",
"old_arg",
"=",
"unshare_expr",
"(",
"old_arg",
")",
";",
"tmp",
"=",
"gimple_build_assign",
"(",
"new_var",
",",
"fold_build2",
"(",
"MEM_REF",
",",
"TREE_TYPE",
"(",
"rhs",
")",
",",
"old_arg",
",",
"TREE_OPERAND",
"(",
"rhs",
",",
"1",
")",
")",
")",
";",
"gimple_set_location",
"(",
"tmp",
",",
"locus",
")",
";",
"gsi_insert_on_edge",
"(",
"e",
",",
"tmp",
")",
";",
"update_stmt",
"(",
"tmp",
")",
";",
"if",
"(",
"dump_file",
"&&",
"(",
"dump_flags",
"&",
"TDF_DETAILS",
")",
")",
"{",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\"",
")",
";",
"print_generic_expr",
"(",
"dump_file",
",",
"PHI_ARG_DEF_FROM_EDGE",
"(",
"phi",
",",
"e",
")",
")",
";",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\"",
")",
";",
"print_gimple_stmt",
"(",
"dump_file",
",",
"tmp",
",",
"0",
")",
";",
"}",
"}",
"if",
"(",
"new_phi",
")",
"add_phi_arg",
"(",
"new_phi",
",",
"new_var",
",",
"e",
",",
"locus",
")",
";",
"}",
"if",
"(",
"new_phi",
")",
"{",
"update_stmt",
"(",
"new_phi",
")",
";",
"if",
"(",
"dump_file",
"&&",
"(",
"dump_flags",
"&",
"TDF_DETAILS",
")",
")",
"print_gimple_stmt",
"(",
"dump_file",
",",
"new_phi",
",",
"0",
")",
";",
"}",
"return",
"res",
";",
"}"
] | Insert a new phi node for the dereference of PHI at basic_block
BB with the virtual operands from USE_STMT. | [
"Insert",
"a",
"new",
"phi",
"node",
"for",
"the",
"dereference",
"of",
"PHI",
"at",
"basic_block",
"BB",
"with",
"the",
"virtual",
"operands",
"from",
"USE_STMT",
"."
] | [
"/* Build a new PHI node to replace the definition of\n the indirect reference lhs. */",
"/* Add PHI arguments for each edge inserting loads of the\n addressable operands. */",
"/* Reuse a formerly created dereference. */"
] | [
{
"param": "bb",
"type": "basic_block"
},
{
"param": "phi",
"type": "gphi"
},
{
"param": "use_stmt",
"type": "gimple"
},
{
"param": "phivn",
"type": "struct phiprop_d"
},
{
"param": "n",
"type": "size_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "bb",
"type": "basic_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "phi",
"type": "gphi",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "use_stmt",
"type": "gimple",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "phivn",
"type": "struct phiprop_d",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "n",
"type": "size_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
14dfe2ab3bd65d185900aa7ba1ee2f072014cdef | atrens/DragonFlyBSD-src | contrib/gcc-8.0/gcc/tree-ssa-phiprop.c | [
"BSD-3-Clause"
] | C | chk_uses | bool | static bool
chk_uses (tree, tree *idx, void *data)
{
basic_block dom = (basic_block) data;
if (TREE_CODE (*idx) == SSA_NAME)
return (SSA_NAME_IS_DEFAULT_DEF (*idx)
|| ! dominated_by_p (CDI_DOMINATORS,
gimple_bb (SSA_NAME_DEF_STMT (*idx)), dom));
return true;
} | /* Verify if *idx is available at *DATA. */ | Verify if *idx is available at *DATA. | [
"Verify",
"if",
"*",
"idx",
"is",
"available",
"at",
"*",
"DATA",
"."
] | static bool
chk_uses (tree, tree *idx, void *data)
{
basic_block dom = (basic_block) data;
if (TREE_CODE (*idx) == SSA_NAME)
return (SSA_NAME_IS_DEFAULT_DEF (*idx)
|| ! dominated_by_p (CDI_DOMINATORS,
gimple_bb (SSA_NAME_DEF_STMT (*idx)), dom));
return true;
} | [
"static",
"bool",
"chk_uses",
"(",
"tree",
",",
"tree",
"*",
"idx",
",",
"void",
"*",
"data",
")",
"{",
"basic_block",
"dom",
"=",
"(",
"basic_block",
")",
"data",
";",
"if",
"(",
"TREE_CODE",
"(",
"*",
"idx",
")",
"==",
"SSA_NAME",
")",
"return",
"(",
"SSA_NAME_IS_DEFAULT_DEF",
"(",
"*",
"idx",
")",
"||",
"!",
"dominated_by_p",
"(",
"CDI_DOMINATORS",
",",
"gimple_bb",
"(",
"SSA_NAME_DEF_STMT",
"(",
"*",
"idx",
")",
")",
",",
"dom",
")",
")",
";",
"return",
"true",
";",
"}"
] | Verify if *idx is available at *DATA. | [
"Verify",
"if",
"*",
"idx",
"is",
"available",
"at",
"*",
"DATA",
"."
] | [] | [
{
"param": "idx",
"type": "tree"
},
{
"param": "data",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "idx",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cb4d32cc0d2f7d7734f1124bdc6c5c0fc4f95ccf | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/graphite-interchange.c | [
"BSD-3-Clause"
] | C | build_partial_difference | void | static void
build_partial_difference (ppl_Pointset_Powerset_C_Polyhedron_t *p,
ppl_dimension_type time_depth,
ppl_dimension_type offset,
ppl_dimension_type dim_sctr)
{
ppl_Constraint_t new_cstr;
ppl_Linear_Expression_t le;
ppl_dimension_type i;
ppl_dimension_type dim;
ppl_Pointset_Powerset_C_Polyhedron_t temp;
/* Add the equality: t_{time_depth} = t'_{time_depth} + 1.
This is the core part of this alogrithm, since this
constraint asks for the memory access stride (difference)
between two consecutive points in time dimensions. */
ppl_Pointset_Powerset_C_Polyhedron_space_dimension (*p, &dim);
ppl_new_Linear_Expression_with_dimension (&le, dim);
ppl_set_coef (le, time_depth, 1);
ppl_set_coef (le, time_depth + offset, -1);
ppl_set_inhomogeneous (le, 1);
ppl_new_Constraint (&new_cstr, le, PPL_CONSTRAINT_TYPE_EQUAL);
ppl_Pointset_Powerset_C_Polyhedron_add_constraint (*p, new_cstr);
ppl_delete_Linear_Expression (le);
ppl_delete_Constraint (new_cstr);
/* Add equalities:
| t1 = t1'
| ...
| t_{time_depth-1} = t'_{time_depth-1}
| t_{time_depth+1} = t'_{time_depth+1}
| ...
| t_{dim_sctr} = t'_{dim_sctr}
This means that all the time dimensions are equal except for
time_depth, where the constraint is t_{depth} = t'_{depth} + 1
step. More to this: we should be carefull not to add equalities
to the 'coupled' dimensions, which happens when the one dimension
is stripmined dimension, and the other dimension corresponds
to the point loop inside stripmined dimension. */
ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron (&temp, *p);
for (i = 0; i < dim_sctr; i++)
if (i != time_depth)
{
ppl_new_Linear_Expression_with_dimension (&le, dim);
ppl_set_coef (le, i, 1);
ppl_set_coef (le, i + offset, -1);
ppl_new_Constraint (&new_cstr, le, PPL_CONSTRAINT_TYPE_EQUAL);
ppl_Pointset_Powerset_C_Polyhedron_add_constraint (temp, new_cstr);
if (ppl_Pointset_Powerset_C_Polyhedron_is_empty (temp))
{
ppl_delete_Pointset_Powerset_C_Polyhedron (temp);
ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron (&temp, *p);
}
else
ppl_Pointset_Powerset_C_Polyhedron_add_constraint (*p, new_cstr);
ppl_delete_Linear_Expression (le);
ppl_delete_Constraint (new_cstr);
}
ppl_delete_Pointset_Powerset_C_Polyhedron (temp);
} | /* Builds a partial difference equations and inserts them
into pointset powerset polyhedron P. Polyhedron is assumed
to have the format: T|I|T'|I'|G|S|S'|l1|l2.
TIME_DEPTH is the time dimension w.r.t. which we are
differentiating.
OFFSET represents the number of dimensions between
columns t_{time_depth} and t'_{time_depth}.
DIM_SCTR is the number of scattering dimensions. It is
essentially the dimensionality of the T vector.
The following equations are inserted into the polyhedron P:
| t_1 = t_1'
| ...
| t_{time_depth-1} = t'_{time_depth-1}
| t_{time_depth} = t'_{time_depth} + 1
| t_{time_depth+1} = t'_{time_depth + 1}
| ...
| t_{dim_sctr} = t'_{dim_sctr}. */ | Builds a partial difference equations and inserts them
into pointset powerset polyhedron P.
TIME_DEPTH is the time dimension w.r.t. which we are
differentiating.
OFFSET represents the number of dimensions between
columns t_{time_depth} and t'_{time_depth}.
DIM_SCTR is the number of scattering dimensions. It is
essentially the dimensionality of the T vector.
| [
"Builds",
"a",
"partial",
"difference",
"equations",
"and",
"inserts",
"them",
"into",
"pointset",
"powerset",
"polyhedron",
"P",
".",
"TIME_DEPTH",
"is",
"the",
"time",
"dimension",
"w",
".",
"r",
".",
"t",
".",
"which",
"we",
"are",
"differentiating",
".",
"OFFSET",
"represents",
"the",
"number",
"of",
"dimensions",
"between",
"columns",
"t_",
"{",
"time_depth",
"}",
"and",
"t",
"'",
"_",
"{",
"time_depth",
"}",
".",
"DIM_SCTR",
"is",
"the",
"number",
"of",
"scattering",
"dimensions",
".",
"It",
"is",
"essentially",
"the",
"dimensionality",
"of",
"the",
"T",
"vector",
"."
] | static void
build_partial_difference (ppl_Pointset_Powerset_C_Polyhedron_t *p,
ppl_dimension_type time_depth,
ppl_dimension_type offset,
ppl_dimension_type dim_sctr)
{
ppl_Constraint_t new_cstr;
ppl_Linear_Expression_t le;
ppl_dimension_type i;
ppl_dimension_type dim;
ppl_Pointset_Powerset_C_Polyhedron_t temp;
ppl_Pointset_Powerset_C_Polyhedron_space_dimension (*p, &dim);
ppl_new_Linear_Expression_with_dimension (&le, dim);
ppl_set_coef (le, time_depth, 1);
ppl_set_coef (le, time_depth + offset, -1);
ppl_set_inhomogeneous (le, 1);
ppl_new_Constraint (&new_cstr, le, PPL_CONSTRAINT_TYPE_EQUAL);
ppl_Pointset_Powerset_C_Polyhedron_add_constraint (*p, new_cstr);
ppl_delete_Linear_Expression (le);
ppl_delete_Constraint (new_cstr);
ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron (&temp, *p);
for (i = 0; i < dim_sctr; i++)
if (i != time_depth)
{
ppl_new_Linear_Expression_with_dimension (&le, dim);
ppl_set_coef (le, i, 1);
ppl_set_coef (le, i + offset, -1);
ppl_new_Constraint (&new_cstr, le, PPL_CONSTRAINT_TYPE_EQUAL);
ppl_Pointset_Powerset_C_Polyhedron_add_constraint (temp, new_cstr);
if (ppl_Pointset_Powerset_C_Polyhedron_is_empty (temp))
{
ppl_delete_Pointset_Powerset_C_Polyhedron (temp);
ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron (&temp, *p);
}
else
ppl_Pointset_Powerset_C_Polyhedron_add_constraint (*p, new_cstr);
ppl_delete_Linear_Expression (le);
ppl_delete_Constraint (new_cstr);
}
ppl_delete_Pointset_Powerset_C_Polyhedron (temp);
} | [
"static",
"void",
"build_partial_difference",
"(",
"ppl_Pointset_Powerset_C_Polyhedron_t",
"*",
"p",
",",
"ppl_dimension_type",
"time_depth",
",",
"ppl_dimension_type",
"offset",
",",
"ppl_dimension_type",
"dim_sctr",
")",
"{",
"ppl_Constraint_t",
"new_cstr",
";",
"ppl_Linear_Expression_t",
"le",
";",
"ppl_dimension_type",
"i",
";",
"ppl_dimension_type",
"dim",
";",
"ppl_Pointset_Powerset_C_Polyhedron_t",
"temp",
";",
"ppl_Pointset_Powerset_C_Polyhedron_space_dimension",
"(",
"*",
"p",
",",
"&",
"dim",
")",
";",
"ppl_new_Linear_Expression_with_dimension",
"(",
"&",
"le",
",",
"dim",
")",
";",
"ppl_set_coef",
"(",
"le",
",",
"time_depth",
",",
"1",
")",
";",
"ppl_set_coef",
"(",
"le",
",",
"time_depth",
"+",
"offset",
",",
"-1",
")",
";",
"ppl_set_inhomogeneous",
"(",
"le",
",",
"1",
")",
";",
"ppl_new_Constraint",
"(",
"&",
"new_cstr",
",",
"le",
",",
"PPL_CONSTRAINT_TYPE_EQUAL",
")",
";",
"ppl_Pointset_Powerset_C_Polyhedron_add_constraint",
"(",
"*",
"p",
",",
"new_cstr",
")",
";",
"ppl_delete_Linear_Expression",
"(",
"le",
")",
";",
"ppl_delete_Constraint",
"(",
"new_cstr",
")",
";",
"ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron",
"(",
"&",
"temp",
",",
"*",
"p",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"dim_sctr",
";",
"i",
"++",
")",
"if",
"(",
"i",
"!=",
"time_depth",
")",
"{",
"ppl_new_Linear_Expression_with_dimension",
"(",
"&",
"le",
",",
"dim",
")",
";",
"ppl_set_coef",
"(",
"le",
",",
"i",
",",
"1",
")",
";",
"ppl_set_coef",
"(",
"le",
",",
"i",
"+",
"offset",
",",
"-1",
")",
";",
"ppl_new_Constraint",
"(",
"&",
"new_cstr",
",",
"le",
",",
"PPL_CONSTRAINT_TYPE_EQUAL",
")",
";",
"ppl_Pointset_Powerset_C_Polyhedron_add_constraint",
"(",
"temp",
",",
"new_cstr",
")",
";",
"if",
"(",
"ppl_Pointset_Powerset_C_Polyhedron_is_empty",
"(",
"temp",
")",
")",
"{",
"ppl_delete_Pointset_Powerset_C_Polyhedron",
"(",
"temp",
")",
";",
"ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron",
"(",
"&",
"temp",
",",
"*",
"p",
")",
";",
"}",
"else",
"ppl_Pointset_Powerset_C_Polyhedron_add_constraint",
"(",
"*",
"p",
",",
"new_cstr",
")",
";",
"ppl_delete_Linear_Expression",
"(",
"le",
")",
";",
"ppl_delete_Constraint",
"(",
"new_cstr",
")",
";",
"}",
"ppl_delete_Pointset_Powerset_C_Polyhedron",
"(",
"temp",
")",
";",
"}"
] | Builds a partial difference equations and inserts them
into pointset powerset polyhedron P. Polyhedron is assumed
to have the format: T|I|T'|I'|G|S|S'|l1|l2. | [
"Builds",
"a",
"partial",
"difference",
"equations",
"and",
"inserts",
"them",
"into",
"pointset",
"powerset",
"polyhedron",
"P",
".",
"Polyhedron",
"is",
"assumed",
"to",
"have",
"the",
"format",
":",
"T|I|T",
"'",
"|I",
"'",
"|G|S|S",
"'",
"|l1|l2",
"."
] | [
"/* Add the equality: t_{time_depth} = t'_{time_depth} + 1.\n This is the core part of this alogrithm, since this\n constraint asks for the memory access stride (difference)\n between two consecutive points in time dimensions. */",
"/* Add equalities:\n | t1 = t1'\n | ...\n | t_{time_depth-1} = t'_{time_depth-1}\n | t_{time_depth+1} = t'_{time_depth+1}\n | ...\n | t_{dim_sctr} = t'_{dim_sctr}\n\n This means that all the time dimensions are equal except for\n time_depth, where the constraint is t_{depth} = t'_{depth} + 1\n step. More to this: we should be carefull not to add equalities\n to the 'coupled' dimensions, which happens when the one dimension\n is stripmined dimension, and the other dimension corresponds\n to the point loop inside stripmined dimension. */"
] | [
{
"param": "p",
"type": "ppl_Pointset_Powerset_C_Polyhedron_t"
},
{
"param": "time_depth",
"type": "ppl_dimension_type"
},
{
"param": "offset",
"type": "ppl_dimension_type"
},
{
"param": "dim_sctr",
"type": "ppl_dimension_type"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "p",
"type": "ppl_Pointset_Powerset_C_Polyhedron_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "time_depth",
"type": "ppl_dimension_type",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "offset",
"type": "ppl_dimension_type",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "dim_sctr",
"type": "ppl_dimension_type",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cb4d32cc0d2f7d7734f1124bdc6c5c0fc4f95ccf | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/graphite-interchange.c | [
"BSD-3-Clause"
] | C | pdr_stride_in_loop | void | static void
pdr_stride_in_loop (mpz_t stride, graphite_dim_t depth, poly_dr_p pdr)
{
ppl_dimension_type time_depth;
ppl_Linear_Expression_t le, lma;
ppl_Constraint_t new_cstr;
ppl_dimension_type i, *map;
ppl_Pointset_Powerset_C_Polyhedron_t p1, p2, sctr;
graphite_dim_t nb_subscripts = PDR_NB_SUBSCRIPTS (pdr) + 1;
poly_bb_p pbb = PDR_PBB (pdr);
ppl_dimension_type offset = pbb_nb_scattering_transform (pbb)
+ pbb_nb_local_vars (pbb)
+ pbb_dim_iter_domain (pbb);
ppl_dimension_type offsetg = offset + pbb_nb_params (pbb);
ppl_dimension_type dim_sctr = pbb_nb_scattering_transform (pbb)
+ pbb_nb_local_vars (pbb);
ppl_dimension_type dim_L1 = offset + offsetg + 2 * nb_subscripts;
ppl_dimension_type dim_L2 = offset + offsetg + 2 * nb_subscripts + 1;
ppl_dimension_type new_dim = offset + offsetg + 2 * nb_subscripts + 2;
/* The resulting polyhedron should have the following format:
T|I|T'|I'|G|S|S'|l1|l2
where:
| T = t_1..t_{dim_sctr}
| I = i_1..i_{dim_iter_domain}
| T'= t'_1..t'_{dim_sctr}
| I'= i'_1..i'_{dim_iter_domain}
| G = g_1..g_{nb_params}
| S = s_1..s_{nb_subscripts}
| S'= s'_1..s'_{nb_subscripts}
| l1 and l2 are scalars.
Some invariants:
offset = dim_sctr + dim_iter_domain + nb_local_vars
offsetg = dim_sctr + dim_iter_domain + nb_local_vars + nb_params. */
/* Construct the T|I|0|0|G|0|0|0|0 part. */
{
ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron
(&sctr, PBB_TRANSFORMED_SCATTERING (pbb));
ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed
(sctr, 2 * nb_subscripts + 2);
ppl_insert_dimensions_pointset (sctr, offset, offset);
}
/* Construct the 0|I|0|0|G|S|0|0|0 part. */
{
ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron
(&p1, PDR_ACCESSES (pdr));
ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed
(p1, nb_subscripts + 2);
ppl_insert_dimensions_pointset (p1, 0, dim_sctr);
ppl_insert_dimensions_pointset (p1, offset, offset);
}
/* Construct the 0|0|0|0|0|S|0|l1|0 part. */
{
lma = build_linearized_memory_access (offset + dim_sctr, pdr);
ppl_set_coef (lma, dim_L1, -1);
ppl_new_Constraint (&new_cstr, lma, PPL_CONSTRAINT_TYPE_EQUAL);
ppl_Pointset_Powerset_C_Polyhedron_add_constraint (p1, new_cstr);
ppl_delete_Linear_Expression (lma);
ppl_delete_Constraint (new_cstr);
}
/* Now intersect all the parts to get the polyhedron P1:
T|I|0|0|G|0|0|0 |0
0|I|0|0|G|S|0|0 |0
0|0|0|0|0|S|0|l1|0
------------------
T|I|0|0|G|S|0|l1|0. */
ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (p1, sctr);
ppl_delete_Pointset_Powerset_C_Polyhedron (sctr);
/* Build P2, which would have the following form:
0|0|T'|I'|G|0|S'|0|l2
P2 is built, by remapping the P1 polyhedron:
T|I|0|0|G|S|0|l1|0
using the following mapping:
T->T'
I->I'
S->S'
l1->l2. */
{
ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron
(&p2, p1);
map = ppl_new_id_map (new_dim);
/* TI -> T'I'. */
for (i = 0; i < offset; i++)
ppl_interchange (map, i, i + offset);
/* l1 -> l2. */
ppl_interchange (map, dim_L1, dim_L2);
/* S -> S'. */
for (i = 0; i < nb_subscripts; i++)
ppl_interchange (map, offset + offsetg + i,
offset + offsetg + nb_subscripts + i);
ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions (p2, map, new_dim);
free (map);
}
time_depth = psct_dynamic_dim (pbb, depth);
/* P1 = P1 inter P2. */
ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (p1, p2);
build_partial_difference (&p1, time_depth, offset, dim_sctr);
/* Maximise the expression L2 - L1. */
{
ppl_new_Linear_Expression_with_dimension (&le, new_dim);
ppl_set_coef (le, dim_L2, 1);
ppl_set_coef (le, dim_L1, -1);
ppl_max_for_le_pointset (p1, le, stride);
}
if (dump_file && (dump_flags & TDF_DETAILS))
{
char *str;
void (*gmp_free) (void *, size_t);
fprintf (dump_file, "\nStride in BB_%d, DR_%d, depth %d:",
pbb_index (pbb), PDR_ID (pdr), (int) depth);
str = mpz_get_str (0, 10, stride);
fprintf (dump_file, " %s ", str);
mp_get_memory_functions (NULL, NULL, &gmp_free);
(*gmp_free) (str, strlen (str) + 1);
}
ppl_delete_Pointset_Powerset_C_Polyhedron (p1);
ppl_delete_Pointset_Powerset_C_Polyhedron (p2);
ppl_delete_Linear_Expression (le);
} | /* Set STRIDE to the stride of PDR in memory by advancing by one in
the loop at DEPTH. */ | Set STRIDE to the stride of PDR in memory by advancing by one in
the loop at DEPTH. | [
"Set",
"STRIDE",
"to",
"the",
"stride",
"of",
"PDR",
"in",
"memory",
"by",
"advancing",
"by",
"one",
"in",
"the",
"loop",
"at",
"DEPTH",
"."
] | static void
pdr_stride_in_loop (mpz_t stride, graphite_dim_t depth, poly_dr_p pdr)
{
ppl_dimension_type time_depth;
ppl_Linear_Expression_t le, lma;
ppl_Constraint_t new_cstr;
ppl_dimension_type i, *map;
ppl_Pointset_Powerset_C_Polyhedron_t p1, p2, sctr;
graphite_dim_t nb_subscripts = PDR_NB_SUBSCRIPTS (pdr) + 1;
poly_bb_p pbb = PDR_PBB (pdr);
ppl_dimension_type offset = pbb_nb_scattering_transform (pbb)
+ pbb_nb_local_vars (pbb)
+ pbb_dim_iter_domain (pbb);
ppl_dimension_type offsetg = offset + pbb_nb_params (pbb);
ppl_dimension_type dim_sctr = pbb_nb_scattering_transform (pbb)
+ pbb_nb_local_vars (pbb);
ppl_dimension_type dim_L1 = offset + offsetg + 2 * nb_subscripts;
ppl_dimension_type dim_L2 = offset + offsetg + 2 * nb_subscripts + 1;
ppl_dimension_type new_dim = offset + offsetg + 2 * nb_subscripts + 2;
{
ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron
(&sctr, PBB_TRANSFORMED_SCATTERING (pbb));
ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed
(sctr, 2 * nb_subscripts + 2);
ppl_insert_dimensions_pointset (sctr, offset, offset);
}
{
ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron
(&p1, PDR_ACCESSES (pdr));
ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed
(p1, nb_subscripts + 2);
ppl_insert_dimensions_pointset (p1, 0, dim_sctr);
ppl_insert_dimensions_pointset (p1, offset, offset);
}
{
lma = build_linearized_memory_access (offset + dim_sctr, pdr);
ppl_set_coef (lma, dim_L1, -1);
ppl_new_Constraint (&new_cstr, lma, PPL_CONSTRAINT_TYPE_EQUAL);
ppl_Pointset_Powerset_C_Polyhedron_add_constraint (p1, new_cstr);
ppl_delete_Linear_Expression (lma);
ppl_delete_Constraint (new_cstr);
}
ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (p1, sctr);
ppl_delete_Pointset_Powerset_C_Polyhedron (sctr);
{
ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron
(&p2, p1);
map = ppl_new_id_map (new_dim);
for (i = 0; i < offset; i++)
ppl_interchange (map, i, i + offset);
ppl_interchange (map, dim_L1, dim_L2);
for (i = 0; i < nb_subscripts; i++)
ppl_interchange (map, offset + offsetg + i,
offset + offsetg + nb_subscripts + i);
ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions (p2, map, new_dim);
free (map);
}
time_depth = psct_dynamic_dim (pbb, depth);
ppl_Pointset_Powerset_C_Polyhedron_intersection_assign (p1, p2);
build_partial_difference (&p1, time_depth, offset, dim_sctr);
{
ppl_new_Linear_Expression_with_dimension (&le, new_dim);
ppl_set_coef (le, dim_L2, 1);
ppl_set_coef (le, dim_L1, -1);
ppl_max_for_le_pointset (p1, le, stride);
}
if (dump_file && (dump_flags & TDF_DETAILS))
{
char *str;
void (*gmp_free) (void *, size_t);
fprintf (dump_file, "\nStride in BB_%d, DR_%d, depth %d:",
pbb_index (pbb), PDR_ID (pdr), (int) depth);
str = mpz_get_str (0, 10, stride);
fprintf (dump_file, " %s ", str);
mp_get_memory_functions (NULL, NULL, &gmp_free);
(*gmp_free) (str, strlen (str) + 1);
}
ppl_delete_Pointset_Powerset_C_Polyhedron (p1);
ppl_delete_Pointset_Powerset_C_Polyhedron (p2);
ppl_delete_Linear_Expression (le);
} | [
"static",
"void",
"pdr_stride_in_loop",
"(",
"mpz_t",
"stride",
",",
"graphite_dim_t",
"depth",
",",
"poly_dr_p",
"pdr",
")",
"{",
"ppl_dimension_type",
"time_depth",
";",
"ppl_Linear_Expression_t",
"le",
",",
"lma",
";",
"ppl_Constraint_t",
"new_cstr",
";",
"ppl_dimension_type",
"i",
",",
"*",
"map",
";",
"ppl_Pointset_Powerset_C_Polyhedron_t",
"p1",
",",
"p2",
",",
"sctr",
";",
"graphite_dim_t",
"nb_subscripts",
"=",
"PDR_NB_SUBSCRIPTS",
"(",
"pdr",
")",
"+",
"1",
";",
"poly_bb_p",
"pbb",
"=",
"PDR_PBB",
"(",
"pdr",
")",
";",
"ppl_dimension_type",
"offset",
"=",
"pbb_nb_scattering_transform",
"(",
"pbb",
")",
"+",
"pbb_nb_local_vars",
"(",
"pbb",
")",
"+",
"pbb_dim_iter_domain",
"(",
"pbb",
")",
";",
"ppl_dimension_type",
"offsetg",
"=",
"offset",
"+",
"pbb_nb_params",
"(",
"pbb",
")",
";",
"ppl_dimension_type",
"dim_sctr",
"=",
"pbb_nb_scattering_transform",
"(",
"pbb",
")",
"+",
"pbb_nb_local_vars",
"(",
"pbb",
")",
";",
"ppl_dimension_type",
"dim_L1",
"=",
"offset",
"+",
"offsetg",
"+",
"2",
"*",
"nb_subscripts",
";",
"ppl_dimension_type",
"dim_L2",
"=",
"offset",
"+",
"offsetg",
"+",
"2",
"*",
"nb_subscripts",
"+",
"1",
";",
"ppl_dimension_type",
"new_dim",
"=",
"offset",
"+",
"offsetg",
"+",
"2",
"*",
"nb_subscripts",
"+",
"2",
";",
"{",
"ppl_new_Pointset_Powerset_C_Polyhedron_from_C_Polyhedron",
"(",
"&",
"sctr",
",",
"PBB_TRANSFORMED_SCATTERING",
"(",
"pbb",
")",
")",
";",
"ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed",
"(",
"sctr",
",",
"2",
"*",
"nb_subscripts",
"+",
"2",
")",
";",
"ppl_insert_dimensions_pointset",
"(",
"sctr",
",",
"offset",
",",
"offset",
")",
";",
"}",
"{",
"ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron",
"(",
"&",
"p1",
",",
"PDR_ACCESSES",
"(",
"pdr",
")",
")",
";",
"ppl_Pointset_Powerset_C_Polyhedron_add_space_dimensions_and_embed",
"(",
"p1",
",",
"nb_subscripts",
"+",
"2",
")",
";",
"ppl_insert_dimensions_pointset",
"(",
"p1",
",",
"0",
",",
"dim_sctr",
")",
";",
"ppl_insert_dimensions_pointset",
"(",
"p1",
",",
"offset",
",",
"offset",
")",
";",
"}",
"{",
"lma",
"=",
"build_linearized_memory_access",
"(",
"offset",
"+",
"dim_sctr",
",",
"pdr",
")",
";",
"ppl_set_coef",
"(",
"lma",
",",
"dim_L1",
",",
"-1",
")",
";",
"ppl_new_Constraint",
"(",
"&",
"new_cstr",
",",
"lma",
",",
"PPL_CONSTRAINT_TYPE_EQUAL",
")",
";",
"ppl_Pointset_Powerset_C_Polyhedron_add_constraint",
"(",
"p1",
",",
"new_cstr",
")",
";",
"ppl_delete_Linear_Expression",
"(",
"lma",
")",
";",
"ppl_delete_Constraint",
"(",
"new_cstr",
")",
";",
"}",
"ppl_Pointset_Powerset_C_Polyhedron_intersection_assign",
"(",
"p1",
",",
"sctr",
")",
";",
"ppl_delete_Pointset_Powerset_C_Polyhedron",
"(",
"sctr",
")",
";",
"{",
"ppl_new_Pointset_Powerset_C_Polyhedron_from_Pointset_Powerset_C_Polyhedron",
"(",
"&",
"p2",
",",
"p1",
")",
";",
"map",
"=",
"ppl_new_id_map",
"(",
"new_dim",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"offset",
";",
"i",
"++",
")",
"ppl_interchange",
"(",
"map",
",",
"i",
",",
"i",
"+",
"offset",
")",
";",
"ppl_interchange",
"(",
"map",
",",
"dim_L1",
",",
"dim_L2",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"nb_subscripts",
";",
"i",
"++",
")",
"ppl_interchange",
"(",
"map",
",",
"offset",
"+",
"offsetg",
"+",
"i",
",",
"offset",
"+",
"offsetg",
"+",
"nb_subscripts",
"+",
"i",
")",
";",
"ppl_Pointset_Powerset_C_Polyhedron_map_space_dimensions",
"(",
"p2",
",",
"map",
",",
"new_dim",
")",
";",
"free",
"(",
"map",
")",
";",
"}",
"time_depth",
"=",
"psct_dynamic_dim",
"(",
"pbb",
",",
"depth",
")",
";",
"ppl_Pointset_Powerset_C_Polyhedron_intersection_assign",
"(",
"p1",
",",
"p2",
")",
";",
"build_partial_difference",
"(",
"&",
"p1",
",",
"time_depth",
",",
"offset",
",",
"dim_sctr",
")",
";",
"{",
"ppl_new_Linear_Expression_with_dimension",
"(",
"&",
"le",
",",
"new_dim",
")",
";",
"ppl_set_coef",
"(",
"le",
",",
"dim_L2",
",",
"1",
")",
";",
"ppl_set_coef",
"(",
"le",
",",
"dim_L1",
",",
"-1",
")",
";",
"ppl_max_for_le_pointset",
"(",
"p1",
",",
"le",
",",
"stride",
")",
";",
"}",
"if",
"(",
"dump_file",
"&&",
"(",
"dump_flags",
"&",
"TDF_DETAILS",
")",
")",
"{",
"char",
"*",
"str",
";",
"void",
"(",
"*",
"gmp_free",
")",
"(",
"void",
"*",
",",
"size_t",
")",
";",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\\n",
"\"",
",",
"pbb_index",
"(",
"pbb",
")",
",",
"PDR_ID",
"(",
"pdr",
")",
",",
"(",
"int",
")",
"depth",
")",
";",
"str",
"=",
"mpz_get_str",
"(",
"0",
",",
"10",
",",
"stride",
")",
";",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\"",
",",
"str",
")",
";",
"mp_get_memory_functions",
"(",
"NULL",
",",
"NULL",
",",
"&",
"gmp_free",
")",
";",
"(",
"*",
"gmp_free",
")",
"(",
"str",
",",
"strlen",
"(",
"str",
")",
"+",
"1",
")",
";",
"}",
"ppl_delete_Pointset_Powerset_C_Polyhedron",
"(",
"p1",
")",
";",
"ppl_delete_Pointset_Powerset_C_Polyhedron",
"(",
"p2",
")",
";",
"ppl_delete_Linear_Expression",
"(",
"le",
")",
";",
"}"
] | Set STRIDE to the stride of PDR in memory by advancing by one in
the loop at DEPTH. | [
"Set",
"STRIDE",
"to",
"the",
"stride",
"of",
"PDR",
"in",
"memory",
"by",
"advancing",
"by",
"one",
"in",
"the",
"loop",
"at",
"DEPTH",
"."
] | [
"/* The resulting polyhedron should have the following format:\n T|I|T'|I'|G|S|S'|l1|l2\n where:\n | T = t_1..t_{dim_sctr}\n | I = i_1..i_{dim_iter_domain}\n | T'= t'_1..t'_{dim_sctr}\n | I'= i'_1..i'_{dim_iter_domain}\n | G = g_1..g_{nb_params}\n | S = s_1..s_{nb_subscripts}\n | S'= s'_1..s'_{nb_subscripts}\n | l1 and l2 are scalars.\n\n Some invariants:\n offset = dim_sctr + dim_iter_domain + nb_local_vars\n offsetg = dim_sctr + dim_iter_domain + nb_local_vars + nb_params. */",
"/* Construct the T|I|0|0|G|0|0|0|0 part. */",
"/* Construct the 0|I|0|0|G|S|0|0|0 part. */",
"/* Construct the 0|0|0|0|0|S|0|l1|0 part. */",
"/* Now intersect all the parts to get the polyhedron P1:\n T|I|0|0|G|0|0|0 |0\n 0|I|0|0|G|S|0|0 |0\n 0|0|0|0|0|S|0|l1|0\n ------------------\n T|I|0|0|G|S|0|l1|0. */",
"/* Build P2, which would have the following form:\n 0|0|T'|I'|G|0|S'|0|l2\n\n P2 is built, by remapping the P1 polyhedron:\n T|I|0|0|G|S|0|l1|0\n\n using the following mapping:\n T->T'\n I->I'\n S->S'\n l1->l2. */",
"/* TI -> T'I'. */",
"/* l1 -> l2. */",
"/* S -> S'. */",
"/* P1 = P1 inter P2. */",
"/* Maximise the expression L2 - L1. */"
] | [
{
"param": "stride",
"type": "mpz_t"
},
{
"param": "depth",
"type": "graphite_dim_t"
},
{
"param": "pdr",
"type": "poly_dr_p"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "stride",
"type": "mpz_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "depth",
"type": "graphite_dim_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "pdr",
"type": "poly_dr_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cb4d32cc0d2f7d7734f1124bdc6c5c0fc4f95ccf | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/graphite-interchange.c | [
"BSD-3-Clause"
] | C | memory_strides_in_loop_1 | void | static void
memory_strides_in_loop_1 (lst_p loop, graphite_dim_t depth, mpz_t strides)
{
int i, j;
lst_p l;
poly_dr_p pdr;
mpz_t s, n;
mpz_init (s);
mpz_init (n);
FOR_EACH_VEC_ELT (lst_p, LST_SEQ (loop), j, l)
if (LST_LOOP_P (l))
memory_strides_in_loop_1 (l, depth, strides);
else
FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (LST_PBB (l)), i, pdr)
{
pdr_stride_in_loop (s, depth, pdr);
mpz_set_si (n, PDR_NB_REFS (pdr));
mpz_mul (s, s, n);
mpz_add (strides, strides, s);
}
mpz_clear (s);
mpz_clear (n);
} | /* Sets STRIDES to the sum of all the strides of the data references
accessed in LOOP at DEPTH. */ | Sets STRIDES to the sum of all the strides of the data references
accessed in LOOP at DEPTH. | [
"Sets",
"STRIDES",
"to",
"the",
"sum",
"of",
"all",
"the",
"strides",
"of",
"the",
"data",
"references",
"accessed",
"in",
"LOOP",
"at",
"DEPTH",
"."
] | static void
memory_strides_in_loop_1 (lst_p loop, graphite_dim_t depth, mpz_t strides)
{
int i, j;
lst_p l;
poly_dr_p pdr;
mpz_t s, n;
mpz_init (s);
mpz_init (n);
FOR_EACH_VEC_ELT (lst_p, LST_SEQ (loop), j, l)
if (LST_LOOP_P (l))
memory_strides_in_loop_1 (l, depth, strides);
else
FOR_EACH_VEC_ELT (poly_dr_p, PBB_DRS (LST_PBB (l)), i, pdr)
{
pdr_stride_in_loop (s, depth, pdr);
mpz_set_si (n, PDR_NB_REFS (pdr));
mpz_mul (s, s, n);
mpz_add (strides, strides, s);
}
mpz_clear (s);
mpz_clear (n);
} | [
"static",
"void",
"memory_strides_in_loop_1",
"(",
"lst_p",
"loop",
",",
"graphite_dim_t",
"depth",
",",
"mpz_t",
"strides",
")",
"{",
"int",
"i",
",",
"j",
";",
"lst_p",
"l",
";",
"poly_dr_p",
"pdr",
";",
"mpz_t",
"s",
",",
"n",
";",
"mpz_init",
"(",
"s",
")",
";",
"mpz_init",
"(",
"n",
")",
";",
"FOR_EACH_VEC_ELT",
"(",
"lst_p",
",",
"LST_SEQ",
"(",
"loop",
")",
",",
"j",
",",
"l",
")",
"",
"if",
"(",
"LST_LOOP_P",
"(",
"l",
")",
")",
"memory_strides_in_loop_1",
"(",
"l",
",",
"depth",
",",
"strides",
")",
";",
"else",
"FOR_EACH_VEC_ELT",
"(",
"poly_dr_p",
",",
"PBB_DRS",
"(",
"LST_PBB",
"(",
"l",
")",
")",
",",
"i",
",",
"pdr",
")",
"",
"{",
"pdr_stride_in_loop",
"(",
"s",
",",
"depth",
",",
"pdr",
")",
";",
"mpz_set_si",
"(",
"n",
",",
"PDR_NB_REFS",
"(",
"pdr",
")",
")",
";",
"mpz_mul",
"(",
"s",
",",
"s",
",",
"n",
")",
";",
"mpz_add",
"(",
"strides",
",",
"strides",
",",
"s",
")",
";",
"}",
"mpz_clear",
"(",
"s",
")",
";",
"mpz_clear",
"(",
"n",
")",
";",
"}"
] | Sets STRIDES to the sum of all the strides of the data references
accessed in LOOP at DEPTH. | [
"Sets",
"STRIDES",
"to",
"the",
"sum",
"of",
"all",
"the",
"strides",
"of",
"the",
"data",
"references",
"accessed",
"in",
"LOOP",
"at",
"DEPTH",
"."
] | [] | [
{
"param": "loop",
"type": "lst_p"
},
{
"param": "depth",
"type": "graphite_dim_t"
},
{
"param": "strides",
"type": "mpz_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "loop",
"type": "lst_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "depth",
"type": "graphite_dim_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "strides",
"type": "mpz_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cb4d32cc0d2f7d7734f1124bdc6c5c0fc4f95ccf | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/graphite-interchange.c | [
"BSD-3-Clause"
] | C | memory_strides_in_loop | void | static void
memory_strides_in_loop (lst_p loop, graphite_dim_t depth, mpz_t strides)
{
if (mpz_cmp_si (loop->memory_strides, -1) == 0)
{
mpz_set_si (strides, 0);
memory_strides_in_loop_1 (loop, depth, strides);
}
else
mpz_set (strides, loop->memory_strides);
} | /* Sets STRIDES to the sum of all the strides of the data references
accessed in LOOP at DEPTH. */ | Sets STRIDES to the sum of all the strides of the data references
accessed in LOOP at DEPTH. | [
"Sets",
"STRIDES",
"to",
"the",
"sum",
"of",
"all",
"the",
"strides",
"of",
"the",
"data",
"references",
"accessed",
"in",
"LOOP",
"at",
"DEPTH",
"."
] | static void
memory_strides_in_loop (lst_p loop, graphite_dim_t depth, mpz_t strides)
{
if (mpz_cmp_si (loop->memory_strides, -1) == 0)
{
mpz_set_si (strides, 0);
memory_strides_in_loop_1 (loop, depth, strides);
}
else
mpz_set (strides, loop->memory_strides);
} | [
"static",
"void",
"memory_strides_in_loop",
"(",
"lst_p",
"loop",
",",
"graphite_dim_t",
"depth",
",",
"mpz_t",
"strides",
")",
"{",
"if",
"(",
"mpz_cmp_si",
"(",
"loop",
"->",
"memory_strides",
",",
"-1",
")",
"==",
"0",
")",
"{",
"mpz_set_si",
"(",
"strides",
",",
"0",
")",
";",
"memory_strides_in_loop_1",
"(",
"loop",
",",
"depth",
",",
"strides",
")",
";",
"}",
"else",
"mpz_set",
"(",
"strides",
",",
"loop",
"->",
"memory_strides",
")",
";",
"}"
] | Sets STRIDES to the sum of all the strides of the data references
accessed in LOOP at DEPTH. | [
"Sets",
"STRIDES",
"to",
"the",
"sum",
"of",
"all",
"the",
"strides",
"of",
"the",
"data",
"references",
"accessed",
"in",
"LOOP",
"at",
"DEPTH",
"."
] | [] | [
{
"param": "loop",
"type": "lst_p"
},
{
"param": "depth",
"type": "graphite_dim_t"
},
{
"param": "strides",
"type": "mpz_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "loop",
"type": "lst_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "depth",
"type": "graphite_dim_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "strides",
"type": "mpz_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cb4d32cc0d2f7d7734f1124bdc6c5c0fc4f95ccf | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/graphite-interchange.c | [
"BSD-3-Clause"
] | C | pbb_interchange_loop_depths | void | static void
pbb_interchange_loop_depths (graphite_dim_t depth1, graphite_dim_t depth2,
poly_bb_p pbb)
{
ppl_dimension_type i, dim;
ppl_dimension_type *map;
ppl_Polyhedron_t poly = PBB_TRANSFORMED_SCATTERING (pbb);
ppl_dimension_type dim1 = psct_dynamic_dim (pbb, depth1);
ppl_dimension_type dim2 = psct_dynamic_dim (pbb, depth2);
ppl_Polyhedron_space_dimension (poly, &dim);
map = (ppl_dimension_type *) XNEWVEC (ppl_dimension_type, dim);
for (i = 0; i < dim; i++)
map[i] = i;
map[dim1] = dim2;
map[dim2] = dim1;
ppl_Polyhedron_map_space_dimensions (poly, map, dim);
free (map);
} | /* Interchanges the loops at DEPTH1 and DEPTH2 of the original
scattering and assigns the resulting polyhedron to the transformed
scattering. */ | Interchanges the loops at DEPTH1 and DEPTH2 of the original
scattering and assigns the resulting polyhedron to the transformed
scattering. | [
"Interchanges",
"the",
"loops",
"at",
"DEPTH1",
"and",
"DEPTH2",
"of",
"the",
"original",
"scattering",
"and",
"assigns",
"the",
"resulting",
"polyhedron",
"to",
"the",
"transformed",
"scattering",
"."
] | static void
pbb_interchange_loop_depths (graphite_dim_t depth1, graphite_dim_t depth2,
poly_bb_p pbb)
{
ppl_dimension_type i, dim;
ppl_dimension_type *map;
ppl_Polyhedron_t poly = PBB_TRANSFORMED_SCATTERING (pbb);
ppl_dimension_type dim1 = psct_dynamic_dim (pbb, depth1);
ppl_dimension_type dim2 = psct_dynamic_dim (pbb, depth2);
ppl_Polyhedron_space_dimension (poly, &dim);
map = (ppl_dimension_type *) XNEWVEC (ppl_dimension_type, dim);
for (i = 0; i < dim; i++)
map[i] = i;
map[dim1] = dim2;
map[dim2] = dim1;
ppl_Polyhedron_map_space_dimensions (poly, map, dim);
free (map);
} | [
"static",
"void",
"pbb_interchange_loop_depths",
"(",
"graphite_dim_t",
"depth1",
",",
"graphite_dim_t",
"depth2",
",",
"poly_bb_p",
"pbb",
")",
"{",
"ppl_dimension_type",
"i",
",",
"dim",
";",
"ppl_dimension_type",
"*",
"map",
";",
"ppl_Polyhedron_t",
"poly",
"=",
"PBB_TRANSFORMED_SCATTERING",
"(",
"pbb",
")",
";",
"ppl_dimension_type",
"dim1",
"=",
"psct_dynamic_dim",
"(",
"pbb",
",",
"depth1",
")",
";",
"ppl_dimension_type",
"dim2",
"=",
"psct_dynamic_dim",
"(",
"pbb",
",",
"depth2",
")",
";",
"ppl_Polyhedron_space_dimension",
"(",
"poly",
",",
"&",
"dim",
")",
";",
"map",
"=",
"(",
"ppl_dimension_type",
"*",
")",
"XNEWVEC",
"(",
"ppl_dimension_type",
",",
"dim",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"dim",
";",
"i",
"++",
")",
"map",
"[",
"i",
"]",
"=",
"i",
";",
"map",
"[",
"dim1",
"]",
"=",
"dim2",
";",
"map",
"[",
"dim2",
"]",
"=",
"dim1",
";",
"ppl_Polyhedron_map_space_dimensions",
"(",
"poly",
",",
"map",
",",
"dim",
")",
";",
"free",
"(",
"map",
")",
";",
"}"
] | Interchanges the loops at DEPTH1 and DEPTH2 of the original
scattering and assigns the resulting polyhedron to the transformed
scattering. | [
"Interchanges",
"the",
"loops",
"at",
"DEPTH1",
"and",
"DEPTH2",
"of",
"the",
"original",
"scattering",
"and",
"assigns",
"the",
"resulting",
"polyhedron",
"to",
"the",
"transformed",
"scattering",
"."
] | [] | [
{
"param": "depth1",
"type": "graphite_dim_t"
},
{
"param": "depth2",
"type": "graphite_dim_t"
},
{
"param": "pbb",
"type": "poly_bb_p"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "depth1",
"type": "graphite_dim_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "depth2",
"type": "graphite_dim_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "pbb",
"type": "poly_bb_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cb4d32cc0d2f7d7734f1124bdc6c5c0fc4f95ccf | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/graphite-interchange.c | [
"BSD-3-Clause"
] | C | lst_apply_interchange | void | static void
lst_apply_interchange (lst_p lst, int depth1, int depth2)
{
if (!lst)
return;
if (LST_LOOP_P (lst))
{
int i;
lst_p l;
FOR_EACH_VEC_ELT (lst_p, LST_SEQ (lst), i, l)
lst_apply_interchange (l, depth1, depth2);
}
else
pbb_interchange_loop_depths (depth1, depth2, LST_PBB (lst));
} | /* Apply the interchange of loops at depths DEPTH1 and DEPTH2 to all
the statements below LST. */ | Apply the interchange of loops at depths DEPTH1 and DEPTH2 to all
the statements below LST. | [
"Apply",
"the",
"interchange",
"of",
"loops",
"at",
"depths",
"DEPTH1",
"and",
"DEPTH2",
"to",
"all",
"the",
"statements",
"below",
"LST",
"."
] | static void
lst_apply_interchange (lst_p lst, int depth1, int depth2)
{
if (!lst)
return;
if (LST_LOOP_P (lst))
{
int i;
lst_p l;
FOR_EACH_VEC_ELT (lst_p, LST_SEQ (lst), i, l)
lst_apply_interchange (l, depth1, depth2);
}
else
pbb_interchange_loop_depths (depth1, depth2, LST_PBB (lst));
} | [
"static",
"void",
"lst_apply_interchange",
"(",
"lst_p",
"lst",
",",
"int",
"depth1",
",",
"int",
"depth2",
")",
"{",
"if",
"(",
"!",
"lst",
")",
"return",
";",
"if",
"(",
"LST_LOOP_P",
"(",
"lst",
")",
")",
"{",
"int",
"i",
";",
"lst_p",
"l",
";",
"FOR_EACH_VEC_ELT",
"(",
"lst_p",
",",
"LST_SEQ",
"(",
"lst",
")",
",",
"i",
",",
"l",
")",
"",
"lst_apply_interchange",
"(",
"l",
",",
"depth1",
",",
"depth2",
")",
";",
"}",
"else",
"pbb_interchange_loop_depths",
"(",
"depth1",
",",
"depth2",
",",
"LST_PBB",
"(",
"lst",
")",
")",
";",
"}"
] | Apply the interchange of loops at depths DEPTH1 and DEPTH2 to all
the statements below LST. | [
"Apply",
"the",
"interchange",
"of",
"loops",
"at",
"depths",
"DEPTH1",
"and",
"DEPTH2",
"to",
"all",
"the",
"statements",
"below",
"LST",
"."
] | [] | [
{
"param": "lst",
"type": "lst_p"
},
{
"param": "depth1",
"type": "int"
},
{
"param": "depth2",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "lst",
"type": "lst_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "depth1",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "depth2",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cb4d32cc0d2f7d7734f1124bdc6c5c0fc4f95ccf | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/graphite-interchange.c | [
"BSD-3-Clause"
] | C | lst_perfectly_nested_p | bool | static bool
lst_perfectly_nested_p (lst_p loop1, lst_p loop2)
{
if (loop1 == loop2)
return true;
if (!LST_LOOP_P (loop1))
return false;
return VEC_length (lst_p, LST_SEQ (loop1)) == 1
&& lst_perfectly_nested_p (VEC_index (lst_p, LST_SEQ (loop1), 0), loop2);
} | /* Return true when the nest starting at LOOP1 and ending on LOOP2 is
perfect: i.e. there are no sequence of statements. */ | Return true when the nest starting at LOOP1 and ending on LOOP2 is
perfect: i.e. there are no sequence of statements. | [
"Return",
"true",
"when",
"the",
"nest",
"starting",
"at",
"LOOP1",
"and",
"ending",
"on",
"LOOP2",
"is",
"perfect",
":",
"i",
".",
"e",
".",
"there",
"are",
"no",
"sequence",
"of",
"statements",
"."
] | static bool
lst_perfectly_nested_p (lst_p loop1, lst_p loop2)
{
if (loop1 == loop2)
return true;
if (!LST_LOOP_P (loop1))
return false;
return VEC_length (lst_p, LST_SEQ (loop1)) == 1
&& lst_perfectly_nested_p (VEC_index (lst_p, LST_SEQ (loop1), 0), loop2);
} | [
"static",
"bool",
"lst_perfectly_nested_p",
"(",
"lst_p",
"loop1",
",",
"lst_p",
"loop2",
")",
"{",
"if",
"(",
"loop1",
"==",
"loop2",
")",
"return",
"true",
";",
"if",
"(",
"!",
"LST_LOOP_P",
"(",
"loop1",
")",
")",
"return",
"false",
";",
"return",
"VEC_length",
"(",
"lst_p",
",",
"LST_SEQ",
"(",
"loop1",
")",
")",
"==",
"1",
"&&",
"lst_perfectly_nested_p",
"(",
"VEC_index",
"(",
"lst_p",
",",
"LST_SEQ",
"(",
"loop1",
")",
",",
"0",
")",
",",
"loop2",
")",
";",
"}"
] | Return true when the nest starting at LOOP1 and ending on LOOP2 is
perfect: i.e. | [
"Return",
"true",
"when",
"the",
"nest",
"starting",
"at",
"LOOP1",
"and",
"ending",
"on",
"LOOP2",
"is",
"perfect",
":",
"i",
".",
"e",
"."
] | [] | [
{
"param": "loop1",
"type": "lst_p"
},
{
"param": "loop2",
"type": "lst_p"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "loop1",
"type": "lst_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "loop2",
"type": "lst_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cb4d32cc0d2f7d7734f1124bdc6c5c0fc4f95ccf | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/graphite-interchange.c | [
"BSD-3-Clause"
] | C | lst_perfect_nestify | void | static void
lst_perfect_nestify (lst_p loop1, lst_p loop2, lst_p *before,
lst_p *nest, lst_p *after)
{
poly_bb_p first, last;
gcc_assert (loop1 && loop2
&& loop1 != loop2
&& LST_LOOP_P (loop1) && LST_LOOP_P (loop2));
first = LST_PBB (lst_find_first_pbb (loop2));
last = LST_PBB (lst_find_last_pbb (loop2));
*before = copy_lst (loop1);
*nest = copy_lst (loop1);
*after = copy_lst (loop1);
lst_remove_all_before_including_pbb (*before, first, false);
lst_remove_all_before_including_pbb (*after, last, true);
lst_remove_all_before_excluding_pbb (*nest, first, true);
lst_remove_all_before_excluding_pbb (*nest, last, false);
if (lst_empty_p (*before))
{
free_lst (*before);
*before = NULL;
}
if (lst_empty_p (*after))
{
free_lst (*after);
*after = NULL;
}
if (lst_empty_p (*nest))
{
free_lst (*nest);
*nest = NULL;
}
} | /* Transform the loop nest between LOOP1 and LOOP2 into a perfect
nest. To continue the naming tradition, this function is called
after perfect_nestify. NEST is set to the perfectly nested loop
that is created. BEFORE/AFTER are set to the loops distributed
before/after the loop NEST. */ | Transform the loop nest between LOOP1 and LOOP2 into a perfect
nest. To continue the naming tradition, this function is called
after perfect_nestify. NEST is set to the perfectly nested loop
that is created. BEFORE/AFTER are set to the loops distributed
before/after the loop NEST. | [
"Transform",
"the",
"loop",
"nest",
"between",
"LOOP1",
"and",
"LOOP2",
"into",
"a",
"perfect",
"nest",
".",
"To",
"continue",
"the",
"naming",
"tradition",
"this",
"function",
"is",
"called",
"after",
"perfect_nestify",
".",
"NEST",
"is",
"set",
"to",
"the",
"perfectly",
"nested",
"loop",
"that",
"is",
"created",
".",
"BEFORE",
"/",
"AFTER",
"are",
"set",
"to",
"the",
"loops",
"distributed",
"before",
"/",
"after",
"the",
"loop",
"NEST",
"."
] | static void
lst_perfect_nestify (lst_p loop1, lst_p loop2, lst_p *before,
lst_p *nest, lst_p *after)
{
poly_bb_p first, last;
gcc_assert (loop1 && loop2
&& loop1 != loop2
&& LST_LOOP_P (loop1) && LST_LOOP_P (loop2));
first = LST_PBB (lst_find_first_pbb (loop2));
last = LST_PBB (lst_find_last_pbb (loop2));
*before = copy_lst (loop1);
*nest = copy_lst (loop1);
*after = copy_lst (loop1);
lst_remove_all_before_including_pbb (*before, first, false);
lst_remove_all_before_including_pbb (*after, last, true);
lst_remove_all_before_excluding_pbb (*nest, first, true);
lst_remove_all_before_excluding_pbb (*nest, last, false);
if (lst_empty_p (*before))
{
free_lst (*before);
*before = NULL;
}
if (lst_empty_p (*after))
{
free_lst (*after);
*after = NULL;
}
if (lst_empty_p (*nest))
{
free_lst (*nest);
*nest = NULL;
}
} | [
"static",
"void",
"lst_perfect_nestify",
"(",
"lst_p",
"loop1",
",",
"lst_p",
"loop2",
",",
"lst_p",
"*",
"before",
",",
"lst_p",
"*",
"nest",
",",
"lst_p",
"*",
"after",
")",
"{",
"poly_bb_p",
"first",
",",
"last",
";",
"gcc_assert",
"(",
"loop1",
"&&",
"loop2",
"&&",
"loop1",
"!=",
"loop2",
"&&",
"LST_LOOP_P",
"(",
"loop1",
")",
"&&",
"LST_LOOP_P",
"(",
"loop2",
")",
")",
";",
"first",
"=",
"LST_PBB",
"(",
"lst_find_first_pbb",
"(",
"loop2",
")",
")",
";",
"last",
"=",
"LST_PBB",
"(",
"lst_find_last_pbb",
"(",
"loop2",
")",
")",
";",
"*",
"before",
"=",
"copy_lst",
"(",
"loop1",
")",
";",
"*",
"nest",
"=",
"copy_lst",
"(",
"loop1",
")",
";",
"*",
"after",
"=",
"copy_lst",
"(",
"loop1",
")",
";",
"lst_remove_all_before_including_pbb",
"(",
"*",
"before",
",",
"first",
",",
"false",
")",
";",
"lst_remove_all_before_including_pbb",
"(",
"*",
"after",
",",
"last",
",",
"true",
")",
";",
"lst_remove_all_before_excluding_pbb",
"(",
"*",
"nest",
",",
"first",
",",
"true",
")",
";",
"lst_remove_all_before_excluding_pbb",
"(",
"*",
"nest",
",",
"last",
",",
"false",
")",
";",
"if",
"(",
"lst_empty_p",
"(",
"*",
"before",
")",
")",
"{",
"free_lst",
"(",
"*",
"before",
")",
";",
"*",
"before",
"=",
"NULL",
";",
"}",
"if",
"(",
"lst_empty_p",
"(",
"*",
"after",
")",
")",
"{",
"free_lst",
"(",
"*",
"after",
")",
";",
"*",
"after",
"=",
"NULL",
";",
"}",
"if",
"(",
"lst_empty_p",
"(",
"*",
"nest",
")",
")",
"{",
"free_lst",
"(",
"*",
"nest",
")",
";",
"*",
"nest",
"=",
"NULL",
";",
"}",
"}"
] | Transform the loop nest between LOOP1 and LOOP2 into a perfect
nest. | [
"Transform",
"the",
"loop",
"nest",
"between",
"LOOP1",
"and",
"LOOP2",
"into",
"a",
"perfect",
"nest",
"."
] | [] | [
{
"param": "loop1",
"type": "lst_p"
},
{
"param": "loop2",
"type": "lst_p"
},
{
"param": "before",
"type": "lst_p"
},
{
"param": "nest",
"type": "lst_p"
},
{
"param": "after",
"type": "lst_p"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "loop1",
"type": "lst_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "loop2",
"type": "lst_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "before",
"type": "lst_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "nest",
"type": "lst_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "after",
"type": "lst_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cb4d32cc0d2f7d7734f1124bdc6c5c0fc4f95ccf | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/graphite-interchange.c | [
"BSD-3-Clause"
] | C | lst_try_interchange_loops | bool | static bool
lst_try_interchange_loops (scop_p scop, lst_p loop1, lst_p loop2)
{
int depth1 = lst_depth (loop1);
int depth2 = lst_depth (loop2);
lst_p transformed;
lst_p before = NULL, nest = NULL, after = NULL;
if (!lst_perfectly_nested_p (loop1, loop2))
lst_perfect_nestify (loop1, loop2, &before, &nest, &after);
if (!lst_interchange_profitable_p (loop2, depth1, depth2))
return false;
lst_apply_interchange (loop2, depth1, depth2);
/* Sync the transformed LST information and the PBB scatterings
before using the scatterings in the data dependence analysis. */
if (before || nest || after)
{
transformed = lst_substitute_3 (SCOP_TRANSFORMED_SCHEDULE (scop), loop1,
before, nest, after);
lst_update_scattering (transformed);
free_lst (transformed);
}
if (graphite_legal_transform (scop))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
"Loops at depths %d and %d will be interchanged.\n",
depth1, depth2);
/* Transform the SCOP_TRANSFORMED_SCHEDULE of the SCOP. */
lst_insert_in_sequence (before, loop1, true);
lst_insert_in_sequence (after, loop1, false);
if (nest)
{
lst_replace (loop1, nest);
free_lst (loop1);
}
return true;
}
/* Undo the transform. */
free_lst (before);
free_lst (nest);
free_lst (after);
lst_apply_interchange (loop2, depth2, depth1);
return false;
} | /* Try to interchange LOOP1 with LOOP2 for all the statements of the
body of LOOP2. LOOP1 contains LOOP2. Return true if it did the
interchange. */ | Try to interchange LOOP1 with LOOP2 for all the statements of the
body of LOOP2. LOOP1 contains LOOP2. Return true if it did the
interchange. | [
"Try",
"to",
"interchange",
"LOOP1",
"with",
"LOOP2",
"for",
"all",
"the",
"statements",
"of",
"the",
"body",
"of",
"LOOP2",
".",
"LOOP1",
"contains",
"LOOP2",
".",
"Return",
"true",
"if",
"it",
"did",
"the",
"interchange",
"."
] | static bool
lst_try_interchange_loops (scop_p scop, lst_p loop1, lst_p loop2)
{
int depth1 = lst_depth (loop1);
int depth2 = lst_depth (loop2);
lst_p transformed;
lst_p before = NULL, nest = NULL, after = NULL;
if (!lst_perfectly_nested_p (loop1, loop2))
lst_perfect_nestify (loop1, loop2, &before, &nest, &after);
if (!lst_interchange_profitable_p (loop2, depth1, depth2))
return false;
lst_apply_interchange (loop2, depth1, depth2);
if (before || nest || after)
{
transformed = lst_substitute_3 (SCOP_TRANSFORMED_SCHEDULE (scop), loop1,
before, nest, after);
lst_update_scattering (transformed);
free_lst (transformed);
}
if (graphite_legal_transform (scop))
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
"Loops at depths %d and %d will be interchanged.\n",
depth1, depth2);
lst_insert_in_sequence (before, loop1, true);
lst_insert_in_sequence (after, loop1, false);
if (nest)
{
lst_replace (loop1, nest);
free_lst (loop1);
}
return true;
}
free_lst (before);
free_lst (nest);
free_lst (after);
lst_apply_interchange (loop2, depth2, depth1);
return false;
} | [
"static",
"bool",
"lst_try_interchange_loops",
"(",
"scop_p",
"scop",
",",
"lst_p",
"loop1",
",",
"lst_p",
"loop2",
")",
"{",
"int",
"depth1",
"=",
"lst_depth",
"(",
"loop1",
")",
";",
"int",
"depth2",
"=",
"lst_depth",
"(",
"loop2",
")",
";",
"lst_p",
"transformed",
";",
"lst_p",
"before",
"=",
"NULL",
",",
"nest",
"=",
"NULL",
",",
"after",
"=",
"NULL",
";",
"if",
"(",
"!",
"lst_perfectly_nested_p",
"(",
"loop1",
",",
"loop2",
")",
")",
"lst_perfect_nestify",
"(",
"loop1",
",",
"loop2",
",",
"&",
"before",
",",
"&",
"nest",
",",
"&",
"after",
")",
";",
"if",
"(",
"!",
"lst_interchange_profitable_p",
"(",
"loop2",
",",
"depth1",
",",
"depth2",
")",
")",
"return",
"false",
";",
"lst_apply_interchange",
"(",
"loop2",
",",
"depth1",
",",
"depth2",
")",
";",
"if",
"(",
"before",
"||",
"nest",
"||",
"after",
")",
"{",
"transformed",
"=",
"lst_substitute_3",
"(",
"SCOP_TRANSFORMED_SCHEDULE",
"(",
"scop",
")",
",",
"loop1",
",",
"before",
",",
"nest",
",",
"after",
")",
";",
"lst_update_scattering",
"(",
"transformed",
")",
";",
"free_lst",
"(",
"transformed",
")",
";",
"}",
"if",
"(",
"graphite_legal_transform",
"(",
"scop",
")",
")",
"{",
"if",
"(",
"dump_file",
"&&",
"(",
"dump_flags",
"&",
"TDF_DETAILS",
")",
")",
"fprintf",
"(",
"dump_file",
",",
"\"",
"\\n",
"\"",
",",
"depth1",
",",
"depth2",
")",
";",
"lst_insert_in_sequence",
"(",
"before",
",",
"loop1",
",",
"true",
")",
";",
"lst_insert_in_sequence",
"(",
"after",
",",
"loop1",
",",
"false",
")",
";",
"if",
"(",
"nest",
")",
"{",
"lst_replace",
"(",
"loop1",
",",
"nest",
")",
";",
"free_lst",
"(",
"loop1",
")",
";",
"}",
"return",
"true",
";",
"}",
"free_lst",
"(",
"before",
")",
";",
"free_lst",
"(",
"nest",
")",
";",
"free_lst",
"(",
"after",
")",
";",
"lst_apply_interchange",
"(",
"loop2",
",",
"depth2",
",",
"depth1",
")",
";",
"return",
"false",
";",
"}"
] | Try to interchange LOOP1 with LOOP2 for all the statements of the
body of LOOP2. | [
"Try",
"to",
"interchange",
"LOOP1",
"with",
"LOOP2",
"for",
"all",
"the",
"statements",
"of",
"the",
"body",
"of",
"LOOP2",
"."
] | [
"/* Sync the transformed LST information and the PBB scatterings\n before using the scatterings in the data dependence analysis. */",
"/* Transform the SCOP_TRANSFORMED_SCHEDULE of the SCOP. */",
"/* Undo the transform. */"
] | [
{
"param": "scop",
"type": "scop_p"
},
{
"param": "loop1",
"type": "lst_p"
},
{
"param": "loop2",
"type": "lst_p"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "scop",
"type": "scop_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "loop1",
"type": "lst_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "loop2",
"type": "lst_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cb4d32cc0d2f7d7734f1124bdc6c5c0fc4f95ccf | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/graphite-interchange.c | [
"BSD-3-Clause"
] | C | lst_interchange_select_outer | int | static int
lst_interchange_select_outer (scop_p scop, lst_p loop, int outer)
{
lst_p l;
int res = 0;
int i = 0;
lst_p father;
if (!loop || !LST_LOOP_P (loop))
return 0;
father = LST_LOOP_FATHER (loop);
if (father)
{
while (lst_interchange_select_inner (scop, father, outer, loop))
{
res++;
loop = VEC_index (lst_p, LST_SEQ (father), outer);
}
}
if (LST_LOOP_P (loop))
FOR_EACH_VEC_ELT (lst_p, LST_SEQ (loop), i, l)
if (LST_LOOP_P (l))
res += lst_interchange_select_outer (scop, l, i);
return res;
} | /* Interchanges all the loops of LOOP and the loops of its body that
are considered profitable to interchange. Return the number of
interchanged loops. OUTER is the index in LST_SEQ (LOOP) that
points to the next outer loop to be considered for interchange. */ | Interchanges all the loops of LOOP and the loops of its body that
are considered profitable to interchange. Return the number of
interchanged loops. OUTER is the index in LST_SEQ (LOOP) that
points to the next outer loop to be considered for interchange. | [
"Interchanges",
"all",
"the",
"loops",
"of",
"LOOP",
"and",
"the",
"loops",
"of",
"its",
"body",
"that",
"are",
"considered",
"profitable",
"to",
"interchange",
".",
"Return",
"the",
"number",
"of",
"interchanged",
"loops",
".",
"OUTER",
"is",
"the",
"index",
"in",
"LST_SEQ",
"(",
"LOOP",
")",
"that",
"points",
"to",
"the",
"next",
"outer",
"loop",
"to",
"be",
"considered",
"for",
"interchange",
"."
] | static int
lst_interchange_select_outer (scop_p scop, lst_p loop, int outer)
{
lst_p l;
int res = 0;
int i = 0;
lst_p father;
if (!loop || !LST_LOOP_P (loop))
return 0;
father = LST_LOOP_FATHER (loop);
if (father)
{
while (lst_interchange_select_inner (scop, father, outer, loop))
{
res++;
loop = VEC_index (lst_p, LST_SEQ (father), outer);
}
}
if (LST_LOOP_P (loop))
FOR_EACH_VEC_ELT (lst_p, LST_SEQ (loop), i, l)
if (LST_LOOP_P (l))
res += lst_interchange_select_outer (scop, l, i);
return res;
} | [
"static",
"int",
"lst_interchange_select_outer",
"(",
"scop_p",
"scop",
",",
"lst_p",
"loop",
",",
"int",
"outer",
")",
"{",
"lst_p",
"l",
";",
"int",
"res",
"=",
"0",
";",
"int",
"i",
"=",
"0",
";",
"lst_p",
"father",
";",
"if",
"(",
"!",
"loop",
"||",
"!",
"LST_LOOP_P",
"(",
"loop",
")",
")",
"return",
"0",
";",
"father",
"=",
"LST_LOOP_FATHER",
"(",
"loop",
")",
";",
"if",
"(",
"father",
")",
"{",
"while",
"(",
"lst_interchange_select_inner",
"(",
"scop",
",",
"father",
",",
"outer",
",",
"loop",
")",
")",
"{",
"res",
"++",
";",
"loop",
"=",
"VEC_index",
"(",
"lst_p",
",",
"LST_SEQ",
"(",
"father",
")",
",",
"outer",
")",
";",
"}",
"}",
"if",
"(",
"LST_LOOP_P",
"(",
"loop",
")",
")",
"FOR_EACH_VEC_ELT",
"(",
"lst_p",
",",
"LST_SEQ",
"(",
"loop",
")",
",",
"i",
",",
"l",
")",
"",
"if",
"(",
"LST_LOOP_P",
"(",
"l",
")",
")",
"res",
"+=",
"lst_interchange_select_outer",
"(",
"scop",
",",
"l",
",",
"i",
")",
";",
"return",
"res",
";",
"}"
] | Interchanges all the loops of LOOP and the loops of its body that
are considered profitable to interchange. | [
"Interchanges",
"all",
"the",
"loops",
"of",
"LOOP",
"and",
"the",
"loops",
"of",
"its",
"body",
"that",
"are",
"considered",
"profitable",
"to",
"interchange",
"."
] | [] | [
{
"param": "scop",
"type": "scop_p"
},
{
"param": "loop",
"type": "lst_p"
},
{
"param": "outer",
"type": "int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "scop",
"type": "scop_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "loop",
"type": "lst_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "outer",
"type": "int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
cb4d32cc0d2f7d7734f1124bdc6c5c0fc4f95ccf | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/graphite-interchange.c | [
"BSD-3-Clause"
] | C | scop_do_interchange | int | int
scop_do_interchange (scop_p scop)
{
int res = lst_interchange_select_outer
(scop, SCOP_TRANSFORMED_SCHEDULE (scop), 0);
lst_update_scattering (SCOP_TRANSFORMED_SCHEDULE (scop));
return res;
} | /* Interchanges all the loop depths that are considered profitable for
SCOP. Return the number of interchanged loops. */ | Interchanges all the loop depths that are considered profitable for
SCOP. Return the number of interchanged loops. | [
"Interchanges",
"all",
"the",
"loop",
"depths",
"that",
"are",
"considered",
"profitable",
"for",
"SCOP",
".",
"Return",
"the",
"number",
"of",
"interchanged",
"loops",
"."
] | int
scop_do_interchange (scop_p scop)
{
int res = lst_interchange_select_outer
(scop, SCOP_TRANSFORMED_SCHEDULE (scop), 0);
lst_update_scattering (SCOP_TRANSFORMED_SCHEDULE (scop));
return res;
} | [
"int",
"scop_do_interchange",
"(",
"scop_p",
"scop",
")",
"{",
"int",
"res",
"=",
"lst_interchange_select_outer",
"(",
"scop",
",",
"SCOP_TRANSFORMED_SCHEDULE",
"(",
"scop",
")",
",",
"0",
")",
";",
"lst_update_scattering",
"(",
"SCOP_TRANSFORMED_SCHEDULE",
"(",
"scop",
")",
")",
";",
"return",
"res",
";",
"}"
] | Interchanges all the loop depths that are considered profitable for
SCOP. | [
"Interchanges",
"all",
"the",
"loop",
"depths",
"that",
"are",
"considered",
"profitable",
"for",
"SCOP",
"."
] | [] | [
{
"param": "scop",
"type": "scop_p"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "scop",
"type": "scop_p",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | streamer_read_string_cst | tree | tree
streamer_read_string_cst (struct data_in *data_in, struct lto_input_block *ib)
{
unsigned int len;
const char * ptr;
ptr = streamer_read_indexed_string (data_in, ib, &len);
if (!ptr)
return NULL;
return build_string (len, ptr);
} | /* Read a STRING_CST from the string table in DATA_IN using input
block IB. */ | Read a STRING_CST from the string table in DATA_IN using input
block IB. | [
"Read",
"a",
"STRING_CST",
"from",
"the",
"string",
"table",
"in",
"DATA_IN",
"using",
"input",
"block",
"IB",
"."
] | tree
streamer_read_string_cst (struct data_in *data_in, struct lto_input_block *ib)
{
unsigned int len;
const char * ptr;
ptr = streamer_read_indexed_string (data_in, ib, &len);
if (!ptr)
return NULL;
return build_string (len, ptr);
} | [
"tree",
"streamer_read_string_cst",
"(",
"struct",
"data_in",
"*",
"data_in",
",",
"struct",
"lto_input_block",
"*",
"ib",
")",
"{",
"unsigned",
"int",
"len",
";",
"const",
"char",
"*",
"ptr",
";",
"ptr",
"=",
"streamer_read_indexed_string",
"(",
"data_in",
",",
"ib",
",",
"&",
"len",
")",
";",
"if",
"(",
"!",
"ptr",
")",
"return",
"NULL",
";",
"return",
"build_string",
"(",
"len",
",",
"ptr",
")",
";",
"}"
] | Read a STRING_CST from the string table in DATA_IN using input
block IB. | [
"Read",
"a",
"STRING_CST",
"from",
"the",
"string",
"table",
"in",
"DATA_IN",
"using",
"input",
"block",
"IB",
"."
] | [] | [
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "ib",
"type": "struct lto_input_block"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | input_identifier | tree | static tree
input_identifier (struct data_in *data_in, struct lto_input_block *ib)
{
unsigned int len;
const char *ptr;
ptr = streamer_read_indexed_string (data_in, ib, &len);
if (!ptr)
return NULL;
return get_identifier_with_length (ptr, len);
} | /* Read an IDENTIFIER from the string table in DATA_IN using input
block IB. */ | Read an IDENTIFIER from the string table in DATA_IN using input
block IB. | [
"Read",
"an",
"IDENTIFIER",
"from",
"the",
"string",
"table",
"in",
"DATA_IN",
"using",
"input",
"block",
"IB",
"."
] | static tree
input_identifier (struct data_in *data_in, struct lto_input_block *ib)
{
unsigned int len;
const char *ptr;
ptr = streamer_read_indexed_string (data_in, ib, &len);
if (!ptr)
return NULL;
return get_identifier_with_length (ptr, len);
} | [
"static",
"tree",
"input_identifier",
"(",
"struct",
"data_in",
"*",
"data_in",
",",
"struct",
"lto_input_block",
"*",
"ib",
")",
"{",
"unsigned",
"int",
"len",
";",
"const",
"char",
"*",
"ptr",
";",
"ptr",
"=",
"streamer_read_indexed_string",
"(",
"data_in",
",",
"ib",
",",
"&",
"len",
")",
";",
"if",
"(",
"!",
"ptr",
")",
"return",
"NULL",
";",
"return",
"get_identifier_with_length",
"(",
"ptr",
",",
"len",
")",
";",
"}"
] | Read an IDENTIFIER from the string table in DATA_IN using input
block IB. | [
"Read",
"an",
"IDENTIFIER",
"from",
"the",
"string",
"table",
"in",
"DATA_IN",
"using",
"input",
"block",
"IB",
"."
] | [] | [
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "ib",
"type": "struct lto_input_block"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | streamer_read_chain | tree | tree
streamer_read_chain (struct lto_input_block *ib, struct data_in *data_in)
{
int i, count;
tree first, prev, curr;
first = prev = NULL_TREE;
count = streamer_read_hwi (ib);
for (i = 0; i < count; i++)
{
curr = stream_read_tree (ib, data_in);
if (prev)
TREE_CHAIN (prev) = curr;
else
first = curr;
TREE_CHAIN (curr) = NULL_TREE;
prev = curr;
}
return first;
} | /* Read a chain of tree nodes from input block IB. DATA_IN contains
tables and descriptors for the file being read. */ | Read a chain of tree nodes from input block IB. DATA_IN contains
tables and descriptors for the file being read. | [
"Read",
"a",
"chain",
"of",
"tree",
"nodes",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | tree
streamer_read_chain (struct lto_input_block *ib, struct data_in *data_in)
{
int i, count;
tree first, prev, curr;
first = prev = NULL_TREE;
count = streamer_read_hwi (ib);
for (i = 0; i < count; i++)
{
curr = stream_read_tree (ib, data_in);
if (prev)
TREE_CHAIN (prev) = curr;
else
first = curr;
TREE_CHAIN (curr) = NULL_TREE;
prev = curr;
}
return first;
} | [
"tree",
"streamer_read_chain",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
")",
"{",
"int",
"i",
",",
"count",
";",
"tree",
"first",
",",
"prev",
",",
"curr",
";",
"first",
"=",
"prev",
"=",
"NULL_TREE",
";",
"count",
"=",
"streamer_read_hwi",
"(",
"ib",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"count",
";",
"i",
"++",
")",
"{",
"curr",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"if",
"(",
"prev",
")",
"TREE_CHAIN",
"(",
"prev",
")",
"=",
"curr",
";",
"else",
"first",
"=",
"curr",
";",
"TREE_CHAIN",
"(",
"curr",
")",
"=",
"NULL_TREE",
";",
"prev",
"=",
"curr",
";",
"}",
"return",
"first",
";",
"}"
] | Read a chain of tree nodes from input block IB. | [
"Read",
"a",
"chain",
"of",
"tree",
"nodes",
"from",
"input",
"block",
"IB",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | unpack_ts_base_value_fields | void | static void
unpack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
{
/* Note that the code for EXPR has already been unpacked to create EXPR in
streamer_alloc_tree. */
if (!TYPE_P (expr))
{
TREE_SIDE_EFFECTS (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_CONSTANT (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_READONLY (expr) = (unsigned) bp_unpack_value (bp, 1);
/* TREE_PUBLIC is used on types to indicate that the type
has a TYPE_CACHED_VALUES vector. This is not streamed out,
so we skip it here. */
TREE_PUBLIC (expr) = (unsigned) bp_unpack_value (bp, 1);
}
else
bp_unpack_value (bp, 4);
TREE_ADDRESSABLE (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_THIS_VOLATILE (expr) = (unsigned) bp_unpack_value (bp, 1);
if (DECL_P (expr))
DECL_UNSIGNED (expr) = (unsigned) bp_unpack_value (bp, 1);
else if (TYPE_P (expr))
TYPE_UNSIGNED (expr) = (unsigned) bp_unpack_value (bp, 1);
else
bp_unpack_value (bp, 1);
TREE_ASM_WRITTEN (expr) = (unsigned) bp_unpack_value (bp, 1);
if (TYPE_P (expr))
TYPE_ARTIFICIAL (expr) = (unsigned) bp_unpack_value (bp, 1);
else
TREE_NO_WARNING (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_USED (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_NOTHROW (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_STATIC (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_PRIVATE (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_PROTECTED (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_DEPRECATED (expr) = (unsigned) bp_unpack_value (bp, 1);
if (TYPE_P (expr))
{
TYPE_SATURATING (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_ADDR_SPACE (expr) = (unsigned) bp_unpack_value (bp, 8);
}
else if (TREE_CODE (expr) == SSA_NAME)
SSA_NAME_IS_DEFAULT_DEF (expr) = (unsigned) bp_unpack_value (bp, 1);
else
bp_unpack_value (bp, 1);
} | /* Unpack all the non-pointer fields of the TS_BASE structure of
expression EXPR from bitpack BP. */ | Unpack all the non-pointer fields of the TS_BASE structure of
expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_BASE",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | static void
unpack_ts_base_value_fields (struct bitpack_d *bp, tree expr)
{
if (!TYPE_P (expr))
{
TREE_SIDE_EFFECTS (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_CONSTANT (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_READONLY (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_PUBLIC (expr) = (unsigned) bp_unpack_value (bp, 1);
}
else
bp_unpack_value (bp, 4);
TREE_ADDRESSABLE (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_THIS_VOLATILE (expr) = (unsigned) bp_unpack_value (bp, 1);
if (DECL_P (expr))
DECL_UNSIGNED (expr) = (unsigned) bp_unpack_value (bp, 1);
else if (TYPE_P (expr))
TYPE_UNSIGNED (expr) = (unsigned) bp_unpack_value (bp, 1);
else
bp_unpack_value (bp, 1);
TREE_ASM_WRITTEN (expr) = (unsigned) bp_unpack_value (bp, 1);
if (TYPE_P (expr))
TYPE_ARTIFICIAL (expr) = (unsigned) bp_unpack_value (bp, 1);
else
TREE_NO_WARNING (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_USED (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_NOTHROW (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_STATIC (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_PRIVATE (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_PROTECTED (expr) = (unsigned) bp_unpack_value (bp, 1);
TREE_DEPRECATED (expr) = (unsigned) bp_unpack_value (bp, 1);
if (TYPE_P (expr))
{
TYPE_SATURATING (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_ADDR_SPACE (expr) = (unsigned) bp_unpack_value (bp, 8);
}
else if (TREE_CODE (expr) == SSA_NAME)
SSA_NAME_IS_DEFAULT_DEF (expr) = (unsigned) bp_unpack_value (bp, 1);
else
bp_unpack_value (bp, 1);
} | [
"static",
"void",
"unpack_ts_base_value_fields",
"(",
"struct",
"bitpack_d",
"*",
"bp",
",",
"tree",
"expr",
")",
"{",
"if",
"(",
"!",
"TYPE_P",
"(",
"expr",
")",
")",
"{",
"TREE_SIDE_EFFECTS",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TREE_CONSTANT",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TREE_READONLY",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TREE_PUBLIC",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"}",
"else",
"bp_unpack_value",
"(",
"bp",
",",
"4",
")",
";",
"TREE_ADDRESSABLE",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TREE_THIS_VOLATILE",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"if",
"(",
"DECL_P",
"(",
"expr",
")",
")",
"DECL_UNSIGNED",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"else",
"if",
"(",
"TYPE_P",
"(",
"expr",
")",
")",
"TYPE_UNSIGNED",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"else",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TREE_ASM_WRITTEN",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"if",
"(",
"TYPE_P",
"(",
"expr",
")",
")",
"TYPE_ARTIFICIAL",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"else",
"TREE_NO_WARNING",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TREE_USED",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TREE_NOTHROW",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TREE_STATIC",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TREE_PRIVATE",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TREE_PROTECTED",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TREE_DEPRECATED",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"if",
"(",
"TYPE_P",
"(",
"expr",
")",
")",
"{",
"TYPE_SATURATING",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TYPE_ADDR_SPACE",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"8",
")",
";",
"}",
"else",
"if",
"(",
"TREE_CODE",
"(",
"expr",
")",
"==",
"SSA_NAME",
")",
"SSA_NAME_IS_DEFAULT_DEF",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"else",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"}"
] | Unpack all the non-pointer fields of the TS_BASE structure of
expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_BASE",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | [
"/* Note that the code for EXPR has already been unpacked to create EXPR in\n streamer_alloc_tree. */",
"/* TREE_PUBLIC is used on types to indicate that the type\n\t has a TYPE_CACHED_VALUES vector. This is not streamed out,\n\t so we skip it here. */"
] | [
{
"param": "bp",
"type": "struct bitpack_d"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "bp",
"type": "struct bitpack_d",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | unpack_ts_real_cst_value_fields | void | static void
unpack_ts_real_cst_value_fields (struct bitpack_d *bp, tree expr)
{
unsigned i;
REAL_VALUE_TYPE r;
REAL_VALUE_TYPE *rp;
r.cl = (unsigned) bp_unpack_value (bp, 2);
r.decimal = (unsigned) bp_unpack_value (bp, 1);
r.sign = (unsigned) bp_unpack_value (bp, 1);
r.signalling = (unsigned) bp_unpack_value (bp, 1);
r.canonical = (unsigned) bp_unpack_value (bp, 1);
r.uexp = (unsigned) bp_unpack_value (bp, EXP_BITS);
for (i = 0; i < SIGSZ; i++)
r.sig[i] = (unsigned long) bp_unpack_value (bp, HOST_BITS_PER_LONG);
rp = ggc_alloc_real_value ();
memcpy (rp, &r, sizeof (REAL_VALUE_TYPE));
TREE_REAL_CST_PTR (expr) = rp;
} | /* Unpack all the non-pointer fields of the TS_REAL_CST structure of
expression EXPR from bitpack BP. */ | Unpack all the non-pointer fields of the TS_REAL_CST structure of
expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_REAL_CST",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | static void
unpack_ts_real_cst_value_fields (struct bitpack_d *bp, tree expr)
{
unsigned i;
REAL_VALUE_TYPE r;
REAL_VALUE_TYPE *rp;
r.cl = (unsigned) bp_unpack_value (bp, 2);
r.decimal = (unsigned) bp_unpack_value (bp, 1);
r.sign = (unsigned) bp_unpack_value (bp, 1);
r.signalling = (unsigned) bp_unpack_value (bp, 1);
r.canonical = (unsigned) bp_unpack_value (bp, 1);
r.uexp = (unsigned) bp_unpack_value (bp, EXP_BITS);
for (i = 0; i < SIGSZ; i++)
r.sig[i] = (unsigned long) bp_unpack_value (bp, HOST_BITS_PER_LONG);
rp = ggc_alloc_real_value ();
memcpy (rp, &r, sizeof (REAL_VALUE_TYPE));
TREE_REAL_CST_PTR (expr) = rp;
} | [
"static",
"void",
"unpack_ts_real_cst_value_fields",
"(",
"struct",
"bitpack_d",
"*",
"bp",
",",
"tree",
"expr",
")",
"{",
"unsigned",
"i",
";",
"REAL_VALUE_TYPE",
"r",
";",
"REAL_VALUE_TYPE",
"*",
"rp",
";",
"r",
".",
"cl",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"2",
")",
";",
"r",
".",
"decimal",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"r",
".",
"sign",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"r",
".",
"signalling",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"r",
".",
"canonical",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"r",
".",
"uexp",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"EXP_BITS",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"SIGSZ",
";",
"i",
"++",
")",
"r",
".",
"sig",
"[",
"i",
"]",
"=",
"(",
"unsigned",
"long",
")",
"bp_unpack_value",
"(",
"bp",
",",
"HOST_BITS_PER_LONG",
")",
";",
"rp",
"=",
"ggc_alloc_real_value",
"(",
")",
";",
"memcpy",
"(",
"rp",
",",
"&",
"r",
",",
"sizeof",
"(",
"REAL_VALUE_TYPE",
")",
")",
";",
"TREE_REAL_CST_PTR",
"(",
"expr",
")",
"=",
"rp",
";",
"}"
] | Unpack all the non-pointer fields of the TS_REAL_CST structure of
expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_REAL_CST",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | [] | [
{
"param": "bp",
"type": "struct bitpack_d"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "bp",
"type": "struct bitpack_d",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | unpack_ts_fixed_cst_value_fields | void | static void
unpack_ts_fixed_cst_value_fields (struct bitpack_d *bp, tree expr)
{
FIXED_VALUE_TYPE *fp = ggc_alloc_fixed_value ();
fp->mode = bp_unpack_enum (bp, machine_mode, MAX_MACHINE_MODE);
fp->data.low = bp_unpack_var_len_int (bp);
fp->data.high = bp_unpack_var_len_int (bp);
TREE_FIXED_CST_PTR (expr) = fp;
} | /* Unpack all the non-pointer fields of the TS_FIXED_CST structure of
expression EXPR from bitpack BP. */ | Unpack all the non-pointer fields of the TS_FIXED_CST structure of
expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_FIXED_CST",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | static void
unpack_ts_fixed_cst_value_fields (struct bitpack_d *bp, tree expr)
{
FIXED_VALUE_TYPE *fp = ggc_alloc_fixed_value ();
fp->mode = bp_unpack_enum (bp, machine_mode, MAX_MACHINE_MODE);
fp->data.low = bp_unpack_var_len_int (bp);
fp->data.high = bp_unpack_var_len_int (bp);
TREE_FIXED_CST_PTR (expr) = fp;
} | [
"static",
"void",
"unpack_ts_fixed_cst_value_fields",
"(",
"struct",
"bitpack_d",
"*",
"bp",
",",
"tree",
"expr",
")",
"{",
"FIXED_VALUE_TYPE",
"*",
"fp",
"=",
"ggc_alloc_fixed_value",
"(",
")",
";",
"fp",
"->",
"mode",
"=",
"bp_unpack_enum",
"(",
"bp",
",",
"machine_mode",
",",
"MAX_MACHINE_MODE",
")",
";",
"fp",
"->",
"data",
".",
"low",
"=",
"bp_unpack_var_len_int",
"(",
"bp",
")",
";",
"fp",
"->",
"data",
".",
"high",
"=",
"bp_unpack_var_len_int",
"(",
"bp",
")",
";",
"TREE_FIXED_CST_PTR",
"(",
"expr",
")",
"=",
"fp",
";",
"}"
] | Unpack all the non-pointer fields of the TS_FIXED_CST structure of
expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_FIXED_CST",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | [] | [
{
"param": "bp",
"type": "struct bitpack_d"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "bp",
"type": "struct bitpack_d",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | unpack_ts_decl_common_value_fields | void | static void
unpack_ts_decl_common_value_fields (struct bitpack_d *bp, tree expr)
{
DECL_MODE (expr) = bp_unpack_enum (bp, machine_mode, MAX_MACHINE_MODE);
DECL_NONLOCAL (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_VIRTUAL_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_IGNORED_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_ABSTRACT (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_ARTIFICIAL (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_USER_ALIGN (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_PRESERVE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_DEBUG_EXPR_IS_FROM (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_EXTERNAL (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_GIMPLE_REG_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_ALIGN (expr) = (unsigned) bp_unpack_var_len_unsigned (bp);
if (TREE_CODE (expr) == LABEL_DECL)
{
DECL_ERROR_ISSUED (expr) = (unsigned) bp_unpack_value (bp, 1);
EH_LANDING_PAD_NR (expr) = (int) bp_unpack_var_len_unsigned (bp);
/* Always assume an initial value of -1 for LABEL_DECL_UID to
force gimple_set_bb to recreate label_to_block_map. */
LABEL_DECL_UID (expr) = -1;
}
if (TREE_CODE (expr) == FIELD_DECL)
{
DECL_PACKED (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_NONADDRESSABLE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
expr->decl_common.off_align = bp_unpack_value (bp, 8);
}
if (TREE_CODE (expr) == RESULT_DECL
|| TREE_CODE (expr) == PARM_DECL
|| TREE_CODE (expr) == VAR_DECL)
{
DECL_BY_REFERENCE (expr) = (unsigned) bp_unpack_value (bp, 1);
if (TREE_CODE (expr) == VAR_DECL
|| TREE_CODE (expr) == PARM_DECL)
DECL_HAS_VALUE_EXPR_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_RESTRICTED_P (expr) = (unsigned) bp_unpack_value (bp, 1);
}
} | /* Unpack all the non-pointer fields of the TS_DECL_COMMON structure
of expression EXPR from bitpack BP. */ | Unpack all the non-pointer fields of the TS_DECL_COMMON structure
of expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_DECL_COMMON",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | static void
unpack_ts_decl_common_value_fields (struct bitpack_d *bp, tree expr)
{
DECL_MODE (expr) = bp_unpack_enum (bp, machine_mode, MAX_MACHINE_MODE);
DECL_NONLOCAL (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_VIRTUAL_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_IGNORED_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_ABSTRACT (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_ARTIFICIAL (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_USER_ALIGN (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_PRESERVE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_DEBUG_EXPR_IS_FROM (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_EXTERNAL (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_GIMPLE_REG_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_ALIGN (expr) = (unsigned) bp_unpack_var_len_unsigned (bp);
if (TREE_CODE (expr) == LABEL_DECL)
{
DECL_ERROR_ISSUED (expr) = (unsigned) bp_unpack_value (bp, 1);
EH_LANDING_PAD_NR (expr) = (int) bp_unpack_var_len_unsigned (bp);
LABEL_DECL_UID (expr) = -1;
}
if (TREE_CODE (expr) == FIELD_DECL)
{
DECL_PACKED (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_NONADDRESSABLE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
expr->decl_common.off_align = bp_unpack_value (bp, 8);
}
if (TREE_CODE (expr) == RESULT_DECL
|| TREE_CODE (expr) == PARM_DECL
|| TREE_CODE (expr) == VAR_DECL)
{
DECL_BY_REFERENCE (expr) = (unsigned) bp_unpack_value (bp, 1);
if (TREE_CODE (expr) == VAR_DECL
|| TREE_CODE (expr) == PARM_DECL)
DECL_HAS_VALUE_EXPR_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_RESTRICTED_P (expr) = (unsigned) bp_unpack_value (bp, 1);
}
} | [
"static",
"void",
"unpack_ts_decl_common_value_fields",
"(",
"struct",
"bitpack_d",
"*",
"bp",
",",
"tree",
"expr",
")",
"{",
"DECL_MODE",
"(",
"expr",
")",
"=",
"bp_unpack_enum",
"(",
"bp",
",",
"machine_mode",
",",
"MAX_MACHINE_MODE",
")",
";",
"DECL_NONLOCAL",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_VIRTUAL_P",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_IGNORED_P",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_ABSTRACT",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_ARTIFICIAL",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_USER_ALIGN",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_PRESERVE_P",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_DEBUG_EXPR_IS_FROM",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_EXTERNAL",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_GIMPLE_REG_P",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_ALIGN",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_var_len_unsigned",
"(",
"bp",
")",
";",
"if",
"(",
"TREE_CODE",
"(",
"expr",
")",
"==",
"LABEL_DECL",
")",
"{",
"DECL_ERROR_ISSUED",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"EH_LANDING_PAD_NR",
"(",
"expr",
")",
"=",
"(",
"int",
")",
"bp_unpack_var_len_unsigned",
"(",
"bp",
")",
";",
"LABEL_DECL_UID",
"(",
"expr",
")",
"=",
"-1",
";",
"}",
"if",
"(",
"TREE_CODE",
"(",
"expr",
")",
"==",
"FIELD_DECL",
")",
"{",
"DECL_PACKED",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_NONADDRESSABLE_P",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"expr",
"->",
"decl_common",
".",
"off_align",
"=",
"bp_unpack_value",
"(",
"bp",
",",
"8",
")",
";",
"}",
"if",
"(",
"TREE_CODE",
"(",
"expr",
")",
"==",
"RESULT_DECL",
"||",
"TREE_CODE",
"(",
"expr",
")",
"==",
"PARM_DECL",
"||",
"TREE_CODE",
"(",
"expr",
")",
"==",
"VAR_DECL",
")",
"{",
"DECL_BY_REFERENCE",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"if",
"(",
"TREE_CODE",
"(",
"expr",
")",
"==",
"VAR_DECL",
"||",
"TREE_CODE",
"(",
"expr",
")",
"==",
"PARM_DECL",
")",
"DECL_HAS_VALUE_EXPR_P",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_RESTRICTED_P",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"}",
"}"
] | Unpack all the non-pointer fields of the TS_DECL_COMMON structure
of expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_DECL_COMMON",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | [
"/* Always assume an initial value of -1 for LABEL_DECL_UID to\n\t force gimple_set_bb to recreate label_to_block_map. */"
] | [
{
"param": "bp",
"type": "struct bitpack_d"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "bp",
"type": "struct bitpack_d",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | unpack_ts_decl_wrtl_value_fields | void | static void
unpack_ts_decl_wrtl_value_fields (struct bitpack_d *bp, tree expr)
{
DECL_REGISTER (expr) = (unsigned) bp_unpack_value (bp, 1);
} | /* Unpack all the non-pointer fields of the TS_DECL_WRTL structure
of expression EXPR from bitpack BP. */ | Unpack all the non-pointer fields of the TS_DECL_WRTL structure
of expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_DECL_WRTL",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | static void
unpack_ts_decl_wrtl_value_fields (struct bitpack_d *bp, tree expr)
{
DECL_REGISTER (expr) = (unsigned) bp_unpack_value (bp, 1);
} | [
"static",
"void",
"unpack_ts_decl_wrtl_value_fields",
"(",
"struct",
"bitpack_d",
"*",
"bp",
",",
"tree",
"expr",
")",
"{",
"DECL_REGISTER",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"}"
] | Unpack all the non-pointer fields of the TS_DECL_WRTL structure
of expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_DECL_WRTL",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | [] | [
{
"param": "bp",
"type": "struct bitpack_d"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "bp",
"type": "struct bitpack_d",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | unpack_ts_decl_with_vis_value_fields | void | static void
unpack_ts_decl_with_vis_value_fields (struct bitpack_d *bp, tree expr)
{
DECL_DEFER_OUTPUT (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_COMMON (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_DLLIMPORT_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_WEAK (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_SEEN_IN_BIND_EXPR_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_COMDAT (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_VISIBILITY (expr) = (enum symbol_visibility) bp_unpack_value (bp, 2);
DECL_VISIBILITY_SPECIFIED (expr) = (unsigned) bp_unpack_value (bp, 1);
if (TREE_CODE (expr) == VAR_DECL)
{
DECL_HARD_REGISTER (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_IN_TEXT_SECTION (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_IN_CONSTANT_POOL (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_TLS_MODEL (expr) = (enum tls_model) bp_unpack_value (bp, 3);
}
if (VAR_OR_FUNCTION_DECL_P (expr))
{
priority_type p;
p = (priority_type) bp_unpack_var_len_unsigned (bp);
SET_DECL_INIT_PRIORITY (expr, p);
}
} | /* Unpack all the non-pointer fields of the TS_DECL_WITH_VIS structure
of expression EXPR from bitpack BP. */ | Unpack all the non-pointer fields of the TS_DECL_WITH_VIS structure
of expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_DECL_WITH_VIS",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | static void
unpack_ts_decl_with_vis_value_fields (struct bitpack_d *bp, tree expr)
{
DECL_DEFER_OUTPUT (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_COMMON (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_DLLIMPORT_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_WEAK (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_SEEN_IN_BIND_EXPR_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_COMDAT (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_VISIBILITY (expr) = (enum symbol_visibility) bp_unpack_value (bp, 2);
DECL_VISIBILITY_SPECIFIED (expr) = (unsigned) bp_unpack_value (bp, 1);
if (TREE_CODE (expr) == VAR_DECL)
{
DECL_HARD_REGISTER (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_IN_TEXT_SECTION (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_IN_CONSTANT_POOL (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_TLS_MODEL (expr) = (enum tls_model) bp_unpack_value (bp, 3);
}
if (VAR_OR_FUNCTION_DECL_P (expr))
{
priority_type p;
p = (priority_type) bp_unpack_var_len_unsigned (bp);
SET_DECL_INIT_PRIORITY (expr, p);
}
} | [
"static",
"void",
"unpack_ts_decl_with_vis_value_fields",
"(",
"struct",
"bitpack_d",
"*",
"bp",
",",
"tree",
"expr",
")",
"{",
"DECL_DEFER_OUTPUT",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_COMMON",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_DLLIMPORT_P",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_WEAK",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_SEEN_IN_BIND_EXPR_P",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_COMDAT",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_VISIBILITY",
"(",
"expr",
")",
"=",
"(",
"enum",
"symbol_visibility",
")",
"bp_unpack_value",
"(",
"bp",
",",
"2",
")",
";",
"DECL_VISIBILITY_SPECIFIED",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"if",
"(",
"TREE_CODE",
"(",
"expr",
")",
"==",
"VAR_DECL",
")",
"{",
"DECL_HARD_REGISTER",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_IN_TEXT_SECTION",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_IN_CONSTANT_POOL",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_TLS_MODEL",
"(",
"expr",
")",
"=",
"(",
"enum",
"tls_model",
")",
"bp_unpack_value",
"(",
"bp",
",",
"3",
")",
";",
"}",
"if",
"(",
"VAR_OR_FUNCTION_DECL_P",
"(",
"expr",
")",
")",
"{",
"priority_type",
"p",
";",
"p",
"=",
"(",
"priority_type",
")",
"bp_unpack_var_len_unsigned",
"(",
"bp",
")",
";",
"SET_DECL_INIT_PRIORITY",
"(",
"expr",
",",
"p",
")",
";",
"}",
"}"
] | Unpack all the non-pointer fields of the TS_DECL_WITH_VIS structure
of expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_DECL_WITH_VIS",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | [] | [
{
"param": "bp",
"type": "struct bitpack_d"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "bp",
"type": "struct bitpack_d",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | unpack_ts_function_decl_value_fields | void | static void
unpack_ts_function_decl_value_fields (struct bitpack_d *bp, tree expr)
{
DECL_BUILT_IN_CLASS (expr) = bp_unpack_enum (bp, built_in_class,
BUILT_IN_LAST);
DECL_STATIC_CONSTRUCTOR (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_STATIC_DESTRUCTOR (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_UNINLINABLE (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_POSSIBLY_INLINED (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_IS_NOVOPS (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_IS_RETURNS_TWICE (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_IS_MALLOC (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_IS_OPERATOR_NEW (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_DECLARED_INLINE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_STATIC_CHAIN (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_NO_INLINE_WARNING_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (expr)
= (unsigned) bp_unpack_value (bp, 1);
DECL_NO_LIMIT_STACK (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_DISREGARD_INLINE_LIMITS (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_PURE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_LOOPING_CONST_OR_PURE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
if (DECL_BUILT_IN_CLASS (expr) != NOT_BUILT_IN)
{
DECL_FUNCTION_CODE (expr) = (enum built_in_function) bp_unpack_value (bp,
11);
if (DECL_BUILT_IN_CLASS (expr) == BUILT_IN_NORMAL
&& DECL_FUNCTION_CODE (expr) >= END_BUILTINS)
fatal_error ("machine independent builtin code out of range");
else if (DECL_BUILT_IN_CLASS (expr) == BUILT_IN_MD)
{
tree result = targetm.builtin_decl (DECL_FUNCTION_CODE (expr), true);
if (!result || result == error_mark_node)
fatal_error ("target specific builtin not available");
}
}
if (DECL_STATIC_DESTRUCTOR (expr))
{
priority_type p;
p = (priority_type) bp_unpack_var_len_unsigned (bp);
SET_DECL_FINI_PRIORITY (expr, p);
}
} | /* Unpack all the non-pointer fields of the TS_FUNCTION_DECL structure
of expression EXPR from bitpack BP. */ | Unpack all the non-pointer fields of the TS_FUNCTION_DECL structure
of expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_FUNCTION_DECL",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | static void
unpack_ts_function_decl_value_fields (struct bitpack_d *bp, tree expr)
{
DECL_BUILT_IN_CLASS (expr) = bp_unpack_enum (bp, built_in_class,
BUILT_IN_LAST);
DECL_STATIC_CONSTRUCTOR (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_STATIC_DESTRUCTOR (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_UNINLINABLE (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_POSSIBLY_INLINED (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_IS_NOVOPS (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_IS_RETURNS_TWICE (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_IS_MALLOC (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_IS_OPERATOR_NEW (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_DECLARED_INLINE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_STATIC_CHAIN (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_NO_INLINE_WARNING_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (expr)
= (unsigned) bp_unpack_value (bp, 1);
DECL_NO_LIMIT_STACK (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_DISREGARD_INLINE_LIMITS (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_PURE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
DECL_LOOPING_CONST_OR_PURE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
if (DECL_BUILT_IN_CLASS (expr) != NOT_BUILT_IN)
{
DECL_FUNCTION_CODE (expr) = (enum built_in_function) bp_unpack_value (bp,
11);
if (DECL_BUILT_IN_CLASS (expr) == BUILT_IN_NORMAL
&& DECL_FUNCTION_CODE (expr) >= END_BUILTINS)
fatal_error ("machine independent builtin code out of range");
else if (DECL_BUILT_IN_CLASS (expr) == BUILT_IN_MD)
{
tree result = targetm.builtin_decl (DECL_FUNCTION_CODE (expr), true);
if (!result || result == error_mark_node)
fatal_error ("target specific builtin not available");
}
}
if (DECL_STATIC_DESTRUCTOR (expr))
{
priority_type p;
p = (priority_type) bp_unpack_var_len_unsigned (bp);
SET_DECL_FINI_PRIORITY (expr, p);
}
} | [
"static",
"void",
"unpack_ts_function_decl_value_fields",
"(",
"struct",
"bitpack_d",
"*",
"bp",
",",
"tree",
"expr",
")",
"{",
"DECL_BUILT_IN_CLASS",
"(",
"expr",
")",
"=",
"bp_unpack_enum",
"(",
"bp",
",",
"built_in_class",
",",
"BUILT_IN_LAST",
")",
";",
"DECL_STATIC_CONSTRUCTOR",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_STATIC_DESTRUCTOR",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_UNINLINABLE",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_POSSIBLY_INLINED",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_IS_NOVOPS",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_IS_RETURNS_TWICE",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_IS_MALLOC",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_IS_OPERATOR_NEW",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_DECLARED_INLINE_P",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_STATIC_CHAIN",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_NO_INLINE_WARNING_P",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_NO_LIMIT_STACK",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_DISREGARD_INLINE_LIMITS",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_PURE_P",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"DECL_LOOPING_CONST_OR_PURE_P",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"if",
"(",
"DECL_BUILT_IN_CLASS",
"(",
"expr",
")",
"!=",
"NOT_BUILT_IN",
")",
"{",
"DECL_FUNCTION_CODE",
"(",
"expr",
")",
"=",
"(",
"enum",
"built_in_function",
")",
"bp_unpack_value",
"(",
"bp",
",",
"11",
")",
";",
"if",
"(",
"DECL_BUILT_IN_CLASS",
"(",
"expr",
")",
"==",
"BUILT_IN_NORMAL",
"&&",
"DECL_FUNCTION_CODE",
"(",
"expr",
")",
">=",
"END_BUILTINS",
")",
"fatal_error",
"(",
"\"",
"\"",
")",
";",
"else",
"if",
"(",
"DECL_BUILT_IN_CLASS",
"(",
"expr",
")",
"==",
"BUILT_IN_MD",
")",
"{",
"tree",
"result",
"=",
"targetm",
".",
"builtin_decl",
"(",
"DECL_FUNCTION_CODE",
"(",
"expr",
")",
",",
"true",
")",
";",
"if",
"(",
"!",
"result",
"||",
"result",
"==",
"error_mark_node",
")",
"fatal_error",
"(",
"\"",
"\"",
")",
";",
"}",
"}",
"if",
"(",
"DECL_STATIC_DESTRUCTOR",
"(",
"expr",
")",
")",
"{",
"priority_type",
"p",
";",
"p",
"=",
"(",
"priority_type",
")",
"bp_unpack_var_len_unsigned",
"(",
"bp",
")",
";",
"SET_DECL_FINI_PRIORITY",
"(",
"expr",
",",
"p",
")",
";",
"}",
"}"
] | Unpack all the non-pointer fields of the TS_FUNCTION_DECL structure
of expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_FUNCTION_DECL",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | [] | [
{
"param": "bp",
"type": "struct bitpack_d"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "bp",
"type": "struct bitpack_d",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | unpack_ts_type_common_value_fields | void | static void
unpack_ts_type_common_value_fields (struct bitpack_d *bp, tree expr)
{
enum machine_mode mode;
mode = bp_unpack_enum (bp, machine_mode, MAX_MACHINE_MODE);
SET_TYPE_MODE (expr, mode);
TYPE_STRING_FLAG (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_NO_FORCE_BLK (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_NEEDS_CONSTRUCTING (expr) = (unsigned) bp_unpack_value (bp, 1);
if (RECORD_OR_UNION_TYPE_P (expr))
TYPE_TRANSPARENT_AGGR (expr) = (unsigned) bp_unpack_value (bp, 1);
else if (TREE_CODE (expr) == ARRAY_TYPE)
TYPE_NONALIASED_COMPONENT (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_PACKED (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_RESTRICT (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr)
= (unsigned) bp_unpack_value (bp, 2);
TYPE_USER_ALIGN (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_READONLY (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_PRECISION (expr) = bp_unpack_var_len_unsigned (bp);
TYPE_ALIGN (expr) = bp_unpack_var_len_unsigned (bp);
TYPE_ALIAS_SET (expr) = bp_unpack_var_len_int (bp);
} | /* Unpack all the non-pointer fields of the TS_TYPE_COMMON structure
of expression EXPR from bitpack BP. */ | Unpack all the non-pointer fields of the TS_TYPE_COMMON structure
of expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_TYPE_COMMON",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | static void
unpack_ts_type_common_value_fields (struct bitpack_d *bp, tree expr)
{
enum machine_mode mode;
mode = bp_unpack_enum (bp, machine_mode, MAX_MACHINE_MODE);
SET_TYPE_MODE (expr, mode);
TYPE_STRING_FLAG (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_NO_FORCE_BLK (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_NEEDS_CONSTRUCTING (expr) = (unsigned) bp_unpack_value (bp, 1);
if (RECORD_OR_UNION_TYPE_P (expr))
TYPE_TRANSPARENT_AGGR (expr) = (unsigned) bp_unpack_value (bp, 1);
else if (TREE_CODE (expr) == ARRAY_TYPE)
TYPE_NONALIASED_COMPONENT (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_PACKED (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_RESTRICT (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_CONTAINS_PLACEHOLDER_INTERNAL (expr)
= (unsigned) bp_unpack_value (bp, 2);
TYPE_USER_ALIGN (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_READONLY (expr) = (unsigned) bp_unpack_value (bp, 1);
TYPE_PRECISION (expr) = bp_unpack_var_len_unsigned (bp);
TYPE_ALIGN (expr) = bp_unpack_var_len_unsigned (bp);
TYPE_ALIAS_SET (expr) = bp_unpack_var_len_int (bp);
} | [
"static",
"void",
"unpack_ts_type_common_value_fields",
"(",
"struct",
"bitpack_d",
"*",
"bp",
",",
"tree",
"expr",
")",
"{",
"enum",
"machine_mode",
"mode",
";",
"mode",
"=",
"bp_unpack_enum",
"(",
"bp",
",",
"machine_mode",
",",
"MAX_MACHINE_MODE",
")",
";",
"SET_TYPE_MODE",
"(",
"expr",
",",
"mode",
")",
";",
"TYPE_STRING_FLAG",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TYPE_NO_FORCE_BLK",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TYPE_NEEDS_CONSTRUCTING",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"if",
"(",
"RECORD_OR_UNION_TYPE_P",
"(",
"expr",
")",
")",
"TYPE_TRANSPARENT_AGGR",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"else",
"if",
"(",
"TREE_CODE",
"(",
"expr",
")",
"==",
"ARRAY_TYPE",
")",
"TYPE_NONALIASED_COMPONENT",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TYPE_PACKED",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TYPE_RESTRICT",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TYPE_CONTAINS_PLACEHOLDER_INTERNAL",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"2",
")",
";",
"TYPE_USER_ALIGN",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TYPE_READONLY",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"TYPE_PRECISION",
"(",
"expr",
")",
"=",
"bp_unpack_var_len_unsigned",
"(",
"bp",
")",
";",
"TYPE_ALIGN",
"(",
"expr",
")",
"=",
"bp_unpack_var_len_unsigned",
"(",
"bp",
")",
";",
"TYPE_ALIAS_SET",
"(",
"expr",
")",
"=",
"bp_unpack_var_len_int",
"(",
"bp",
")",
";",
"}"
] | Unpack all the non-pointer fields of the TS_TYPE_COMMON structure
of expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_TYPE_COMMON",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | [] | [
{
"param": "bp",
"type": "struct bitpack_d"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "bp",
"type": "struct bitpack_d",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | unpack_ts_block_value_fields | void | static void
unpack_ts_block_value_fields (struct bitpack_d *bp, tree expr)
{
BLOCK_ABSTRACT (expr) = (unsigned) bp_unpack_value (bp, 1);
/* BLOCK_NUMBER is recomputed. */
} | /* Unpack all the non-pointer fields of the TS_BLOCK structure
of expression EXPR from bitpack BP. */ | Unpack all the non-pointer fields of the TS_BLOCK structure
of expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_BLOCK",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | static void
unpack_ts_block_value_fields (struct bitpack_d *bp, tree expr)
{
BLOCK_ABSTRACT (expr) = (unsigned) bp_unpack_value (bp, 1);
} | [
"static",
"void",
"unpack_ts_block_value_fields",
"(",
"struct",
"bitpack_d",
"*",
"bp",
",",
"tree",
"expr",
")",
"{",
"BLOCK_ABSTRACT",
"(",
"expr",
")",
"=",
"(",
"unsigned",
")",
"bp_unpack_value",
"(",
"bp",
",",
"1",
")",
";",
"}"
] | Unpack all the non-pointer fields of the TS_BLOCK structure
of expression EXPR from bitpack BP. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"of",
"the",
"TS_BLOCK",
"structure",
"of",
"expression",
"EXPR",
"from",
"bitpack",
"BP",
"."
] | [
"/* BLOCK_NUMBER is recomputed. */"
] | [
{
"param": "bp",
"type": "struct bitpack_d"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "bp",
"type": "struct bitpack_d",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | unpack_value_fields | void | static void
unpack_value_fields (struct bitpack_d *bp, tree expr)
{
enum tree_code code;
code = TREE_CODE (expr);
/* Note that all these functions are highly sensitive to changes in
the types and sizes of each of the fields being packed. */
unpack_ts_base_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_REAL_CST))
unpack_ts_real_cst_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_FIXED_CST))
unpack_ts_fixed_cst_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
unpack_ts_decl_common_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_WRTL))
unpack_ts_decl_wrtl_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS))
unpack_ts_decl_with_vis_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_FUNCTION_DECL))
unpack_ts_function_decl_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_TYPE_COMMON))
unpack_ts_type_common_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
unpack_ts_block_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL))
unpack_ts_translation_unit_decl_value_fields (bp, expr);
} | /* Unpack all the non-pointer fields in EXPR into a bit pack. */ | Unpack all the non-pointer fields in EXPR into a bit pack. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"in",
"EXPR",
"into",
"a",
"bit",
"pack",
"."
] | static void
unpack_value_fields (struct bitpack_d *bp, tree expr)
{
enum tree_code code;
code = TREE_CODE (expr);
unpack_ts_base_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_REAL_CST))
unpack_ts_real_cst_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_FIXED_CST))
unpack_ts_fixed_cst_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
unpack_ts_decl_common_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_WRTL))
unpack_ts_decl_wrtl_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS))
unpack_ts_decl_with_vis_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_FUNCTION_DECL))
unpack_ts_function_decl_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_TYPE_COMMON))
unpack_ts_type_common_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
unpack_ts_block_value_fields (bp, expr);
if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL))
unpack_ts_translation_unit_decl_value_fields (bp, expr);
} | [
"static",
"void",
"unpack_value_fields",
"(",
"struct",
"bitpack_d",
"*",
"bp",
",",
"tree",
"expr",
")",
"{",
"enum",
"tree_code",
"code",
";",
"code",
"=",
"TREE_CODE",
"(",
"expr",
")",
";",
"unpack_ts_base_value_fields",
"(",
"bp",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_REAL_CST",
")",
")",
"unpack_ts_real_cst_value_fields",
"(",
"bp",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_FIXED_CST",
")",
")",
"unpack_ts_fixed_cst_value_fields",
"(",
"bp",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_DECL_COMMON",
")",
")",
"unpack_ts_decl_common_value_fields",
"(",
"bp",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_DECL_WRTL",
")",
")",
"unpack_ts_decl_wrtl_value_fields",
"(",
"bp",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_DECL_WITH_VIS",
")",
")",
"unpack_ts_decl_with_vis_value_fields",
"(",
"bp",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_FUNCTION_DECL",
")",
")",
"unpack_ts_function_decl_value_fields",
"(",
"bp",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_TYPE_COMMON",
")",
")",
"unpack_ts_type_common_value_fields",
"(",
"bp",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_BLOCK",
")",
")",
"unpack_ts_block_value_fields",
"(",
"bp",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_TRANSLATION_UNIT_DECL",
")",
")",
"unpack_ts_translation_unit_decl_value_fields",
"(",
"bp",
",",
"expr",
")",
";",
"}"
] | Unpack all the non-pointer fields in EXPR into a bit pack. | [
"Unpack",
"all",
"the",
"non",
"-",
"pointer",
"fields",
"in",
"EXPR",
"into",
"a",
"bit",
"pack",
"."
] | [
"/* Note that all these functions are highly sensitive to changes in\n the types and sizes of each of the fields being packed. */"
] | [
{
"param": "bp",
"type": "struct bitpack_d"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "bp",
"type": "struct bitpack_d",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | streamer_read_tree_bitfields | null | struct bitpack_d
streamer_read_tree_bitfields (struct lto_input_block *ib, tree expr)
{
enum tree_code code;
struct bitpack_d bp;
/* Read the bitpack of non-pointer values from IB. */
bp = streamer_read_bitpack (ib);
/* The first word in BP contains the code of the tree that we
are about to read. */
code = (enum tree_code) bp_unpack_value (&bp, 16);
lto_tag_check (lto_tree_code_to_tag (code),
lto_tree_code_to_tag (TREE_CODE (expr)));
/* Unpack all the value fields from BP. */
unpack_value_fields (&bp, expr);
return bp;
} | /* Read all the language-independent bitfield values for EXPR from IB.
Return the partially unpacked bitpack so the caller can unpack any other
bitfield values that the writer may have written. */ | Read all the language-independent bitfield values for EXPR from IB.
Return the partially unpacked bitpack so the caller can unpack any other
bitfield values that the writer may have written. | [
"Read",
"all",
"the",
"language",
"-",
"independent",
"bitfield",
"values",
"for",
"EXPR",
"from",
"IB",
".",
"Return",
"the",
"partially",
"unpacked",
"bitpack",
"so",
"the",
"caller",
"can",
"unpack",
"any",
"other",
"bitfield",
"values",
"that",
"the",
"writer",
"may",
"have",
"written",
"."
] | struct bitpack_d
streamer_read_tree_bitfields (struct lto_input_block *ib, tree expr)
{
enum tree_code code;
struct bitpack_d bp;
bp = streamer_read_bitpack (ib);
code = (enum tree_code) bp_unpack_value (&bp, 16);
lto_tag_check (lto_tree_code_to_tag (code),
lto_tree_code_to_tag (TREE_CODE (expr)));
unpack_value_fields (&bp, expr);
return bp;
} | [
"struct",
"bitpack_d",
"streamer_read_tree_bitfields",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"tree",
"expr",
")",
"{",
"enum",
"tree_code",
"code",
";",
"struct",
"bitpack_d",
"bp",
";",
"bp",
"=",
"streamer_read_bitpack",
"(",
"ib",
")",
";",
"code",
"=",
"(",
"enum",
"tree_code",
")",
"bp_unpack_value",
"(",
"&",
"bp",
",",
"16",
")",
";",
"lto_tag_check",
"(",
"lto_tree_code_to_tag",
"(",
"code",
")",
",",
"lto_tree_code_to_tag",
"(",
"TREE_CODE",
"(",
"expr",
")",
")",
")",
";",
"unpack_value_fields",
"(",
"&",
"bp",
",",
"expr",
")",
";",
"return",
"bp",
";",
"}"
] | Read all the language-independent bitfield values for EXPR from IB. | [
"Read",
"all",
"the",
"language",
"-",
"independent",
"bitfield",
"values",
"for",
"EXPR",
"from",
"IB",
"."
] | [
"/* Read the bitpack of non-pointer values from IB. */",
"/* The first word in BP contains the code of the tree that we\n are about to read. */",
"/* Unpack all the value fields from BP. */"
] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | streamer_alloc_tree | tree | tree
streamer_alloc_tree (struct lto_input_block *ib, struct data_in *data_in,
enum LTO_tags tag)
{
enum tree_code code;
tree result;
#ifdef LTO_STREAMER_DEBUG
HOST_WIDEST_INT orig_address_in_writer;
#endif
result = NULL_TREE;
#ifdef LTO_STREAMER_DEBUG
/* Read the word representing the memory address for the tree
as it was written by the writer. This is useful when
debugging differences between the writer and reader. */
orig_address_in_writer = streamer_read_hwi (ib);
gcc_assert ((intptr_t) orig_address_in_writer == orig_address_in_writer);
#endif
code = lto_tag_to_tree_code (tag);
/* We should never see an SSA_NAME tree. Only the version numbers of
SSA names are ever written out. See input_ssa_names. */
gcc_assert (code != SSA_NAME);
/* Instantiate a new tree using the header data. */
if (CODE_CONTAINS_STRUCT (code, TS_STRING))
result = streamer_read_string_cst (data_in, ib);
else if (CODE_CONTAINS_STRUCT (code, TS_IDENTIFIER))
result = input_identifier (data_in, ib);
else if (CODE_CONTAINS_STRUCT (code, TS_VEC))
{
HOST_WIDE_INT len = streamer_read_hwi (ib);
result = make_tree_vec (len);
}
else if (CODE_CONTAINS_STRUCT (code, TS_BINFO))
{
unsigned HOST_WIDE_INT len = streamer_read_uhwi (ib);
result = make_tree_binfo (len);
}
else if (code == CALL_EXPR)
{
unsigned HOST_WIDE_INT nargs = streamer_read_uhwi (ib);
return build_vl_exp (CALL_EXPR, nargs + 3);
}
else
{
/* For all other nodes, materialize the tree with a raw
make_node call. */
result = make_node (code);
}
#ifdef LTO_STREAMER_DEBUG
/* Store the original address of the tree as seen by the writer
in RESULT's aux field. This is useful when debugging streaming
problems. This way, a debugging session can be started on
both writer and reader with a breakpoint using this address
value in both. */
lto_orig_address_map (result, (intptr_t) orig_address_in_writer);
#endif
return result;
} | /* Materialize a new tree from input block IB using descriptors in
DATA_IN. The code for the new tree should match TAG. Store in
*IX_P the index into the reader cache where the new tree is stored. */ | Materialize a new tree from input block IB using descriptors in
DATA_IN. The code for the new tree should match TAG. Store in
IX_P the index into the reader cache where the new tree is stored. | [
"Materialize",
"a",
"new",
"tree",
"from",
"input",
"block",
"IB",
"using",
"descriptors",
"in",
"DATA_IN",
".",
"The",
"code",
"for",
"the",
"new",
"tree",
"should",
"match",
"TAG",
".",
"Store",
"in",
"IX_P",
"the",
"index",
"into",
"the",
"reader",
"cache",
"where",
"the",
"new",
"tree",
"is",
"stored",
"."
] | tree
streamer_alloc_tree (struct lto_input_block *ib, struct data_in *data_in,
enum LTO_tags tag)
{
enum tree_code code;
tree result;
#ifdef LTO_STREAMER_DEBUG
HOST_WIDEST_INT orig_address_in_writer;
#endif
result = NULL_TREE;
#ifdef LTO_STREAMER_DEBUG
orig_address_in_writer = streamer_read_hwi (ib);
gcc_assert ((intptr_t) orig_address_in_writer == orig_address_in_writer);
#endif
code = lto_tag_to_tree_code (tag);
gcc_assert (code != SSA_NAME);
if (CODE_CONTAINS_STRUCT (code, TS_STRING))
result = streamer_read_string_cst (data_in, ib);
else if (CODE_CONTAINS_STRUCT (code, TS_IDENTIFIER))
result = input_identifier (data_in, ib);
else if (CODE_CONTAINS_STRUCT (code, TS_VEC))
{
HOST_WIDE_INT len = streamer_read_hwi (ib);
result = make_tree_vec (len);
}
else if (CODE_CONTAINS_STRUCT (code, TS_BINFO))
{
unsigned HOST_WIDE_INT len = streamer_read_uhwi (ib);
result = make_tree_binfo (len);
}
else if (code == CALL_EXPR)
{
unsigned HOST_WIDE_INT nargs = streamer_read_uhwi (ib);
return build_vl_exp (CALL_EXPR, nargs + 3);
}
else
{
result = make_node (code);
}
#ifdef LTO_STREAMER_DEBUG
lto_orig_address_map (result, (intptr_t) orig_address_in_writer);
#endif
return result;
} | [
"tree",
"streamer_alloc_tree",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"enum",
"LTO_tags",
"tag",
")",
"{",
"enum",
"tree_code",
"code",
";",
"tree",
"result",
";",
"#ifdef",
"LTO_STREAMER_DEBUG",
"HOST_WIDEST_INT",
"orig_address_in_writer",
";",
"#endif",
"result",
"=",
"NULL_TREE",
";",
"#ifdef",
"LTO_STREAMER_DEBUG",
"orig_address_in_writer",
"=",
"streamer_read_hwi",
"(",
"ib",
")",
";",
"gcc_assert",
"(",
"(",
"intptr_t",
")",
"orig_address_in_writer",
"==",
"orig_address_in_writer",
")",
";",
"#endif",
"code",
"=",
"lto_tag_to_tree_code",
"(",
"tag",
")",
";",
"gcc_assert",
"(",
"code",
"!=",
"SSA_NAME",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_STRING",
")",
")",
"result",
"=",
"streamer_read_string_cst",
"(",
"data_in",
",",
"ib",
")",
";",
"else",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_IDENTIFIER",
")",
")",
"result",
"=",
"input_identifier",
"(",
"data_in",
",",
"ib",
")",
";",
"else",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_VEC",
")",
")",
"{",
"HOST_WIDE_INT",
"len",
"=",
"streamer_read_hwi",
"(",
"ib",
")",
";",
"result",
"=",
"make_tree_vec",
"(",
"len",
")",
";",
"}",
"else",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_BINFO",
")",
")",
"{",
"unsigned",
"HOST_WIDE_INT",
"len",
"=",
"streamer_read_uhwi",
"(",
"ib",
")",
";",
"result",
"=",
"make_tree_binfo",
"(",
"len",
")",
";",
"}",
"else",
"if",
"(",
"code",
"==",
"CALL_EXPR",
")",
"{",
"unsigned",
"HOST_WIDE_INT",
"nargs",
"=",
"streamer_read_uhwi",
"(",
"ib",
")",
";",
"return",
"build_vl_exp",
"(",
"CALL_EXPR",
",",
"nargs",
"+",
"3",
")",
";",
"}",
"else",
"{",
"result",
"=",
"make_node",
"(",
"code",
")",
";",
"}",
"#ifdef",
"LTO_STREAMER_DEBUG",
"lto_orig_address_map",
"(",
"result",
",",
"(",
"intptr_t",
")",
"orig_address_in_writer",
")",
";",
"#endif",
"return",
"result",
";",
"}"
] | Materialize a new tree from input block IB using descriptors in
DATA_IN. | [
"Materialize",
"a",
"new",
"tree",
"from",
"input",
"block",
"IB",
"using",
"descriptors",
"in",
"DATA_IN",
"."
] | [
"/* Read the word representing the memory address for the tree\n as it was written by the writer. This is useful when\n debugging differences between the writer and reader. */",
"/* We should never see an SSA_NAME tree. Only the version numbers of\n SSA names are ever written out. See input_ssa_names. */",
"/* Instantiate a new tree using the header data. */",
"/* For all other nodes, materialize the tree with a raw\n\t make_node call. */",
"/* Store the original address of the tree as seen by the writer\n in RESULT's aux field. This is useful when debugging streaming\n problems. This way, a debugging session can be started on\n both writer and reader with a breakpoint using this address\n value in both. */"
] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "tag",
"type": "enum LTO_tags"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "tag",
"type": "enum LTO_tags",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_common_tree_pointers | void | static void
lto_input_ts_common_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
if (TREE_CODE (expr) != IDENTIFIER_NODE)
TREE_TYPE (expr) = stream_read_tree (ib, data_in);
} | /* Read all pointer fields in the TS_COMMON structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. */ | Read all pointer fields in the TS_COMMON structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_COMMON",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_common_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
if (TREE_CODE (expr) != IDENTIFIER_NODE)
TREE_TYPE (expr) = stream_read_tree (ib, data_in);
} | [
"static",
"void",
"lto_input_ts_common_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"if",
"(",
"TREE_CODE",
"(",
"expr",
")",
"!=",
"IDENTIFIER_NODE",
")",
"TREE_TYPE",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"}"
] | Read all pointer fields in the TS_COMMON structure of EXPR from input
block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_COMMON",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_vector_tree_pointers | void | static void
lto_input_ts_vector_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
TREE_VECTOR_CST_ELTS (expr) = streamer_read_chain (ib, data_in);
} | /* Read all pointer fields in the TS_VECTOR structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. */ | Read all pointer fields in the TS_VECTOR structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_VECTOR",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_vector_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
TREE_VECTOR_CST_ELTS (expr) = streamer_read_chain (ib, data_in);
} | [
"static",
"void",
"lto_input_ts_vector_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"TREE_VECTOR_CST_ELTS",
"(",
"expr",
")",
"=",
"streamer_read_chain",
"(",
"ib",
",",
"data_in",
")",
";",
"}"
] | Read all pointer fields in the TS_VECTOR structure of EXPR from input
block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_VECTOR",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_complex_tree_pointers | void | static void
lto_input_ts_complex_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
TREE_REALPART (expr) = stream_read_tree (ib, data_in);
TREE_IMAGPART (expr) = stream_read_tree (ib, data_in);
} | /* Read all pointer fields in the TS_COMPLEX structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. */ | Read all pointer fields in the TS_COMPLEX structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_COMPLEX",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_complex_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
TREE_REALPART (expr) = stream_read_tree (ib, data_in);
TREE_IMAGPART (expr) = stream_read_tree (ib, data_in);
} | [
"static",
"void",
"lto_input_ts_complex_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"TREE_REALPART",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"TREE_IMAGPART",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"}"
] | Read all pointer fields in the TS_COMPLEX structure of EXPR from input
block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_COMPLEX",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_decl_minimal_tree_pointers | void | static void
lto_input_ts_decl_minimal_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
DECL_NAME (expr) = stream_read_tree (ib, data_in);
DECL_CONTEXT (expr) = stream_read_tree (ib, data_in);
DECL_SOURCE_LOCATION (expr) = lto_input_location (ib, data_in);
} | /* Read all pointer fields in the TS_DECL_MINIMAL structure of EXPR
from input block IB. DATA_IN contains tables and descriptors for the
file being read. */ | Read all pointer fields in the TS_DECL_MINIMAL structure of EXPR
from input block IB. DATA_IN contains tables and descriptors for the
file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_DECL_MINIMAL",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_decl_minimal_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
DECL_NAME (expr) = stream_read_tree (ib, data_in);
DECL_CONTEXT (expr) = stream_read_tree (ib, data_in);
DECL_SOURCE_LOCATION (expr) = lto_input_location (ib, data_in);
} | [
"static",
"void",
"lto_input_ts_decl_minimal_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"DECL_NAME",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"DECL_CONTEXT",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"DECL_SOURCE_LOCATION",
"(",
"expr",
")",
"=",
"lto_input_location",
"(",
"ib",
",",
"data_in",
")",
";",
"}"
] | Read all pointer fields in the TS_DECL_MINIMAL structure of EXPR
from input block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_DECL_MINIMAL",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_decl_common_tree_pointers | void | static void
lto_input_ts_decl_common_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
DECL_SIZE (expr) = stream_read_tree (ib, data_in);
DECL_SIZE_UNIT (expr) = stream_read_tree (ib, data_in);
DECL_ATTRIBUTES (expr) = stream_read_tree (ib, data_in);
/* Do not stream DECL_ABSTRACT_ORIGIN. We cannot handle debug information
for early inlining so drop it on the floor instead of ICEing in
dwarf2out.c. */
if (TREE_CODE (expr) == PARM_DECL)
TREE_CHAIN (expr) = streamer_read_chain (ib, data_in);
if ((TREE_CODE (expr) == VAR_DECL
|| TREE_CODE (expr) == PARM_DECL)
&& DECL_HAS_VALUE_EXPR_P (expr))
SET_DECL_VALUE_EXPR (expr, stream_read_tree (ib, data_in));
if (TREE_CODE (expr) == VAR_DECL)
{
tree dexpr = stream_read_tree (ib, data_in);
if (dexpr)
SET_DECL_DEBUG_EXPR (expr, dexpr);
}
} | /* Read all pointer fields in the TS_DECL_COMMON structure of EXPR from
input block IB. DATA_IN contains tables and descriptors for the
file being read. */ | Read all pointer fields in the TS_DECL_COMMON structure of EXPR from
input block IB. DATA_IN contains tables and descriptors for the
file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_DECL_COMMON",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_decl_common_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
DECL_SIZE (expr) = stream_read_tree (ib, data_in);
DECL_SIZE_UNIT (expr) = stream_read_tree (ib, data_in);
DECL_ATTRIBUTES (expr) = stream_read_tree (ib, data_in);
if (TREE_CODE (expr) == PARM_DECL)
TREE_CHAIN (expr) = streamer_read_chain (ib, data_in);
if ((TREE_CODE (expr) == VAR_DECL
|| TREE_CODE (expr) == PARM_DECL)
&& DECL_HAS_VALUE_EXPR_P (expr))
SET_DECL_VALUE_EXPR (expr, stream_read_tree (ib, data_in));
if (TREE_CODE (expr) == VAR_DECL)
{
tree dexpr = stream_read_tree (ib, data_in);
if (dexpr)
SET_DECL_DEBUG_EXPR (expr, dexpr);
}
} | [
"static",
"void",
"lto_input_ts_decl_common_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"DECL_SIZE",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"DECL_SIZE_UNIT",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"DECL_ATTRIBUTES",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"if",
"(",
"TREE_CODE",
"(",
"expr",
")",
"==",
"PARM_DECL",
")",
"TREE_CHAIN",
"(",
"expr",
")",
"=",
"streamer_read_chain",
"(",
"ib",
",",
"data_in",
")",
";",
"if",
"(",
"(",
"TREE_CODE",
"(",
"expr",
")",
"==",
"VAR_DECL",
"||",
"TREE_CODE",
"(",
"expr",
")",
"==",
"PARM_DECL",
")",
"&&",
"DECL_HAS_VALUE_EXPR_P",
"(",
"expr",
")",
")",
"SET_DECL_VALUE_EXPR",
"(",
"expr",
",",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
")",
";",
"if",
"(",
"TREE_CODE",
"(",
"expr",
")",
"==",
"VAR_DECL",
")",
"{",
"tree",
"dexpr",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"if",
"(",
"dexpr",
")",
"SET_DECL_DEBUG_EXPR",
"(",
"expr",
",",
"dexpr",
")",
";",
"}",
"}"
] | Read all pointer fields in the TS_DECL_COMMON structure of EXPR from
input block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_DECL_COMMON",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [
"/* Do not stream DECL_ABSTRACT_ORIGIN. We cannot handle debug information\n for early inlining so drop it on the floor instead of ICEing in\n dwarf2out.c. */"
] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_decl_non_common_tree_pointers | void | static void
lto_input_ts_decl_non_common_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
if (TREE_CODE (expr) == FUNCTION_DECL)
{
DECL_ARGUMENTS (expr) = stream_read_tree (ib, data_in);
DECL_RESULT (expr) = stream_read_tree (ib, data_in);
}
else if (TREE_CODE (expr) == TYPE_DECL)
DECL_ORIGINAL_TYPE (expr) = stream_read_tree (ib, data_in);
DECL_VINDEX (expr) = stream_read_tree (ib, data_in);
} | /* Read all pointer fields in the TS_DECL_NON_COMMON structure of
EXPR from input block IB. DATA_IN contains tables and descriptors for the
file being read. */ | Read all pointer fields in the TS_DECL_NON_COMMON structure of
EXPR from input block IB. DATA_IN contains tables and descriptors for the
file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_DECL_NON_COMMON",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_decl_non_common_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
if (TREE_CODE (expr) == FUNCTION_DECL)
{
DECL_ARGUMENTS (expr) = stream_read_tree (ib, data_in);
DECL_RESULT (expr) = stream_read_tree (ib, data_in);
}
else if (TREE_CODE (expr) == TYPE_DECL)
DECL_ORIGINAL_TYPE (expr) = stream_read_tree (ib, data_in);
DECL_VINDEX (expr) = stream_read_tree (ib, data_in);
} | [
"static",
"void",
"lto_input_ts_decl_non_common_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"if",
"(",
"TREE_CODE",
"(",
"expr",
")",
"==",
"FUNCTION_DECL",
")",
"{",
"DECL_ARGUMENTS",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"DECL_RESULT",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"}",
"else",
"if",
"(",
"TREE_CODE",
"(",
"expr",
")",
"==",
"TYPE_DECL",
")",
"DECL_ORIGINAL_TYPE",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"DECL_VINDEX",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"}"
] | Read all pointer fields in the TS_DECL_NON_COMMON structure of
EXPR from input block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_DECL_NON_COMMON",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_decl_with_vis_tree_pointers | void | static void
lto_input_ts_decl_with_vis_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
tree id;
id = stream_read_tree (ib, data_in);
if (id)
{
gcc_assert (TREE_CODE (id) == IDENTIFIER_NODE);
SET_DECL_ASSEMBLER_NAME (expr, id);
}
DECL_SECTION_NAME (expr) = stream_read_tree (ib, data_in);
DECL_COMDAT_GROUP (expr) = stream_read_tree (ib, data_in);
} | /* Read all pointer fields in the TS_DECL_WITH_VIS structure of EXPR
from input block IB. DATA_IN contains tables and descriptors for the
file being read. */ | Read all pointer fields in the TS_DECL_WITH_VIS structure of EXPR
from input block IB. DATA_IN contains tables and descriptors for the
file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_DECL_WITH_VIS",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_decl_with_vis_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
tree id;
id = stream_read_tree (ib, data_in);
if (id)
{
gcc_assert (TREE_CODE (id) == IDENTIFIER_NODE);
SET_DECL_ASSEMBLER_NAME (expr, id);
}
DECL_SECTION_NAME (expr) = stream_read_tree (ib, data_in);
DECL_COMDAT_GROUP (expr) = stream_read_tree (ib, data_in);
} | [
"static",
"void",
"lto_input_ts_decl_with_vis_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"tree",
"id",
";",
"id",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"if",
"(",
"id",
")",
"{",
"gcc_assert",
"(",
"TREE_CODE",
"(",
"id",
")",
"==",
"IDENTIFIER_NODE",
")",
";",
"SET_DECL_ASSEMBLER_NAME",
"(",
"expr",
",",
"id",
")",
";",
"}",
"DECL_SECTION_NAME",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"DECL_COMDAT_GROUP",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"}"
] | Read all pointer fields in the TS_DECL_WITH_VIS structure of EXPR
from input block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_DECL_WITH_VIS",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_field_decl_tree_pointers | void | static void
lto_input_ts_field_decl_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
DECL_FIELD_OFFSET (expr) = stream_read_tree (ib, data_in);
DECL_BIT_FIELD_TYPE (expr) = stream_read_tree (ib, data_in);
DECL_BIT_FIELD_REPRESENTATIVE (expr) = stream_read_tree (ib, data_in);
DECL_FIELD_BIT_OFFSET (expr) = stream_read_tree (ib, data_in);
DECL_FCONTEXT (expr) = stream_read_tree (ib, data_in);
} | /* Read all pointer fields in the TS_FIELD_DECL structure of EXPR from
input block IB. DATA_IN contains tables and descriptors for the
file being read. */ | Read all pointer fields in the TS_FIELD_DECL structure of EXPR from
input block IB. DATA_IN contains tables and descriptors for the
file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_FIELD_DECL",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_field_decl_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
DECL_FIELD_OFFSET (expr) = stream_read_tree (ib, data_in);
DECL_BIT_FIELD_TYPE (expr) = stream_read_tree (ib, data_in);
DECL_BIT_FIELD_REPRESENTATIVE (expr) = stream_read_tree (ib, data_in);
DECL_FIELD_BIT_OFFSET (expr) = stream_read_tree (ib, data_in);
DECL_FCONTEXT (expr) = stream_read_tree (ib, data_in);
} | [
"static",
"void",
"lto_input_ts_field_decl_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"DECL_FIELD_OFFSET",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"DECL_BIT_FIELD_TYPE",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"DECL_BIT_FIELD_REPRESENTATIVE",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"DECL_FIELD_BIT_OFFSET",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"DECL_FCONTEXT",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"}"
] | Read all pointer fields in the TS_FIELD_DECL structure of EXPR from
input block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_FIELD_DECL",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_function_decl_tree_pointers | void | static void
lto_input_ts_function_decl_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
/* DECL_STRUCT_FUNCTION is handled by lto_input_function. FIXME lto,
maybe it should be handled here? */
DECL_FUNCTION_PERSONALITY (expr) = stream_read_tree (ib, data_in);
DECL_FUNCTION_SPECIFIC_TARGET (expr) = stream_read_tree (ib, data_in);
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (expr) = stream_read_tree (ib, data_in);
/* If the file contains a function with an EH personality set,
then it was compiled with -fexceptions. In that case, initialize
the backend EH machinery. */
if (DECL_FUNCTION_PERSONALITY (expr))
lto_init_eh ();
} | /* Read all pointer fields in the TS_FUNCTION_DECL structure of EXPR
from input block IB. DATA_IN contains tables and descriptors for the
file being read. */ | Read all pointer fields in the TS_FUNCTION_DECL structure of EXPR
from input block IB. DATA_IN contains tables and descriptors for the
file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_FUNCTION_DECL",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_function_decl_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
DECL_FUNCTION_PERSONALITY (expr) = stream_read_tree (ib, data_in);
DECL_FUNCTION_SPECIFIC_TARGET (expr) = stream_read_tree (ib, data_in);
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (expr) = stream_read_tree (ib, data_in);
if (DECL_FUNCTION_PERSONALITY (expr))
lto_init_eh ();
} | [
"static",
"void",
"lto_input_ts_function_decl_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"DECL_FUNCTION_PERSONALITY",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"DECL_FUNCTION_SPECIFIC_TARGET",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"DECL_FUNCTION_SPECIFIC_OPTIMIZATION",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"if",
"(",
"DECL_FUNCTION_PERSONALITY",
"(",
"expr",
")",
")",
"lto_init_eh",
"(",
")",
";",
"}"
] | Read all pointer fields in the TS_FUNCTION_DECL structure of EXPR
from input block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_FUNCTION_DECL",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [
"/* DECL_STRUCT_FUNCTION is handled by lto_input_function. FIXME lto,\n maybe it should be handled here? */",
"/* If the file contains a function with an EH personality set,\n then it was compiled with -fexceptions. In that case, initialize\n the backend EH machinery. */"
] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_type_common_tree_pointers | void | static void
lto_input_ts_type_common_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
TYPE_SIZE (expr) = stream_read_tree (ib, data_in);
TYPE_SIZE_UNIT (expr) = stream_read_tree (ib, data_in);
TYPE_ATTRIBUTES (expr) = stream_read_tree (ib, data_in);
TYPE_NAME (expr) = stream_read_tree (ib, data_in);
/* Do not stream TYPE_POINTER_TO or TYPE_REFERENCE_TO. They will be
reconstructed during fixup. */
/* Do not stream TYPE_NEXT_VARIANT, we reconstruct the variant lists
during fixup. */
TYPE_MAIN_VARIANT (expr) = stream_read_tree (ib, data_in);
TYPE_CONTEXT (expr) = stream_read_tree (ib, data_in);
/* TYPE_CANONICAL gets re-computed during type merging. */
TYPE_CANONICAL (expr) = NULL_TREE;
TYPE_STUB_DECL (expr) = stream_read_tree (ib, data_in);
} | /* Read all pointer fields in the TS_TYPE_COMMON structure of EXPR from
input block IB. DATA_IN contains tables and descriptors for the file
being read. */ | Read all pointer fields in the TS_TYPE_COMMON structure of EXPR from
input block IB. DATA_IN contains tables and descriptors for the file
being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_TYPE_COMMON",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_type_common_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
TYPE_SIZE (expr) = stream_read_tree (ib, data_in);
TYPE_SIZE_UNIT (expr) = stream_read_tree (ib, data_in);
TYPE_ATTRIBUTES (expr) = stream_read_tree (ib, data_in);
TYPE_NAME (expr) = stream_read_tree (ib, data_in);
TYPE_MAIN_VARIANT (expr) = stream_read_tree (ib, data_in);
TYPE_CONTEXT (expr) = stream_read_tree (ib, data_in);
TYPE_CANONICAL (expr) = NULL_TREE;
TYPE_STUB_DECL (expr) = stream_read_tree (ib, data_in);
} | [
"static",
"void",
"lto_input_ts_type_common_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"TYPE_SIZE",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"TYPE_SIZE_UNIT",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"TYPE_ATTRIBUTES",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"TYPE_NAME",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"TYPE_MAIN_VARIANT",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"TYPE_CONTEXT",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"TYPE_CANONICAL",
"(",
"expr",
")",
"=",
"NULL_TREE",
";",
"TYPE_STUB_DECL",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"}"
] | Read all pointer fields in the TS_TYPE_COMMON structure of EXPR from
input block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_TYPE_COMMON",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [
"/* Do not stream TYPE_POINTER_TO or TYPE_REFERENCE_TO. They will be\n reconstructed during fixup. */",
"/* Do not stream TYPE_NEXT_VARIANT, we reconstruct the variant lists\n during fixup. */",
"/* TYPE_CANONICAL gets re-computed during type merging. */"
] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_type_non_common_tree_pointers | void | static void
lto_input_ts_type_non_common_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in,
tree expr)
{
if (TREE_CODE (expr) == ENUMERAL_TYPE)
TYPE_VALUES (expr) = stream_read_tree (ib, data_in);
else if (TREE_CODE (expr) == ARRAY_TYPE)
TYPE_DOMAIN (expr) = stream_read_tree (ib, data_in);
else if (RECORD_OR_UNION_TYPE_P (expr))
TYPE_FIELDS (expr) = streamer_read_chain (ib, data_in);
else if (TREE_CODE (expr) == FUNCTION_TYPE
|| TREE_CODE (expr) == METHOD_TYPE)
TYPE_ARG_TYPES (expr) = stream_read_tree (ib, data_in);
if (!POINTER_TYPE_P (expr))
TYPE_MINVAL (expr) = stream_read_tree (ib, data_in);
TYPE_MAXVAL (expr) = stream_read_tree (ib, data_in);
if (RECORD_OR_UNION_TYPE_P (expr))
TYPE_BINFO (expr) = stream_read_tree (ib, data_in);
} | /* Read all pointer fields in the TS_TYPE_NON_COMMON structure of EXPR
from input block IB. DATA_IN contains tables and descriptors for the
file being read. */ | Read all pointer fields in the TS_TYPE_NON_COMMON structure of EXPR
from input block IB. DATA_IN contains tables and descriptors for the
file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_TYPE_NON_COMMON",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_type_non_common_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in,
tree expr)
{
if (TREE_CODE (expr) == ENUMERAL_TYPE)
TYPE_VALUES (expr) = stream_read_tree (ib, data_in);
else if (TREE_CODE (expr) == ARRAY_TYPE)
TYPE_DOMAIN (expr) = stream_read_tree (ib, data_in);
else if (RECORD_OR_UNION_TYPE_P (expr))
TYPE_FIELDS (expr) = streamer_read_chain (ib, data_in);
else if (TREE_CODE (expr) == FUNCTION_TYPE
|| TREE_CODE (expr) == METHOD_TYPE)
TYPE_ARG_TYPES (expr) = stream_read_tree (ib, data_in);
if (!POINTER_TYPE_P (expr))
TYPE_MINVAL (expr) = stream_read_tree (ib, data_in);
TYPE_MAXVAL (expr) = stream_read_tree (ib, data_in);
if (RECORD_OR_UNION_TYPE_P (expr))
TYPE_BINFO (expr) = stream_read_tree (ib, data_in);
} | [
"static",
"void",
"lto_input_ts_type_non_common_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"if",
"(",
"TREE_CODE",
"(",
"expr",
")",
"==",
"ENUMERAL_TYPE",
")",
"TYPE_VALUES",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"else",
"if",
"(",
"TREE_CODE",
"(",
"expr",
")",
"==",
"ARRAY_TYPE",
")",
"TYPE_DOMAIN",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"else",
"if",
"(",
"RECORD_OR_UNION_TYPE_P",
"(",
"expr",
")",
")",
"TYPE_FIELDS",
"(",
"expr",
")",
"=",
"streamer_read_chain",
"(",
"ib",
",",
"data_in",
")",
";",
"else",
"if",
"(",
"TREE_CODE",
"(",
"expr",
")",
"==",
"FUNCTION_TYPE",
"||",
"TREE_CODE",
"(",
"expr",
")",
"==",
"METHOD_TYPE",
")",
"TYPE_ARG_TYPES",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"if",
"(",
"!",
"POINTER_TYPE_P",
"(",
"expr",
")",
")",
"TYPE_MINVAL",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"TYPE_MAXVAL",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"if",
"(",
"RECORD_OR_UNION_TYPE_P",
"(",
"expr",
")",
")",
"TYPE_BINFO",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"}"
] | Read all pointer fields in the TS_TYPE_NON_COMMON structure of EXPR
from input block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_TYPE_NON_COMMON",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_list_tree_pointers | void | static void
lto_input_ts_list_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
TREE_PURPOSE (expr) = stream_read_tree (ib, data_in);
TREE_VALUE (expr) = stream_read_tree (ib, data_in);
TREE_CHAIN (expr) = streamer_read_chain (ib, data_in);
} | /* Read all pointer fields in the TS_LIST structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. */ | Read all pointer fields in the TS_LIST structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_LIST",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_list_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
TREE_PURPOSE (expr) = stream_read_tree (ib, data_in);
TREE_VALUE (expr) = stream_read_tree (ib, data_in);
TREE_CHAIN (expr) = streamer_read_chain (ib, data_in);
} | [
"static",
"void",
"lto_input_ts_list_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"TREE_PURPOSE",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"TREE_VALUE",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"TREE_CHAIN",
"(",
"expr",
")",
"=",
"streamer_read_chain",
"(",
"ib",
",",
"data_in",
")",
";",
"}"
] | Read all pointer fields in the TS_LIST structure of EXPR from input
block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_LIST",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_vec_tree_pointers | void | static void
lto_input_ts_vec_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
int i;
/* Note that TREE_VEC_LENGTH was read by streamer_alloc_tree to
instantiate EXPR. */
for (i = 0; i < TREE_VEC_LENGTH (expr); i++)
TREE_VEC_ELT (expr, i) = stream_read_tree (ib, data_in);
} | /* Read all pointer fields in the TS_VEC structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. */ | Read all pointer fields in the TS_VEC structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_VEC",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_vec_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
int i;
for (i = 0; i < TREE_VEC_LENGTH (expr); i++)
TREE_VEC_ELT (expr, i) = stream_read_tree (ib, data_in);
} | [
"static",
"void",
"lto_input_ts_vec_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"int",
"i",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"TREE_VEC_LENGTH",
"(",
"expr",
")",
";",
"i",
"++",
")",
"TREE_VEC_ELT",
"(",
"expr",
",",
"i",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"}"
] | Read all pointer fields in the TS_VEC structure of EXPR from input
block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_VEC",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [
"/* Note that TREE_VEC_LENGTH was read by streamer_alloc_tree to\n instantiate EXPR. */"
] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_exp_tree_pointers | void | static void
lto_input_ts_exp_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
int i, length;
location_t loc;
length = streamer_read_hwi (ib);
gcc_assert (length == TREE_OPERAND_LENGTH (expr));
for (i = 0; i < length; i++)
TREE_OPERAND (expr, i) = stream_read_tree (ib, data_in);
loc = lto_input_location (ib, data_in);
SET_EXPR_LOCATION (expr, loc);
TREE_BLOCK (expr) = stream_read_tree (ib, data_in);
} | /* Read all pointer fields in the TS_EXP structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. */ | Read all pointer fields in the TS_EXP structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_EXP",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_exp_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
int i, length;
location_t loc;
length = streamer_read_hwi (ib);
gcc_assert (length == TREE_OPERAND_LENGTH (expr));
for (i = 0; i < length; i++)
TREE_OPERAND (expr, i) = stream_read_tree (ib, data_in);
loc = lto_input_location (ib, data_in);
SET_EXPR_LOCATION (expr, loc);
TREE_BLOCK (expr) = stream_read_tree (ib, data_in);
} | [
"static",
"void",
"lto_input_ts_exp_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"int",
"i",
",",
"length",
";",
"location_t",
"loc",
";",
"length",
"=",
"streamer_read_hwi",
"(",
"ib",
")",
";",
"gcc_assert",
"(",
"length",
"==",
"TREE_OPERAND_LENGTH",
"(",
"expr",
")",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
"++",
")",
"TREE_OPERAND",
"(",
"expr",
",",
"i",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"loc",
"=",
"lto_input_location",
"(",
"ib",
",",
"data_in",
")",
";",
"SET_EXPR_LOCATION",
"(",
"expr",
",",
"loc",
")",
";",
"TREE_BLOCK",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"}"
] | Read all pointer fields in the TS_EXP structure of EXPR from input
block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_EXP",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_block_tree_pointers | void | static void
lto_input_ts_block_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
/* Do not stream BLOCK_SOURCE_LOCATION. We cannot handle debug information
for early inlining so drop it on the floor instead of ICEing in
dwarf2out.c. */
BLOCK_VARS (expr) = streamer_read_chain (ib, data_in);
/* Do not stream BLOCK_NONLOCALIZED_VARS. We cannot handle debug information
for early inlining so drop it on the floor instead of ICEing in
dwarf2out.c. */
BLOCK_SUPERCONTEXT (expr) = stream_read_tree (ib, data_in);
/* Do not stream BLOCK_ABSTRACT_ORIGIN. We cannot handle debug information
for early inlining so drop it on the floor instead of ICEing in
dwarf2out.c. */
BLOCK_FRAGMENT_ORIGIN (expr) = stream_read_tree (ib, data_in);
BLOCK_FRAGMENT_CHAIN (expr) = stream_read_tree (ib, data_in);
/* We re-compute BLOCK_SUBBLOCKS of our parent here instead
of streaming it. For non-BLOCK BLOCK_SUPERCONTEXTs we still
stream the child relationship explicitly. */
if (BLOCK_SUPERCONTEXT (expr)
&& TREE_CODE (BLOCK_SUPERCONTEXT (expr)) == BLOCK)
{
BLOCK_CHAIN (expr) = BLOCK_SUBBLOCKS (BLOCK_SUPERCONTEXT (expr));
BLOCK_SUBBLOCKS (BLOCK_SUPERCONTEXT (expr)) = expr;
}
/* The global block is rooted at the TU decl. Hook it here to
avoid the need to stream in this block during WPA time. */
else if (BLOCK_SUPERCONTEXT (expr)
&& TREE_CODE (BLOCK_SUPERCONTEXT (expr)) == TRANSLATION_UNIT_DECL)
DECL_INITIAL (BLOCK_SUPERCONTEXT (expr)) = expr;
/* The function-level block is connected at the time we read in
function bodies for the same reason. */
} | /* Read all pointer fields in the TS_BLOCK structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. */ | Read all pointer fields in the TS_BLOCK structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_BLOCK",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_block_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
BLOCK_VARS (expr) = streamer_read_chain (ib, data_in);
BLOCK_SUPERCONTEXT (expr) = stream_read_tree (ib, data_in);
BLOCK_FRAGMENT_ORIGIN (expr) = stream_read_tree (ib, data_in);
BLOCK_FRAGMENT_CHAIN (expr) = stream_read_tree (ib, data_in);
if (BLOCK_SUPERCONTEXT (expr)
&& TREE_CODE (BLOCK_SUPERCONTEXT (expr)) == BLOCK)
{
BLOCK_CHAIN (expr) = BLOCK_SUBBLOCKS (BLOCK_SUPERCONTEXT (expr));
BLOCK_SUBBLOCKS (BLOCK_SUPERCONTEXT (expr)) = expr;
}
else if (BLOCK_SUPERCONTEXT (expr)
&& TREE_CODE (BLOCK_SUPERCONTEXT (expr)) == TRANSLATION_UNIT_DECL)
DECL_INITIAL (BLOCK_SUPERCONTEXT (expr)) = expr;
} | [
"static",
"void",
"lto_input_ts_block_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"BLOCK_VARS",
"(",
"expr",
")",
"=",
"streamer_read_chain",
"(",
"ib",
",",
"data_in",
")",
";",
"BLOCK_SUPERCONTEXT",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"BLOCK_FRAGMENT_ORIGIN",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"BLOCK_FRAGMENT_CHAIN",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"if",
"(",
"BLOCK_SUPERCONTEXT",
"(",
"expr",
")",
"&&",
"TREE_CODE",
"(",
"BLOCK_SUPERCONTEXT",
"(",
"expr",
")",
")",
"==",
"BLOCK",
")",
"{",
"BLOCK_CHAIN",
"(",
"expr",
")",
"=",
"BLOCK_SUBBLOCKS",
"(",
"BLOCK_SUPERCONTEXT",
"(",
"expr",
")",
")",
";",
"BLOCK_SUBBLOCKS",
"(",
"BLOCK_SUPERCONTEXT",
"(",
"expr",
")",
")",
"=",
"expr",
";",
"}",
"else",
"if",
"(",
"BLOCK_SUPERCONTEXT",
"(",
"expr",
")",
"&&",
"TREE_CODE",
"(",
"BLOCK_SUPERCONTEXT",
"(",
"expr",
")",
")",
"==",
"TRANSLATION_UNIT_DECL",
")",
"DECL_INITIAL",
"(",
"BLOCK_SUPERCONTEXT",
"(",
"expr",
")",
")",
"=",
"expr",
";",
"}"
] | Read all pointer fields in the TS_BLOCK structure of EXPR from input
block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_BLOCK",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [
"/* Do not stream BLOCK_SOURCE_LOCATION. We cannot handle debug information\n for early inlining so drop it on the floor instead of ICEing in\n dwarf2out.c. */",
"/* Do not stream BLOCK_NONLOCALIZED_VARS. We cannot handle debug information\n for early inlining so drop it on the floor instead of ICEing in\n dwarf2out.c. */",
"/* Do not stream BLOCK_ABSTRACT_ORIGIN. We cannot handle debug information\n for early inlining so drop it on the floor instead of ICEing in\n dwarf2out.c. */",
"/* We re-compute BLOCK_SUBBLOCKS of our parent here instead\n of streaming it. For non-BLOCK BLOCK_SUPERCONTEXTs we still\n stream the child relationship explicitly. */",
"/* The global block is rooted at the TU decl. Hook it here to\n avoid the need to stream in this block during WPA time. */",
"/* The function-level block is connected at the time we read in\n function bodies for the same reason. */"
] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_binfo_tree_pointers | void | static void
lto_input_ts_binfo_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
unsigned i, len;
tree t;
/* Note that the number of slots in EXPR was read in
streamer_alloc_tree when instantiating EXPR. However, the
vector is empty so we cannot rely on VEC_length to know how many
elements to read. So, this list is emitted as a 0-terminated
list on the writer side. */
do
{
t = stream_read_tree (ib, data_in);
if (t)
VEC_quick_push (tree, BINFO_BASE_BINFOS (expr), t);
}
while (t);
BINFO_OFFSET (expr) = stream_read_tree (ib, data_in);
BINFO_VTABLE (expr) = stream_read_tree (ib, data_in);
BINFO_VPTR_FIELD (expr) = stream_read_tree (ib, data_in);
len = streamer_read_uhwi (ib);
if (len > 0)
{
VEC_reserve_exact (tree, gc, BINFO_BASE_ACCESSES (expr), len);
for (i = 0; i < len; i++)
{
tree a = stream_read_tree (ib, data_in);
VEC_quick_push (tree, BINFO_BASE_ACCESSES (expr), a);
}
}
BINFO_INHERITANCE_CHAIN (expr) = stream_read_tree (ib, data_in);
BINFO_SUBVTT_INDEX (expr) = stream_read_tree (ib, data_in);
BINFO_VPTR_INDEX (expr) = stream_read_tree (ib, data_in);
} | /* Read all pointer fields in the TS_BINFO structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. */ | Read all pointer fields in the TS_BINFO structure of EXPR from input
block IB. DATA_IN contains tables and descriptors for the
file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_BINFO",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | static void
lto_input_ts_binfo_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in, tree expr)
{
unsigned i, len;
tree t;
do
{
t = stream_read_tree (ib, data_in);
if (t)
VEC_quick_push (tree, BINFO_BASE_BINFOS (expr), t);
}
while (t);
BINFO_OFFSET (expr) = stream_read_tree (ib, data_in);
BINFO_VTABLE (expr) = stream_read_tree (ib, data_in);
BINFO_VPTR_FIELD (expr) = stream_read_tree (ib, data_in);
len = streamer_read_uhwi (ib);
if (len > 0)
{
VEC_reserve_exact (tree, gc, BINFO_BASE_ACCESSES (expr), len);
for (i = 0; i < len; i++)
{
tree a = stream_read_tree (ib, data_in);
VEC_quick_push (tree, BINFO_BASE_ACCESSES (expr), a);
}
}
BINFO_INHERITANCE_CHAIN (expr) = stream_read_tree (ib, data_in);
BINFO_SUBVTT_INDEX (expr) = stream_read_tree (ib, data_in);
BINFO_VPTR_INDEX (expr) = stream_read_tree (ib, data_in);
} | [
"static",
"void",
"lto_input_ts_binfo_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"unsigned",
"i",
",",
"len",
";",
"tree",
"t",
";",
"do",
"{",
"t",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"if",
"(",
"t",
")",
"VEC_quick_push",
"(",
"tree",
",",
"BINFO_BASE_BINFOS",
"(",
"expr",
")",
",",
"t",
")",
";",
"}",
"while",
"(",
"t",
")",
";",
"BINFO_OFFSET",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"BINFO_VTABLE",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"BINFO_VPTR_FIELD",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"len",
"=",
"streamer_read_uhwi",
"(",
"ib",
")",
";",
"if",
"(",
"len",
">",
"0",
")",
"{",
"VEC_reserve_exact",
"(",
"tree",
",",
"gc",
",",
"BINFO_BASE_ACCESSES",
"(",
"expr",
")",
",",
"len",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"{",
"tree",
"a",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"VEC_quick_push",
"(",
"tree",
",",
"BINFO_BASE_ACCESSES",
"(",
"expr",
")",
",",
"a",
")",
";",
"}",
"}",
"BINFO_INHERITANCE_CHAIN",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"BINFO_SUBVTT_INDEX",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"BINFO_VPTR_INDEX",
"(",
"expr",
")",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"}"
] | Read all pointer fields in the TS_BINFO structure of EXPR from input
block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"the",
"TS_BINFO",
"structure",
"of",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [
"/* Note that the number of slots in EXPR was read in\n streamer_alloc_tree when instantiating EXPR. However, the\n vector is empty so we cannot rely on VEC_length to know how many\n elements to read. So, this list is emitted as a 0-terminated\n list on the writer side. */"
] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_target_option | void | static void
lto_input_ts_target_option (struct lto_input_block *ib, tree expr)
{
unsigned i, len;
struct bitpack_d bp;
struct cl_target_option *t = TREE_TARGET_OPTION (expr);
bp = streamer_read_bitpack (ib);
len = sizeof (struct cl_target_option);
for (i = 0; i < len; i++)
((unsigned char *)t)[i] = bp_unpack_value (&bp, 8);
if (bp_unpack_value (&bp, 32) != 0x12345678)
fatal_error ("cl_target_option size mismatch in LTO reader and writer");
} | /* Input a TS_TARGET_OPTION tree from IB into EXPR. */ | Input a TS_TARGET_OPTION tree from IB into EXPR. | [
"Input",
"a",
"TS_TARGET_OPTION",
"tree",
"from",
"IB",
"into",
"EXPR",
"."
] | static void
lto_input_ts_target_option (struct lto_input_block *ib, tree expr)
{
unsigned i, len;
struct bitpack_d bp;
struct cl_target_option *t = TREE_TARGET_OPTION (expr);
bp = streamer_read_bitpack (ib);
len = sizeof (struct cl_target_option);
for (i = 0; i < len; i++)
((unsigned char *)t)[i] = bp_unpack_value (&bp, 8);
if (bp_unpack_value (&bp, 32) != 0x12345678)
fatal_error ("cl_target_option size mismatch in LTO reader and writer");
} | [
"static",
"void",
"lto_input_ts_target_option",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"tree",
"expr",
")",
"{",
"unsigned",
"i",
",",
"len",
";",
"struct",
"bitpack_d",
"bp",
";",
"struct",
"cl_target_option",
"*",
"t",
"=",
"TREE_TARGET_OPTION",
"(",
"expr",
")",
";",
"bp",
"=",
"streamer_read_bitpack",
"(",
"ib",
")",
";",
"len",
"=",
"sizeof",
"(",
"struct",
"cl_target_option",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"(",
"(",
"unsigned",
"char",
"*",
")",
"t",
")",
"[",
"i",
"]",
"=",
"bp_unpack_value",
"(",
"&",
"bp",
",",
"8",
")",
";",
"if",
"(",
"bp_unpack_value",
"(",
"&",
"bp",
",",
"32",
")",
"!=",
"0x12345678",
")",
"fatal_error",
"(",
"\"",
"\"",
")",
";",
"}"
] | Input a TS_TARGET_OPTION tree from IB into EXPR. | [
"Input",
"a",
"TS_TARGET_OPTION",
"tree",
"from",
"IB",
"into",
"EXPR",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_optimization | void | static void
lto_input_ts_optimization (struct lto_input_block *ib, tree expr)
{
unsigned i, len;
struct bitpack_d bp;
struct cl_optimization *t = TREE_OPTIMIZATION (expr);
bp = streamer_read_bitpack (ib);
len = sizeof (struct cl_optimization);
for (i = 0; i < len; i++)
((unsigned char *)t)[i] = bp_unpack_value (&bp, 8);
if (bp_unpack_value (&bp, 32) != 0x12345678)
fatal_error ("cl_optimization size mismatch in LTO reader and writer");
} | /* Input a TS_OPTIMIZATION tree from IB into EXPR. */ | Input a TS_OPTIMIZATION tree from IB into EXPR. | [
"Input",
"a",
"TS_OPTIMIZATION",
"tree",
"from",
"IB",
"into",
"EXPR",
"."
] | static void
lto_input_ts_optimization (struct lto_input_block *ib, tree expr)
{
unsigned i, len;
struct bitpack_d bp;
struct cl_optimization *t = TREE_OPTIMIZATION (expr);
bp = streamer_read_bitpack (ib);
len = sizeof (struct cl_optimization);
for (i = 0; i < len; i++)
((unsigned char *)t)[i] = bp_unpack_value (&bp, 8);
if (bp_unpack_value (&bp, 32) != 0x12345678)
fatal_error ("cl_optimization size mismatch in LTO reader and writer");
} | [
"static",
"void",
"lto_input_ts_optimization",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"tree",
"expr",
")",
"{",
"unsigned",
"i",
",",
"len",
";",
"struct",
"bitpack_d",
"bp",
";",
"struct",
"cl_optimization",
"*",
"t",
"=",
"TREE_OPTIMIZATION",
"(",
"expr",
")",
";",
"bp",
"=",
"streamer_read_bitpack",
"(",
"ib",
")",
";",
"len",
"=",
"sizeof",
"(",
"struct",
"cl_optimization",
")",
";",
"for",
"(",
"i",
"=",
"0",
";",
"i",
"<",
"len",
";",
"i",
"++",
")",
"(",
"(",
"unsigned",
"char",
"*",
")",
"t",
")",
"[",
"i",
"]",
"=",
"bp_unpack_value",
"(",
"&",
"bp",
",",
"8",
")",
";",
"if",
"(",
"bp_unpack_value",
"(",
"&",
"bp",
",",
"32",
")",
"!=",
"0x12345678",
")",
"fatal_error",
"(",
"\"",
"\"",
")",
";",
"}"
] | Input a TS_OPTIMIZATION tree from IB into EXPR. | [
"Input",
"a",
"TS_OPTIMIZATION",
"tree",
"from",
"IB",
"into",
"EXPR",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | lto_input_ts_translation_unit_decl_tree_pointers | void | static void
lto_input_ts_translation_unit_decl_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in,
tree expr)
{
TRANSLATION_UNIT_LANGUAGE (expr) = xstrdup (streamer_read_string (data_in, ib));
VEC_safe_push (tree, gc, all_translation_units, expr);
} | /* Input a TS_TRANSLATION_UNIT_DECL tree from IB and DATA_IN into EXPR. */ | Input a TS_TRANSLATION_UNIT_DECL tree from IB and DATA_IN into EXPR. | [
"Input",
"a",
"TS_TRANSLATION_UNIT_DECL",
"tree",
"from",
"IB",
"and",
"DATA_IN",
"into",
"EXPR",
"."
] | static void
lto_input_ts_translation_unit_decl_tree_pointers (struct lto_input_block *ib,
struct data_in *data_in,
tree expr)
{
TRANSLATION_UNIT_LANGUAGE (expr) = xstrdup (streamer_read_string (data_in, ib));
VEC_safe_push (tree, gc, all_translation_units, expr);
} | [
"static",
"void",
"lto_input_ts_translation_unit_decl_tree_pointers",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"TRANSLATION_UNIT_LANGUAGE",
"(",
"expr",
")",
"=",
"xstrdup",
"(",
"streamer_read_string",
"(",
"data_in",
",",
"ib",
")",
")",
";",
"VEC_safe_push",
"(",
"tree",
",",
"gc",
",",
"all_translation_units",
",",
"expr",
")",
";",
"}"
] | Input a TS_TRANSLATION_UNIT_DECL tree from IB and DATA_IN into EXPR. | [
"Input",
"a",
"TS_TRANSLATION_UNIT_DECL",
"tree",
"from",
"IB",
"and",
"DATA_IN",
"into",
"EXPR",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | streamer_read_tree_body | void | void
streamer_read_tree_body (struct lto_input_block *ib, struct data_in *data_in,
tree expr)
{
enum tree_code code;
code = TREE_CODE (expr);
if (CODE_CONTAINS_STRUCT (code, TS_TYPED))
lto_input_ts_common_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_VECTOR))
lto_input_ts_vector_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_COMPLEX))
lto_input_ts_complex_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_MINIMAL))
lto_input_ts_decl_minimal_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
lto_input_ts_decl_common_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_NON_COMMON))
lto_input_ts_decl_non_common_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS))
lto_input_ts_decl_with_vis_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_FIELD_DECL))
lto_input_ts_field_decl_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_FUNCTION_DECL))
lto_input_ts_function_decl_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_TYPE_COMMON))
lto_input_ts_type_common_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_TYPE_NON_COMMON))
lto_input_ts_type_non_common_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_LIST))
lto_input_ts_list_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_VEC))
lto_input_ts_vec_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_EXP))
lto_input_ts_exp_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
lto_input_ts_block_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_BINFO))
lto_input_ts_binfo_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_CONSTRUCTOR))
lto_input_ts_constructor_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION))
lto_input_ts_target_option (ib, expr);
if (CODE_CONTAINS_STRUCT (code, TS_OPTIMIZATION))
lto_input_ts_optimization (ib, expr);
if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL))
lto_input_ts_translation_unit_decl_tree_pointers (ib, data_in, expr);
} | /* Read all pointer fields in EXPR from input block IB. DATA_IN
contains tables and descriptors for the file being read. */ | Read all pointer fields in EXPR from input block IB. DATA_IN
contains tables and descriptors for the file being read. | [
"Read",
"all",
"pointer",
"fields",
"in",
"EXPR",
"from",
"input",
"block",
"IB",
".",
"DATA_IN",
"contains",
"tables",
"and",
"descriptors",
"for",
"the",
"file",
"being",
"read",
"."
] | void
streamer_read_tree_body (struct lto_input_block *ib, struct data_in *data_in,
tree expr)
{
enum tree_code code;
code = TREE_CODE (expr);
if (CODE_CONTAINS_STRUCT (code, TS_TYPED))
lto_input_ts_common_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_VECTOR))
lto_input_ts_vector_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_COMPLEX))
lto_input_ts_complex_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_MINIMAL))
lto_input_ts_decl_minimal_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_COMMON))
lto_input_ts_decl_common_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_NON_COMMON))
lto_input_ts_decl_non_common_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_DECL_WITH_VIS))
lto_input_ts_decl_with_vis_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_FIELD_DECL))
lto_input_ts_field_decl_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_FUNCTION_DECL))
lto_input_ts_function_decl_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_TYPE_COMMON))
lto_input_ts_type_common_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_TYPE_NON_COMMON))
lto_input_ts_type_non_common_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_LIST))
lto_input_ts_list_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_VEC))
lto_input_ts_vec_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_EXP))
lto_input_ts_exp_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_BLOCK))
lto_input_ts_block_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_BINFO))
lto_input_ts_binfo_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_CONSTRUCTOR))
lto_input_ts_constructor_tree_pointers (ib, data_in, expr);
if (CODE_CONTAINS_STRUCT (code, TS_TARGET_OPTION))
lto_input_ts_target_option (ib, expr);
if (CODE_CONTAINS_STRUCT (code, TS_OPTIMIZATION))
lto_input_ts_optimization (ib, expr);
if (CODE_CONTAINS_STRUCT (code, TS_TRANSLATION_UNIT_DECL))
lto_input_ts_translation_unit_decl_tree_pointers (ib, data_in, expr);
} | [
"void",
"streamer_read_tree_body",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
",",
"tree",
"expr",
")",
"{",
"enum",
"tree_code",
"code",
";",
"code",
"=",
"TREE_CODE",
"(",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_TYPED",
")",
")",
"lto_input_ts_common_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_VECTOR",
")",
")",
"lto_input_ts_vector_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_COMPLEX",
")",
")",
"lto_input_ts_complex_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_DECL_MINIMAL",
")",
")",
"lto_input_ts_decl_minimal_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_DECL_COMMON",
")",
")",
"lto_input_ts_decl_common_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_DECL_NON_COMMON",
")",
")",
"lto_input_ts_decl_non_common_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_DECL_WITH_VIS",
")",
")",
"lto_input_ts_decl_with_vis_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_FIELD_DECL",
")",
")",
"lto_input_ts_field_decl_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_FUNCTION_DECL",
")",
")",
"lto_input_ts_function_decl_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_TYPE_COMMON",
")",
")",
"lto_input_ts_type_common_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_TYPE_NON_COMMON",
")",
")",
"lto_input_ts_type_non_common_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_LIST",
")",
")",
"lto_input_ts_list_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_VEC",
")",
")",
"lto_input_ts_vec_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_EXP",
")",
")",
"lto_input_ts_exp_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_BLOCK",
")",
")",
"lto_input_ts_block_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_BINFO",
")",
")",
"lto_input_ts_binfo_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_CONSTRUCTOR",
")",
")",
"lto_input_ts_constructor_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_TARGET_OPTION",
")",
")",
"lto_input_ts_target_option",
"(",
"ib",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_OPTIMIZATION",
")",
")",
"lto_input_ts_optimization",
"(",
"ib",
",",
"expr",
")",
";",
"if",
"(",
"CODE_CONTAINS_STRUCT",
"(",
"code",
",",
"TS_TRANSLATION_UNIT_DECL",
")",
")",
"lto_input_ts_translation_unit_decl_tree_pointers",
"(",
"ib",
",",
"data_in",
",",
"expr",
")",
";",
"}"
] | Read all pointer fields in EXPR from input block IB. | [
"Read",
"all",
"pointer",
"fields",
"in",
"EXPR",
"from",
"input",
"block",
"IB",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
},
{
"param": "expr",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "expr",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | streamer_read_integer_cst | tree | tree
streamer_read_integer_cst (struct lto_input_block *ib, struct data_in *data_in)
{
tree result, type;
HOST_WIDE_INT low, high;
bool overflow_p;
type = stream_read_tree (ib, data_in);
overflow_p = (streamer_read_uchar (ib) != 0);
low = streamer_read_uhwi (ib);
high = streamer_read_uhwi (ib);
result = build_int_cst_wide (type, low, high);
/* If the original constant had overflown, build a replica of RESULT to
avoid modifying the shared constant returned by build_int_cst_wide. */
if (overflow_p)
{
result = copy_node (result);
TREE_OVERFLOW (result) = 1;
}
return result;
} | /* Read and INTEGER_CST node from input block IB using the per-file
context in DATA_IN. */ | Read and INTEGER_CST node from input block IB using the per-file
context in DATA_IN. | [
"Read",
"and",
"INTEGER_CST",
"node",
"from",
"input",
"block",
"IB",
"using",
"the",
"per",
"-",
"file",
"context",
"in",
"DATA_IN",
"."
] | tree
streamer_read_integer_cst (struct lto_input_block *ib, struct data_in *data_in)
{
tree result, type;
HOST_WIDE_INT low, high;
bool overflow_p;
type = stream_read_tree (ib, data_in);
overflow_p = (streamer_read_uchar (ib) != 0);
low = streamer_read_uhwi (ib);
high = streamer_read_uhwi (ib);
result = build_int_cst_wide (type, low, high);
if (overflow_p)
{
result = copy_node (result);
TREE_OVERFLOW (result) = 1;
}
return result;
} | [
"tree",
"streamer_read_integer_cst",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
")",
"{",
"tree",
"result",
",",
"type",
";",
"HOST_WIDE_INT",
"low",
",",
"high",
";",
"bool",
"overflow_p",
";",
"type",
"=",
"stream_read_tree",
"(",
"ib",
",",
"data_in",
")",
";",
"overflow_p",
"=",
"(",
"streamer_read_uchar",
"(",
"ib",
")",
"!=",
"0",
")",
";",
"low",
"=",
"streamer_read_uhwi",
"(",
"ib",
")",
";",
"high",
"=",
"streamer_read_uhwi",
"(",
"ib",
")",
";",
"result",
"=",
"build_int_cst_wide",
"(",
"type",
",",
"low",
",",
"high",
")",
";",
"if",
"(",
"overflow_p",
")",
"{",
"result",
"=",
"copy_node",
"(",
"result",
")",
";",
"TREE_OVERFLOW",
"(",
"result",
")",
"=",
"1",
";",
"}",
"return",
"result",
";",
"}"
] | Read and INTEGER_CST node from input block IB using the per-file
context in DATA_IN. | [
"Read",
"and",
"INTEGER_CST",
"node",
"from",
"input",
"block",
"IB",
"using",
"the",
"per",
"-",
"file",
"context",
"in",
"DATA_IN",
"."
] | [
"/* If the original constant had overflown, build a replica of RESULT to\n avoid modifying the shared constant returned by build_int_cst_wide. */"
] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
f2b12243b12a44f4de41873889a84ebdf2e430cd | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-streamer-in.c | [
"BSD-3-Clause"
] | C | streamer_get_builtin_tree | tree | tree
streamer_get_builtin_tree (struct lto_input_block *ib, struct data_in *data_in)
{
enum built_in_class fclass;
enum built_in_function fcode;
const char *asmname;
tree result;
fclass = streamer_read_enum (ib, built_in_class, BUILT_IN_LAST);
gcc_assert (fclass == BUILT_IN_NORMAL || fclass == BUILT_IN_MD);
fcode = (enum built_in_function) streamer_read_uhwi (ib);
if (fclass == BUILT_IN_NORMAL)
{
if (fcode >= END_BUILTINS)
fatal_error ("machine independent builtin code out of range");
result = builtin_decl_explicit (fcode);
gcc_assert (result);
}
else if (fclass == BUILT_IN_MD)
{
result = targetm.builtin_decl (fcode, true);
if (!result || result == error_mark_node)
fatal_error ("target specific builtin not available");
}
else
gcc_unreachable ();
asmname = streamer_read_string (data_in, ib);
if (asmname)
set_builtin_user_assembler_name (result, asmname);
streamer_tree_cache_append (data_in->reader_cache, result);
return result;
} | /* Read a code and class from input block IB and return the
corresponding builtin. DATA_IN is as in stream_read_tree. */ | Read a code and class from input block IB and return the
corresponding builtin. | [
"Read",
"a",
"code",
"and",
"class",
"from",
"input",
"block",
"IB",
"and",
"return",
"the",
"corresponding",
"builtin",
"."
] | tree
streamer_get_builtin_tree (struct lto_input_block *ib, struct data_in *data_in)
{
enum built_in_class fclass;
enum built_in_function fcode;
const char *asmname;
tree result;
fclass = streamer_read_enum (ib, built_in_class, BUILT_IN_LAST);
gcc_assert (fclass == BUILT_IN_NORMAL || fclass == BUILT_IN_MD);
fcode = (enum built_in_function) streamer_read_uhwi (ib);
if (fclass == BUILT_IN_NORMAL)
{
if (fcode >= END_BUILTINS)
fatal_error ("machine independent builtin code out of range");
result = builtin_decl_explicit (fcode);
gcc_assert (result);
}
else if (fclass == BUILT_IN_MD)
{
result = targetm.builtin_decl (fcode, true);
if (!result || result == error_mark_node)
fatal_error ("target specific builtin not available");
}
else
gcc_unreachable ();
asmname = streamer_read_string (data_in, ib);
if (asmname)
set_builtin_user_assembler_name (result, asmname);
streamer_tree_cache_append (data_in->reader_cache, result);
return result;
} | [
"tree",
"streamer_get_builtin_tree",
"(",
"struct",
"lto_input_block",
"*",
"ib",
",",
"struct",
"data_in",
"*",
"data_in",
")",
"{",
"enum",
"built_in_class",
"fclass",
";",
"enum",
"built_in_function",
"fcode",
";",
"const",
"char",
"*",
"asmname",
";",
"tree",
"result",
";",
"fclass",
"=",
"streamer_read_enum",
"(",
"ib",
",",
"built_in_class",
",",
"BUILT_IN_LAST",
")",
";",
"gcc_assert",
"(",
"fclass",
"==",
"BUILT_IN_NORMAL",
"||",
"fclass",
"==",
"BUILT_IN_MD",
")",
";",
"fcode",
"=",
"(",
"enum",
"built_in_function",
")",
"streamer_read_uhwi",
"(",
"ib",
")",
";",
"if",
"(",
"fclass",
"==",
"BUILT_IN_NORMAL",
")",
"{",
"if",
"(",
"fcode",
">=",
"END_BUILTINS",
")",
"fatal_error",
"(",
"\"",
"\"",
")",
";",
"result",
"=",
"builtin_decl_explicit",
"(",
"fcode",
")",
";",
"gcc_assert",
"(",
"result",
")",
";",
"}",
"else",
"if",
"(",
"fclass",
"==",
"BUILT_IN_MD",
")",
"{",
"result",
"=",
"targetm",
".",
"builtin_decl",
"(",
"fcode",
",",
"true",
")",
";",
"if",
"(",
"!",
"result",
"||",
"result",
"==",
"error_mark_node",
")",
"fatal_error",
"(",
"\"",
"\"",
")",
";",
"}",
"else",
"gcc_unreachable",
"(",
")",
";",
"asmname",
"=",
"streamer_read_string",
"(",
"data_in",
",",
"ib",
")",
";",
"if",
"(",
"asmname",
")",
"set_builtin_user_assembler_name",
"(",
"result",
",",
"asmname",
")",
";",
"streamer_tree_cache_append",
"(",
"data_in",
"->",
"reader_cache",
",",
"result",
")",
";",
"return",
"result",
";",
"}"
] | Read a code and class from input block IB and return the
corresponding builtin. | [
"Read",
"a",
"code",
"and",
"class",
"from",
"input",
"block",
"IB",
"and",
"return",
"the",
"corresponding",
"builtin",
"."
] | [] | [
{
"param": "ib",
"type": "struct lto_input_block"
},
{
"param": "data_in",
"type": "struct data_in"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ib",
"type": "struct lto_input_block",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "data_in",
"type": "struct data_in",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e4dc14434d6cf8445323db81d832877f4f0f30b | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | [
"BSD-3-Clause"
] | C | VN_INFO | vn_ssa_aux_t | vn_ssa_aux_t
VN_INFO (tree name)
{
vn_ssa_aux_t res = VEC_index (vn_ssa_aux_t, vn_ssa_aux_table,
SSA_NAME_VERSION (name));
gcc_checking_assert (res);
return res;
} | /* Return the value numbering information for a given SSA name. */ | Return the value numbering information for a given SSA name. | [
"Return",
"the",
"value",
"numbering",
"information",
"for",
"a",
"given",
"SSA",
"name",
"."
] | vn_ssa_aux_t
VN_INFO (tree name)
{
vn_ssa_aux_t res = VEC_index (vn_ssa_aux_t, vn_ssa_aux_table,
SSA_NAME_VERSION (name));
gcc_checking_assert (res);
return res;
} | [
"vn_ssa_aux_t",
"VN_INFO",
"(",
"tree",
"name",
")",
"{",
"vn_ssa_aux_t",
"res",
"=",
"VEC_index",
"(",
"vn_ssa_aux_t",
",",
"vn_ssa_aux_table",
",",
"SSA_NAME_VERSION",
"(",
"name",
")",
")",
";",
"gcc_checking_assert",
"(",
"res",
")",
";",
"return",
"res",
";",
"}"
] | Return the value numbering information for a given SSA name. | [
"Return",
"the",
"value",
"numbering",
"information",
"for",
"a",
"given",
"SSA",
"name",
"."
] | [] | [
{
"param": "name",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "name",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e4dc14434d6cf8445323db81d832877f4f0f30b | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | [
"BSD-3-Clause"
] | C | VN_INFO_SET | void | static inline void
VN_INFO_SET (tree name, vn_ssa_aux_t value)
{
VEC_replace (vn_ssa_aux_t, vn_ssa_aux_table,
SSA_NAME_VERSION (name), value);
} | /* Set the value numbering info for a given SSA name to a given
value. */ | Set the value numbering info for a given SSA name to a given
value. | [
"Set",
"the",
"value",
"numbering",
"info",
"for",
"a",
"given",
"SSA",
"name",
"to",
"a",
"given",
"value",
"."
] | static inline void
VN_INFO_SET (tree name, vn_ssa_aux_t value)
{
VEC_replace (vn_ssa_aux_t, vn_ssa_aux_table,
SSA_NAME_VERSION (name), value);
} | [
"static",
"inline",
"void",
"VN_INFO_SET",
"(",
"tree",
"name",
",",
"vn_ssa_aux_t",
"value",
")",
"{",
"VEC_replace",
"(",
"vn_ssa_aux_t",
",",
"vn_ssa_aux_table",
",",
"SSA_NAME_VERSION",
"(",
"name",
")",
",",
"value",
")",
";",
"}"
] | Set the value numbering info for a given SSA name to a given
value. | [
"Set",
"the",
"value",
"numbering",
"info",
"for",
"a",
"given",
"SSA",
"name",
"to",
"a",
"given",
"value",
"."
] | [] | [
{
"param": "name",
"type": "tree"
},
{
"param": "value",
"type": "vn_ssa_aux_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "name",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "value",
"type": "vn_ssa_aux_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e4dc14434d6cf8445323db81d832877f4f0f30b | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | [
"BSD-3-Clause"
] | C | vn_get_expr_for | tree | tree
vn_get_expr_for (tree name)
{
vn_ssa_aux_t vn = VN_INFO (name);
gimple def_stmt;
tree expr = NULL_TREE;
enum tree_code code;
if (vn->valnum == VN_TOP)
return name;
/* If the value-number is a constant it is the representative
expression. */
if (TREE_CODE (vn->valnum) != SSA_NAME)
return vn->valnum;
/* Get to the information of the value of this SSA_NAME. */
vn = VN_INFO (vn->valnum);
/* If the value-number is a constant it is the representative
expression. */
if (TREE_CODE (vn->valnum) != SSA_NAME)
return vn->valnum;
/* Else if we have an expression, return it. */
if (vn->expr != NULL_TREE)
return vn->expr;
/* Otherwise use the defining statement to build the expression. */
def_stmt = SSA_NAME_DEF_STMT (vn->valnum);
/* If the value number is not an assignment use it directly. */
if (!is_gimple_assign (def_stmt))
return vn->valnum;
/* FIXME tuples. This is incomplete and likely will miss some
simplifications. */
code = gimple_assign_rhs_code (def_stmt);
switch (TREE_CODE_CLASS (code))
{
case tcc_reference:
if ((code == REALPART_EXPR
|| code == IMAGPART_EXPR
|| code == VIEW_CONVERT_EXPR)
&& TREE_CODE (TREE_OPERAND (gimple_assign_rhs1 (def_stmt),
0)) == SSA_NAME)
expr = fold_build1 (code,
gimple_expr_type (def_stmt),
TREE_OPERAND (gimple_assign_rhs1 (def_stmt), 0));
break;
case tcc_unary:
expr = fold_build1 (code,
gimple_expr_type (def_stmt),
gimple_assign_rhs1 (def_stmt));
break;
case tcc_binary:
expr = fold_build2 (code,
gimple_expr_type (def_stmt),
gimple_assign_rhs1 (def_stmt),
gimple_assign_rhs2 (def_stmt));
break;
case tcc_exceptional:
if (code == CONSTRUCTOR
&& TREE_CODE
(TREE_TYPE (gimple_assign_rhs1 (def_stmt))) == VECTOR_TYPE)
expr = gimple_assign_rhs1 (def_stmt);
break;
default:;
}
if (expr == NULL_TREE)
return vn->valnum;
/* Cache the expression. */
vn->expr = expr;
return expr;
} | /* Get the representative expression for the SSA_NAME NAME. Returns
the representative SSA_NAME if there is no expression associated with it. */ | Get the representative expression for the SSA_NAME NAME. Returns
the representative SSA_NAME if there is no expression associated with it. | [
"Get",
"the",
"representative",
"expression",
"for",
"the",
"SSA_NAME",
"NAME",
".",
"Returns",
"the",
"representative",
"SSA_NAME",
"if",
"there",
"is",
"no",
"expression",
"associated",
"with",
"it",
"."
] | tree
vn_get_expr_for (tree name)
{
vn_ssa_aux_t vn = VN_INFO (name);
gimple def_stmt;
tree expr = NULL_TREE;
enum tree_code code;
if (vn->valnum == VN_TOP)
return name;
if (TREE_CODE (vn->valnum) != SSA_NAME)
return vn->valnum;
vn = VN_INFO (vn->valnum);
if (TREE_CODE (vn->valnum) != SSA_NAME)
return vn->valnum;
if (vn->expr != NULL_TREE)
return vn->expr;
def_stmt = SSA_NAME_DEF_STMT (vn->valnum);
if (!is_gimple_assign (def_stmt))
return vn->valnum;
code = gimple_assign_rhs_code (def_stmt);
switch (TREE_CODE_CLASS (code))
{
case tcc_reference:
if ((code == REALPART_EXPR
|| code == IMAGPART_EXPR
|| code == VIEW_CONVERT_EXPR)
&& TREE_CODE (TREE_OPERAND (gimple_assign_rhs1 (def_stmt),
0)) == SSA_NAME)
expr = fold_build1 (code,
gimple_expr_type (def_stmt),
TREE_OPERAND (gimple_assign_rhs1 (def_stmt), 0));
break;
case tcc_unary:
expr = fold_build1 (code,
gimple_expr_type (def_stmt),
gimple_assign_rhs1 (def_stmt));
break;
case tcc_binary:
expr = fold_build2 (code,
gimple_expr_type (def_stmt),
gimple_assign_rhs1 (def_stmt),
gimple_assign_rhs2 (def_stmt));
break;
case tcc_exceptional:
if (code == CONSTRUCTOR
&& TREE_CODE
(TREE_TYPE (gimple_assign_rhs1 (def_stmt))) == VECTOR_TYPE)
expr = gimple_assign_rhs1 (def_stmt);
break;
default:;
}
if (expr == NULL_TREE)
return vn->valnum;
vn->expr = expr;
return expr;
} | [
"tree",
"vn_get_expr_for",
"(",
"tree",
"name",
")",
"{",
"vn_ssa_aux_t",
"vn",
"=",
"VN_INFO",
"(",
"name",
")",
";",
"gimple",
"def_stmt",
";",
"tree",
"expr",
"=",
"NULL_TREE",
";",
"enum",
"tree_code",
"code",
";",
"if",
"(",
"vn",
"->",
"valnum",
"==",
"VN_TOP",
")",
"return",
"name",
";",
"if",
"(",
"TREE_CODE",
"(",
"vn",
"->",
"valnum",
")",
"!=",
"SSA_NAME",
")",
"return",
"vn",
"->",
"valnum",
";",
"vn",
"=",
"VN_INFO",
"(",
"vn",
"->",
"valnum",
")",
";",
"if",
"(",
"TREE_CODE",
"(",
"vn",
"->",
"valnum",
")",
"!=",
"SSA_NAME",
")",
"return",
"vn",
"->",
"valnum",
";",
"if",
"(",
"vn",
"->",
"expr",
"!=",
"NULL_TREE",
")",
"return",
"vn",
"->",
"expr",
";",
"def_stmt",
"=",
"SSA_NAME_DEF_STMT",
"(",
"vn",
"->",
"valnum",
")",
";",
"if",
"(",
"!",
"is_gimple_assign",
"(",
"def_stmt",
")",
")",
"return",
"vn",
"->",
"valnum",
";",
"code",
"=",
"gimple_assign_rhs_code",
"(",
"def_stmt",
")",
";",
"switch",
"(",
"TREE_CODE_CLASS",
"(",
"code",
")",
")",
"{",
"case",
"tcc_reference",
":",
"if",
"(",
"(",
"code",
"==",
"REALPART_EXPR",
"||",
"code",
"==",
"IMAGPART_EXPR",
"||",
"code",
"==",
"VIEW_CONVERT_EXPR",
")",
"&&",
"TREE_CODE",
"(",
"TREE_OPERAND",
"(",
"gimple_assign_rhs1",
"(",
"def_stmt",
")",
",",
"0",
")",
")",
"==",
"SSA_NAME",
")",
"expr",
"=",
"fold_build1",
"(",
"code",
",",
"gimple_expr_type",
"(",
"def_stmt",
")",
",",
"TREE_OPERAND",
"(",
"gimple_assign_rhs1",
"(",
"def_stmt",
")",
",",
"0",
")",
")",
";",
"break",
";",
"case",
"tcc_unary",
":",
"expr",
"=",
"fold_build1",
"(",
"code",
",",
"gimple_expr_type",
"(",
"def_stmt",
")",
",",
"gimple_assign_rhs1",
"(",
"def_stmt",
")",
")",
";",
"break",
";",
"case",
"tcc_binary",
":",
"expr",
"=",
"fold_build2",
"(",
"code",
",",
"gimple_expr_type",
"(",
"def_stmt",
")",
",",
"gimple_assign_rhs1",
"(",
"def_stmt",
")",
",",
"gimple_assign_rhs2",
"(",
"def_stmt",
")",
")",
";",
"break",
";",
"case",
"tcc_exceptional",
":",
"if",
"(",
"code",
"==",
"CONSTRUCTOR",
"&&",
"TREE_CODE",
"(",
"TREE_TYPE",
"(",
"gimple_assign_rhs1",
"(",
"def_stmt",
")",
")",
")",
"==",
"VECTOR_TYPE",
")",
"expr",
"=",
"gimple_assign_rhs1",
"(",
"def_stmt",
")",
";",
"break",
";",
"default",
":",
";",
"}",
"if",
"(",
"expr",
"==",
"NULL_TREE",
")",
"return",
"vn",
"->",
"valnum",
";",
"vn",
"->",
"expr",
"=",
"expr",
";",
"return",
"expr",
";",
"}"
] | Get the representative expression for the SSA_NAME NAME. | [
"Get",
"the",
"representative",
"expression",
"for",
"the",
"SSA_NAME",
"NAME",
"."
] | [
"/* If the value-number is a constant it is the representative\n expression. */",
"/* Get to the information of the value of this SSA_NAME. */",
"/* If the value-number is a constant it is the representative\n expression. */",
"/* Else if we have an expression, return it. */",
"/* Otherwise use the defining statement to build the expression. */",
"/* If the value number is not an assignment use it directly. */",
"/* FIXME tuples. This is incomplete and likely will miss some\n simplifications. */",
"/* Cache the expression. */"
] | [
{
"param": "name",
"type": "tree"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "name",
"type": "tree",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e4dc14434d6cf8445323db81d832877f4f0f30b | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | [
"BSD-3-Clause"
] | C | free_phi | void | static void
free_phi (void *vp)
{
vn_phi_t phi = (vn_phi_t) vp;
VEC_free (tree, heap, phi->phiargs);
} | /* Free a phi operation structure VP. */ | Free a phi operation structure VP. | [
"Free",
"a",
"phi",
"operation",
"structure",
"VP",
"."
] | static void
free_phi (void *vp)
{
vn_phi_t phi = (vn_phi_t) vp;
VEC_free (tree, heap, phi->phiargs);
} | [
"static",
"void",
"free_phi",
"(",
"void",
"*",
"vp",
")",
"{",
"vn_phi_t",
"phi",
"=",
"(",
"vn_phi_t",
")",
"vp",
";",
"VEC_free",
"(",
"tree",
",",
"heap",
",",
"phi",
"->",
"phiargs",
")",
";",
"}"
] | Free a phi operation structure VP. | [
"Free",
"a",
"phi",
"operation",
"structure",
"VP",
"."
] | [] | [
{
"param": "vp",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "vp",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e4dc14434d6cf8445323db81d832877f4f0f30b | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | [
"BSD-3-Clause"
] | C | free_reference | void | static void
free_reference (void *vp)
{
vn_reference_t vr = (vn_reference_t) vp;
VEC_free (vn_reference_op_s, heap, vr->operands);
} | /* Free a reference operation structure VP. */ | Free a reference operation structure VP. | [
"Free",
"a",
"reference",
"operation",
"structure",
"VP",
"."
] | static void
free_reference (void *vp)
{
vn_reference_t vr = (vn_reference_t) vp;
VEC_free (vn_reference_op_s, heap, vr->operands);
} | [
"static",
"void",
"free_reference",
"(",
"void",
"*",
"vp",
")",
"{",
"vn_reference_t",
"vr",
"=",
"(",
"vn_reference_t",
")",
"vp",
";",
"VEC_free",
"(",
"vn_reference_op_s",
",",
"heap",
",",
"vr",
"->",
"operands",
")",
";",
"}"
] | Free a reference operation structure VP. | [
"Free",
"a",
"reference",
"operation",
"structure",
"VP",
"."
] | [] | [
{
"param": "vp",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "vp",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e4dc14434d6cf8445323db81d832877f4f0f30b | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | [
"BSD-3-Clause"
] | C | vn_constant_eq | int | static int
vn_constant_eq (const void *p1, const void *p2)
{
const struct vn_constant_s *vc1 = (const struct vn_constant_s *) p1;
const struct vn_constant_s *vc2 = (const struct vn_constant_s *) p2;
if (vc1->hashcode != vc2->hashcode)
return false;
return vn_constant_eq_with_type (vc1->constant, vc2->constant);
} | /* Hash table equality function for vn_constant_t. */ | Hash table equality function for vn_constant_t. | [
"Hash",
"table",
"equality",
"function",
"for",
"vn_constant_t",
"."
] | static int
vn_constant_eq (const void *p1, const void *p2)
{
const struct vn_constant_s *vc1 = (const struct vn_constant_s *) p1;
const struct vn_constant_s *vc2 = (const struct vn_constant_s *) p2;
if (vc1->hashcode != vc2->hashcode)
return false;
return vn_constant_eq_with_type (vc1->constant, vc2->constant);
} | [
"static",
"int",
"vn_constant_eq",
"(",
"const",
"void",
"*",
"p1",
",",
"const",
"void",
"*",
"p2",
")",
"{",
"const",
"struct",
"vn_constant_s",
"*",
"vc1",
"=",
"(",
"const",
"struct",
"vn_constant_s",
"*",
")",
"p1",
";",
"const",
"struct",
"vn_constant_s",
"*",
"vc2",
"=",
"(",
"const",
"struct",
"vn_constant_s",
"*",
")",
"p2",
";",
"if",
"(",
"vc1",
"->",
"hashcode",
"!=",
"vc2",
"->",
"hashcode",
")",
"return",
"false",
";",
"return",
"vn_constant_eq_with_type",
"(",
"vc1",
"->",
"constant",
",",
"vc2",
"->",
"constant",
")",
";",
"}"
] | Hash table equality function for vn_constant_t. | [
"Hash",
"table",
"equality",
"function",
"for",
"vn_constant_t",
"."
] | [] | [
{
"param": "p1",
"type": "void"
},
{
"param": "p2",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "p1",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "p2",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e4dc14434d6cf8445323db81d832877f4f0f30b | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | [
"BSD-3-Clause"
] | C | vn_constant_hash | hashval_t | static hashval_t
vn_constant_hash (const void *p1)
{
const struct vn_constant_s *vc1 = (const struct vn_constant_s *) p1;
return vc1->hashcode;
} | /* Hash table hash function for vn_constant_t. */ | Hash table hash function for vn_constant_t. | [
"Hash",
"table",
"hash",
"function",
"for",
"vn_constant_t",
"."
] | static hashval_t
vn_constant_hash (const void *p1)
{
const struct vn_constant_s *vc1 = (const struct vn_constant_s *) p1;
return vc1->hashcode;
} | [
"static",
"hashval_t",
"vn_constant_hash",
"(",
"const",
"void",
"*",
"p1",
")",
"{",
"const",
"struct",
"vn_constant_s",
"*",
"vc1",
"=",
"(",
"const",
"struct",
"vn_constant_s",
"*",
")",
"p1",
";",
"return",
"vc1",
"->",
"hashcode",
";",
"}"
] | Hash table hash function for vn_constant_t. | [
"Hash",
"table",
"hash",
"function",
"for",
"vn_constant_t",
"."
] | [] | [
{
"param": "p1",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "p1",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e4dc14434d6cf8445323db81d832877f4f0f30b | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | [
"BSD-3-Clause"
] | C | value_id_constant_p | bool | bool
value_id_constant_p (unsigned int v)
{
return bitmap_bit_p (constant_value_ids, v);
} | /* Return true if V is a value id for a constant. */ | Return true if V is a value id for a constant. | [
"Return",
"true",
"if",
"V",
"is",
"a",
"value",
"id",
"for",
"a",
"constant",
"."
] | bool
value_id_constant_p (unsigned int v)
{
return bitmap_bit_p (constant_value_ids, v);
} | [
"bool",
"value_id_constant_p",
"(",
"unsigned",
"int",
"v",
")",
"{",
"return",
"bitmap_bit_p",
"(",
"constant_value_ids",
",",
"v",
")",
";",
"}"
] | Return true if V is a value id for a constant. | [
"Return",
"true",
"if",
"V",
"is",
"a",
"value",
"id",
"for",
"a",
"constant",
"."
] | [] | [
{
"param": "v",
"type": "unsigned int"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "v",
"type": "unsigned int",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e4dc14434d6cf8445323db81d832877f4f0f30b | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | [
"BSD-3-Clause"
] | C | vn_reference_op_eq | int | static int
vn_reference_op_eq (const void *p1, const void *p2)
{
const_vn_reference_op_t const vro1 = (const_vn_reference_op_t) p1;
const_vn_reference_op_t const vro2 = (const_vn_reference_op_t) p2;
return (vro1->opcode == vro2->opcode
/* We do not care for differences in type qualification. */
&& (vro1->type == vro2->type
|| (vro1->type && vro2->type
&& types_compatible_p (TYPE_MAIN_VARIANT (vro1->type),
TYPE_MAIN_VARIANT (vro2->type))))
&& expressions_equal_p (vro1->op0, vro2->op0)
&& expressions_equal_p (vro1->op1, vro2->op1)
&& expressions_equal_p (vro1->op2, vro2->op2));
} | /* Compare two reference operands P1 and P2 for equality. Return true if
they are equal, and false otherwise. */ | Compare two reference operands P1 and P2 for equality. Return true if
they are equal, and false otherwise. | [
"Compare",
"two",
"reference",
"operands",
"P1",
"and",
"P2",
"for",
"equality",
".",
"Return",
"true",
"if",
"they",
"are",
"equal",
"and",
"false",
"otherwise",
"."
] | static int
vn_reference_op_eq (const void *p1, const void *p2)
{
const_vn_reference_op_t const vro1 = (const_vn_reference_op_t) p1;
const_vn_reference_op_t const vro2 = (const_vn_reference_op_t) p2;
return (vro1->opcode == vro2->opcode
&& (vro1->type == vro2->type
|| (vro1->type && vro2->type
&& types_compatible_p (TYPE_MAIN_VARIANT (vro1->type),
TYPE_MAIN_VARIANT (vro2->type))))
&& expressions_equal_p (vro1->op0, vro2->op0)
&& expressions_equal_p (vro1->op1, vro2->op1)
&& expressions_equal_p (vro1->op2, vro2->op2));
} | [
"static",
"int",
"vn_reference_op_eq",
"(",
"const",
"void",
"*",
"p1",
",",
"const",
"void",
"*",
"p2",
")",
"{",
"const_vn_reference_op_t",
"const",
"vro1",
"=",
"(",
"const_vn_reference_op_t",
")",
"p1",
";",
"const_vn_reference_op_t",
"const",
"vro2",
"=",
"(",
"const_vn_reference_op_t",
")",
"p2",
";",
"return",
"(",
"vro1",
"->",
"opcode",
"==",
"vro2",
"->",
"opcode",
"&&",
"(",
"vro1",
"->",
"type",
"==",
"vro2",
"->",
"type",
"||",
"(",
"vro1",
"->",
"type",
"&&",
"vro2",
"->",
"type",
"&&",
"types_compatible_p",
"(",
"TYPE_MAIN_VARIANT",
"(",
"vro1",
"->",
"type",
")",
",",
"TYPE_MAIN_VARIANT",
"(",
"vro2",
"->",
"type",
")",
")",
")",
")",
"&&",
"expressions_equal_p",
"(",
"vro1",
"->",
"op0",
",",
"vro2",
"->",
"op0",
")",
"&&",
"expressions_equal_p",
"(",
"vro1",
"->",
"op1",
",",
"vro2",
"->",
"op1",
")",
"&&",
"expressions_equal_p",
"(",
"vro1",
"->",
"op2",
",",
"vro2",
"->",
"op2",
")",
")",
";",
"}"
] | Compare two reference operands P1 and P2 for equality. | [
"Compare",
"two",
"reference",
"operands",
"P1",
"and",
"P2",
"for",
"equality",
"."
] | [
"/* We do not care for differences in type qualification. */"
] | [
{
"param": "p1",
"type": "void"
},
{
"param": "p2",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "p1",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "p2",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e4dc14434d6cf8445323db81d832877f4f0f30b | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | [
"BSD-3-Clause"
] | C | vn_reference_op_compute_hash | hashval_t | static hashval_t
vn_reference_op_compute_hash (const vn_reference_op_t vro1, hashval_t result)
{
result = iterative_hash_hashval_t (vro1->opcode, result);
if (vro1->op0)
result = iterative_hash_expr (vro1->op0, result);
if (vro1->op1)
result = iterative_hash_expr (vro1->op1, result);
if (vro1->op2)
result = iterative_hash_expr (vro1->op2, result);
return result;
} | /* Compute the hash for a reference operand VRO1. */ | Compute the hash for a reference operand VRO1. | [
"Compute",
"the",
"hash",
"for",
"a",
"reference",
"operand",
"VRO1",
"."
] | static hashval_t
vn_reference_op_compute_hash (const vn_reference_op_t vro1, hashval_t result)
{
result = iterative_hash_hashval_t (vro1->opcode, result);
if (vro1->op0)
result = iterative_hash_expr (vro1->op0, result);
if (vro1->op1)
result = iterative_hash_expr (vro1->op1, result);
if (vro1->op2)
result = iterative_hash_expr (vro1->op2, result);
return result;
} | [
"static",
"hashval_t",
"vn_reference_op_compute_hash",
"(",
"const",
"vn_reference_op_t",
"vro1",
",",
"hashval_t",
"result",
")",
"{",
"result",
"=",
"iterative_hash_hashval_t",
"(",
"vro1",
"->",
"opcode",
",",
"result",
")",
";",
"if",
"(",
"vro1",
"->",
"op0",
")",
"result",
"=",
"iterative_hash_expr",
"(",
"vro1",
"->",
"op0",
",",
"result",
")",
";",
"if",
"(",
"vro1",
"->",
"op1",
")",
"result",
"=",
"iterative_hash_expr",
"(",
"vro1",
"->",
"op1",
",",
"result",
")",
";",
"if",
"(",
"vro1",
"->",
"op2",
")",
"result",
"=",
"iterative_hash_expr",
"(",
"vro1",
"->",
"op2",
",",
"result",
")",
";",
"return",
"result",
";",
"}"
] | Compute the hash for a reference operand VRO1. | [
"Compute",
"the",
"hash",
"for",
"a",
"reference",
"operand",
"VRO1",
"."
] | [] | [
{
"param": "vro1",
"type": "vn_reference_op_t"
},
{
"param": "result",
"type": "hashval_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "vro1",
"type": "vn_reference_op_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "result",
"type": "hashval_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e4dc14434d6cf8445323db81d832877f4f0f30b | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | [
"BSD-3-Clause"
] | C | vn_reference_hash | hashval_t | static hashval_t
vn_reference_hash (const void *p1)
{
const_vn_reference_t const vr1 = (const_vn_reference_t) p1;
return vr1->hashcode;
} | /* Return the hashcode for a given reference operation P1. */ | Return the hashcode for a given reference operation P1. | [
"Return",
"the",
"hashcode",
"for",
"a",
"given",
"reference",
"operation",
"P1",
"."
] | static hashval_t
vn_reference_hash (const void *p1)
{
const_vn_reference_t const vr1 = (const_vn_reference_t) p1;
return vr1->hashcode;
} | [
"static",
"hashval_t",
"vn_reference_hash",
"(",
"const",
"void",
"*",
"p1",
")",
"{",
"const_vn_reference_t",
"const",
"vr1",
"=",
"(",
"const_vn_reference_t",
")",
"p1",
";",
"return",
"vr1",
"->",
"hashcode",
";",
"}"
] | Return the hashcode for a given reference operation P1. | [
"Return",
"the",
"hashcode",
"for",
"a",
"given",
"reference",
"operation",
"P1",
"."
] | [] | [
{
"param": "p1",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "p1",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e4dc14434d6cf8445323db81d832877f4f0f30b | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | [
"BSD-3-Clause"
] | C | vn_reference_compute_hash | hashval_t | hashval_t
vn_reference_compute_hash (const vn_reference_t vr1)
{
hashval_t result = 0;
int i;
vn_reference_op_t vro;
HOST_WIDE_INT off = -1;
bool deref = false;
FOR_EACH_VEC_ELT (vn_reference_op_s, vr1->operands, i, vro)
{
if (vro->opcode == MEM_REF)
deref = true;
else if (vro->opcode != ADDR_EXPR)
deref = false;
if (vro->off != -1)
{
if (off == -1)
off = 0;
off += vro->off;
}
else
{
if (off != -1
&& off != 0)
result = iterative_hash_hashval_t (off, result);
off = -1;
if (deref
&& vro->opcode == ADDR_EXPR)
{
if (vro->op0)
{
tree op = TREE_OPERAND (vro->op0, 0);
result = iterative_hash_hashval_t (TREE_CODE (op), result);
result = iterative_hash_expr (op, result);
}
}
else
result = vn_reference_op_compute_hash (vro, result);
}
}
if (vr1->vuse)
result += SSA_NAME_VERSION (vr1->vuse);
return result;
} | /* Compute a hash for the reference operation VR1 and return it. */ | Compute a hash for the reference operation VR1 and return it. | [
"Compute",
"a",
"hash",
"for",
"the",
"reference",
"operation",
"VR1",
"and",
"return",
"it",
"."
] | hashval_t
vn_reference_compute_hash (const vn_reference_t vr1)
{
hashval_t result = 0;
int i;
vn_reference_op_t vro;
HOST_WIDE_INT off = -1;
bool deref = false;
FOR_EACH_VEC_ELT (vn_reference_op_s, vr1->operands, i, vro)
{
if (vro->opcode == MEM_REF)
deref = true;
else if (vro->opcode != ADDR_EXPR)
deref = false;
if (vro->off != -1)
{
if (off == -1)
off = 0;
off += vro->off;
}
else
{
if (off != -1
&& off != 0)
result = iterative_hash_hashval_t (off, result);
off = -1;
if (deref
&& vro->opcode == ADDR_EXPR)
{
if (vro->op0)
{
tree op = TREE_OPERAND (vro->op0, 0);
result = iterative_hash_hashval_t (TREE_CODE (op), result);
result = iterative_hash_expr (op, result);
}
}
else
result = vn_reference_op_compute_hash (vro, result);
}
}
if (vr1->vuse)
result += SSA_NAME_VERSION (vr1->vuse);
return result;
} | [
"hashval_t",
"vn_reference_compute_hash",
"(",
"const",
"vn_reference_t",
"vr1",
")",
"{",
"hashval_t",
"result",
"=",
"0",
";",
"int",
"i",
";",
"vn_reference_op_t",
"vro",
";",
"HOST_WIDE_INT",
"off",
"=",
"-1",
";",
"bool",
"deref",
"=",
"false",
";",
"FOR_EACH_VEC_ELT",
"(",
"vn_reference_op_s",
",",
"vr1",
"->",
"operands",
",",
"i",
",",
"vro",
")",
"",
"{",
"if",
"(",
"vro",
"->",
"opcode",
"==",
"MEM_REF",
")",
"deref",
"=",
"true",
";",
"else",
"if",
"(",
"vro",
"->",
"opcode",
"!=",
"ADDR_EXPR",
")",
"deref",
"=",
"false",
";",
"if",
"(",
"vro",
"->",
"off",
"!=",
"-1",
")",
"{",
"if",
"(",
"off",
"==",
"-1",
")",
"off",
"=",
"0",
";",
"off",
"+=",
"vro",
"->",
"off",
";",
"}",
"else",
"{",
"if",
"(",
"off",
"!=",
"-1",
"&&",
"off",
"!=",
"0",
")",
"result",
"=",
"iterative_hash_hashval_t",
"(",
"off",
",",
"result",
")",
";",
"off",
"=",
"-1",
";",
"if",
"(",
"deref",
"&&",
"vro",
"->",
"opcode",
"==",
"ADDR_EXPR",
")",
"{",
"if",
"(",
"vro",
"->",
"op0",
")",
"{",
"tree",
"op",
"=",
"TREE_OPERAND",
"(",
"vro",
"->",
"op0",
",",
"0",
")",
";",
"result",
"=",
"iterative_hash_hashval_t",
"(",
"TREE_CODE",
"(",
"op",
")",
",",
"result",
")",
";",
"result",
"=",
"iterative_hash_expr",
"(",
"op",
",",
"result",
")",
";",
"}",
"}",
"else",
"result",
"=",
"vn_reference_op_compute_hash",
"(",
"vro",
",",
"result",
")",
";",
"}",
"}",
"if",
"(",
"vr1",
"->",
"vuse",
")",
"result",
"+=",
"SSA_NAME_VERSION",
"(",
"vr1",
"->",
"vuse",
")",
";",
"return",
"result",
";",
"}"
] | Compute a hash for the reference operation VR1 and return it. | [
"Compute",
"a",
"hash",
"for",
"the",
"reference",
"operation",
"VR1",
"and",
"return",
"it",
"."
] | [] | [
{
"param": "vr1",
"type": "vn_reference_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "vr1",
"type": "vn_reference_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e4dc14434d6cf8445323db81d832877f4f0f30b | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | [
"BSD-3-Clause"
] | C | vn_reference_eq | int | int
vn_reference_eq (const void *p1, const void *p2)
{
unsigned i, j;
const_vn_reference_t const vr1 = (const_vn_reference_t) p1;
const_vn_reference_t const vr2 = (const_vn_reference_t) p2;
if (vr1->hashcode != vr2->hashcode)
return false;
/* Early out if this is not a hash collision. */
if (vr1->hashcode != vr2->hashcode)
return false;
/* The VOP needs to be the same. */
if (vr1->vuse != vr2->vuse)
return false;
/* If the operands are the same we are done. */
if (vr1->operands == vr2->operands)
return true;
if (!expressions_equal_p (TYPE_SIZE (vr1->type), TYPE_SIZE (vr2->type)))
return false;
if (INTEGRAL_TYPE_P (vr1->type)
&& INTEGRAL_TYPE_P (vr2->type))
{
if (TYPE_PRECISION (vr1->type) != TYPE_PRECISION (vr2->type))
return false;
}
else if (INTEGRAL_TYPE_P (vr1->type)
&& (TYPE_PRECISION (vr1->type)
!= TREE_INT_CST_LOW (TYPE_SIZE (vr1->type))))
return false;
else if (INTEGRAL_TYPE_P (vr2->type)
&& (TYPE_PRECISION (vr2->type)
!= TREE_INT_CST_LOW (TYPE_SIZE (vr2->type))))
return false;
i = 0;
j = 0;
do
{
HOST_WIDE_INT off1 = 0, off2 = 0;
vn_reference_op_t vro1, vro2;
vn_reference_op_s tem1, tem2;
bool deref1 = false, deref2 = false;
for (; VEC_iterate (vn_reference_op_s, vr1->operands, i, vro1); i++)
{
if (vro1->opcode == MEM_REF)
deref1 = true;
if (vro1->off == -1)
break;
off1 += vro1->off;
}
for (; VEC_iterate (vn_reference_op_s, vr2->operands, j, vro2); j++)
{
if (vro2->opcode == MEM_REF)
deref2 = true;
if (vro2->off == -1)
break;
off2 += vro2->off;
}
if (off1 != off2)
return false;
if (deref1 && vro1->opcode == ADDR_EXPR)
{
memset (&tem1, 0, sizeof (tem1));
tem1.op0 = TREE_OPERAND (vro1->op0, 0);
tem1.type = TREE_TYPE (tem1.op0);
tem1.opcode = TREE_CODE (tem1.op0);
vro1 = &tem1;
deref1 = false;
}
if (deref2 && vro2->opcode == ADDR_EXPR)
{
memset (&tem2, 0, sizeof (tem2));
tem2.op0 = TREE_OPERAND (vro2->op0, 0);
tem2.type = TREE_TYPE (tem2.op0);
tem2.opcode = TREE_CODE (tem2.op0);
vro2 = &tem2;
deref2 = false;
}
if (deref1 != deref2)
return false;
if (!vn_reference_op_eq (vro1, vro2))
return false;
++j;
++i;
}
while (VEC_length (vn_reference_op_s, vr1->operands) != i
|| VEC_length (vn_reference_op_s, vr2->operands) != j);
return true;
} | /* Return true if reference operations P1 and P2 are equivalent. This
means they have the same set of operands and vuses. */ | Return true if reference operations P1 and P2 are equivalent. This
means they have the same set of operands and vuses. | [
"Return",
"true",
"if",
"reference",
"operations",
"P1",
"and",
"P2",
"are",
"equivalent",
".",
"This",
"means",
"they",
"have",
"the",
"same",
"set",
"of",
"operands",
"and",
"vuses",
"."
] | int
vn_reference_eq (const void *p1, const void *p2)
{
unsigned i, j;
const_vn_reference_t const vr1 = (const_vn_reference_t) p1;
const_vn_reference_t const vr2 = (const_vn_reference_t) p2;
if (vr1->hashcode != vr2->hashcode)
return false;
if (vr1->hashcode != vr2->hashcode)
return false;
if (vr1->vuse != vr2->vuse)
return false;
if (vr1->operands == vr2->operands)
return true;
if (!expressions_equal_p (TYPE_SIZE (vr1->type), TYPE_SIZE (vr2->type)))
return false;
if (INTEGRAL_TYPE_P (vr1->type)
&& INTEGRAL_TYPE_P (vr2->type))
{
if (TYPE_PRECISION (vr1->type) != TYPE_PRECISION (vr2->type))
return false;
}
else if (INTEGRAL_TYPE_P (vr1->type)
&& (TYPE_PRECISION (vr1->type)
!= TREE_INT_CST_LOW (TYPE_SIZE (vr1->type))))
return false;
else if (INTEGRAL_TYPE_P (vr2->type)
&& (TYPE_PRECISION (vr2->type)
!= TREE_INT_CST_LOW (TYPE_SIZE (vr2->type))))
return false;
i = 0;
j = 0;
do
{
HOST_WIDE_INT off1 = 0, off2 = 0;
vn_reference_op_t vro1, vro2;
vn_reference_op_s tem1, tem2;
bool deref1 = false, deref2 = false;
for (; VEC_iterate (vn_reference_op_s, vr1->operands, i, vro1); i++)
{
if (vro1->opcode == MEM_REF)
deref1 = true;
if (vro1->off == -1)
break;
off1 += vro1->off;
}
for (; VEC_iterate (vn_reference_op_s, vr2->operands, j, vro2); j++)
{
if (vro2->opcode == MEM_REF)
deref2 = true;
if (vro2->off == -1)
break;
off2 += vro2->off;
}
if (off1 != off2)
return false;
if (deref1 && vro1->opcode == ADDR_EXPR)
{
memset (&tem1, 0, sizeof (tem1));
tem1.op0 = TREE_OPERAND (vro1->op0, 0);
tem1.type = TREE_TYPE (tem1.op0);
tem1.opcode = TREE_CODE (tem1.op0);
vro1 = &tem1;
deref1 = false;
}
if (deref2 && vro2->opcode == ADDR_EXPR)
{
memset (&tem2, 0, sizeof (tem2));
tem2.op0 = TREE_OPERAND (vro2->op0, 0);
tem2.type = TREE_TYPE (tem2.op0);
tem2.opcode = TREE_CODE (tem2.op0);
vro2 = &tem2;
deref2 = false;
}
if (deref1 != deref2)
return false;
if (!vn_reference_op_eq (vro1, vro2))
return false;
++j;
++i;
}
while (VEC_length (vn_reference_op_s, vr1->operands) != i
|| VEC_length (vn_reference_op_s, vr2->operands) != j);
return true;
} | [
"int",
"vn_reference_eq",
"(",
"const",
"void",
"*",
"p1",
",",
"const",
"void",
"*",
"p2",
")",
"{",
"unsigned",
"i",
",",
"j",
";",
"const_vn_reference_t",
"const",
"vr1",
"=",
"(",
"const_vn_reference_t",
")",
"p1",
";",
"const_vn_reference_t",
"const",
"vr2",
"=",
"(",
"const_vn_reference_t",
")",
"p2",
";",
"if",
"(",
"vr1",
"->",
"hashcode",
"!=",
"vr2",
"->",
"hashcode",
")",
"return",
"false",
";",
"if",
"(",
"vr1",
"->",
"hashcode",
"!=",
"vr2",
"->",
"hashcode",
")",
"return",
"false",
";",
"if",
"(",
"vr1",
"->",
"vuse",
"!=",
"vr2",
"->",
"vuse",
")",
"return",
"false",
";",
"if",
"(",
"vr1",
"->",
"operands",
"==",
"vr2",
"->",
"operands",
")",
"return",
"true",
";",
"if",
"(",
"!",
"expressions_equal_p",
"(",
"TYPE_SIZE",
"(",
"vr1",
"->",
"type",
")",
",",
"TYPE_SIZE",
"(",
"vr2",
"->",
"type",
")",
")",
")",
"return",
"false",
";",
"if",
"(",
"INTEGRAL_TYPE_P",
"(",
"vr1",
"->",
"type",
")",
"&&",
"INTEGRAL_TYPE_P",
"(",
"vr2",
"->",
"type",
")",
")",
"{",
"if",
"(",
"TYPE_PRECISION",
"(",
"vr1",
"->",
"type",
")",
"!=",
"TYPE_PRECISION",
"(",
"vr2",
"->",
"type",
")",
")",
"return",
"false",
";",
"}",
"else",
"if",
"(",
"INTEGRAL_TYPE_P",
"(",
"vr1",
"->",
"type",
")",
"&&",
"(",
"TYPE_PRECISION",
"(",
"vr1",
"->",
"type",
")",
"!=",
"TREE_INT_CST_LOW",
"(",
"TYPE_SIZE",
"(",
"vr1",
"->",
"type",
")",
")",
")",
")",
"return",
"false",
";",
"else",
"if",
"(",
"INTEGRAL_TYPE_P",
"(",
"vr2",
"->",
"type",
")",
"&&",
"(",
"TYPE_PRECISION",
"(",
"vr2",
"->",
"type",
")",
"!=",
"TREE_INT_CST_LOW",
"(",
"TYPE_SIZE",
"(",
"vr2",
"->",
"type",
")",
")",
")",
")",
"return",
"false",
";",
"i",
"=",
"0",
";",
"j",
"=",
"0",
";",
"do",
"{",
"HOST_WIDE_INT",
"off1",
"=",
"0",
",",
"off2",
"=",
"0",
";",
"vn_reference_op_t",
"vro1",
",",
"vro2",
";",
"vn_reference_op_s",
"tem1",
",",
"tem2",
";",
"bool",
"deref1",
"=",
"false",
",",
"deref2",
"=",
"false",
";",
"for",
"(",
";",
"VEC_iterate",
"(",
"vn_reference_op_s",
",",
"vr1",
"->",
"operands",
",",
"i",
",",
"vro1",
")",
";",
"i",
"++",
")",
"{",
"if",
"(",
"vro1",
"->",
"opcode",
"==",
"MEM_REF",
")",
"deref1",
"=",
"true",
";",
"if",
"(",
"vro1",
"->",
"off",
"==",
"-1",
")",
"break",
";",
"off1",
"+=",
"vro1",
"->",
"off",
";",
"}",
"for",
"(",
";",
"VEC_iterate",
"(",
"vn_reference_op_s",
",",
"vr2",
"->",
"operands",
",",
"j",
",",
"vro2",
")",
";",
"j",
"++",
")",
"{",
"if",
"(",
"vro2",
"->",
"opcode",
"==",
"MEM_REF",
")",
"deref2",
"=",
"true",
";",
"if",
"(",
"vro2",
"->",
"off",
"==",
"-1",
")",
"break",
";",
"off2",
"+=",
"vro2",
"->",
"off",
";",
"}",
"if",
"(",
"off1",
"!=",
"off2",
")",
"return",
"false",
";",
"if",
"(",
"deref1",
"&&",
"vro1",
"->",
"opcode",
"==",
"ADDR_EXPR",
")",
"{",
"memset",
"(",
"&",
"tem1",
",",
"0",
",",
"sizeof",
"(",
"tem1",
")",
")",
";",
"tem1",
".",
"op0",
"=",
"TREE_OPERAND",
"(",
"vro1",
"->",
"op0",
",",
"0",
")",
";",
"tem1",
".",
"type",
"=",
"TREE_TYPE",
"(",
"tem1",
".",
"op0",
")",
";",
"tem1",
".",
"opcode",
"=",
"TREE_CODE",
"(",
"tem1",
".",
"op0",
")",
";",
"vro1",
"=",
"&",
"tem1",
";",
"deref1",
"=",
"false",
";",
"}",
"if",
"(",
"deref2",
"&&",
"vro2",
"->",
"opcode",
"==",
"ADDR_EXPR",
")",
"{",
"memset",
"(",
"&",
"tem2",
",",
"0",
",",
"sizeof",
"(",
"tem2",
")",
")",
";",
"tem2",
".",
"op0",
"=",
"TREE_OPERAND",
"(",
"vro2",
"->",
"op0",
",",
"0",
")",
";",
"tem2",
".",
"type",
"=",
"TREE_TYPE",
"(",
"tem2",
".",
"op0",
")",
";",
"tem2",
".",
"opcode",
"=",
"TREE_CODE",
"(",
"tem2",
".",
"op0",
")",
";",
"vro2",
"=",
"&",
"tem2",
";",
"deref2",
"=",
"false",
";",
"}",
"if",
"(",
"deref1",
"!=",
"deref2",
")",
"return",
"false",
";",
"if",
"(",
"!",
"vn_reference_op_eq",
"(",
"vro1",
",",
"vro2",
")",
")",
"return",
"false",
";",
"++",
"j",
";",
"++",
"i",
";",
"}",
"while",
"(",
"VEC_length",
"(",
"vn_reference_op_s",
",",
"vr1",
"->",
"operands",
")",
"!=",
"i",
"||",
"VEC_length",
"(",
"vn_reference_op_s",
",",
"vr2",
"->",
"operands",
")",
"!=",
"j",
")",
";",
"return",
"true",
";",
"}"
] | Return true if reference operations P1 and P2 are equivalent. | [
"Return",
"true",
"if",
"reference",
"operations",
"P1",
"and",
"P2",
"are",
"equivalent",
"."
] | [
"/* Early out if this is not a hash collision. */",
"/* The VOP needs to be the same. */",
"/* If the operands are the same we are done. */"
] | [
{
"param": "p1",
"type": "void"
},
{
"param": "p2",
"type": "void"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "p1",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "p2",
"type": "void",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e4dc14434d6cf8445323db81d832877f4f0f30b | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | [
"BSD-3-Clause"
] | C | fully_constant_vn_reference_p | tree | tree
fully_constant_vn_reference_p (vn_reference_t ref)
{
VEC (vn_reference_op_s, heap) *operands = ref->operands;
vn_reference_op_t op;
/* Try to simplify the translated expression if it is
a call to a builtin function with at most two arguments. */
op = VEC_index (vn_reference_op_s, operands, 0);
if (op->opcode == CALL_EXPR
&& TREE_CODE (op->op0) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (op->op0, 0)) == FUNCTION_DECL
&& DECL_BUILT_IN (TREE_OPERAND (op->op0, 0))
&& VEC_length (vn_reference_op_s, operands) >= 2
&& VEC_length (vn_reference_op_s, operands) <= 3)
{
vn_reference_op_t arg0, arg1 = NULL;
bool anyconst = false;
arg0 = VEC_index (vn_reference_op_s, operands, 1);
if (VEC_length (vn_reference_op_s, operands) > 2)
arg1 = VEC_index (vn_reference_op_s, operands, 2);
if (TREE_CODE_CLASS (arg0->opcode) == tcc_constant
|| (arg0->opcode == ADDR_EXPR
&& is_gimple_min_invariant (arg0->op0)))
anyconst = true;
if (arg1
&& (TREE_CODE_CLASS (arg1->opcode) == tcc_constant
|| (arg1->opcode == ADDR_EXPR
&& is_gimple_min_invariant (arg1->op0))))
anyconst = true;
if (anyconst)
{
tree folded = build_call_expr (TREE_OPERAND (op->op0, 0),
arg1 ? 2 : 1,
arg0->op0,
arg1 ? arg1->op0 : NULL);
if (folded
&& TREE_CODE (folded) == NOP_EXPR)
folded = TREE_OPERAND (folded, 0);
if (folded
&& is_gimple_min_invariant (folded))
return folded;
}
}
/* Simplify reads from constant strings. */
else if (op->opcode == ARRAY_REF
&& TREE_CODE (op->op0) == INTEGER_CST
&& integer_zerop (op->op1)
&& VEC_length (vn_reference_op_s, operands) == 2)
{
vn_reference_op_t arg0;
arg0 = VEC_index (vn_reference_op_s, operands, 1);
if (arg0->opcode == STRING_CST
&& (TYPE_MODE (op->type)
== TYPE_MODE (TREE_TYPE (TREE_TYPE (arg0->op0))))
&& GET_MODE_CLASS (TYPE_MODE (op->type)) == MODE_INT
&& GET_MODE_SIZE (TYPE_MODE (op->type)) == 1
&& compare_tree_int (op->op0, TREE_STRING_LENGTH (arg0->op0)) < 0)
return build_int_cst_type (op->type,
(TREE_STRING_POINTER (arg0->op0)
[TREE_INT_CST_LOW (op->op0)]));
}
return NULL_TREE;
} | /* Optimize the reference REF to a constant if possible or return
NULL_TREE if not. */ | Optimize the reference REF to a constant if possible or return
NULL_TREE if not. | [
"Optimize",
"the",
"reference",
"REF",
"to",
"a",
"constant",
"if",
"possible",
"or",
"return",
"NULL_TREE",
"if",
"not",
"."
] | tree
fully_constant_vn_reference_p (vn_reference_t ref)
{
VEC (vn_reference_op_s, heap) *operands = ref->operands;
vn_reference_op_t op;
op = VEC_index (vn_reference_op_s, operands, 0);
if (op->opcode == CALL_EXPR
&& TREE_CODE (op->op0) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (op->op0, 0)) == FUNCTION_DECL
&& DECL_BUILT_IN (TREE_OPERAND (op->op0, 0))
&& VEC_length (vn_reference_op_s, operands) >= 2
&& VEC_length (vn_reference_op_s, operands) <= 3)
{
vn_reference_op_t arg0, arg1 = NULL;
bool anyconst = false;
arg0 = VEC_index (vn_reference_op_s, operands, 1);
if (VEC_length (vn_reference_op_s, operands) > 2)
arg1 = VEC_index (vn_reference_op_s, operands, 2);
if (TREE_CODE_CLASS (arg0->opcode) == tcc_constant
|| (arg0->opcode == ADDR_EXPR
&& is_gimple_min_invariant (arg0->op0)))
anyconst = true;
if (arg1
&& (TREE_CODE_CLASS (arg1->opcode) == tcc_constant
|| (arg1->opcode == ADDR_EXPR
&& is_gimple_min_invariant (arg1->op0))))
anyconst = true;
if (anyconst)
{
tree folded = build_call_expr (TREE_OPERAND (op->op0, 0),
arg1 ? 2 : 1,
arg0->op0,
arg1 ? arg1->op0 : NULL);
if (folded
&& TREE_CODE (folded) == NOP_EXPR)
folded = TREE_OPERAND (folded, 0);
if (folded
&& is_gimple_min_invariant (folded))
return folded;
}
}
else if (op->opcode == ARRAY_REF
&& TREE_CODE (op->op0) == INTEGER_CST
&& integer_zerop (op->op1)
&& VEC_length (vn_reference_op_s, operands) == 2)
{
vn_reference_op_t arg0;
arg0 = VEC_index (vn_reference_op_s, operands, 1);
if (arg0->opcode == STRING_CST
&& (TYPE_MODE (op->type)
== TYPE_MODE (TREE_TYPE (TREE_TYPE (arg0->op0))))
&& GET_MODE_CLASS (TYPE_MODE (op->type)) == MODE_INT
&& GET_MODE_SIZE (TYPE_MODE (op->type)) == 1
&& compare_tree_int (op->op0, TREE_STRING_LENGTH (arg0->op0)) < 0)
return build_int_cst_type (op->type,
(TREE_STRING_POINTER (arg0->op0)
[TREE_INT_CST_LOW (op->op0)]));
}
return NULL_TREE;
} | [
"tree",
"fully_constant_vn_reference_p",
"(",
"vn_reference_t",
"ref",
")",
"{",
"VEC",
"(",
"vn_reference_op_s",
",",
"heap",
")",
"*",
"operands",
"=",
"ref",
"->",
"operands",
";",
"vn_reference_op_t",
"op",
";",
"op",
"=",
"VEC_index",
"(",
"vn_reference_op_s",
",",
"operands",
",",
"0",
")",
";",
"if",
"(",
"op",
"->",
"opcode",
"==",
"CALL_EXPR",
"&&",
"TREE_CODE",
"(",
"op",
"->",
"op0",
")",
"==",
"ADDR_EXPR",
"&&",
"TREE_CODE",
"(",
"TREE_OPERAND",
"(",
"op",
"->",
"op0",
",",
"0",
")",
")",
"==",
"FUNCTION_DECL",
"&&",
"DECL_BUILT_IN",
"(",
"TREE_OPERAND",
"(",
"op",
"->",
"op0",
",",
"0",
")",
")",
"&&",
"VEC_length",
"(",
"vn_reference_op_s",
",",
"operands",
")",
">=",
"2",
"&&",
"VEC_length",
"(",
"vn_reference_op_s",
",",
"operands",
")",
"<=",
"3",
")",
"{",
"vn_reference_op_t",
"arg0",
",",
"arg1",
"=",
"NULL",
";",
"bool",
"anyconst",
"=",
"false",
";",
"arg0",
"=",
"VEC_index",
"(",
"vn_reference_op_s",
",",
"operands",
",",
"1",
")",
";",
"if",
"(",
"VEC_length",
"(",
"vn_reference_op_s",
",",
"operands",
")",
">",
"2",
")",
"arg1",
"=",
"VEC_index",
"(",
"vn_reference_op_s",
",",
"operands",
",",
"2",
")",
";",
"if",
"(",
"TREE_CODE_CLASS",
"(",
"arg0",
"->",
"opcode",
")",
"==",
"tcc_constant",
"||",
"(",
"arg0",
"->",
"opcode",
"==",
"ADDR_EXPR",
"&&",
"is_gimple_min_invariant",
"(",
"arg0",
"->",
"op0",
")",
")",
")",
"anyconst",
"=",
"true",
";",
"if",
"(",
"arg1",
"&&",
"(",
"TREE_CODE_CLASS",
"(",
"arg1",
"->",
"opcode",
")",
"==",
"tcc_constant",
"||",
"(",
"arg1",
"->",
"opcode",
"==",
"ADDR_EXPR",
"&&",
"is_gimple_min_invariant",
"(",
"arg1",
"->",
"op0",
")",
")",
")",
")",
"anyconst",
"=",
"true",
";",
"if",
"(",
"anyconst",
")",
"{",
"tree",
"folded",
"=",
"build_call_expr",
"(",
"TREE_OPERAND",
"(",
"op",
"->",
"op0",
",",
"0",
")",
",",
"arg1",
"?",
"2",
":",
"1",
",",
"arg0",
"->",
"op0",
",",
"arg1",
"?",
"arg1",
"->",
"op0",
":",
"NULL",
")",
";",
"if",
"(",
"folded",
"&&",
"TREE_CODE",
"(",
"folded",
")",
"==",
"NOP_EXPR",
")",
"folded",
"=",
"TREE_OPERAND",
"(",
"folded",
",",
"0",
")",
";",
"if",
"(",
"folded",
"&&",
"is_gimple_min_invariant",
"(",
"folded",
")",
")",
"return",
"folded",
";",
"}",
"}",
"else",
"if",
"(",
"op",
"->",
"opcode",
"==",
"ARRAY_REF",
"&&",
"TREE_CODE",
"(",
"op",
"->",
"op0",
")",
"==",
"INTEGER_CST",
"&&",
"integer_zerop",
"(",
"op",
"->",
"op1",
")",
"&&",
"VEC_length",
"(",
"vn_reference_op_s",
",",
"operands",
")",
"==",
"2",
")",
"{",
"vn_reference_op_t",
"arg0",
";",
"arg0",
"=",
"VEC_index",
"(",
"vn_reference_op_s",
",",
"operands",
",",
"1",
")",
";",
"if",
"(",
"arg0",
"->",
"opcode",
"==",
"STRING_CST",
"&&",
"(",
"TYPE_MODE",
"(",
"op",
"->",
"type",
")",
"==",
"TYPE_MODE",
"(",
"TREE_TYPE",
"(",
"TREE_TYPE",
"(",
"arg0",
"->",
"op0",
")",
")",
")",
")",
"&&",
"GET_MODE_CLASS",
"(",
"TYPE_MODE",
"(",
"op",
"->",
"type",
")",
")",
"==",
"MODE_INT",
"&&",
"GET_MODE_SIZE",
"(",
"TYPE_MODE",
"(",
"op",
"->",
"type",
")",
")",
"==",
"1",
"&&",
"compare_tree_int",
"(",
"op",
"->",
"op0",
",",
"TREE_STRING_LENGTH",
"(",
"arg0",
"->",
"op0",
")",
")",
"<",
"0",
")",
"return",
"build_int_cst_type",
"(",
"op",
"->",
"type",
",",
"(",
"TREE_STRING_POINTER",
"(",
"arg0",
"->",
"op0",
")",
"[",
"TREE_INT_CST_LOW",
"(",
"op",
"->",
"op0",
")",
"]",
")",
")",
";",
"}",
"return",
"NULL_TREE",
";",
"}"
] | Optimize the reference REF to a constant if possible or return
NULL_TREE if not. | [
"Optimize",
"the",
"reference",
"REF",
"to",
"a",
"constant",
"if",
"possible",
"or",
"return",
"NULL_TREE",
"if",
"not",
"."
] | [
"/* Try to simplify the translated expression if it is\n a call to a builtin function with at most two arguments. */",
"/* Simplify reads from constant strings. */"
] | [
{
"param": "ref",
"type": "vn_reference_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "ref",
"type": "vn_reference_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
1e4dc14434d6cf8445323db81d832877f4f0f30b | atrens/DragonFlyBSD-src | contrib/gcc-4.7/gcc/tree-ssa-sccvn.c | [
"BSD-3-Clause"
] | C | vn_reference_lookup_1 | tree | static tree
vn_reference_lookup_1 (vn_reference_t vr, vn_reference_t *vnresult)
{
void **slot;
hashval_t hash;
hash = vr->hashcode;
slot = htab_find_slot_with_hash (current_info->references, vr,
hash, NO_INSERT);
if (!slot && current_info == optimistic_info)
slot = htab_find_slot_with_hash (valid_info->references, vr,
hash, NO_INSERT);
if (slot)
{
if (vnresult)
*vnresult = (vn_reference_t)*slot;
return ((vn_reference_t)*slot)->result;
}
return NULL_TREE;
} | /* Lookup a SCCVN reference operation VR in the current hash table.
Returns the resulting value number if it exists in the hash table,
NULL_TREE otherwise. VNRESULT will be filled in with the actual
vn_reference_t stored in the hashtable if something is found. */ | Lookup a SCCVN reference operation VR in the current hash table.
Returns the resulting value number if it exists in the hash table,
NULL_TREE otherwise. VNRESULT will be filled in with the actual
vn_reference_t stored in the hashtable if something is found. | [
"Lookup",
"a",
"SCCVN",
"reference",
"operation",
"VR",
"in",
"the",
"current",
"hash",
"table",
".",
"Returns",
"the",
"resulting",
"value",
"number",
"if",
"it",
"exists",
"in",
"the",
"hash",
"table",
"NULL_TREE",
"otherwise",
".",
"VNRESULT",
"will",
"be",
"filled",
"in",
"with",
"the",
"actual",
"vn_reference_t",
"stored",
"in",
"the",
"hashtable",
"if",
"something",
"is",
"found",
"."
] | static tree
vn_reference_lookup_1 (vn_reference_t vr, vn_reference_t *vnresult)
{
void **slot;
hashval_t hash;
hash = vr->hashcode;
slot = htab_find_slot_with_hash (current_info->references, vr,
hash, NO_INSERT);
if (!slot && current_info == optimistic_info)
slot = htab_find_slot_with_hash (valid_info->references, vr,
hash, NO_INSERT);
if (slot)
{
if (vnresult)
*vnresult = (vn_reference_t)*slot;
return ((vn_reference_t)*slot)->result;
}
return NULL_TREE;
} | [
"static",
"tree",
"vn_reference_lookup_1",
"(",
"vn_reference_t",
"vr",
",",
"vn_reference_t",
"*",
"vnresult",
")",
"{",
"void",
"*",
"*",
"slot",
";",
"hashval_t",
"hash",
";",
"hash",
"=",
"vr",
"->",
"hashcode",
";",
"slot",
"=",
"htab_find_slot_with_hash",
"(",
"current_info",
"->",
"references",
",",
"vr",
",",
"hash",
",",
"NO_INSERT",
")",
";",
"if",
"(",
"!",
"slot",
"&&",
"current_info",
"==",
"optimistic_info",
")",
"slot",
"=",
"htab_find_slot_with_hash",
"(",
"valid_info",
"->",
"references",
",",
"vr",
",",
"hash",
",",
"NO_INSERT",
")",
";",
"if",
"(",
"slot",
")",
"{",
"if",
"(",
"vnresult",
")",
"*",
"vnresult",
"=",
"(",
"vn_reference_t",
")",
"*",
"slot",
";",
"return",
"(",
"(",
"vn_reference_t",
")",
"*",
"slot",
")",
"->",
"result",
";",
"}",
"return",
"NULL_TREE",
";",
"}"
] | Lookup a SCCVN reference operation VR in the current hash table. | [
"Lookup",
"a",
"SCCVN",
"reference",
"operation",
"VR",
"in",
"the",
"current",
"hash",
"table",
"."
] | [] | [
{
"param": "vr",
"type": "vn_reference_t"
},
{
"param": "vnresult",
"type": "vn_reference_t"
}
] | {
"returns": [],
"raises": [],
"params": [
{
"identifier": "vr",
"type": "vn_reference_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
},
{
"identifier": "vnresult",
"type": "vn_reference_t",
"docstring": null,
"docstring_tokens": [],
"default": null,
"is_optional": null
}
],
"outlier_params": [],
"others": []
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.