A synecdoche (/sɪˈnɛkdəkiː/, si-NEK-də-kee; from Greek συνεκδοχή, synekdoche, lit. "simultaneous understanding") is a figure of speech in which a term for a part of something refers to the whole of something or vice versa. A synecdoche is a class of metonymy, often by means of either mentioning a part for the whole or conversely the whole for one of its parts. Examples from common English expressions include "bread and butter" (for "livelihood"), "suits" (for "businesspeople"), and "boots" (for "soldiers") (Pars pro toto), or conversely "America" (for "the United States of America") (Totum pro parte).
The use of government buildings to refer to their occupant(s) is on the border between synecdoche and metonymy. "The Pentagon" for the United States Department of Defense can be considered synecdoche, as the building can be considered part of the department. "No. 10" for the British Prime Minister can be counted as metonymy, since the building is not part of the person, but using "No. 10" to mean "the Office of the Prime Minister" is synecdoche.
Synecdoche is a rhetorical trope and a type of figurative speech similar to metonymy, a figure of speech in which a term that denotes one thing is used to refer to a related thing. Indeed, synecdoche is sometimes considered a subclass of metonymy. It is more distantly related to other figures of speech, such as metaphor.