tree.h 197 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087
  1. /* Definitions for the ubiquitous 'tree' type for GNU compilers.
  2. Copyright (C) 1989-2015 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. GCC is free software; you can redistribute it and/or modify it under
  5. the terms of the GNU General Public License as published by the Free
  6. Software Foundation; either version 3, or (at your option) any later
  7. version.
  8. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  9. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  10. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  11. for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GCC; see the file COPYING3. If not see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef GCC_TREE_H
  16. #define GCC_TREE_H
  17. #include "tree-core.h"
  18. /* Macros for initializing `tree_contains_struct'. */
  19. #define MARK_TS_BASE(C) \
  20. do { \
  21. tree_contains_struct[C][TS_BASE] = 1; \
  22. } while (0)
  23. #define MARK_TS_TYPED(C) \
  24. do { \
  25. MARK_TS_BASE (C); \
  26. tree_contains_struct[C][TS_TYPED] = 1; \
  27. } while (0)
  28. #define MARK_TS_COMMON(C) \
  29. do { \
  30. MARK_TS_TYPED (C); \
  31. tree_contains_struct[C][TS_COMMON] = 1; \
  32. } while (0)
  33. #define MARK_TS_TYPE_COMMON(C) \
  34. do { \
  35. MARK_TS_COMMON (C); \
  36. tree_contains_struct[C][TS_TYPE_COMMON] = 1; \
  37. } while (0)
  38. #define MARK_TS_TYPE_WITH_LANG_SPECIFIC(C) \
  39. do { \
  40. MARK_TS_TYPE_COMMON (C); \
  41. tree_contains_struct[C][TS_TYPE_WITH_LANG_SPECIFIC] = 1; \
  42. } while (0)
  43. #define MARK_TS_DECL_MINIMAL(C) \
  44. do { \
  45. MARK_TS_COMMON (C); \
  46. tree_contains_struct[C][TS_DECL_MINIMAL] = 1; \
  47. } while (0)
  48. #define MARK_TS_DECL_COMMON(C) \
  49. do { \
  50. MARK_TS_DECL_MINIMAL (C); \
  51. tree_contains_struct[C][TS_DECL_COMMON] = 1; \
  52. } while (0)
  53. #define MARK_TS_DECL_WRTL(C) \
  54. do { \
  55. MARK_TS_DECL_COMMON (C); \
  56. tree_contains_struct[C][TS_DECL_WRTL] = 1; \
  57. } while (0)
  58. #define MARK_TS_DECL_WITH_VIS(C) \
  59. do { \
  60. MARK_TS_DECL_WRTL (C); \
  61. tree_contains_struct[C][TS_DECL_WITH_VIS] = 1; \
  62. } while (0)
  63. #define MARK_TS_DECL_NON_COMMON(C) \
  64. do { \
  65. MARK_TS_DECL_WITH_VIS (C); \
  66. tree_contains_struct[C][TS_DECL_NON_COMMON] = 1; \
  67. } while (0)
  68. /* Returns the string representing CLASS. */
  69. #define TREE_CODE_CLASS_STRING(CLASS)\
  70. tree_code_class_strings[(int) (CLASS)]
  71. #define TREE_CODE_CLASS(CODE) tree_code_type[(int) (CODE)]
  72. /* Nonzero if NODE represents an exceptional code. */
  73. #define EXCEPTIONAL_CLASS_P(NODE)\
  74. (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_exceptional)
  75. /* Nonzero if NODE represents a constant. */
  76. #define CONSTANT_CLASS_P(NODE)\
  77. (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_constant)
  78. /* Nonzero if NODE represents a type. */
  79. #define TYPE_P(NODE)\
  80. (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_type)
  81. /* Nonzero if NODE represents a declaration. */
  82. #define DECL_P(NODE)\
  83. (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_declaration)
  84. /* True if NODE designates a variable declaration. */
  85. #define VAR_P(NODE) \
  86. (TREE_CODE (NODE) == VAR_DECL)
  87. /* Nonzero if DECL represents a VAR_DECL or FUNCTION_DECL. */
  88. #define VAR_OR_FUNCTION_DECL_P(DECL)\
  89. (TREE_CODE (DECL) == VAR_DECL || TREE_CODE (DECL) == FUNCTION_DECL)
  90. /* Nonzero if NODE represents a INDIRECT_REF. Keep these checks in
  91. ascending code order. */
  92. #define INDIRECT_REF_P(NODE)\
  93. (TREE_CODE (NODE) == INDIRECT_REF)
  94. /* Nonzero if NODE represents a reference. */
  95. #define REFERENCE_CLASS_P(NODE)\
  96. (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_reference)
  97. /* Nonzero if NODE represents a comparison. */
  98. #define COMPARISON_CLASS_P(NODE)\
  99. (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_comparison)
  100. /* Nonzero if NODE represents a unary arithmetic expression. */
  101. #define UNARY_CLASS_P(NODE)\
  102. (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_unary)
  103. /* Nonzero if NODE represents a binary arithmetic expression. */
  104. #define BINARY_CLASS_P(NODE)\
  105. (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_binary)
  106. /* Nonzero if NODE represents a statement expression. */
  107. #define STATEMENT_CLASS_P(NODE)\
  108. (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_statement)
  109. /* Nonzero if NODE represents a function call-like expression with a
  110. variable-length operand vector. */
  111. #define VL_EXP_CLASS_P(NODE)\
  112. (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_vl_exp)
  113. /* Nonzero if NODE represents any other expression. */
  114. #define EXPRESSION_CLASS_P(NODE)\
  115. (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_expression)
  116. /* Returns nonzero iff NODE represents a type or declaration. */
  117. #define IS_TYPE_OR_DECL_P(NODE)\
  118. (TYPE_P (NODE) || DECL_P (NODE))
  119. /* Returns nonzero iff CLASS is the tree-code class of an
  120. expression. */
  121. #define IS_EXPR_CODE_CLASS(CLASS)\
  122. ((CLASS) >= tcc_reference && (CLASS) <= tcc_expression)
  123. /* Returns nonzero iff NODE is an expression of some kind. */
  124. #define EXPR_P(NODE) IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (NODE)))
  125. #define TREE_CODE_LENGTH(CODE) tree_code_length[(int) (CODE)]
  126. /* Helper macros for math builtins. */
  127. #define BUILTIN_EXP10_P(FN) \
  128. ((FN) == BUILT_IN_EXP10 || (FN) == BUILT_IN_EXP10F || (FN) == BUILT_IN_EXP10L \
  129. || (FN) == BUILT_IN_POW10 || (FN) == BUILT_IN_POW10F || (FN) == BUILT_IN_POW10L)
  130. #define BUILTIN_EXPONENT_P(FN) (BUILTIN_EXP10_P (FN) \
  131. || (FN) == BUILT_IN_EXP || (FN) == BUILT_IN_EXPF || (FN) == BUILT_IN_EXPL \
  132. || (FN) == BUILT_IN_EXP2 || (FN) == BUILT_IN_EXP2F || (FN) == BUILT_IN_EXP2L)
  133. #define BUILTIN_SQRT_P(FN) \
  134. ((FN) == BUILT_IN_SQRT || (FN) == BUILT_IN_SQRTF || (FN) == BUILT_IN_SQRTL)
  135. #define BUILTIN_CBRT_P(FN) \
  136. ((FN) == BUILT_IN_CBRT || (FN) == BUILT_IN_CBRTF || (FN) == BUILT_IN_CBRTL)
  137. #define BUILTIN_ROOT_P(FN) (BUILTIN_SQRT_P (FN) || BUILTIN_CBRT_P (FN))
  138. #define CASE_FLT_FN(FN) case FN: case FN##F: case FN##L
  139. #define CASE_FLT_FN_REENT(FN) case FN##_R: case FN##F_R: case FN##L_R
  140. #define CASE_INT_FN(FN) case FN: case FN##L: case FN##LL: case FN##IMAX
  141. #define NULL_TREE (tree) NULL
  142. /* Define accessors for the fields that all tree nodes have
  143. (though some fields are not used for all kinds of nodes). */
  144. /* The tree-code says what kind of node it is.
  145. Codes are defined in tree.def. */
  146. #define TREE_CODE(NODE) ((enum tree_code) (NODE)->base.code)
  147. #define TREE_SET_CODE(NODE, VALUE) ((NODE)->base.code = (VALUE))
  148. /* When checking is enabled, errors will be generated if a tree node
  149. is accessed incorrectly. The macros die with a fatal error. */
  150. #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
  151. #define TREE_CHECK(T, CODE) \
  152. (tree_check ((T), __FILE__, __LINE__, __FUNCTION__, (CODE)))
  153. #define TREE_NOT_CHECK(T, CODE) \
  154. (tree_not_check ((T), __FILE__, __LINE__, __FUNCTION__, (CODE)))
  155. #define TREE_CHECK2(T, CODE1, CODE2) \
  156. (tree_check2 ((T), __FILE__, __LINE__, __FUNCTION__, (CODE1), (CODE2)))
  157. #define TREE_NOT_CHECK2(T, CODE1, CODE2) \
  158. (tree_not_check2 ((T), __FILE__, __LINE__, __FUNCTION__, (CODE1), (CODE2)))
  159. #define TREE_CHECK3(T, CODE1, CODE2, CODE3) \
  160. (tree_check3 ((T), __FILE__, __LINE__, __FUNCTION__, (CODE1), (CODE2), (CODE3)))
  161. #define TREE_NOT_CHECK3(T, CODE1, CODE2, CODE3) \
  162. (tree_not_check3 ((T), __FILE__, __LINE__, __FUNCTION__, \
  163. (CODE1), (CODE2), (CODE3)))
  164. #define TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) \
  165. (tree_check4 ((T), __FILE__, __LINE__, __FUNCTION__, \
  166. (CODE1), (CODE2), (CODE3), (CODE4)))
  167. #define TREE_NOT_CHECK4(T, CODE1, CODE2, CODE3, CODE4) \
  168. (tree_not_check4 ((T), __FILE__, __LINE__, __FUNCTION__, \
  169. (CODE1), (CODE2), (CODE3), (CODE4)))
  170. #define TREE_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) \
  171. (tree_check5 ((T), __FILE__, __LINE__, __FUNCTION__, \
  172. (CODE1), (CODE2), (CODE3), (CODE4), (CODE5)))
  173. #define TREE_NOT_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) \
  174. (tree_not_check5 ((T), __FILE__, __LINE__, __FUNCTION__, \
  175. (CODE1), (CODE2), (CODE3), (CODE4), (CODE5)))
  176. #define CONTAINS_STRUCT_CHECK(T, STRUCT) \
  177. (contains_struct_check ((T), (STRUCT), __FILE__, __LINE__, __FUNCTION__))
  178. #define TREE_CLASS_CHECK(T, CLASS) \
  179. (tree_class_check ((T), (CLASS), __FILE__, __LINE__, __FUNCTION__))
  180. #define TREE_RANGE_CHECK(T, CODE1, CODE2) \
  181. (tree_range_check ((T), (CODE1), (CODE2), __FILE__, __LINE__, __FUNCTION__))
  182. #define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) \
  183. (omp_clause_subcode_check ((T), (CODE), __FILE__, __LINE__, __FUNCTION__))
  184. #define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) \
  185. (omp_clause_range_check ((T), (CODE1), (CODE2), \
  186. __FILE__, __LINE__, __FUNCTION__))
  187. /* These checks have to be special cased. */
  188. #define EXPR_CHECK(T) \
  189. (expr_check ((T), __FILE__, __LINE__, __FUNCTION__))
  190. /* These checks have to be special cased. */
  191. #define NON_TYPE_CHECK(T) \
  192. (non_type_check ((T), __FILE__, __LINE__, __FUNCTION__))
  193. /* These checks have to be special cased. */
  194. #define ANY_INTEGRAL_TYPE_CHECK(T) \
  195. (any_integral_type_check ((T), __FILE__, __LINE__, __FUNCTION__))
  196. #define TREE_INT_CST_ELT_CHECK(T, I) \
  197. (*tree_int_cst_elt_check ((T), (I), __FILE__, __LINE__, __FUNCTION__))
  198. #define TREE_VEC_ELT_CHECK(T, I) \
  199. (*(CONST_CAST2 (tree *, typeof (T)*, \
  200. tree_vec_elt_check ((T), (I), __FILE__, __LINE__, __FUNCTION__))))
  201. #define OMP_CLAUSE_ELT_CHECK(T, I) \
  202. (*(omp_clause_elt_check ((T), (I), __FILE__, __LINE__, __FUNCTION__)))
  203. /* Special checks for TREE_OPERANDs. */
  204. #define TREE_OPERAND_CHECK(T, I) \
  205. (*(CONST_CAST2 (tree*, typeof (T)*, \
  206. tree_operand_check ((T), (I), __FILE__, __LINE__, __FUNCTION__))))
  207. #define TREE_OPERAND_CHECK_CODE(T, CODE, I) \
  208. (*(tree_operand_check_code ((T), (CODE), (I), \
  209. __FILE__, __LINE__, __FUNCTION__)))
  210. /* Nodes are chained together for many purposes.
  211. Types are chained together to record them for being output to the debugger
  212. (see the function `chain_type').
  213. Decls in the same scope are chained together to record the contents
  214. of the scope.
  215. Statement nodes for successive statements used to be chained together.
  216. Often lists of things are represented by TREE_LIST nodes that
  217. are chained together. */
  218. #define TREE_CHAIN(NODE) \
  219. (CONTAINS_STRUCT_CHECK (NODE, TS_COMMON)->common.chain)
  220. /* In all nodes that are expressions, this is the data type of the expression.
  221. In POINTER_TYPE nodes, this is the type that the pointer points to.
  222. In ARRAY_TYPE nodes, this is the type of the elements.
  223. In VECTOR_TYPE nodes, this is the type of the elements. */
  224. #define TREE_TYPE(NODE) \
  225. (CONTAINS_STRUCT_CHECK (NODE, TS_TYPED)->typed.type)
  226. extern void tree_contains_struct_check_failed (const_tree,
  227. const enum tree_node_structure_enum,
  228. const char *, int, const char *)
  229. ATTRIBUTE_NORETURN;
  230. extern void tree_check_failed (const_tree, const char *, int, const char *,
  231. ...) ATTRIBUTE_NORETURN;
  232. extern void tree_not_check_failed (const_tree, const char *, int, const char *,
  233. ...) ATTRIBUTE_NORETURN;
  234. extern void tree_class_check_failed (const_tree, const enum tree_code_class,
  235. const char *, int, const char *)
  236. ATTRIBUTE_NORETURN;
  237. extern void tree_range_check_failed (const_tree, const char *, int,
  238. const char *, enum tree_code,
  239. enum tree_code)
  240. ATTRIBUTE_NORETURN;
  241. extern void tree_not_class_check_failed (const_tree,
  242. const enum tree_code_class,
  243. const char *, int, const char *)
  244. ATTRIBUTE_NORETURN;
  245. extern void tree_int_cst_elt_check_failed (int, int, const char *,
  246. int, const char *)
  247. ATTRIBUTE_NORETURN;
  248. extern void tree_vec_elt_check_failed (int, int, const char *,
  249. int, const char *)
  250. ATTRIBUTE_NORETURN;
  251. extern void phi_node_elt_check_failed (int, int, const char *,
  252. int, const char *)
  253. ATTRIBUTE_NORETURN;
  254. extern void tree_operand_check_failed (int, const_tree,
  255. const char *, int, const char *)
  256. ATTRIBUTE_NORETURN;
  257. extern void omp_clause_check_failed (const_tree, const char *, int,
  258. const char *, enum omp_clause_code)
  259. ATTRIBUTE_NORETURN;
  260. extern void omp_clause_operand_check_failed (int, const_tree, const char *,
  261. int, const char *)
  262. ATTRIBUTE_NORETURN;
  263. extern void omp_clause_range_check_failed (const_tree, const char *, int,
  264. const char *, enum omp_clause_code,
  265. enum omp_clause_code)
  266. ATTRIBUTE_NORETURN;
  267. #else /* not ENABLE_TREE_CHECKING, or not gcc */
  268. #define CONTAINS_STRUCT_CHECK(T, ENUM) (T)
  269. #define TREE_CHECK(T, CODE) (T)
  270. #define TREE_NOT_CHECK(T, CODE) (T)
  271. #define TREE_CHECK2(T, CODE1, CODE2) (T)
  272. #define TREE_NOT_CHECK2(T, CODE1, CODE2) (T)
  273. #define TREE_CHECK3(T, CODE1, CODE2, CODE3) (T)
  274. #define TREE_NOT_CHECK3(T, CODE1, CODE2, CODE3) (T)
  275. #define TREE_CHECK4(T, CODE1, CODE2, CODE3, CODE4) (T)
  276. #define TREE_NOT_CHECK4(T, CODE1, CODE2, CODE3, CODE4) (T)
  277. #define TREE_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) (T)
  278. #define TREE_NOT_CHECK5(T, CODE1, CODE2, CODE3, CODE4, CODE5) (T)
  279. #define TREE_CLASS_CHECK(T, CODE) (T)
  280. #define TREE_RANGE_CHECK(T, CODE1, CODE2) (T)
  281. #define EXPR_CHECK(T) (T)
  282. #define NON_TYPE_CHECK(T) (T)
  283. #define TREE_INT_CST_ELT_CHECK(T, I) ((T)->int_cst.val[I])
  284. #define TREE_VEC_ELT_CHECK(T, I) ((T)->vec.a[I])
  285. #define TREE_OPERAND_CHECK(T, I) ((T)->exp.operands[I])
  286. #define TREE_OPERAND_CHECK_CODE(T, CODE, I) ((T)->exp.operands[I])
  287. #define OMP_CLAUSE_ELT_CHECK(T, i) ((T)->omp_clause.ops[i])
  288. #define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T)
  289. #define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T)
  290. #define ANY_INTEGRAL_TYPE_CHECK(T) (T)
  291. #define TREE_CHAIN(NODE) ((NODE)->common.chain)
  292. #define TREE_TYPE(NODE) ((NODE)->typed.type)
  293. #endif
  294. #define TREE_BLOCK(NODE) (tree_block (NODE))
  295. #define TREE_SET_BLOCK(T, B) (tree_set_block ((T), (B)))
  296. #include "tree-check.h"
  297. #define TYPE_CHECK(T) TREE_CLASS_CHECK (T, tcc_type)
  298. #define DECL_MINIMAL_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_MINIMAL)
  299. #define DECL_COMMON_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_COMMON)
  300. #define DECL_WRTL_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_WRTL)
  301. #define DECL_WITH_VIS_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_WITH_VIS)
  302. #define DECL_NON_COMMON_CHECK(T) CONTAINS_STRUCT_CHECK (T, TS_DECL_NON_COMMON)
  303. #define CST_CHECK(T) TREE_CLASS_CHECK (T, tcc_constant)
  304. #define STMT_CHECK(T) TREE_CLASS_CHECK (T, tcc_statement)
  305. #define VL_EXP_CHECK(T) TREE_CLASS_CHECK (T, tcc_vl_exp)
  306. #define FUNC_OR_METHOD_CHECK(T) TREE_CHECK2 (T, FUNCTION_TYPE, METHOD_TYPE)
  307. #define PTR_OR_REF_CHECK(T) TREE_CHECK2 (T, POINTER_TYPE, REFERENCE_TYPE)
  308. #define RECORD_OR_UNION_CHECK(T) \
  309. TREE_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
  310. #define NOT_RECORD_OR_UNION_CHECK(T) \
  311. TREE_NOT_CHECK3 (T, RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE)
  312. #define NUMERICAL_TYPE_CHECK(T) \
  313. TREE_CHECK5 (T, INTEGER_TYPE, ENUMERAL_TYPE, BOOLEAN_TYPE, REAL_TYPE, \
  314. FIXED_POINT_TYPE)
  315. /* Here is how primitive or already-canonicalized types' hash codes
  316. are made. */
  317. #define TYPE_HASH(TYPE) (TYPE_UID (TYPE))
  318. /* A simple hash function for an arbitrary tree node. This must not be
  319. used in hash tables which are saved to a PCH. */
  320. #define TREE_HASH(NODE) ((size_t) (NODE) & 0777777)
  321. /* Tests if CODE is a conversion expr (NOP_EXPR or CONVERT_EXPR). */
  322. #define CONVERT_EXPR_CODE_P(CODE) \
  323. ((CODE) == NOP_EXPR || (CODE) == CONVERT_EXPR)
  324. /* Similarly, but accept an expression instead of a tree code. */
  325. #define CONVERT_EXPR_P(EXP) CONVERT_EXPR_CODE_P (TREE_CODE (EXP))
  326. /* Generate case for NOP_EXPR, CONVERT_EXPR. */
  327. #define CASE_CONVERT \
  328. case NOP_EXPR: \
  329. case CONVERT_EXPR
  330. /* Given an expression as a tree, strip any conversion that generates
  331. no instruction. Accepts both tree and const_tree arguments since
  332. we are not modifying the tree itself. */
  333. #define STRIP_NOPS(EXP) \
  334. (EXP) = tree_strip_nop_conversions (CONST_CAST_TREE (EXP))
  335. /* Like STRIP_NOPS, but don't let the signedness change either. */
  336. #define STRIP_SIGN_NOPS(EXP) \
  337. (EXP) = tree_strip_sign_nop_conversions (CONST_CAST_TREE (EXP))
  338. /* Like STRIP_NOPS, but don't alter the TREE_TYPE either. */
  339. #define STRIP_TYPE_NOPS(EXP) \
  340. while ((CONVERT_EXPR_P (EXP) \
  341. || TREE_CODE (EXP) == NON_LVALUE_EXPR) \
  342. && TREE_OPERAND (EXP, 0) != error_mark_node \
  343. && (TREE_TYPE (EXP) \
  344. == TREE_TYPE (TREE_OPERAND (EXP, 0)))) \
  345. (EXP) = TREE_OPERAND (EXP, 0)
  346. /* Remove unnecessary type conversions according to
  347. tree_ssa_useless_type_conversion. */
  348. #define STRIP_USELESS_TYPE_CONVERSION(EXP) \
  349. (EXP) = tree_ssa_strip_useless_type_conversions (EXP)
  350. /* Nonzero if TYPE represents a vector type. */
  351. #define VECTOR_TYPE_P(TYPE) (TREE_CODE (TYPE) == VECTOR_TYPE)
  352. /* Nonzero if TYPE represents an integral type. Note that we do not
  353. include COMPLEX types here. Keep these checks in ascending code
  354. order. */
  355. #define INTEGRAL_TYPE_P(TYPE) \
  356. (TREE_CODE (TYPE) == ENUMERAL_TYPE \
  357. || TREE_CODE (TYPE) == BOOLEAN_TYPE \
  358. || TREE_CODE (TYPE) == INTEGER_TYPE)
  359. /* Nonzero if TYPE represents an integral type, including complex
  360. and vector integer types. */
  361. #define ANY_INTEGRAL_TYPE_P(TYPE) \
  362. (INTEGRAL_TYPE_P (TYPE) \
  363. || ((TREE_CODE (TYPE) == COMPLEX_TYPE \
  364. || VECTOR_TYPE_P (TYPE)) \
  365. && INTEGRAL_TYPE_P (TREE_TYPE (TYPE))))
  366. /* Nonzero if TYPE represents a non-saturating fixed-point type. */
  367. #define NON_SAT_FIXED_POINT_TYPE_P(TYPE) \
  368. (TREE_CODE (TYPE) == FIXED_POINT_TYPE && !TYPE_SATURATING (TYPE))
  369. /* Nonzero if TYPE represents a saturating fixed-point type. */
  370. #define SAT_FIXED_POINT_TYPE_P(TYPE) \
  371. (TREE_CODE (TYPE) == FIXED_POINT_TYPE && TYPE_SATURATING (TYPE))
  372. /* Nonzero if TYPE represents a fixed-point type. */
  373. #define FIXED_POINT_TYPE_P(TYPE) (TREE_CODE (TYPE) == FIXED_POINT_TYPE)
  374. /* Nonzero if TYPE represents a scalar floating-point type. */
  375. #define SCALAR_FLOAT_TYPE_P(TYPE) (TREE_CODE (TYPE) == REAL_TYPE)
  376. /* Nonzero if TYPE represents a complex floating-point type. */
  377. #define COMPLEX_FLOAT_TYPE_P(TYPE) \
  378. (TREE_CODE (TYPE) == COMPLEX_TYPE \
  379. && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE)
  380. /* Nonzero if TYPE represents a vector integer type. */
  381. #define VECTOR_INTEGER_TYPE_P(TYPE) \
  382. (VECTOR_TYPE_P (TYPE) \
  383. && TREE_CODE (TREE_TYPE (TYPE)) == INTEGER_TYPE)
  384. /* Nonzero if TYPE represents a vector floating-point type. */
  385. #define VECTOR_FLOAT_TYPE_P(TYPE) \
  386. (VECTOR_TYPE_P (TYPE) \
  387. && TREE_CODE (TREE_TYPE (TYPE)) == REAL_TYPE)
  388. /* Nonzero if TYPE represents a floating-point type, including complex
  389. and vector floating-point types. The vector and complex check does
  390. not use the previous two macros to enable early folding. */
  391. #define FLOAT_TYPE_P(TYPE) \
  392. (SCALAR_FLOAT_TYPE_P (TYPE) \
  393. || ((TREE_CODE (TYPE) == COMPLEX_TYPE \
  394. || VECTOR_TYPE_P (TYPE)) \
  395. && SCALAR_FLOAT_TYPE_P (TREE_TYPE (TYPE))))
  396. /* Nonzero if TYPE represents a decimal floating-point type. */
  397. #define DECIMAL_FLOAT_TYPE_P(TYPE) \
  398. (SCALAR_FLOAT_TYPE_P (TYPE) \
  399. && DECIMAL_FLOAT_MODE_P (TYPE_MODE (TYPE)))
  400. /* Nonzero if TYPE is a record or union type. */
  401. #define RECORD_OR_UNION_TYPE_P(TYPE) \
  402. (TREE_CODE (TYPE) == RECORD_TYPE \
  403. || TREE_CODE (TYPE) == UNION_TYPE \
  404. || TREE_CODE (TYPE) == QUAL_UNION_TYPE)
  405. /* Nonzero if TYPE represents an aggregate (multi-component) type.
  406. Keep these checks in ascending code order. */
  407. #define AGGREGATE_TYPE_P(TYPE) \
  408. (TREE_CODE (TYPE) == ARRAY_TYPE || RECORD_OR_UNION_TYPE_P (TYPE))
  409. /* Nonzero if TYPE represents a pointer or reference type.
  410. (It should be renamed to INDIRECT_TYPE_P.) Keep these checks in
  411. ascending code order. */
  412. #define POINTER_TYPE_P(TYPE) \
  413. (TREE_CODE (TYPE) == POINTER_TYPE || TREE_CODE (TYPE) == REFERENCE_TYPE)
  414. /* Nonzero if TYPE represents a pointer to function. */
  415. #define FUNCTION_POINTER_TYPE_P(TYPE) \
  416. (POINTER_TYPE_P (TYPE) && TREE_CODE (TREE_TYPE (TYPE)) == FUNCTION_TYPE)
  417. /* Nonzero if this type is a complete type. */
  418. #define COMPLETE_TYPE_P(NODE) (TYPE_SIZE (NODE) != NULL_TREE)
  419. /* Nonzero if this type is a pointer bounds type. */
  420. #define POINTER_BOUNDS_TYPE_P(NODE) \
  421. (TREE_CODE (NODE) == POINTER_BOUNDS_TYPE)
  422. /* Nonzero if this node has a pointer bounds type. */
  423. #define POINTER_BOUNDS_P(NODE) \
  424. (POINTER_BOUNDS_TYPE_P (TREE_TYPE (NODE)))
  425. /* Nonzero if this type supposes bounds existence. */
  426. #define BOUNDED_TYPE_P(type) (POINTER_TYPE_P (type))
  427. /* Nonzero for objects with bounded type. */
  428. #define BOUNDED_P(node) \
  429. BOUNDED_TYPE_P (TREE_TYPE (node))
  430. /* Nonzero if this type is the (possibly qualified) void type. */
  431. #define VOID_TYPE_P(NODE) (TREE_CODE (NODE) == VOID_TYPE)
  432. /* Nonzero if this type is complete or is cv void. */
  433. #define COMPLETE_OR_VOID_TYPE_P(NODE) \
  434. (COMPLETE_TYPE_P (NODE) || VOID_TYPE_P (NODE))
  435. /* Nonzero if this type is complete or is an array with unspecified bound. */
  436. #define COMPLETE_OR_UNBOUND_ARRAY_TYPE_P(NODE) \
  437. (COMPLETE_TYPE_P (TREE_CODE (NODE) == ARRAY_TYPE ? TREE_TYPE (NODE) : (NODE)))
  438. /* Define many boolean fields that all tree nodes have. */
  439. /* In VAR_DECL, PARM_DECL and RESULT_DECL nodes, nonzero means address
  440. of this is needed. So it cannot be in a register.
  441. In a FUNCTION_DECL it has no meaning.
  442. In LABEL_DECL nodes, it means a goto for this label has been seen
  443. from a place outside all binding contours that restore stack levels.
  444. In an artificial SSA_NAME that points to a stack partition with at least
  445. two variables, it means that at least one variable has TREE_ADDRESSABLE.
  446. In ..._TYPE nodes, it means that objects of this type must be fully
  447. addressable. This means that pieces of this object cannot go into
  448. register parameters, for example. If this a function type, this
  449. means that the value must be returned in memory.
  450. In CONSTRUCTOR nodes, it means object constructed must be in memory.
  451. In IDENTIFIER_NODEs, this means that some extern decl for this name
  452. had its address taken. That matters for inline functions.
  453. In a STMT_EXPR, it means we want the result of the enclosed expression. */
  454. #define TREE_ADDRESSABLE(NODE) ((NODE)->base.addressable_flag)
  455. /* Set on a CALL_EXPR if the call is in a tail position, ie. just before the
  456. exit of a function. Calls for which this is true are candidates for tail
  457. call optimizations. */
  458. #define CALL_EXPR_TAILCALL(NODE) \
  459. (CALL_EXPR_CHECK (NODE)->base.addressable_flag)
  460. /* Used as a temporary field on a CASE_LABEL_EXPR to indicate that the
  461. CASE_LOW operand has been processed. */
  462. #define CASE_LOW_SEEN(NODE) \
  463. (CASE_LABEL_EXPR_CHECK (NODE)->base.addressable_flag)
  464. #define PREDICT_EXPR_OUTCOME(NODE) \
  465. ((enum prediction) (PREDICT_EXPR_CHECK (NODE)->base.addressable_flag))
  466. #define SET_PREDICT_EXPR_OUTCOME(NODE, OUTCOME) \
  467. (PREDICT_EXPR_CHECK (NODE)->base.addressable_flag = (int) OUTCOME)
  468. #define PREDICT_EXPR_PREDICTOR(NODE) \
  469. ((enum br_predictor)tree_to_shwi (TREE_OPERAND (PREDICT_EXPR_CHECK (NODE), 0)))
  470. /* In a VAR_DECL, nonzero means allocate static storage.
  471. In a FUNCTION_DECL, nonzero if function has been defined.
  472. In a CONSTRUCTOR, nonzero means allocate static storage. */
  473. #define TREE_STATIC(NODE) ((NODE)->base.static_flag)
  474. /* In an ADDR_EXPR, nonzero means do not use a trampoline. */
  475. #define TREE_NO_TRAMPOLINE(NODE) (ADDR_EXPR_CHECK (NODE)->base.static_flag)
  476. /* In a TARGET_EXPR or WITH_CLEANUP_EXPR, means that the pertinent cleanup
  477. should only be executed if an exception is thrown, not on normal exit
  478. of its scope. */
  479. #define CLEANUP_EH_ONLY(NODE) ((NODE)->base.static_flag)
  480. /* In a TRY_CATCH_EXPR, means that the handler should be considered a
  481. separate cleanup in honor_protect_cleanup_actions. */
  482. #define TRY_CATCH_IS_CLEANUP(NODE) \
  483. (TRY_CATCH_EXPR_CHECK (NODE)->base.static_flag)
  484. /* Used as a temporary field on a CASE_LABEL_EXPR to indicate that the
  485. CASE_HIGH operand has been processed. */
  486. #define CASE_HIGH_SEEN(NODE) \
  487. (CASE_LABEL_EXPR_CHECK (NODE)->base.static_flag)
  488. /* Used to mark scoped enums. */
  489. #define ENUM_IS_SCOPED(NODE) (ENUMERAL_TYPE_CHECK (NODE)->base.static_flag)
  490. /* Determines whether an ENUMERAL_TYPE has defined the list of constants. */
  491. #define ENUM_IS_OPAQUE(NODE) (ENUMERAL_TYPE_CHECK (NODE)->base.private_flag)
  492. /* In an expr node (usually a conversion) this means the node was made
  493. implicitly and should not lead to any sort of warning. In a decl node,
  494. warnings concerning the decl should be suppressed. This is used at
  495. least for used-before-set warnings, and it set after one warning is
  496. emitted. */
  497. #define TREE_NO_WARNING(NODE) ((NODE)->base.nowarning_flag)
  498. /* Used to indicate that this TYPE represents a compiler-generated entity. */
  499. #define TYPE_ARTIFICIAL(NODE) (TYPE_CHECK (NODE)->base.nowarning_flag)
  500. /* In an IDENTIFIER_NODE, this means that assemble_name was called with
  501. this string as an argument. */
  502. #define TREE_SYMBOL_REFERENCED(NODE) \
  503. (IDENTIFIER_NODE_CHECK (NODE)->base.static_flag)
  504. /* Nonzero in a pointer or reference type means the data pointed to
  505. by this type can alias anything. */
  506. #define TYPE_REF_CAN_ALIAS_ALL(NODE) \
  507. (PTR_OR_REF_CHECK (NODE)->base.static_flag)
  508. /* In an INTEGER_CST, REAL_CST, COMPLEX_CST, or VECTOR_CST, this means
  509. there was an overflow in folding. */
  510. #define TREE_OVERFLOW(NODE) (CST_CHECK (NODE)->base.public_flag)
  511. /* TREE_OVERFLOW can only be true for EXPR of CONSTANT_CLASS_P. */
  512. #define TREE_OVERFLOW_P(EXPR) \
  513. (CONSTANT_CLASS_P (EXPR) && TREE_OVERFLOW (EXPR))
  514. /* In a VAR_DECL, FUNCTION_DECL, NAMESPACE_DECL or TYPE_DECL,
  515. nonzero means name is to be accessible from outside this translation unit.
  516. In an IDENTIFIER_NODE, nonzero means an external declaration
  517. accessible from outside this translation unit was previously seen
  518. for this name in an inner scope. */
  519. #define TREE_PUBLIC(NODE) ((NODE)->base.public_flag)
  520. /* In a _TYPE, indicates whether TYPE_CACHED_VALUES contains a vector
  521. of cached values, or is something else. */
  522. #define TYPE_CACHED_VALUES_P(NODE) (TYPE_CHECK (NODE)->base.public_flag)
  523. /* In a SAVE_EXPR, indicates that the original expression has already
  524. been substituted with a VAR_DECL that contains the value. */
  525. #define SAVE_EXPR_RESOLVED_P(NODE) \
  526. (SAVE_EXPR_CHECK (NODE)->base.public_flag)
  527. /* Set on a CALL_EXPR if this stdarg call should be passed the argument
  528. pack. */
  529. #define CALL_EXPR_VA_ARG_PACK(NODE) \
  530. (CALL_EXPR_CHECK (NODE)->base.public_flag)
  531. /* In any expression, decl, or constant, nonzero means it has side effects or
  532. reevaluation of the whole expression could produce a different value.
  533. This is set if any subexpression is a function call, a side effect or a
  534. reference to a volatile variable. In a ..._DECL, this is set only if the
  535. declaration said `volatile'. This will never be set for a constant. */
  536. #define TREE_SIDE_EFFECTS(NODE) \
  537. (NON_TYPE_CHECK (NODE)->base.side_effects_flag)
  538. /* In a LABEL_DECL, nonzero means this label had its address taken
  539. and therefore can never be deleted and is a jump target for
  540. computed gotos. */
  541. #define FORCED_LABEL(NODE) (LABEL_DECL_CHECK (NODE)->base.side_effects_flag)
  542. /* Nonzero means this expression is volatile in the C sense:
  543. its address should be of type `volatile WHATEVER *'.
  544. In other words, the declared item is volatile qualified.
  545. This is used in _DECL nodes and _REF nodes.
  546. On a FUNCTION_DECL node, this means the function does not
  547. return normally. This is the same effect as setting
  548. the attribute noreturn on the function in C.
  549. In a ..._TYPE node, means this type is volatile-qualified.
  550. But use TYPE_VOLATILE instead of this macro when the node is a type,
  551. because eventually we may make that a different bit.
  552. If this bit is set in an expression, so is TREE_SIDE_EFFECTS. */
  553. #define TREE_THIS_VOLATILE(NODE) ((NODE)->base.volatile_flag)
  554. /* Nonzero means this node will not trap. In an INDIRECT_REF, means
  555. accessing the memory pointed to won't generate a trap. However,
  556. this only applies to an object when used appropriately: it doesn't
  557. mean that writing a READONLY mem won't trap.
  558. In ARRAY_REF and ARRAY_RANGE_REF means that we know that the index
  559. (or slice of the array) always belongs to the range of the array.
  560. I.e. that the access will not trap, provided that the access to
  561. the base to the array will not trap. */
  562. #define TREE_THIS_NOTRAP(NODE) \
  563. (TREE_CHECK5 (NODE, INDIRECT_REF, MEM_REF, TARGET_MEM_REF, ARRAY_REF, \
  564. ARRAY_RANGE_REF)->base.nothrow_flag)
  565. /* In a VAR_DECL, PARM_DECL or FIELD_DECL, or any kind of ..._REF node,
  566. nonzero means it may not be the lhs of an assignment.
  567. Nonzero in a FUNCTION_DECL means this function should be treated
  568. as "const" function (can only read its arguments). */
  569. #define TREE_READONLY(NODE) (NON_TYPE_CHECK (NODE)->base.readonly_flag)
  570. /* Value of expression is constant. Always on in all ..._CST nodes. May
  571. also appear in an expression or decl where the value is constant. */
  572. #define TREE_CONSTANT(NODE) (NON_TYPE_CHECK (NODE)->base.constant_flag)
  573. /* Nonzero if NODE, a type, has had its sizes gimplified. */
  574. #define TYPE_SIZES_GIMPLIFIED(NODE) \
  575. (TYPE_CHECK (NODE)->base.constant_flag)
  576. /* In a decl (most significantly a FIELD_DECL), means an unsigned field. */
  577. #define DECL_UNSIGNED(NODE) \
  578. (DECL_COMMON_CHECK (NODE)->base.u.bits.unsigned_flag)
  579. /* In integral and pointer types, means an unsigned type. */
  580. #define TYPE_UNSIGNED(NODE) (TYPE_CHECK (NODE)->base.u.bits.unsigned_flag)
  581. /* Same as TYPE_UNSIGNED but converted to SIGNOP. */
  582. #define TYPE_SIGN(NODE) ((signop) TYPE_UNSIGNED (NODE))
  583. /* True if overflow wraps around for the given integral type. That
  584. is, TYPE_MAX + 1 == TYPE_MIN. */
  585. #define TYPE_OVERFLOW_WRAPS(TYPE) \
  586. (ANY_INTEGRAL_TYPE_CHECK(TYPE)->base.u.bits.unsigned_flag || flag_wrapv)
  587. /* True if overflow is undefined for the given integral type. We may
  588. optimize on the assumption that values in the type never overflow.
  589. IMPORTANT NOTE: Any optimization based on TYPE_OVERFLOW_UNDEFINED
  590. must issue a warning based on warn_strict_overflow. In some cases
  591. it will be appropriate to issue the warning immediately, and in
  592. other cases it will be appropriate to simply set a flag and let the
  593. caller decide whether a warning is appropriate or not. */
  594. #define TYPE_OVERFLOW_UNDEFINED(TYPE) \
  595. (!ANY_INTEGRAL_TYPE_CHECK(TYPE)->base.u.bits.unsigned_flag \
  596. && !flag_wrapv && !flag_trapv && flag_strict_overflow)
  597. /* True if overflow for the given integral type should issue a
  598. trap. */
  599. #define TYPE_OVERFLOW_TRAPS(TYPE) \
  600. (!ANY_INTEGRAL_TYPE_CHECK(TYPE)->base.u.bits.unsigned_flag && flag_trapv)
  601. /* True if an overflow is to be preserved for sanitization. */
  602. #define TYPE_OVERFLOW_SANITIZED(TYPE) \
  603. (INTEGRAL_TYPE_P (TYPE) \
  604. && !TYPE_OVERFLOW_WRAPS (TYPE) \
  605. && (flag_sanitize & SANITIZE_SI_OVERFLOW))
  606. /* True if pointer types have undefined overflow. */
  607. #define POINTER_TYPE_OVERFLOW_UNDEFINED (flag_strict_overflow)
  608. /* Nonzero in a VAR_DECL or STRING_CST means assembler code has been written.
  609. Nonzero in a FUNCTION_DECL means that the function has been compiled.
  610. This is interesting in an inline function, since it might not need
  611. to be compiled separately.
  612. Nonzero in a RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE, ENUMERAL_TYPE
  613. or TYPE_DECL if the debugging info for the type has been written.
  614. In a BLOCK node, nonzero if reorder_blocks has already seen this block.
  615. In an SSA_NAME node, nonzero if the SSA_NAME occurs in an abnormal
  616. PHI node. */
  617. #define TREE_ASM_WRITTEN(NODE) ((NODE)->base.asm_written_flag)
  618. /* Nonzero in a _DECL if the name is used in its scope.
  619. Nonzero in an expr node means inhibit warning if value is unused.
  620. In IDENTIFIER_NODEs, this means that some extern decl for this name
  621. was used.
  622. In a BLOCK, this means that the block contains variables that are used. */
  623. #define TREE_USED(NODE) ((NODE)->base.used_flag)
  624. /* In a FUNCTION_DECL, nonzero means a call to the function cannot
  625. throw an exception. In a CALL_EXPR, nonzero means the call cannot
  626. throw. We can't easily check the node type here as the C++
  627. frontend also uses this flag (for AGGR_INIT_EXPR). */
  628. #define TREE_NOTHROW(NODE) ((NODE)->base.nothrow_flag)
  629. /* In a CALL_EXPR, means that it's safe to use the target of the call
  630. expansion as the return slot for a call that returns in memory. */
  631. #define CALL_EXPR_RETURN_SLOT_OPT(NODE) \
  632. (CALL_EXPR_CHECK (NODE)->base.private_flag)
  633. /* Cilk keywords accessors. */
  634. #define CILK_SPAWN_FN(NODE) TREE_OPERAND (CILK_SPAWN_STMT_CHECK (NODE), 0)
  635. /* In a RESULT_DECL, PARM_DECL and VAR_DECL, means that it is
  636. passed by invisible reference (and the TREE_TYPE is a pointer to the true
  637. type). */
  638. #define DECL_BY_REFERENCE(NODE) \
  639. (TREE_CHECK3 (NODE, VAR_DECL, PARM_DECL, \
  640. RESULT_DECL)->decl_common.decl_by_reference_flag)
  641. /* In VAR_DECL and PARM_DECL, set when the decl has been used except for
  642. being set. */
  643. #define DECL_READ_P(NODE) \
  644. (TREE_CHECK2 (NODE, VAR_DECL, PARM_DECL)->decl_common.decl_read_flag)
  645. /* In VAR_DECL or RESULT_DECL, set when significant code movement precludes
  646. attempting to share the stack slot with some other variable. */
  647. #define DECL_NONSHAREABLE(NODE) \
  648. (TREE_CHECK2 (NODE, VAR_DECL, \
  649. RESULT_DECL)->decl_common.decl_nonshareable_flag)
  650. /* In a CALL_EXPR, means that the call is the jump from a thunk to the
  651. thunked-to function. */
  652. #define CALL_FROM_THUNK_P(NODE) (CALL_EXPR_CHECK (NODE)->base.protected_flag)
  653. /* In a CALL_EXPR, if the function being called is BUILT_IN_ALLOCA, means that
  654. it has been built for the declaration of a variable-sized object. */
  655. #define CALL_ALLOCA_FOR_VAR_P(NODE) \
  656. (CALL_EXPR_CHECK (NODE)->base.protected_flag)
  657. /* In a CALL_EXPR, means call was instrumented by Pointer Bounds Checker. */
  658. #define CALL_WITH_BOUNDS_P(NODE) (CALL_EXPR_CHECK (NODE)->base.deprecated_flag)
  659. /* In a type, nonzero means that all objects of the type are guaranteed by the
  660. language or front-end to be properly aligned, so we can indicate that a MEM
  661. of this type is aligned at least to the alignment of the type, even if it
  662. doesn't appear that it is. We see this, for example, in object-oriented
  663. languages where a tag field may show this is an object of a more-aligned
  664. variant of the more generic type.
  665. In an SSA_NAME node, nonzero if the SSA_NAME node is on the SSA_NAME
  666. freelist. */
  667. #define TYPE_ALIGN_OK(NODE) (TYPE_CHECK (NODE)->base.nothrow_flag)
  668. /* Used in classes in C++. */
  669. #define TREE_PRIVATE(NODE) ((NODE)->base.private_flag)
  670. /* Used in classes in C++. */
  671. #define TREE_PROTECTED(NODE) ((NODE)->base.protected_flag)
  672. /* True if reference type NODE is a C++ rvalue reference. */
  673. #define TYPE_REF_IS_RVALUE(NODE) \
  674. (REFERENCE_TYPE_CHECK (NODE)->base.private_flag)
  675. /* Nonzero in a _DECL if the use of the name is defined as a
  676. deprecated feature by __attribute__((deprecated)). */
  677. #define TREE_DEPRECATED(NODE) \
  678. ((NODE)->base.deprecated_flag)
  679. /* Nonzero in an IDENTIFIER_NODE if the name is a local alias, whose
  680. uses are to be substituted for uses of the TREE_CHAINed identifier. */
  681. #define IDENTIFIER_TRANSPARENT_ALIAS(NODE) \
  682. (IDENTIFIER_NODE_CHECK (NODE)->base.deprecated_flag)
  683. /* In fixed-point types, means a saturating type. */
  684. #define TYPE_SATURATING(NODE) (TYPE_CHECK (NODE)->base.u.bits.saturating_flag)
  685. /* These flags are available for each language front end to use internally. */
  686. #define TREE_LANG_FLAG_0(NODE) \
  687. (TREE_NOT_CHECK2 (NODE, TREE_VEC, SSA_NAME)->base.u.bits.lang_flag_0)
  688. #define TREE_LANG_FLAG_1(NODE) \
  689. (TREE_NOT_CHECK2 (NODE, TREE_VEC, SSA_NAME)->base.u.bits.lang_flag_1)
  690. #define TREE_LANG_FLAG_2(NODE) \
  691. (TREE_NOT_CHECK2 (NODE, TREE_VEC, SSA_NAME)->base.u.bits.lang_flag_2)
  692. #define TREE_LANG_FLAG_3(NODE) \
  693. (TREE_NOT_CHECK2 (NODE, TREE_VEC, SSA_NAME)->base.u.bits.lang_flag_3)
  694. #define TREE_LANG_FLAG_4(NODE) \
  695. (TREE_NOT_CHECK2 (NODE, TREE_VEC, SSA_NAME)->base.u.bits.lang_flag_4)
  696. #define TREE_LANG_FLAG_5(NODE) \
  697. (TREE_NOT_CHECK2 (NODE, TREE_VEC, SSA_NAME)->base.u.bits.lang_flag_5)
  698. #define TREE_LANG_FLAG_6(NODE) \
  699. (TREE_NOT_CHECK2 (NODE, TREE_VEC, SSA_NAME)->base.u.bits.lang_flag_6)
  700. /* Define additional fields and accessors for nodes representing constants. */
  701. #define TREE_INT_CST_NUNITS(NODE) \
  702. (INTEGER_CST_CHECK (NODE)->base.u.int_length.unextended)
  703. #define TREE_INT_CST_EXT_NUNITS(NODE) \
  704. (INTEGER_CST_CHECK (NODE)->base.u.int_length.extended)
  705. #define TREE_INT_CST_OFFSET_NUNITS(NODE) \
  706. (INTEGER_CST_CHECK (NODE)->base.u.int_length.offset)
  707. #define TREE_INT_CST_ELT(NODE, I) TREE_INT_CST_ELT_CHECK (NODE, I)
  708. #define TREE_INT_CST_LOW(NODE) \
  709. ((unsigned HOST_WIDE_INT) TREE_INT_CST_ELT (NODE, 0))
  710. #define TREE_REAL_CST_PTR(NODE) (REAL_CST_CHECK (NODE)->real_cst.real_cst_ptr)
  711. #define TREE_REAL_CST(NODE) (*TREE_REAL_CST_PTR (NODE))
  712. #define TREE_FIXED_CST_PTR(NODE) \
  713. (FIXED_CST_CHECK (NODE)->fixed_cst.fixed_cst_ptr)
  714. #define TREE_FIXED_CST(NODE) (*TREE_FIXED_CST_PTR (NODE))
  715. /* In a STRING_CST */
  716. /* In C terms, this is sizeof, not strlen. */
  717. #define TREE_STRING_LENGTH(NODE) (STRING_CST_CHECK (NODE)->string.length)
  718. #define TREE_STRING_POINTER(NODE) \
  719. ((const char *)(STRING_CST_CHECK (NODE)->string.str))
  720. /* In a COMPLEX_CST node. */
  721. #define TREE_REALPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.real)
  722. #define TREE_IMAGPART(NODE) (COMPLEX_CST_CHECK (NODE)->complex.imag)
  723. /* In a VECTOR_CST node. */
  724. #define VECTOR_CST_NELTS(NODE) (TYPE_VECTOR_SUBPARTS (TREE_TYPE (NODE)))
  725. #define VECTOR_CST_ELTS(NODE) (VECTOR_CST_CHECK (NODE)->vector.elts)
  726. #define VECTOR_CST_ELT(NODE,IDX) (VECTOR_CST_CHECK (NODE)->vector.elts[IDX])
  727. /* Define fields and accessors for some special-purpose tree nodes. */
  728. #define IDENTIFIER_LENGTH(NODE) \
  729. (IDENTIFIER_NODE_CHECK (NODE)->identifier.id.len)
  730. #define IDENTIFIER_POINTER(NODE) \
  731. ((const char *) IDENTIFIER_NODE_CHECK (NODE)->identifier.id.str)
  732. #define IDENTIFIER_HASH_VALUE(NODE) \
  733. (IDENTIFIER_NODE_CHECK (NODE)->identifier.id.hash_value)
  734. /* Translate a hash table identifier pointer to a tree_identifier
  735. pointer, and vice versa. */
  736. #define HT_IDENT_TO_GCC_IDENT(NODE) \
  737. ((tree) ((char *) (NODE) - sizeof (struct tree_common)))
  738. #define GCC_IDENT_TO_HT_IDENT(NODE) (&((struct tree_identifier *) (NODE))->id)
  739. /* In a TREE_LIST node. */
  740. #define TREE_PURPOSE(NODE) (TREE_LIST_CHECK (NODE)->list.purpose)
  741. #define TREE_VALUE(NODE) (TREE_LIST_CHECK (NODE)->list.value)
  742. /* In a TREE_VEC node. */
  743. #define TREE_VEC_LENGTH(NODE) (TREE_VEC_CHECK (NODE)->base.u.length)
  744. #define TREE_VEC_END(NODE) \
  745. ((void) TREE_VEC_CHECK (NODE), &((NODE)->vec.a[(NODE)->vec.base.u.length]))
  746. #define TREE_VEC_ELT(NODE,I) TREE_VEC_ELT_CHECK (NODE, I)
  747. /* In a CONSTRUCTOR node. */
  748. #define CONSTRUCTOR_ELTS(NODE) (CONSTRUCTOR_CHECK (NODE)->constructor.elts)
  749. #define CONSTRUCTOR_ELT(NODE,IDX) \
  750. (&(*CONSTRUCTOR_ELTS (NODE))[IDX])
  751. #define CONSTRUCTOR_NELTS(NODE) \
  752. (vec_safe_length (CONSTRUCTOR_ELTS (NODE)))
  753. #define CONSTRUCTOR_NO_CLEARING(NODE) \
  754. (CONSTRUCTOR_CHECK (NODE)->base.public_flag)
  755. /* Iterate through the vector V of CONSTRUCTOR_ELT elements, yielding the
  756. value of each element (stored within VAL). IX must be a scratch variable
  757. of unsigned integer type. */
  758. #define FOR_EACH_CONSTRUCTOR_VALUE(V, IX, VAL) \
  759. for (IX = 0; (IX >= vec_safe_length (V)) \
  760. ? false \
  761. : ((VAL = (*(V))[IX].value), \
  762. true); \
  763. (IX)++)
  764. /* Iterate through the vector V of CONSTRUCTOR_ELT elements, yielding both
  765. the value of each element (stored within VAL) and its index (stored
  766. within INDEX). IX must be a scratch variable of unsigned integer type. */
  767. #define FOR_EACH_CONSTRUCTOR_ELT(V, IX, INDEX, VAL) \
  768. for (IX = 0; (IX >= vec_safe_length (V)) \
  769. ? false \
  770. : (((void) (VAL = (*V)[IX].value)), \
  771. (INDEX = (*V)[IX].index), \
  772. true); \
  773. (IX)++)
  774. /* Append a new constructor element to V, with the specified INDEX and VAL. */
  775. #define CONSTRUCTOR_APPEND_ELT(V, INDEX, VALUE) \
  776. do { \
  777. constructor_elt _ce___ = {INDEX, VALUE}; \
  778. vec_safe_push ((V), _ce___); \
  779. } while (0)
  780. /* True if NODE, a FIELD_DECL, is to be processed as a bitfield for
  781. constructor output purposes. */
  782. #define CONSTRUCTOR_BITFIELD_P(NODE) \
  783. (DECL_BIT_FIELD (FIELD_DECL_CHECK (NODE)) && DECL_MODE (NODE) != BLKmode)
  784. /* True if NODE is a clobber right hand side, an expression of indeterminate
  785. value that clobbers the LHS in a copy instruction. We use a volatile
  786. empty CONSTRUCTOR for this, as it matches most of the necessary semantic.
  787. In particular the volatile flag causes us to not prematurely remove
  788. such clobber instructions. */
  789. #define TREE_CLOBBER_P(NODE) \
  790. (TREE_CODE (NODE) == CONSTRUCTOR && TREE_THIS_VOLATILE (NODE))
  791. /* Define fields and accessors for some nodes that represent expressions. */
  792. /* Nonzero if NODE is an empty statement (NOP_EXPR <0>). */
  793. #define IS_EMPTY_STMT(NODE) (TREE_CODE (NODE) == NOP_EXPR \
  794. && VOID_TYPE_P (TREE_TYPE (NODE)) \
  795. && integer_zerop (TREE_OPERAND (NODE, 0)))
  796. /* In ordinary expression nodes. */
  797. #define TREE_OPERAND_LENGTH(NODE) tree_operand_length (NODE)
  798. #define TREE_OPERAND(NODE, I) TREE_OPERAND_CHECK (NODE, I)
  799. /* In a tcc_vl_exp node, operand 0 is an INT_CST node holding the operand
  800. length. Its value includes the length operand itself; that is,
  801. the minimum valid length is 1.
  802. Note that we have to bypass the use of TREE_OPERAND to access
  803. that field to avoid infinite recursion in expanding the macros. */
  804. #define VL_EXP_OPERAND_LENGTH(NODE) \
  805. ((int)TREE_INT_CST_LOW (VL_EXP_CHECK (NODE)->exp.operands[0]))
  806. /* Nonzero if is_gimple_debug() may possibly hold. */
  807. #define MAY_HAVE_DEBUG_STMTS (flag_var_tracking_assignments)
  808. /* In a LOOP_EXPR node. */
  809. #define LOOP_EXPR_BODY(NODE) TREE_OPERAND_CHECK_CODE (NODE, LOOP_EXPR, 0)
  810. /* The source location of this expression. Non-tree_exp nodes such as
  811. decls and constants can be shared among multiple locations, so
  812. return nothing. */
  813. #define EXPR_LOCATION(NODE) \
  814. (CAN_HAVE_LOCATION_P ((NODE)) ? (NODE)->exp.locus : UNKNOWN_LOCATION)
  815. #define SET_EXPR_LOCATION(NODE, LOCUS) EXPR_CHECK ((NODE))->exp.locus = (LOCUS)
  816. #define EXPR_HAS_LOCATION(NODE) (LOCATION_LOCUS (EXPR_LOCATION (NODE)) \
  817. != UNKNOWN_LOCATION)
  818. /* The location to be used in a diagnostic about this expression. Do not
  819. use this macro if the location will be assigned to other expressions. */
  820. #define EXPR_LOC_OR_LOC(NODE, LOCUS) (EXPR_HAS_LOCATION (NODE) \
  821. ? (NODE)->exp.locus : (LOCUS))
  822. #define EXPR_FILENAME(NODE) LOCATION_FILE (EXPR_CHECK ((NODE))->exp.locus)
  823. #define EXPR_LINENO(NODE) LOCATION_LINE (EXPR_CHECK (NODE)->exp.locus)
  824. /* True if a tree is an expression or statement that can have a
  825. location. */
  826. #define CAN_HAVE_LOCATION_P(NODE) ((NODE) && EXPR_P (NODE))
  827. extern void protected_set_expr_location (tree, location_t);
  828. /* In a TARGET_EXPR node. */
  829. #define TARGET_EXPR_SLOT(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 0)
  830. #define TARGET_EXPR_INITIAL(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 1)
  831. #define TARGET_EXPR_CLEANUP(NODE) TREE_OPERAND_CHECK_CODE (NODE, TARGET_EXPR, 2)
  832. /* DECL_EXPR accessor. This gives access to the DECL associated with
  833. the given declaration statement. */
  834. #define DECL_EXPR_DECL(NODE) TREE_OPERAND (DECL_EXPR_CHECK (NODE), 0)
  835. #define EXIT_EXPR_COND(NODE) TREE_OPERAND (EXIT_EXPR_CHECK (NODE), 0)
  836. /* COMPOUND_LITERAL_EXPR accessors. */
  837. #define COMPOUND_LITERAL_EXPR_DECL_EXPR(NODE) \
  838. TREE_OPERAND (COMPOUND_LITERAL_EXPR_CHECK (NODE), 0)
  839. #define COMPOUND_LITERAL_EXPR_DECL(NODE) \
  840. DECL_EXPR_DECL (COMPOUND_LITERAL_EXPR_DECL_EXPR (NODE))
  841. /* SWITCH_EXPR accessors. These give access to the condition, body and
  842. original condition type (before any compiler conversions)
  843. of the switch statement, respectively. */
  844. #define SWITCH_COND(NODE) TREE_OPERAND (SWITCH_EXPR_CHECK (NODE), 0)
  845. #define SWITCH_BODY(NODE) TREE_OPERAND (SWITCH_EXPR_CHECK (NODE), 1)
  846. #define SWITCH_LABELS(NODE) TREE_OPERAND (SWITCH_EXPR_CHECK (NODE), 2)
  847. /* CASE_LABEL_EXPR accessors. These give access to the high and low values
  848. of a case label, respectively. */
  849. #define CASE_LOW(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 0)
  850. #define CASE_HIGH(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 1)
  851. #define CASE_LABEL(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 2)
  852. #define CASE_CHAIN(NODE) TREE_OPERAND (CASE_LABEL_EXPR_CHECK (NODE), 3)
  853. /* The operands of a TARGET_MEM_REF. Operands 0 and 1 have to match
  854. corresponding MEM_REF operands. */
  855. #define TMR_BASE(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 0))
  856. #define TMR_OFFSET(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 1))
  857. #define TMR_INDEX(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 2))
  858. #define TMR_STEP(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 3))
  859. #define TMR_INDEX2(NODE) (TREE_OPERAND (TARGET_MEM_REF_CHECK (NODE), 4))
  860. #define MR_DEPENDENCE_CLIQUE(NODE) \
  861. (TREE_CHECK2 (NODE, MEM_REF, TARGET_MEM_REF)->base.u.dependence_info.clique)
  862. #define MR_DEPENDENCE_BASE(NODE) \
  863. (TREE_CHECK2 (NODE, MEM_REF, TARGET_MEM_REF)->base.u.dependence_info.base)
  864. /* The operands of a BIND_EXPR. */
  865. #define BIND_EXPR_VARS(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 0))
  866. #define BIND_EXPR_BODY(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 1))
  867. #define BIND_EXPR_BLOCK(NODE) (TREE_OPERAND (BIND_EXPR_CHECK (NODE), 2))
  868. /* GOTO_EXPR accessor. This gives access to the label associated with
  869. a goto statement. */
  870. #define GOTO_DESTINATION(NODE) TREE_OPERAND ((NODE), 0)
  871. /* ASM_EXPR accessors. ASM_STRING returns a STRING_CST for the
  872. instruction (e.g., "mov x, y"). ASM_OUTPUTS, ASM_INPUTS, and
  873. ASM_CLOBBERS represent the outputs, inputs, and clobbers for the
  874. statement. */
  875. #define ASM_STRING(NODE) TREE_OPERAND (ASM_EXPR_CHECK (NODE), 0)
  876. #define ASM_OUTPUTS(NODE) TREE_OPERAND (ASM_EXPR_CHECK (NODE), 1)
  877. #define ASM_INPUTS(NODE) TREE_OPERAND (ASM_EXPR_CHECK (NODE), 2)
  878. #define ASM_CLOBBERS(NODE) TREE_OPERAND (ASM_EXPR_CHECK (NODE), 3)
  879. #define ASM_LABELS(NODE) TREE_OPERAND (ASM_EXPR_CHECK (NODE), 4)
  880. /* Nonzero if we want to create an ASM_INPUT instead of an
  881. ASM_OPERAND with no operands. */
  882. #define ASM_INPUT_P(NODE) (ASM_EXPR_CHECK (NODE)->base.static_flag)
  883. #define ASM_VOLATILE_P(NODE) (ASM_EXPR_CHECK (NODE)->base.public_flag)
  884. /* COND_EXPR accessors. */
  885. #define COND_EXPR_COND(NODE) (TREE_OPERAND (COND_EXPR_CHECK (NODE), 0))
  886. #define COND_EXPR_THEN(NODE) (TREE_OPERAND (COND_EXPR_CHECK (NODE), 1))
  887. #define COND_EXPR_ELSE(NODE) (TREE_OPERAND (COND_EXPR_CHECK (NODE), 2))
  888. /* Accessors for the chains of recurrences. */
  889. #define CHREC_VAR(NODE) TREE_OPERAND (POLYNOMIAL_CHREC_CHECK (NODE), 0)
  890. #define CHREC_LEFT(NODE) TREE_OPERAND (POLYNOMIAL_CHREC_CHECK (NODE), 1)
  891. #define CHREC_RIGHT(NODE) TREE_OPERAND (POLYNOMIAL_CHREC_CHECK (NODE), 2)
  892. #define CHREC_VARIABLE(NODE) TREE_INT_CST_LOW (CHREC_VAR (NODE))
  893. /* LABEL_EXPR accessor. This gives access to the label associated with
  894. the given label expression. */
  895. #define LABEL_EXPR_LABEL(NODE) TREE_OPERAND (LABEL_EXPR_CHECK (NODE), 0)
  896. /* CATCH_EXPR accessors. */
  897. #define CATCH_TYPES(NODE) TREE_OPERAND (CATCH_EXPR_CHECK (NODE), 0)
  898. #define CATCH_BODY(NODE) TREE_OPERAND (CATCH_EXPR_CHECK (NODE), 1)
  899. /* EH_FILTER_EXPR accessors. */
  900. #define EH_FILTER_TYPES(NODE) TREE_OPERAND (EH_FILTER_EXPR_CHECK (NODE), 0)
  901. #define EH_FILTER_FAILURE(NODE) TREE_OPERAND (EH_FILTER_EXPR_CHECK (NODE), 1)
  902. /* OBJ_TYPE_REF accessors. */
  903. #define OBJ_TYPE_REF_EXPR(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 0)
  904. #define OBJ_TYPE_REF_OBJECT(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 1)
  905. #define OBJ_TYPE_REF_TOKEN(NODE) TREE_OPERAND (OBJ_TYPE_REF_CHECK (NODE), 2)
  906. /* ASSERT_EXPR accessors. */
  907. #define ASSERT_EXPR_VAR(NODE) TREE_OPERAND (ASSERT_EXPR_CHECK (NODE), 0)
  908. #define ASSERT_EXPR_COND(NODE) TREE_OPERAND (ASSERT_EXPR_CHECK (NODE), 1)
  909. /* CALL_EXPR accessors. */
  910. #define CALL_EXPR_FN(NODE) TREE_OPERAND (CALL_EXPR_CHECK (NODE), 1)
  911. #define CALL_EXPR_STATIC_CHAIN(NODE) TREE_OPERAND (CALL_EXPR_CHECK (NODE), 2)
  912. #define CALL_EXPR_ARG(NODE, I) TREE_OPERAND (CALL_EXPR_CHECK (NODE), (I) + 3)
  913. #define call_expr_nargs(NODE) (VL_EXP_OPERAND_LENGTH (NODE) - 3)
  914. #define CALL_EXPR_IFN(NODE) (CALL_EXPR_CHECK (NODE)->base.u.ifn)
  915. /* CALL_EXPR_ARGP returns a pointer to the argument vector for NODE.
  916. We can't use &CALL_EXPR_ARG (NODE, 0) because that will complain if
  917. the argument count is zero when checking is enabled. Instead, do
  918. the pointer arithmetic to advance past the 3 fixed operands in a
  919. CALL_EXPR. That produces a valid pointer to just past the end of the
  920. operand array, even if it's not valid to dereference it. */
  921. #define CALL_EXPR_ARGP(NODE) \
  922. (&(TREE_OPERAND (CALL_EXPR_CHECK (NODE), 0)) + 3)
  923. /* TM directives and accessors. */
  924. #define TRANSACTION_EXPR_BODY(NODE) \
  925. TREE_OPERAND (TRANSACTION_EXPR_CHECK (NODE), 0)
  926. #define TRANSACTION_EXPR_OUTER(NODE) \
  927. (TRANSACTION_EXPR_CHECK (NODE)->base.static_flag)
  928. #define TRANSACTION_EXPR_RELAXED(NODE) \
  929. (TRANSACTION_EXPR_CHECK (NODE)->base.public_flag)
  930. /* OpenMP and OpenACC directive and clause accessors. */
  931. #define OMP_BODY(NODE) \
  932. TREE_OPERAND (TREE_RANGE_CHECK (NODE, OACC_PARALLEL, OMP_CRITICAL), 0)
  933. #define OMP_CLAUSES(NODE) \
  934. TREE_OPERAND (TREE_RANGE_CHECK (NODE, OACC_PARALLEL, OMP_SINGLE), 1)
  935. #define OACC_PARALLEL_BODY(NODE) \
  936. TREE_OPERAND (OACC_PARALLEL_CHECK (NODE), 0)
  937. #define OACC_PARALLEL_CLAUSES(NODE) \
  938. TREE_OPERAND (OACC_PARALLEL_CHECK (NODE), 1)
  939. #define OACC_KERNELS_BODY(NODE) \
  940. TREE_OPERAND (OACC_KERNELS_CHECK(NODE), 0)
  941. #define OACC_KERNELS_CLAUSES(NODE) \
  942. TREE_OPERAND (OACC_KERNELS_CHECK(NODE), 1)
  943. #define OACC_DATA_BODY(NODE) \
  944. TREE_OPERAND (OACC_DATA_CHECK (NODE), 0)
  945. #define OACC_DATA_CLAUSES(NODE) \
  946. TREE_OPERAND (OACC_DATA_CHECK (NODE), 1)
  947. #define OACC_HOST_DATA_BODY(NODE) \
  948. TREE_OPERAND (OACC_HOST_DATA_CHECK (NODE), 0)
  949. #define OACC_HOST_DATA_CLAUSES(NODE) \
  950. TREE_OPERAND (OACC_HOST_DATA_CHECK (NODE), 1)
  951. #define OACC_CACHE_CLAUSES(NODE) \
  952. TREE_OPERAND (OACC_CACHE_CHECK (NODE), 0)
  953. #define OACC_DECLARE_CLAUSES(NODE) \
  954. TREE_OPERAND (OACC_DECLARE_CHECK (NODE), 0)
  955. #define OACC_ENTER_DATA_CLAUSES(NODE) \
  956. TREE_OPERAND (OACC_ENTER_DATA_CHECK (NODE), 0)
  957. #define OACC_EXIT_DATA_CLAUSES(NODE) \
  958. TREE_OPERAND (OACC_EXIT_DATA_CHECK (NODE), 0)
  959. #define OACC_UPDATE_CLAUSES(NODE) \
  960. TREE_OPERAND (OACC_UPDATE_CHECK (NODE), 0)
  961. #define OMP_PARALLEL_BODY(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 0)
  962. #define OMP_PARALLEL_CLAUSES(NODE) TREE_OPERAND (OMP_PARALLEL_CHECK (NODE), 1)
  963. #define OMP_TASK_BODY(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 0)
  964. #define OMP_TASK_CLAUSES(NODE) TREE_OPERAND (OMP_TASK_CHECK (NODE), 1)
  965. #define OMP_TASKREG_CHECK(NODE) TREE_RANGE_CHECK (NODE, OMP_PARALLEL, OMP_TASK)
  966. #define OMP_TASKREG_BODY(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 0)
  967. #define OMP_TASKREG_CLAUSES(NODE) TREE_OPERAND (OMP_TASKREG_CHECK (NODE), 1)
  968. #define OMP_LOOP_CHECK(NODE) TREE_RANGE_CHECK (NODE, OMP_FOR, OACC_LOOP)
  969. #define OMP_FOR_BODY(NODE) TREE_OPERAND (OMP_LOOP_CHECK (NODE), 0)
  970. #define OMP_FOR_CLAUSES(NODE) TREE_OPERAND (OMP_LOOP_CHECK (NODE), 1)
  971. #define OMP_FOR_INIT(NODE) TREE_OPERAND (OMP_LOOP_CHECK (NODE), 2)
  972. #define OMP_FOR_COND(NODE) TREE_OPERAND (OMP_LOOP_CHECK (NODE), 3)
  973. #define OMP_FOR_INCR(NODE) TREE_OPERAND (OMP_LOOP_CHECK (NODE), 4)
  974. #define OMP_FOR_PRE_BODY(NODE) TREE_OPERAND (OMP_LOOP_CHECK (NODE), 5)
  975. #define OMP_SECTIONS_BODY(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 0)
  976. #define OMP_SECTIONS_CLAUSES(NODE) TREE_OPERAND (OMP_SECTIONS_CHECK (NODE), 1)
  977. #define OMP_SECTION_BODY(NODE) TREE_OPERAND (OMP_SECTION_CHECK (NODE), 0)
  978. #define OMP_SINGLE_BODY(NODE) TREE_OPERAND (OMP_SINGLE_CHECK (NODE), 0)
  979. #define OMP_SINGLE_CLAUSES(NODE) TREE_OPERAND (OMP_SINGLE_CHECK (NODE), 1)
  980. #define OMP_MASTER_BODY(NODE) TREE_OPERAND (OMP_MASTER_CHECK (NODE), 0)
  981. #define OMP_TASKGROUP_BODY(NODE) TREE_OPERAND (OMP_TASKGROUP_CHECK (NODE), 0)
  982. #define OMP_ORDERED_BODY(NODE) TREE_OPERAND (OMP_ORDERED_CHECK (NODE), 0)
  983. #define OMP_CRITICAL_BODY(NODE) TREE_OPERAND (OMP_CRITICAL_CHECK (NODE), 0)
  984. #define OMP_CRITICAL_NAME(NODE) TREE_OPERAND (OMP_CRITICAL_CHECK (NODE), 1)
  985. #define OMP_TEAMS_BODY(NODE) TREE_OPERAND (OMP_TEAMS_CHECK (NODE), 0)
  986. #define OMP_TEAMS_CLAUSES(NODE) TREE_OPERAND (OMP_TEAMS_CHECK (NODE), 1)
  987. #define OMP_TARGET_DATA_BODY(NODE) \
  988. TREE_OPERAND (OMP_TARGET_DATA_CHECK (NODE), 0)
  989. #define OMP_TARGET_DATA_CLAUSES(NODE)\
  990. TREE_OPERAND (OMP_TARGET_DATA_CHECK (NODE), 1)
  991. #define OMP_TARGET_BODY(NODE) TREE_OPERAND (OMP_TARGET_CHECK (NODE), 0)
  992. #define OMP_TARGET_CLAUSES(NODE) TREE_OPERAND (OMP_TARGET_CHECK (NODE), 1)
  993. #define OMP_TARGET_UPDATE_CLAUSES(NODE)\
  994. TREE_OPERAND (OMP_TARGET_UPDATE_CHECK (NODE), 0)
  995. #define OMP_CLAUSE_SIZE(NODE) \
  996. OMP_CLAUSE_OPERAND (OMP_CLAUSE_RANGE_CHECK (OMP_CLAUSE_CHECK (NODE), \
  997. OMP_CLAUSE_FROM, \
  998. OMP_CLAUSE__CACHE_), 1)
  999. #define OMP_CLAUSE_CHAIN(NODE) TREE_CHAIN (OMP_CLAUSE_CHECK (NODE))
  1000. #define OMP_CLAUSE_DECL(NODE) \
  1001. OMP_CLAUSE_OPERAND (OMP_CLAUSE_RANGE_CHECK (OMP_CLAUSE_CHECK (NODE), \
  1002. OMP_CLAUSE_PRIVATE, \
  1003. OMP_CLAUSE__LOOPTEMP_), 0)
  1004. #define OMP_CLAUSE_HAS_LOCATION(NODE) \
  1005. (LOCATION_LOCUS ((OMP_CLAUSE_CHECK (NODE))->omp_clause.locus) \
  1006. != UNKNOWN_LOCATION)
  1007. #define OMP_CLAUSE_LOCATION(NODE) (OMP_CLAUSE_CHECK (NODE))->omp_clause.locus
  1008. /* True on an OMP_SECTION statement that was the last lexical member.
  1009. This status is meaningful in the implementation of lastprivate. */
  1010. #define OMP_SECTION_LAST(NODE) \
  1011. (OMP_SECTION_CHECK (NODE)->base.private_flag)
  1012. /* True on an OACC_KERNELS statement if is represents combined kernels loop
  1013. directive. */
  1014. #define OACC_KERNELS_COMBINED(NODE) \
  1015. (OACC_KERNELS_CHECK (NODE)->base.private_flag)
  1016. /* Like OACC_KERNELS_COMBINED, but for parallel loop directive. */
  1017. #define OACC_PARALLEL_COMBINED(NODE) \
  1018. (OACC_PARALLEL_CHECK (NODE)->base.private_flag)
  1019. /* True on an OMP_PARALLEL statement if it represents an explicit
  1020. combined parallel work-sharing constructs. */
  1021. #define OMP_PARALLEL_COMBINED(NODE) \
  1022. (OMP_PARALLEL_CHECK (NODE)->base.private_flag)
  1023. /* True on an OMP_TEAMS statement if it represents an explicit
  1024. combined teams distribute constructs. */
  1025. #define OMP_TEAMS_COMBINED(NODE) \
  1026. (OMP_TEAMS_CHECK (NODE)->base.private_flag)
  1027. /* True if OMP_ATOMIC* is supposed to be sequentially consistent
  1028. as opposed to relaxed. */
  1029. #define OMP_ATOMIC_SEQ_CST(NODE) \
  1030. (TREE_RANGE_CHECK (NODE, OMP_ATOMIC, \
  1031. OMP_ATOMIC_CAPTURE_NEW)->base.private_flag)
  1032. /* True on a PRIVATE clause if its decl is kept around for debugging
  1033. information only and its DECL_VALUE_EXPR is supposed to point
  1034. to what it has been remapped to. */
  1035. #define OMP_CLAUSE_PRIVATE_DEBUG(NODE) \
  1036. (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_PRIVATE)->base.public_flag)
  1037. /* True on a PRIVATE clause if ctor needs access to outer region's
  1038. variable. */
  1039. #define OMP_CLAUSE_PRIVATE_OUTER_REF(NODE) \
  1040. TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_PRIVATE))
  1041. /* True on a LASTPRIVATE clause if a FIRSTPRIVATE clause for the same
  1042. decl is present in the chain. */
  1043. #define OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE(NODE) \
  1044. (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LASTPRIVATE)->base.public_flag)
  1045. #define OMP_CLAUSE_LASTPRIVATE_STMT(NODE) \
  1046. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, \
  1047. OMP_CLAUSE_LASTPRIVATE),\
  1048. 1)
  1049. #define OMP_CLAUSE_LASTPRIVATE_GIMPLE_SEQ(NODE) \
  1050. (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_init
  1051. #define OMP_CLAUSE_FINAL_EXPR(NODE) \
  1052. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_FINAL), 0)
  1053. #define OMP_CLAUSE_IF_EXPR(NODE) \
  1054. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_IF), 0)
  1055. #define OMP_CLAUSE_NUM_THREADS_EXPR(NODE) \
  1056. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_THREADS),0)
  1057. #define OMP_CLAUSE_SCHEDULE_CHUNK_EXPR(NODE) \
  1058. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SCHEDULE), 0)
  1059. /* OpenACC clause expressions */
  1060. #define OMP_CLAUSE_GANG_EXPR(NODE) \
  1061. OMP_CLAUSE_OPERAND ( \
  1062. OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_GANG), 0)
  1063. #define OMP_CLAUSE_GANG_STATIC_EXPR(NODE) \
  1064. OMP_CLAUSE_OPERAND ( \
  1065. OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_GANG), 1)
  1066. #define OMP_CLAUSE_ASYNC_EXPR(NODE) \
  1067. OMP_CLAUSE_OPERAND ( \
  1068. OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ASYNC), 0)
  1069. #define OMP_CLAUSE_WAIT_EXPR(NODE) \
  1070. OMP_CLAUSE_OPERAND ( \
  1071. OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_WAIT), 0)
  1072. #define OMP_CLAUSE_VECTOR_EXPR(NODE) \
  1073. OMP_CLAUSE_OPERAND ( \
  1074. OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_VECTOR), 0)
  1075. #define OMP_CLAUSE_WORKER_EXPR(NODE) \
  1076. OMP_CLAUSE_OPERAND ( \
  1077. OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_WORKER), 0)
  1078. #define OMP_CLAUSE_NUM_GANGS_EXPR(NODE) \
  1079. OMP_CLAUSE_OPERAND ( \
  1080. OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_GANGS), 0)
  1081. #define OMP_CLAUSE_NUM_WORKERS_EXPR(NODE) \
  1082. OMP_CLAUSE_OPERAND ( \
  1083. OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_WORKERS), 0)
  1084. #define OMP_CLAUSE_VECTOR_LENGTH_EXPR(NODE) \
  1085. OMP_CLAUSE_OPERAND ( \
  1086. OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_VECTOR_LENGTH), 0)
  1087. #define OMP_CLAUSE_DEPEND_KIND(NODE) \
  1088. (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEPEND)->omp_clause.subcode.depend_kind)
  1089. #define OMP_CLAUSE_MAP_KIND(NODE) \
  1090. ((enum gomp_map_kind) OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP)->omp_clause.subcode.map_kind)
  1091. #define OMP_CLAUSE_SET_MAP_KIND(NODE, MAP_KIND) \
  1092. (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP)->omp_clause.subcode.map_kind \
  1093. = (unsigned char) (MAP_KIND))
  1094. /* Nonzero if this map clause is for array (rather than pointer) based array
  1095. section with zero bias. Both the non-decl OMP_CLAUSE_MAP and corresponding
  1096. OMP_CLAUSE_MAP with GOMP_MAP_POINTER are marked with this flag. */
  1097. #define OMP_CLAUSE_MAP_ZERO_BIAS_ARRAY_SECTION(NODE) \
  1098. (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_MAP)->base.public_flag)
  1099. #define OMP_CLAUSE_PROC_BIND_KIND(NODE) \
  1100. (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_PROC_BIND)->omp_clause.subcode.proc_bind_kind)
  1101. #define OMP_CLAUSE_COLLAPSE_EXPR(NODE) \
  1102. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_COLLAPSE), 0)
  1103. #define OMP_CLAUSE_COLLAPSE_ITERVAR(NODE) \
  1104. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_COLLAPSE), 1)
  1105. #define OMP_CLAUSE_COLLAPSE_COUNT(NODE) \
  1106. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_COLLAPSE), 2)
  1107. #define OMP_CLAUSE_REDUCTION_CODE(NODE) \
  1108. (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION)->omp_clause.subcode.reduction_code)
  1109. #define OMP_CLAUSE_REDUCTION_INIT(NODE) \
  1110. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 1)
  1111. #define OMP_CLAUSE_REDUCTION_MERGE(NODE) \
  1112. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 2)
  1113. #define OMP_CLAUSE_REDUCTION_GIMPLE_INIT(NODE) \
  1114. (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_init
  1115. #define OMP_CLAUSE_REDUCTION_GIMPLE_MERGE(NODE) \
  1116. (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_merge
  1117. #define OMP_CLAUSE_REDUCTION_PLACEHOLDER(NODE) \
  1118. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION), 3)
  1119. /* True if a REDUCTION clause may reference the original list item (omp_orig)
  1120. in its OMP_CLAUSE_REDUCTION_{,GIMPLE_}INIT. */
  1121. #define OMP_CLAUSE_REDUCTION_OMP_ORIG_REF(NODE) \
  1122. (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_REDUCTION)->base.public_flag)
  1123. /* True if a LINEAR clause doesn't need copy in. True for iterator vars which
  1124. are always initialized inside of the loop construct, false otherwise. */
  1125. #define OMP_CLAUSE_LINEAR_NO_COPYIN(NODE) \
  1126. (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LINEAR)->base.public_flag)
  1127. /* True if a LINEAR clause doesn't need copy out. True for iterator vars which
  1128. are declared inside of the simd construct. */
  1129. #define OMP_CLAUSE_LINEAR_NO_COPYOUT(NODE) \
  1130. TREE_PRIVATE (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LINEAR))
  1131. /* True if a LINEAR clause has a stride that is variable. */
  1132. #define OMP_CLAUSE_LINEAR_VARIABLE_STRIDE(NODE) \
  1133. TREE_PROTECTED (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LINEAR))
  1134. /* True if a LINEAR clause is for an array or allocatable variable that
  1135. needs special handling by the frontend. */
  1136. #define OMP_CLAUSE_LINEAR_ARRAY(NODE) \
  1137. (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LINEAR)->base.deprecated_flag)
  1138. #define OMP_CLAUSE_LINEAR_STEP(NODE) \
  1139. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LINEAR), 1)
  1140. #define OMP_CLAUSE_LINEAR_STMT(NODE) \
  1141. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_LINEAR), 2)
  1142. #define OMP_CLAUSE_LINEAR_GIMPLE_SEQ(NODE) \
  1143. (OMP_CLAUSE_CHECK (NODE))->omp_clause.gimple_reduction_init
  1144. #define OMP_CLAUSE_ALIGNED_ALIGNMENT(NODE) \
  1145. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_ALIGNED), 1)
  1146. #define OMP_CLAUSE_NUM_TEAMS_EXPR(NODE) \
  1147. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_NUM_TEAMS), 0)
  1148. #define OMP_CLAUSE_THREAD_LIMIT_EXPR(NODE) \
  1149. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, \
  1150. OMP_CLAUSE_THREAD_LIMIT), 0)
  1151. #define OMP_CLAUSE_DEVICE_ID(NODE) \
  1152. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEVICE), 0)
  1153. #define OMP_CLAUSE_DIST_SCHEDULE_CHUNK_EXPR(NODE) \
  1154. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, \
  1155. OMP_CLAUSE_DIST_SCHEDULE), 0)
  1156. #define OMP_CLAUSE_SAFELEN_EXPR(NODE) \
  1157. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SAFELEN), 0)
  1158. #define OMP_CLAUSE_SIMDLEN_EXPR(NODE) \
  1159. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SIMDLEN), 0)
  1160. #define OMP_CLAUSE__SIMDUID__DECL(NODE) \
  1161. OMP_CLAUSE_OPERAND (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE__SIMDUID_), 0)
  1162. #define OMP_CLAUSE_SCHEDULE_KIND(NODE) \
  1163. (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_SCHEDULE)->omp_clause.subcode.schedule_kind)
  1164. #define OMP_CLAUSE_DEFAULT_KIND(NODE) \
  1165. (OMP_CLAUSE_SUBCODE_CHECK (NODE, OMP_CLAUSE_DEFAULT)->omp_clause.subcode.default_kind)
  1166. /* SSA_NAME accessors. */
  1167. /* Returns the IDENTIFIER_NODE giving the SSA name a name or NULL_TREE
  1168. if there is no name associated with it. */
  1169. #define SSA_NAME_IDENTIFIER(NODE) \
  1170. (SSA_NAME_CHECK (NODE)->ssa_name.var != NULL_TREE \
  1171. ? (TREE_CODE ((NODE)->ssa_name.var) == IDENTIFIER_NODE \
  1172. ? (NODE)->ssa_name.var \
  1173. : DECL_NAME ((NODE)->ssa_name.var)) \
  1174. : NULL_TREE)
  1175. /* Returns the variable being referenced. This can be NULL_TREE for
  1176. temporaries not associated with any user variable.
  1177. Once released, this is the only field that can be relied upon. */
  1178. #define SSA_NAME_VAR(NODE) \
  1179. (SSA_NAME_CHECK (NODE)->ssa_name.var == NULL_TREE \
  1180. || TREE_CODE ((NODE)->ssa_name.var) == IDENTIFIER_NODE \
  1181. ? NULL_TREE : (NODE)->ssa_name.var)
  1182. #define SET_SSA_NAME_VAR_OR_IDENTIFIER(NODE,VAR) \
  1183. do { SSA_NAME_CHECK (NODE)->ssa_name.var = (VAR); } while (0)
  1184. /* Returns the statement which defines this SSA name. */
  1185. #define SSA_NAME_DEF_STMT(NODE) SSA_NAME_CHECK (NODE)->ssa_name.def_stmt
  1186. /* Returns the SSA version number of this SSA name. Note that in
  1187. tree SSA, version numbers are not per variable and may be recycled. */
  1188. #define SSA_NAME_VERSION(NODE) SSA_NAME_CHECK (NODE)->base.u.version
  1189. /* Nonzero if this SSA name occurs in an abnormal PHI. SSA_NAMES are
  1190. never output, so we can safely use the ASM_WRITTEN_FLAG for this
  1191. status bit. */
  1192. #define SSA_NAME_OCCURS_IN_ABNORMAL_PHI(NODE) \
  1193. SSA_NAME_CHECK (NODE)->base.asm_written_flag
  1194. /* Nonzero if this SSA_NAME expression is currently on the free list of
  1195. SSA_NAMES. Using NOTHROW_FLAG seems reasonably safe since throwing
  1196. has no meaning for an SSA_NAME. */
  1197. #define SSA_NAME_IN_FREE_LIST(NODE) \
  1198. SSA_NAME_CHECK (NODE)->base.nothrow_flag
  1199. /* Nonzero if this SSA_NAME is the default definition for the
  1200. underlying symbol. A default SSA name is created for symbol S if
  1201. the very first reference to S in the function is a read operation.
  1202. Default definitions are always created by an empty statement and
  1203. belong to no basic block. */
  1204. #define SSA_NAME_IS_DEFAULT_DEF(NODE) \
  1205. SSA_NAME_CHECK (NODE)->base.default_def_flag
  1206. /* Attributes for SSA_NAMEs for pointer-type variables. */
  1207. #define SSA_NAME_PTR_INFO(N) \
  1208. SSA_NAME_CHECK (N)->ssa_name.info.ptr_info
  1209. /* True if SSA_NAME_RANGE_INFO describes an anti-range. */
  1210. #define SSA_NAME_ANTI_RANGE_P(N) \
  1211. SSA_NAME_CHECK (N)->base.static_flag
  1212. /* The type of range described by SSA_NAME_RANGE_INFO. */
  1213. #define SSA_NAME_RANGE_TYPE(N) \
  1214. (SSA_NAME_ANTI_RANGE_P (N) ? VR_ANTI_RANGE : VR_RANGE)
  1215. /* Value range info attributes for SSA_NAMEs of non pointer-type variables. */
  1216. #define SSA_NAME_RANGE_INFO(N) \
  1217. SSA_NAME_CHECK (N)->ssa_name.info.range_info
  1218. /* Return the immediate_use information for an SSA_NAME. */
  1219. #define SSA_NAME_IMM_USE_NODE(NODE) SSA_NAME_CHECK (NODE)->ssa_name.imm_uses
  1220. #define OMP_CLAUSE_CODE(NODE) \
  1221. (OMP_CLAUSE_CHECK (NODE))->omp_clause.code
  1222. #define OMP_CLAUSE_SET_CODE(NODE, CODE) \
  1223. ((OMP_CLAUSE_CHECK (NODE))->omp_clause.code = (CODE))
  1224. #define OMP_CLAUSE_OPERAND(NODE, I) \
  1225. OMP_CLAUSE_ELT_CHECK (NODE, I)
  1226. /* In a BLOCK node. */
  1227. #define BLOCK_VARS(NODE) (BLOCK_CHECK (NODE)->block.vars)
  1228. #define BLOCK_NONLOCALIZED_VARS(NODE) \
  1229. (BLOCK_CHECK (NODE)->block.nonlocalized_vars)
  1230. #define BLOCK_NUM_NONLOCALIZED_VARS(NODE) \
  1231. vec_safe_length (BLOCK_NONLOCALIZED_VARS (NODE))
  1232. #define BLOCK_NONLOCALIZED_VAR(NODE,N) (*BLOCK_NONLOCALIZED_VARS (NODE))[N]
  1233. #define BLOCK_SUBBLOCKS(NODE) (BLOCK_CHECK (NODE)->block.subblocks)
  1234. #define BLOCK_SUPERCONTEXT(NODE) (BLOCK_CHECK (NODE)->block.supercontext)
  1235. #define BLOCK_CHAIN(NODE) (BLOCK_CHECK (NODE)->block.chain)
  1236. #define BLOCK_ABSTRACT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.abstract_origin)
  1237. #define BLOCK_ABSTRACT(NODE) (BLOCK_CHECK (NODE)->block.abstract_flag)
  1238. /* True if BLOCK has the same ranges as its BLOCK_SUPERCONTEXT. */
  1239. #define BLOCK_SAME_RANGE(NODE) (BLOCK_CHECK (NODE)->base.u.bits.nameless_flag)
  1240. /* An index number for this block. These values are not guaranteed to
  1241. be unique across functions -- whether or not they are depends on
  1242. the debugging output format in use. */
  1243. #define BLOCK_NUMBER(NODE) (BLOCK_CHECK (NODE)->block.block_num)
  1244. /* If block reordering splits a lexical block into discontiguous
  1245. address ranges, we'll make a copy of the original block.
  1246. Note that this is logically distinct from BLOCK_ABSTRACT_ORIGIN.
  1247. In that case, we have one source block that has been replicated
  1248. (through inlining or unrolling) into many logical blocks, and that
  1249. these logical blocks have different physical variables in them.
  1250. In this case, we have one logical block split into several
  1251. non-contiguous address ranges. Most debug formats can't actually
  1252. represent this idea directly, so we fake it by creating multiple
  1253. logical blocks with the same variables in them. However, for those
  1254. that do support non-contiguous regions, these allow the original
  1255. logical block to be reconstructed, along with the set of address
  1256. ranges.
  1257. One of the logical block fragments is arbitrarily chosen to be
  1258. the ORIGIN. The other fragments will point to the origin via
  1259. BLOCK_FRAGMENT_ORIGIN; the origin itself will have this pointer
  1260. be null. The list of fragments will be chained through
  1261. BLOCK_FRAGMENT_CHAIN from the origin. */
  1262. #define BLOCK_FRAGMENT_ORIGIN(NODE) (BLOCK_CHECK (NODE)->block.fragment_origin)
  1263. #define BLOCK_FRAGMENT_CHAIN(NODE) (BLOCK_CHECK (NODE)->block.fragment_chain)
  1264. /* For an inlined function, this gives the location where it was called
  1265. from. This is only set in the top level block, which corresponds to the
  1266. inlined function scope. This is used in the debug output routines. */
  1267. #define BLOCK_SOURCE_LOCATION(NODE) (BLOCK_CHECK (NODE)->block.locus)
  1268. /* This gives the location of the end of the block, useful to attach
  1269. code implicitly generated for outgoing paths. */
  1270. #define BLOCK_SOURCE_END_LOCATION(NODE) (BLOCK_CHECK (NODE)->block.end_locus)
  1271. /* Define fields and accessors for nodes representing data types. */
  1272. /* See tree.def for documentation of the use of these fields.
  1273. Look at the documentation of the various ..._TYPE tree codes.
  1274. Note that the type.values, type.minval, and type.maxval fields are
  1275. overloaded and used for different macros in different kinds of types.
  1276. Each macro must check to ensure the tree node is of the proper kind of
  1277. type. Note also that some of the front-ends also overload these fields,
  1278. so they must be checked as well. */
  1279. #define TYPE_UID(NODE) (TYPE_CHECK (NODE)->type_common.uid)
  1280. #define TYPE_SIZE(NODE) (TYPE_CHECK (NODE)->type_common.size)
  1281. #define TYPE_SIZE_UNIT(NODE) (TYPE_CHECK (NODE)->type_common.size_unit)
  1282. #define TYPE_POINTER_TO(NODE) (TYPE_CHECK (NODE)->type_common.pointer_to)
  1283. #define TYPE_REFERENCE_TO(NODE) (TYPE_CHECK (NODE)->type_common.reference_to)
  1284. #define TYPE_PRECISION(NODE) (TYPE_CHECK (NODE)->type_common.precision)
  1285. #define TYPE_NAME(NODE) (TYPE_CHECK (NODE)->type_common.name)
  1286. #define TYPE_NEXT_VARIANT(NODE) (TYPE_CHECK (NODE)->type_common.next_variant)
  1287. #define TYPE_MAIN_VARIANT(NODE) (TYPE_CHECK (NODE)->type_common.main_variant)
  1288. #define TYPE_CONTEXT(NODE) (TYPE_CHECK (NODE)->type_common.context)
  1289. #define TYPE_MODE(NODE) \
  1290. (VECTOR_TYPE_P (TYPE_CHECK (NODE)) \
  1291. ? vector_type_mode (NODE) : (NODE)->type_common.mode)
  1292. #define SET_TYPE_MODE(NODE, MODE) \
  1293. (TYPE_CHECK (NODE)->type_common.mode = (MODE))
  1294. extern machine_mode element_mode (const_tree t);
  1295. /* The "canonical" type for this type node, which is used by frontends to
  1296. compare the type for equality with another type. If two types are
  1297. equal (based on the semantics of the language), then they will have
  1298. equivalent TYPE_CANONICAL entries.
  1299. As a special case, if TYPE_CANONICAL is NULL_TREE, and thus
  1300. TYPE_STRUCTURAL_EQUALITY_P is true, then it cannot
  1301. be used for comparison against other types. Instead, the type is
  1302. said to require structural equality checks, described in
  1303. TYPE_STRUCTURAL_EQUALITY_P.
  1304. For unqualified aggregate and function types the middle-end relies on
  1305. TYPE_CANONICAL to tell whether two variables can be assigned
  1306. to each other without a conversion. The middle-end also makes sure
  1307. to assign the same alias-sets to the type partition with equal
  1308. TYPE_CANONICAL of their unqualified variants. */
  1309. #define TYPE_CANONICAL(NODE) (TYPE_CHECK (NODE)->type_common.canonical)
  1310. /* Indicates that the type node requires structural equality
  1311. checks. The compiler will need to look at the composition of the
  1312. type to determine whether it is equal to another type, rather than
  1313. just comparing canonical type pointers. For instance, we would need
  1314. to look at the return and parameter types of a FUNCTION_TYPE
  1315. node. */
  1316. #define TYPE_STRUCTURAL_EQUALITY_P(NODE) (TYPE_CANONICAL (NODE) == NULL_TREE)
  1317. /* Sets the TYPE_CANONICAL field to NULL_TREE, indicating that the
  1318. type node requires structural equality. */
  1319. #define SET_TYPE_STRUCTURAL_EQUALITY(NODE) (TYPE_CANONICAL (NODE) = NULL_TREE)
  1320. #define TYPE_IBIT(NODE) (GET_MODE_IBIT (TYPE_MODE (NODE)))
  1321. #define TYPE_FBIT(NODE) (GET_MODE_FBIT (TYPE_MODE (NODE)))
  1322. /* The (language-specific) typed-based alias set for this type.
  1323. Objects whose TYPE_ALIAS_SETs are different cannot alias each
  1324. other. If the TYPE_ALIAS_SET is -1, no alias set has yet been
  1325. assigned to this type. If the TYPE_ALIAS_SET is 0, objects of this
  1326. type can alias objects of any type. */
  1327. #define TYPE_ALIAS_SET(NODE) (TYPE_CHECK (NODE)->type_common.alias_set)
  1328. /* Nonzero iff the typed-based alias set for this type has been
  1329. calculated. */
  1330. #define TYPE_ALIAS_SET_KNOWN_P(NODE) \
  1331. (TYPE_CHECK (NODE)->type_common.alias_set != -1)
  1332. /* A TREE_LIST of IDENTIFIER nodes of the attributes that apply
  1333. to this type. */
  1334. #define TYPE_ATTRIBUTES(NODE) (TYPE_CHECK (NODE)->type_common.attributes)
  1335. /* The alignment necessary for objects of this type.
  1336. The value is an int, measured in bits. */
  1337. #define TYPE_ALIGN(NODE) (TYPE_CHECK (NODE)->type_common.align)
  1338. /* 1 if the alignment for this type was requested by "aligned" attribute,
  1339. 0 if it is the default for this type. */
  1340. #define TYPE_USER_ALIGN(NODE) (TYPE_CHECK (NODE)->base.u.bits.user_align)
  1341. /* The alignment for NODE, in bytes. */
  1342. #define TYPE_ALIGN_UNIT(NODE) (TYPE_ALIGN (NODE) / BITS_PER_UNIT)
  1343. /* If your language allows you to declare types, and you want debug info
  1344. for them, then you need to generate corresponding TYPE_DECL nodes.
  1345. These "stub" TYPE_DECL nodes have no name, and simply point at the
  1346. type node. You then set the TYPE_STUB_DECL field of the type node
  1347. to point back at the TYPE_DECL node. This allows the debug routines
  1348. to know that the two nodes represent the same type, so that we only
  1349. get one debug info record for them. */
  1350. #define TYPE_STUB_DECL(NODE) (TREE_CHAIN (TYPE_CHECK (NODE)))
  1351. /* In a RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE or ARRAY_TYPE, it means
  1352. the type has BLKmode only because it lacks the alignment required for
  1353. its size. */
  1354. #define TYPE_NO_FORCE_BLK(NODE) \
  1355. (TYPE_CHECK (NODE)->type_common.no_force_blk_flag)
  1356. /* Nonzero in a type considered volatile as a whole. */
  1357. #define TYPE_VOLATILE(NODE) (TYPE_CHECK (NODE)->base.volatile_flag)
  1358. /* Nonzero in a type considered atomic as a whole. */
  1359. #define TYPE_ATOMIC(NODE) (TYPE_CHECK (NODE)->base.u.bits.atomic_flag)
  1360. /* Means this type is const-qualified. */
  1361. #define TYPE_READONLY(NODE) (TYPE_CHECK (NODE)->base.readonly_flag)
  1362. /* If nonzero, this type is `restrict'-qualified, in the C sense of
  1363. the term. */
  1364. #define TYPE_RESTRICT(NODE) (TYPE_CHECK (NODE)->type_common.restrict_flag)
  1365. /* If nonzero, type's name shouldn't be emitted into debug info. */
  1366. #define TYPE_NAMELESS(NODE) (TYPE_CHECK (NODE)->base.u.bits.nameless_flag)
  1367. /* The address space the type is in. */
  1368. #define TYPE_ADDR_SPACE(NODE) (TYPE_CHECK (NODE)->base.u.bits.address_space)
  1369. /* Encode/decode the named memory support as part of the qualifier. If more
  1370. than 8 qualifiers are added, these macros need to be adjusted. */
  1371. #define ENCODE_QUAL_ADDR_SPACE(NUM) ((NUM & 0xFF) << 8)
  1372. #define DECODE_QUAL_ADDR_SPACE(X) (((X) >> 8) & 0xFF)
  1373. /* Return all qualifiers except for the address space qualifiers. */
  1374. #define CLEAR_QUAL_ADDR_SPACE(X) ((X) & ~0xFF00)
  1375. /* Only keep the address space out of the qualifiers and discard the other
  1376. qualifiers. */
  1377. #define KEEP_QUAL_ADDR_SPACE(X) ((X) & 0xFF00)
  1378. /* The set of type qualifiers for this type. */
  1379. #define TYPE_QUALS(NODE) \
  1380. ((int) ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
  1381. | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
  1382. | (TYPE_ATOMIC (NODE) * TYPE_QUAL_ATOMIC) \
  1383. | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT) \
  1384. | (ENCODE_QUAL_ADDR_SPACE (TYPE_ADDR_SPACE (NODE)))))
  1385. /* The same as TYPE_QUALS without the address space qualifications. */
  1386. #define TYPE_QUALS_NO_ADDR_SPACE(NODE) \
  1387. ((int) ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
  1388. | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
  1389. | (TYPE_ATOMIC (NODE) * TYPE_QUAL_ATOMIC) \
  1390. | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT)))
  1391. /* The same as TYPE_QUALS without the address space and atomic
  1392. qualifications. */
  1393. #define TYPE_QUALS_NO_ADDR_SPACE_NO_ATOMIC(NODE) \
  1394. ((int) ((TYPE_READONLY (NODE) * TYPE_QUAL_CONST) \
  1395. | (TYPE_VOLATILE (NODE) * TYPE_QUAL_VOLATILE) \
  1396. | (TYPE_RESTRICT (NODE) * TYPE_QUAL_RESTRICT)))
  1397. /* These flags are available for each language front end to use internally. */
  1398. #define TYPE_LANG_FLAG_0(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_0)
  1399. #define TYPE_LANG_FLAG_1(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_1)
  1400. #define TYPE_LANG_FLAG_2(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_2)
  1401. #define TYPE_LANG_FLAG_3(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_3)
  1402. #define TYPE_LANG_FLAG_4(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_4)
  1403. #define TYPE_LANG_FLAG_5(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_5)
  1404. #define TYPE_LANG_FLAG_6(NODE) (TYPE_CHECK (NODE)->type_common.lang_flag_6)
  1405. /* Used to keep track of visited nodes in tree traversals. This is set to
  1406. 0 by copy_node and make_node. */
  1407. #define TREE_VISITED(NODE) ((NODE)->base.visited)
  1408. /* If set in an ARRAY_TYPE, indicates a string type (for languages
  1409. that distinguish string from array of char).
  1410. If set in a INTEGER_TYPE, indicates a character type. */
  1411. #define TYPE_STRING_FLAG(NODE) (TYPE_CHECK (NODE)->type_common.string_flag)
  1412. /* For a VECTOR_TYPE, this is the number of sub-parts of the vector. */
  1413. #define TYPE_VECTOR_SUBPARTS(VECTOR_TYPE) \
  1414. (((unsigned HOST_WIDE_INT) 1) \
  1415. << VECTOR_TYPE_CHECK (VECTOR_TYPE)->type_common.precision)
  1416. /* Set precision to n when we have 2^n sub-parts of the vector. */
  1417. #define SET_TYPE_VECTOR_SUBPARTS(VECTOR_TYPE, X) \
  1418. (VECTOR_TYPE_CHECK (VECTOR_TYPE)->type_common.precision = exact_log2 (X))
  1419. /* Nonzero in a VECTOR_TYPE if the frontends should not emit warnings
  1420. about missing conversions to other vector types of the same size. */
  1421. #define TYPE_VECTOR_OPAQUE(NODE) \
  1422. (VECTOR_TYPE_CHECK (NODE)->base.default_def_flag)
  1423. /* Indicates that objects of this type must be initialized by calling a
  1424. function when they are created. */
  1425. #define TYPE_NEEDS_CONSTRUCTING(NODE) \
  1426. (TYPE_CHECK (NODE)->type_common.needs_constructing_flag)
  1427. /* Indicates that a UNION_TYPE object should be passed the same way that
  1428. the first union alternative would be passed, or that a RECORD_TYPE
  1429. object should be passed the same way that the first (and only) member
  1430. would be passed. */
  1431. #define TYPE_TRANSPARENT_AGGR(NODE) \
  1432. (RECORD_OR_UNION_CHECK (NODE)->type_common.transparent_aggr_flag)
  1433. /* For an ARRAY_TYPE, indicates that it is not permitted to take the
  1434. address of a component of the type. This is the counterpart of
  1435. DECL_NONADDRESSABLE_P for arrays, see the definition of this flag. */
  1436. #define TYPE_NONALIASED_COMPONENT(NODE) \
  1437. (ARRAY_TYPE_CHECK (NODE)->type_common.transparent_aggr_flag)
  1438. /* Indicated that objects of this type should be laid out in as
  1439. compact a way as possible. */
  1440. #define TYPE_PACKED(NODE) (TYPE_CHECK (NODE)->base.u.bits.packed_flag)
  1441. /* Used by type_contains_placeholder_p to avoid recomputation.
  1442. Values are: 0 (unknown), 1 (false), 2 (true). Never access
  1443. this field directly. */
  1444. #define TYPE_CONTAINS_PLACEHOLDER_INTERNAL(NODE) \
  1445. (TYPE_CHECK (NODE)->type_common.contains_placeholder_bits)
  1446. /* Nonzero if RECORD_TYPE represents a final derivation of class. */
  1447. #define TYPE_FINAL_P(NODE) \
  1448. (RECORD_OR_UNION_CHECK (NODE)->base.default_def_flag)
  1449. /* The debug output functions use the symtab union field to store
  1450. information specific to the debugging format. The different debug
  1451. output hooks store different types in the union field. These three
  1452. macros are used to access different fields in the union. The debug
  1453. hooks are responsible for consistently using only a specific
  1454. macro. */
  1455. /* Symtab field as an integer. Used by stabs generator in dbxout.c to
  1456. hold the type's number in the generated stabs. */
  1457. #define TYPE_SYMTAB_ADDRESS(NODE) \
  1458. (TYPE_CHECK (NODE)->type_common.symtab.address)
  1459. /* Symtab field as a string. Used by COFF generator in sdbout.c to
  1460. hold struct/union type tag names. */
  1461. #define TYPE_SYMTAB_POINTER(NODE) \
  1462. (TYPE_CHECK (NODE)->type_common.symtab.pointer)
  1463. /* Symtab field as a pointer to a DWARF DIE. Used by DWARF generator
  1464. in dwarf2out.c to point to the DIE generated for the type. */
  1465. #define TYPE_SYMTAB_DIE(NODE) \
  1466. (TYPE_CHECK (NODE)->type_common.symtab.die)
  1467. /* The garbage collector needs to know the interpretation of the
  1468. symtab field. These constants represent the different types in the
  1469. union. */
  1470. #define TYPE_SYMTAB_IS_ADDRESS (0)
  1471. #define TYPE_SYMTAB_IS_POINTER (1)
  1472. #define TYPE_SYMTAB_IS_DIE (2)
  1473. #define TYPE_LANG_SPECIFIC(NODE) \
  1474. (TYPE_CHECK (NODE)->type_with_lang_specific.lang_specific)
  1475. #define TYPE_VALUES(NODE) (ENUMERAL_TYPE_CHECK (NODE)->type_non_common.values)
  1476. #define TYPE_DOMAIN(NODE) (ARRAY_TYPE_CHECK (NODE)->type_non_common.values)
  1477. #define TYPE_FIELDS(NODE) \
  1478. (RECORD_OR_UNION_CHECK (NODE)->type_non_common.values)
  1479. #define TYPE_CACHED_VALUES(NODE) (TYPE_CHECK (NODE)->type_non_common.values)
  1480. #define TYPE_ARG_TYPES(NODE) \
  1481. (FUNC_OR_METHOD_CHECK (NODE)->type_non_common.values)
  1482. #define TYPE_VALUES_RAW(NODE) (TYPE_CHECK (NODE)->type_non_common.values)
  1483. #define TYPE_METHODS(NODE) \
  1484. (RECORD_OR_UNION_CHECK (NODE)->type_non_common.maxval)
  1485. #define TYPE_VFIELD(NODE) \
  1486. (RECORD_OR_UNION_CHECK (NODE)->type_non_common.minval)
  1487. #define TYPE_METHOD_BASETYPE(NODE) \
  1488. (FUNC_OR_METHOD_CHECK (NODE)->type_non_common.maxval)
  1489. #define TYPE_OFFSET_BASETYPE(NODE) \
  1490. (OFFSET_TYPE_CHECK (NODE)->type_non_common.maxval)
  1491. #define TYPE_MAXVAL(NODE) (TYPE_CHECK (NODE)->type_non_common.maxval)
  1492. #define TYPE_MINVAL(NODE) (TYPE_CHECK (NODE)->type_non_common.minval)
  1493. #define TYPE_NEXT_PTR_TO(NODE) \
  1494. (POINTER_TYPE_CHECK (NODE)->type_non_common.minval)
  1495. #define TYPE_NEXT_REF_TO(NODE) \
  1496. (REFERENCE_TYPE_CHECK (NODE)->type_non_common.minval)
  1497. #define TYPE_MIN_VALUE(NODE) \
  1498. (NUMERICAL_TYPE_CHECK (NODE)->type_non_common.minval)
  1499. #define TYPE_MAX_VALUE(NODE) \
  1500. (NUMERICAL_TYPE_CHECK (NODE)->type_non_common.maxval)
  1501. /* If non-NULL, this is an upper bound of the size (in bytes) of an
  1502. object of the given ARRAY_TYPE_NON_COMMON. This allows temporaries to be
  1503. allocated. */
  1504. #define TYPE_ARRAY_MAX_SIZE(ARRAY_TYPE) \
  1505. (ARRAY_TYPE_CHECK (ARRAY_TYPE)->type_non_common.maxval)
  1506. /* For record and union types, information about this type, as a base type
  1507. for itself. */
  1508. #define TYPE_BINFO(NODE) (RECORD_OR_UNION_CHECK (NODE)->type_non_common.binfo)
  1509. /* For non record and union types, used in a language-dependent way. */
  1510. #define TYPE_LANG_SLOT_1(NODE) \
  1511. (NOT_RECORD_OR_UNION_CHECK (NODE)->type_non_common.binfo)
  1512. /* Define accessor macros for information about type inheritance
  1513. and basetypes.
  1514. A "basetype" means a particular usage of a data type for inheritance
  1515. in another type. Each such basetype usage has its own "binfo"
  1516. object to describe it. The binfo object is a TREE_VEC node.
  1517. Inheritance is represented by the binfo nodes allocated for a
  1518. given type. For example, given types C and D, such that D is
  1519. inherited by C, 3 binfo nodes will be allocated: one for describing
  1520. the binfo properties of C, similarly one for D, and one for
  1521. describing the binfo properties of D as a base type for C.
  1522. Thus, given a pointer to class C, one can get a pointer to the binfo
  1523. of D acting as a basetype for C by looking at C's binfo's basetypes. */
  1524. /* BINFO specific flags. */
  1525. /* Nonzero means that the derivation chain is via a `virtual' declaration. */
  1526. #define BINFO_VIRTUAL_P(NODE) (TREE_BINFO_CHECK (NODE)->base.static_flag)
  1527. /* Flags for language dependent use. */
  1528. #define BINFO_MARKED(NODE) TREE_LANG_FLAG_0 (TREE_BINFO_CHECK (NODE))
  1529. #define BINFO_FLAG_1(NODE) TREE_LANG_FLAG_1 (TREE_BINFO_CHECK (NODE))
  1530. #define BINFO_FLAG_2(NODE) TREE_LANG_FLAG_2 (TREE_BINFO_CHECK (NODE))
  1531. #define BINFO_FLAG_3(NODE) TREE_LANG_FLAG_3 (TREE_BINFO_CHECK (NODE))
  1532. #define BINFO_FLAG_4(NODE) TREE_LANG_FLAG_4 (TREE_BINFO_CHECK (NODE))
  1533. #define BINFO_FLAG_5(NODE) TREE_LANG_FLAG_5 (TREE_BINFO_CHECK (NODE))
  1534. #define BINFO_FLAG_6(NODE) TREE_LANG_FLAG_6 (TREE_BINFO_CHECK (NODE))
  1535. /* The actual data type node being inherited in this basetype. */
  1536. #define BINFO_TYPE(NODE) TREE_TYPE (TREE_BINFO_CHECK (NODE))
  1537. /* The offset where this basetype appears in its containing type.
  1538. BINFO_OFFSET slot holds the offset (in bytes)
  1539. from the base of the complete object to the base of the part of the
  1540. object that is allocated on behalf of this `type'.
  1541. This is always 0 except when there is multiple inheritance. */
  1542. #define BINFO_OFFSET(NODE) (TREE_BINFO_CHECK (NODE)->binfo.offset)
  1543. #define BINFO_OFFSET_ZEROP(NODE) (integer_zerop (BINFO_OFFSET (NODE)))
  1544. /* The virtual function table belonging to this basetype. Virtual
  1545. function tables provide a mechanism for run-time method dispatching.
  1546. The entries of a virtual function table are language-dependent. */
  1547. #define BINFO_VTABLE(NODE) (TREE_BINFO_CHECK (NODE)->binfo.vtable)
  1548. /* The virtual functions in the virtual function table. This is
  1549. a TREE_LIST that is used as an initial approximation for building
  1550. a virtual function table for this basetype. */
  1551. #define BINFO_VIRTUALS(NODE) (TREE_BINFO_CHECK (NODE)->binfo.virtuals)
  1552. /* A vector of binfos for the direct basetypes inherited by this
  1553. basetype.
  1554. If this basetype describes type D as inherited in C, and if the
  1555. basetypes of D are E and F, then this vector contains binfos for
  1556. inheritance of E and F by C. */
  1557. #define BINFO_BASE_BINFOS(NODE) (&TREE_BINFO_CHECK (NODE)->binfo.base_binfos)
  1558. /* The number of basetypes for NODE. */
  1559. #define BINFO_N_BASE_BINFOS(NODE) (BINFO_BASE_BINFOS (NODE)->length ())
  1560. /* Accessor macro to get to the Nth base binfo of this binfo. */
  1561. #define BINFO_BASE_BINFO(NODE,N) \
  1562. ((*BINFO_BASE_BINFOS (NODE))[(N)])
  1563. #define BINFO_BASE_ITERATE(NODE,N,B) \
  1564. (BINFO_BASE_BINFOS (NODE)->iterate ((N), &(B)))
  1565. #define BINFO_BASE_APPEND(NODE,T) \
  1566. (BINFO_BASE_BINFOS (NODE)->quick_push ((T)))
  1567. /* For a BINFO record describing a virtual base class, i.e., one where
  1568. TREE_VIA_VIRTUAL is set, this field assists in locating the virtual
  1569. base. The actual contents are language-dependent. In the C++
  1570. front-end this field is an INTEGER_CST giving an offset into the
  1571. vtable where the offset to the virtual base can be found. */
  1572. #define BINFO_VPTR_FIELD(NODE) (TREE_BINFO_CHECK (NODE)->binfo.vptr_field)
  1573. /* Indicates the accesses this binfo has to its bases. The values are
  1574. access_public_node, access_protected_node or access_private_node.
  1575. If this array is not present, public access is implied. */
  1576. #define BINFO_BASE_ACCESSES(NODE) \
  1577. (TREE_BINFO_CHECK (NODE)->binfo.base_accesses)
  1578. #define BINFO_BASE_ACCESS(NODE,N) \
  1579. (*BINFO_BASE_ACCESSES (NODE))[(N)]
  1580. #define BINFO_BASE_ACCESS_APPEND(NODE,T) \
  1581. BINFO_BASE_ACCESSES (NODE)->quick_push ((T))
  1582. /* The index in the VTT where this subobject's sub-VTT can be found.
  1583. NULL_TREE if there is no sub-VTT. */
  1584. #define BINFO_SUBVTT_INDEX(NODE) (TREE_BINFO_CHECK (NODE)->binfo.vtt_subvtt)
  1585. /* The index in the VTT where the vptr for this subobject can be
  1586. found. NULL_TREE if there is no secondary vptr in the VTT. */
  1587. #define BINFO_VPTR_INDEX(NODE) (TREE_BINFO_CHECK (NODE)->binfo.vtt_vptr)
  1588. /* The BINFO_INHERITANCE_CHAIN points at the binfo for the base
  1589. inheriting this base for non-virtual bases. For virtual bases it
  1590. points either to the binfo for which this is a primary binfo, or to
  1591. the binfo of the most derived type. */
  1592. #define BINFO_INHERITANCE_CHAIN(NODE) \
  1593. (TREE_BINFO_CHECK (NODE)->binfo.inheritance)
  1594. /* Define fields and accessors for nodes representing declared names. */
  1595. /* Nonzero if DECL represents an SSA name or a variable that can possibly
  1596. have an associated SSA name. */
  1597. #define SSA_VAR_P(DECL) \
  1598. (TREE_CODE (DECL) == VAR_DECL \
  1599. || TREE_CODE (DECL) == PARM_DECL \
  1600. || TREE_CODE (DECL) == RESULT_DECL \
  1601. || TREE_CODE (DECL) == SSA_NAME)
  1602. #define DECL_CHAIN(NODE) (TREE_CHAIN (DECL_MINIMAL_CHECK (NODE)))
  1603. /* This is the name of the object as written by the user.
  1604. It is an IDENTIFIER_NODE. */
  1605. #define DECL_NAME(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.name)
  1606. /* The IDENTIFIER_NODE associated with the TYPE_NAME field. */
  1607. #define TYPE_IDENTIFIER(NODE) \
  1608. (TYPE_NAME (NODE) && DECL_P (TYPE_NAME (NODE)) \
  1609. ? DECL_NAME (TYPE_NAME (NODE)) : TYPE_NAME (NODE))
  1610. /* Every ..._DECL node gets a unique number. */
  1611. #define DECL_UID(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.uid)
  1612. /* DEBUG_EXPR_DECLs get negative UID numbers, to catch erroneous
  1613. uses. */
  1614. #define DEBUG_TEMP_UID(NODE) (-DECL_UID (TREE_CHECK ((NODE), DEBUG_EXPR_DECL)))
  1615. /* Every ..._DECL node gets a unique number that stays the same even
  1616. when the decl is copied by the inliner once it is set. */
  1617. #define DECL_PT_UID(NODE) \
  1618. (DECL_COMMON_CHECK (NODE)->decl_common.pt_uid == -1u \
  1619. ? (NODE)->decl_minimal.uid : (NODE)->decl_common.pt_uid)
  1620. /* Initialize the ..._DECL node pt-uid to the decls uid. */
  1621. #define SET_DECL_PT_UID(NODE, UID) \
  1622. (DECL_COMMON_CHECK (NODE)->decl_common.pt_uid = (UID))
  1623. /* Whether the ..._DECL node pt-uid has been initialized and thus needs to
  1624. be preserved when copyin the decl. */
  1625. #define DECL_PT_UID_SET_P(NODE) \
  1626. (DECL_COMMON_CHECK (NODE)->decl_common.pt_uid != -1u)
  1627. /* These two fields describe where in the source code the declaration
  1628. was. If the declaration appears in several places (as for a C
  1629. function that is declared first and then defined later), this
  1630. information should refer to the definition. */
  1631. #define DECL_SOURCE_LOCATION(NODE) \
  1632. (DECL_MINIMAL_CHECK (NODE)->decl_minimal.locus)
  1633. #define DECL_SOURCE_FILE(NODE) LOCATION_FILE (DECL_SOURCE_LOCATION (NODE))
  1634. #define DECL_SOURCE_LINE(NODE) LOCATION_LINE (DECL_SOURCE_LOCATION (NODE))
  1635. #define DECL_SOURCE_COLUMN(NODE) LOCATION_COLUMN (DECL_SOURCE_LOCATION (NODE))
  1636. /* This accessor returns TRUE if the decl it operates on was created
  1637. by a front-end or back-end rather than by user code. In this case
  1638. builtin-ness is indicated by source location. */
  1639. #define DECL_IS_BUILTIN(DECL) \
  1640. (LOCATION_LOCUS (DECL_SOURCE_LOCATION (DECL)) <= BUILTINS_LOCATION)
  1641. /* For FIELD_DECLs, this is the RECORD_TYPE, UNION_TYPE, or
  1642. QUAL_UNION_TYPE node that the field is a member of. For VAR_DECL,
  1643. PARM_DECL, FUNCTION_DECL, LABEL_DECL, RESULT_DECL, and CONST_DECL
  1644. nodes, this points to either the FUNCTION_DECL for the containing
  1645. function, the RECORD_TYPE or UNION_TYPE for the containing type, or
  1646. NULL_TREE or a TRANSLATION_UNIT_DECL if the given decl has "file
  1647. scope". In particular, for VAR_DECLs which are virtual table pointers
  1648. (they have DECL_VIRTUAL set), we use DECL_CONTEXT to determine the type
  1649. they belong to. */
  1650. #define DECL_CONTEXT(NODE) (DECL_MINIMAL_CHECK (NODE)->decl_minimal.context)
  1651. #define DECL_FIELD_CONTEXT(NODE) \
  1652. (FIELD_DECL_CHECK (NODE)->decl_minimal.context)
  1653. /* If nonzero, decl's name shouldn't be emitted into debug info. */
  1654. #define DECL_NAMELESS(NODE) (DECL_MINIMAL_CHECK (NODE)->base.u.bits.nameless_flag)
  1655. /* For any sort of a ..._DECL node, this points to the original (abstract)
  1656. decl node which this decl is an inlined/cloned instance of, or else it
  1657. is NULL indicating that this decl is not an instance of some other decl.
  1658. The C front-end also uses this in a nested declaration of an inline
  1659. function, to point back to the definition. */
  1660. #define DECL_ABSTRACT_ORIGIN(NODE) \
  1661. (DECL_COMMON_CHECK (NODE)->decl_common.abstract_origin)
  1662. /* Like DECL_ABSTRACT_ORIGIN, but returns NODE if there's no abstract
  1663. origin. This is useful when setting the DECL_ABSTRACT_ORIGIN. */
  1664. #define DECL_ORIGIN(NODE) \
  1665. (DECL_ABSTRACT_ORIGIN (NODE) ? DECL_ABSTRACT_ORIGIN (NODE) : (NODE))
  1666. /* Nonzero for any sort of ..._DECL node means this decl node represents an
  1667. inline instance of some original (abstract) decl from an inline function;
  1668. suppress any warnings about shadowing some other variable. FUNCTION_DECL
  1669. nodes can also have their abstract origin set to themselves. */
  1670. #define DECL_FROM_INLINE(NODE) \
  1671. (DECL_ABSTRACT_ORIGIN (NODE) != NULL_TREE \
  1672. && DECL_ABSTRACT_ORIGIN (NODE) != (NODE))
  1673. /* In a DECL this is the field where attributes are stored. */
  1674. #define DECL_ATTRIBUTES(NODE) \
  1675. (DECL_COMMON_CHECK (NODE)->decl_common.attributes)
  1676. /* For a FUNCTION_DECL, holds the tree of BINDINGs.
  1677. For a TRANSLATION_UNIT_DECL, holds the namespace's BLOCK.
  1678. For a VAR_DECL, holds the initial value.
  1679. For a PARM_DECL, used for DECL_ARG_TYPE--default
  1680. values for parameters are encoded in the type of the function,
  1681. not in the PARM_DECL slot.
  1682. For a FIELD_DECL, this is used for enumeration values and the C
  1683. frontend uses it for temporarily storing bitwidth of bitfields.
  1684. ??? Need to figure out some way to check this isn't a PARM_DECL. */
  1685. #define DECL_INITIAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.initial)
  1686. /* Holds the size of the datum, in bits, as a tree expression.
  1687. Need not be constant. */
  1688. #define DECL_SIZE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size)
  1689. /* Likewise for the size in bytes. */
  1690. #define DECL_SIZE_UNIT(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.size_unit)
  1691. /* Holds the alignment required for the datum, in bits. */
  1692. #define DECL_ALIGN(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.align)
  1693. /* The alignment of NODE, in bytes. */
  1694. #define DECL_ALIGN_UNIT(NODE) (DECL_ALIGN (NODE) / BITS_PER_UNIT)
  1695. /* Set if the alignment of this DECL has been set by the user, for
  1696. example with an 'aligned' attribute. */
  1697. #define DECL_USER_ALIGN(NODE) \
  1698. (DECL_COMMON_CHECK (NODE)->base.u.bits.user_align)
  1699. /* Holds the machine mode corresponding to the declaration of a variable or
  1700. field. Always equal to TYPE_MODE (TREE_TYPE (decl)) except for a
  1701. FIELD_DECL. */
  1702. #define DECL_MODE(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.mode)
  1703. /* For FUNCTION_DECL, if it is built-in, this identifies which built-in
  1704. operation it is. Note, however, that this field is overloaded, with
  1705. DECL_BUILT_IN_CLASS as the discriminant, so the latter must always be
  1706. checked before any access to the former. */
  1707. #define DECL_FUNCTION_CODE(NODE) \
  1708. (FUNCTION_DECL_CHECK (NODE)->function_decl.function_code)
  1709. #define DECL_FUNCTION_PERSONALITY(NODE) \
  1710. (FUNCTION_DECL_CHECK (NODE)->function_decl.personality)
  1711. /* Nonzero for a given ..._DECL node means that the name of this node should
  1712. be ignored for symbolic debug purposes. For a TYPE_DECL, this means that
  1713. the associated type should be ignored. For a FUNCTION_DECL, the body of
  1714. the function should also be ignored. */
  1715. #define DECL_IGNORED_P(NODE) \
  1716. (DECL_COMMON_CHECK (NODE)->decl_common.ignored_flag)
  1717. /* Nonzero for a given ..._DECL node means that this node represents an
  1718. "abstract instance" of the given declaration (e.g. in the original
  1719. declaration of an inline function). When generating symbolic debugging
  1720. information, we mustn't try to generate any address information for nodes
  1721. marked as "abstract instances" because we don't actually generate
  1722. any code or allocate any data space for such instances. */
  1723. #define DECL_ABSTRACT_P(NODE) \
  1724. (DECL_COMMON_CHECK (NODE)->decl_common.abstract_flag)
  1725. /* Language-specific decl information. */
  1726. #define DECL_LANG_SPECIFIC(NODE) \
  1727. (DECL_COMMON_CHECK (NODE)->decl_common.lang_specific)
  1728. /* In a VAR_DECL or FUNCTION_DECL, nonzero means external reference:
  1729. do not allocate storage, and refer to a definition elsewhere. Note that
  1730. this does not necessarily imply the entity represented by NODE
  1731. has no program source-level definition in this translation unit. For
  1732. example, for a FUNCTION_DECL, DECL_SAVED_TREE may be non-NULL and
  1733. DECL_EXTERNAL may be true simultaneously; that can be the case for
  1734. a C99 "extern inline" function. */
  1735. #define DECL_EXTERNAL(NODE) (DECL_COMMON_CHECK (NODE)->decl_common.decl_flag_1)
  1736. /* Nonzero in a ..._DECL means this variable is ref'd from a nested function.
  1737. For VAR_DECL nodes, PARM_DECL nodes, and FUNCTION_DECL nodes.
  1738. For LABEL_DECL nodes, nonzero if nonlocal gotos to the label are permitted.
  1739. Also set in some languages for variables, etc., outside the normal
  1740. lexical scope, such as class instance variables. */
  1741. #define DECL_NONLOCAL(NODE) \
  1742. (DECL_COMMON_CHECK (NODE)->decl_common.nonlocal_flag)
  1743. /* Used in VAR_DECLs to indicate that the variable is a vtable.
  1744. Used in FIELD_DECLs for vtable pointers.
  1745. Used in FUNCTION_DECLs to indicate that the function is virtual. */
  1746. #define DECL_VIRTUAL_P(NODE) \
  1747. (DECL_COMMON_CHECK (NODE)->decl_common.virtual_flag)
  1748. /* Used to indicate that this DECL represents a compiler-generated entity. */
  1749. #define DECL_ARTIFICIAL(NODE) \
  1750. (DECL_COMMON_CHECK (NODE)->decl_common.artificial_flag)
  1751. /* Additional flags for language-specific uses. */
  1752. #define DECL_LANG_FLAG_0(NODE) \
  1753. (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_0)
  1754. #define DECL_LANG_FLAG_1(NODE) \
  1755. (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_1)
  1756. #define DECL_LANG_FLAG_2(NODE) \
  1757. (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_2)
  1758. #define DECL_LANG_FLAG_3(NODE) \
  1759. (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_3)
  1760. #define DECL_LANG_FLAG_4(NODE) \
  1761. (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_4)
  1762. #define DECL_LANG_FLAG_5(NODE) \
  1763. (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_5)
  1764. #define DECL_LANG_FLAG_6(NODE) \
  1765. (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_6)
  1766. #define DECL_LANG_FLAG_7(NODE) \
  1767. (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_7)
  1768. #define DECL_LANG_FLAG_8(NODE) \
  1769. (DECL_COMMON_CHECK (NODE)->decl_common.lang_flag_8)
  1770. /* Nonzero for a scope which is equal to file scope. */
  1771. #define SCOPE_FILE_SCOPE_P(EXP) \
  1772. (! (EXP) || TREE_CODE (EXP) == TRANSLATION_UNIT_DECL)
  1773. /* Nonzero for a decl which is at file scope. */
  1774. #define DECL_FILE_SCOPE_P(EXP) SCOPE_FILE_SCOPE_P (DECL_CONTEXT (EXP))
  1775. /* Nonzero for a type which is at file scope. */
  1776. #define TYPE_FILE_SCOPE_P(EXP) SCOPE_FILE_SCOPE_P (TYPE_CONTEXT (EXP))
  1777. /* Nonzero for a decl that is decorated using attribute used.
  1778. This indicates to compiler tools that this decl needs to be preserved. */
  1779. #define DECL_PRESERVE_P(DECL) \
  1780. DECL_COMMON_CHECK (DECL)->decl_common.preserve_flag
  1781. /* For function local variables of COMPLEX and VECTOR types,
  1782. indicates that the variable is not aliased, and that all
  1783. modifications to the variable have been adjusted so that
  1784. they are killing assignments. Thus the variable may now
  1785. be treated as a GIMPLE register, and use real instead of
  1786. virtual ops in SSA form. */
  1787. #define DECL_GIMPLE_REG_P(DECL) \
  1788. DECL_COMMON_CHECK (DECL)->decl_common.gimple_reg_flag
  1789. extern tree decl_value_expr_lookup (tree);
  1790. extern void decl_value_expr_insert (tree, tree);
  1791. /* In a VAR_DECL or PARM_DECL, the location at which the value may be found,
  1792. if transformations have made this more complicated than evaluating the
  1793. decl itself. This should only be used for debugging; once this field has
  1794. been set, the decl itself may not legitimately appear in the function. */
  1795. #define DECL_HAS_VALUE_EXPR_P(NODE) \
  1796. (TREE_CHECK3 (NODE, VAR_DECL, PARM_DECL, RESULT_DECL) \
  1797. ->decl_common.decl_flag_2)
  1798. #define DECL_VALUE_EXPR(NODE) \
  1799. (decl_value_expr_lookup (DECL_WRTL_CHECK (NODE)))
  1800. #define SET_DECL_VALUE_EXPR(NODE, VAL) \
  1801. (decl_value_expr_insert (DECL_WRTL_CHECK (NODE), VAL))
  1802. /* Holds the RTL expression for the value of a variable or function.
  1803. This value can be evaluated lazily for functions, variables with
  1804. static storage duration, and labels. */
  1805. #define DECL_RTL(NODE) \
  1806. (DECL_WRTL_CHECK (NODE)->decl_with_rtl.rtl \
  1807. ? (NODE)->decl_with_rtl.rtl \
  1808. : (make_decl_rtl (NODE), (NODE)->decl_with_rtl.rtl))
  1809. /* Set the DECL_RTL for NODE to RTL. */
  1810. #define SET_DECL_RTL(NODE, RTL) set_decl_rtl (NODE, RTL)
  1811. /* Returns nonzero if NODE is a tree node that can contain RTL. */
  1812. #define HAS_RTL_P(NODE) (CODE_CONTAINS_STRUCT (TREE_CODE (NODE), TS_DECL_WRTL))
  1813. /* Returns nonzero if the DECL_RTL for NODE has already been set. */
  1814. #define DECL_RTL_SET_P(NODE) \
  1815. (HAS_RTL_P (NODE) && DECL_WRTL_CHECK (NODE)->decl_with_rtl.rtl != NULL)
  1816. /* Copy the RTL from NODE1 to NODE2. If the RTL was not set for
  1817. NODE1, it will not be set for NODE2; this is a lazy copy. */
  1818. #define COPY_DECL_RTL(NODE1, NODE2) \
  1819. (DECL_WRTL_CHECK (NODE2)->decl_with_rtl.rtl \
  1820. = DECL_WRTL_CHECK (NODE1)->decl_with_rtl.rtl)
  1821. /* The DECL_RTL for NODE, if it is set, or NULL, if it is not set. */
  1822. #define DECL_RTL_IF_SET(NODE) (DECL_RTL_SET_P (NODE) ? DECL_RTL (NODE) : NULL)
  1823. #if (GCC_VERSION >= 2007)
  1824. #define DECL_RTL_KNOWN_SET(decl) __extension__ \
  1825. ({ tree const __d = (decl); \
  1826. gcc_checking_assert (DECL_RTL_SET_P (__d)); \
  1827. /* Dereference it so the compiler knows it can't be NULL even \
  1828. without assertion checking. */ \
  1829. &*DECL_RTL_IF_SET (__d); })
  1830. #else
  1831. #define DECL_RTL_KNOWN_SET(decl) (&*DECL_RTL_IF_SET (decl))
  1832. #endif
  1833. /* In VAR_DECL and PARM_DECL nodes, nonzero means declared `register'. */
  1834. #define DECL_REGISTER(NODE) (DECL_WRTL_CHECK (NODE)->decl_common.decl_flag_0)
  1835. /* In a FIELD_DECL, this is the field position, counting in bytes, of the
  1836. DECL_OFFSET_ALIGN-bit-sized word containing the bit closest to the beginning
  1837. of the structure. */
  1838. #define DECL_FIELD_OFFSET(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.offset)
  1839. /* In a FIELD_DECL, this is the offset, in bits, of the first bit of the
  1840. field from DECL_FIELD_OFFSET. This field may be nonzero even for fields
  1841. that are not bit fields (since DECL_OFFSET_ALIGN may be larger than the
  1842. natural alignment of the field's type). */
  1843. #define DECL_FIELD_BIT_OFFSET(NODE) \
  1844. (FIELD_DECL_CHECK (NODE)->field_decl.bit_offset)
  1845. /* In a FIELD_DECL, this indicates whether the field was a bit-field and
  1846. if so, the type that was originally specified for it.
  1847. TREE_TYPE may have been modified (in finish_struct). */
  1848. #define DECL_BIT_FIELD_TYPE(NODE) \
  1849. (FIELD_DECL_CHECK (NODE)->field_decl.bit_field_type)
  1850. /* In a FIELD_DECL of a RECORD_TYPE, this is a pointer to the storage
  1851. representative FIELD_DECL. */
  1852. #define DECL_BIT_FIELD_REPRESENTATIVE(NODE) \
  1853. (FIELD_DECL_CHECK (NODE)->field_decl.qualifier)
  1854. /* For a FIELD_DECL in a QUAL_UNION_TYPE, records the expression, which
  1855. if nonzero, indicates that the field occupies the type. */
  1856. #define DECL_QUALIFIER(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.qualifier)
  1857. /* For FIELD_DECLs, off_align holds the number of low-order bits of
  1858. DECL_FIELD_OFFSET which are known to be always zero.
  1859. DECL_OFFSET_ALIGN thus returns the alignment that DECL_FIELD_OFFSET
  1860. has. */
  1861. #define DECL_OFFSET_ALIGN(NODE) \
  1862. (((unsigned HOST_WIDE_INT)1) << FIELD_DECL_CHECK (NODE)->decl_common.off_align)
  1863. /* Specify that DECL_ALIGN(NODE) is a multiple of X. */
  1864. #define SET_DECL_OFFSET_ALIGN(NODE, X) \
  1865. (FIELD_DECL_CHECK (NODE)->decl_common.off_align = ffs_hwi (X) - 1)
  1866. /* For FIELD_DECLS, DECL_FCONTEXT is the *first* baseclass in
  1867. which this FIELD_DECL is defined. This information is needed when
  1868. writing debugging information about vfield and vbase decls for C++. */
  1869. #define DECL_FCONTEXT(NODE) (FIELD_DECL_CHECK (NODE)->field_decl.fcontext)
  1870. /* In a FIELD_DECL, indicates this field should be bit-packed. */
  1871. #define DECL_PACKED(NODE) (FIELD_DECL_CHECK (NODE)->base.u.bits.packed_flag)
  1872. /* Nonzero in a FIELD_DECL means it is a bit field, and must be accessed
  1873. specially. */
  1874. #define DECL_BIT_FIELD(NODE) (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_1)
  1875. /* Used in a FIELD_DECL to indicate that we cannot form the address of
  1876. this component. This makes it possible for Type-Based Alias Analysis
  1877. to disambiguate accesses to this field with indirect accesses using
  1878. the field's type:
  1879. struct S { int i; } s;
  1880. int *p;
  1881. If the flag is set on 'i', TBAA computes that s.i and *p never conflict.
  1882. From the implementation's viewpoint, the alias set of the type of the
  1883. field 'i' (int) will not be recorded as a subset of that of the type of
  1884. 's' (struct S) in record_component_aliases. The counterpart is that
  1885. accesses to s.i must not be given the alias set of the type of 'i'
  1886. (int) but instead directly that of the type of 's' (struct S). */
  1887. #define DECL_NONADDRESSABLE_P(NODE) \
  1888. (FIELD_DECL_CHECK (NODE)->decl_common.decl_flag_2)
  1889. /* A numeric unique identifier for a LABEL_DECL. The UID allocation is
  1890. dense, unique within any one function, and may be used to index arrays.
  1891. If the value is -1, then no UID has been assigned. */
  1892. #define LABEL_DECL_UID(NODE) \
  1893. (LABEL_DECL_CHECK (NODE)->label_decl.label_decl_uid)
  1894. /* In a LABEL_DECL, the EH region number for which the label is the
  1895. post_landing_pad. */
  1896. #define EH_LANDING_PAD_NR(NODE) \
  1897. (LABEL_DECL_CHECK (NODE)->label_decl.eh_landing_pad_nr)
  1898. /* For a PARM_DECL, records the data type used to pass the argument,
  1899. which may be different from the type seen in the program. */
  1900. #define DECL_ARG_TYPE(NODE) (PARM_DECL_CHECK (NODE)->decl_common.initial)
  1901. /* For PARM_DECL, holds an RTL for the stack slot or register
  1902. where the data was actually passed. */
  1903. #define DECL_INCOMING_RTL(NODE) \
  1904. (PARM_DECL_CHECK (NODE)->parm_decl.incoming_rtl)
  1905. /* Nonzero for a given ..._DECL node means that no warnings should be
  1906. generated just because this node is unused. */
  1907. #define DECL_IN_SYSTEM_HEADER(NODE) \
  1908. (in_system_header_at (DECL_SOURCE_LOCATION (NODE)))
  1909. /* Used to indicate that the linkage status of this DECL is not yet known,
  1910. so it should not be output now. */
  1911. #define DECL_DEFER_OUTPUT(NODE) \
  1912. (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.defer_output)
  1913. /* In a VAR_DECL that's static,
  1914. nonzero if the space is in the text section. */
  1915. #define DECL_IN_TEXT_SECTION(NODE) \
  1916. (VAR_DECL_CHECK (NODE)->decl_with_vis.in_text_section)
  1917. /* In a VAR_DECL that's static,
  1918. nonzero if it belongs to the global constant pool. */
  1919. #define DECL_IN_CONSTANT_POOL(NODE) \
  1920. (VAR_DECL_CHECK (NODE)->decl_with_vis.in_constant_pool)
  1921. /* Nonzero for a given ..._DECL node means that this node should be
  1922. put in .common, if possible. If a DECL_INITIAL is given, and it
  1923. is not error_mark_node, then the decl cannot be put in .common. */
  1924. #define DECL_COMMON(NODE) \
  1925. (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.common_flag)
  1926. /* In a VAR_DECL, nonzero if the decl is a register variable with
  1927. an explicit asm specification. */
  1928. #define DECL_HARD_REGISTER(NODE) \
  1929. (VAR_DECL_CHECK (NODE)->decl_with_vis.hard_register)
  1930. /* Used to indicate that this DECL has weak linkage. */
  1931. #define DECL_WEAK(NODE) (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.weak_flag)
  1932. /* Used to indicate that the DECL is a dllimport. */
  1933. #define DECL_DLLIMPORT_P(NODE) \
  1934. (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.dllimport_flag)
  1935. /* Used in a DECL to indicate that, even if it TREE_PUBLIC, it need
  1936. not be put out unless it is needed in this translation unit.
  1937. Entities like this are shared across translation units (like weak
  1938. entities), but are guaranteed to be generated by any translation
  1939. unit that needs them, and therefore need not be put out anywhere
  1940. where they are not needed. DECL_COMDAT is just a hint to the
  1941. back-end; it is up to front-ends which set this flag to ensure
  1942. that there will never be any harm, other than bloat, in putting out
  1943. something which is DECL_COMDAT. */
  1944. #define DECL_COMDAT(NODE) \
  1945. (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.comdat_flag)
  1946. #define DECL_COMDAT_GROUP(NODE) \
  1947. decl_comdat_group (NODE)
  1948. /* Used in TREE_PUBLIC decls to indicate that copies of this DECL in
  1949. multiple translation units should be merged. */
  1950. #define DECL_ONE_ONLY(NODE) (DECL_COMDAT_GROUP (NODE) != NULL_TREE \
  1951. && (TREE_PUBLIC (NODE) || DECL_EXTERNAL (NODE)))
  1952. /* The name of the object as the assembler will see it (but before any
  1953. translations made by ASM_OUTPUT_LABELREF). Often this is the same
  1954. as DECL_NAME. It is an IDENTIFIER_NODE.
  1955. ASSEMBLER_NAME of TYPE_DECLS may store global name of type used for
  1956. One Definition Rule based type merging at LTO. It is computed only for
  1957. LTO compilation and C++. */
  1958. #define DECL_ASSEMBLER_NAME(NODE) decl_assembler_name (NODE)
  1959. /* Return true if NODE is a NODE that can contain a DECL_ASSEMBLER_NAME.
  1960. This is true of all DECL nodes except FIELD_DECL. */
  1961. #define HAS_DECL_ASSEMBLER_NAME_P(NODE) \
  1962. (CODE_CONTAINS_STRUCT (TREE_CODE (NODE), TS_DECL_WITH_VIS))
  1963. /* Returns nonzero if the DECL_ASSEMBLER_NAME for NODE has been set. If zero,
  1964. the NODE might still have a DECL_ASSEMBLER_NAME -- it just hasn't been set
  1965. yet. */
  1966. #define DECL_ASSEMBLER_NAME_SET_P(NODE) \
  1967. (HAS_DECL_ASSEMBLER_NAME_P (NODE) \
  1968. && DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name != NULL_TREE)
  1969. /* Set the DECL_ASSEMBLER_NAME for NODE to NAME. */
  1970. #define SET_DECL_ASSEMBLER_NAME(NODE, NAME) \
  1971. (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.assembler_name = (NAME))
  1972. /* Copy the DECL_ASSEMBLER_NAME from DECL1 to DECL2. Note that if DECL1's
  1973. DECL_ASSEMBLER_NAME has not yet been set, using this macro will not cause
  1974. the DECL_ASSEMBLER_NAME of either DECL to be set. In other words, the
  1975. semantics of using this macro, are different than saying:
  1976. SET_DECL_ASSEMBLER_NAME(DECL2, DECL_ASSEMBLER_NAME (DECL1))
  1977. which will try to set the DECL_ASSEMBLER_NAME for DECL1. */
  1978. #define COPY_DECL_ASSEMBLER_NAME(DECL1, DECL2) \
  1979. (DECL_ASSEMBLER_NAME_SET_P (DECL1) \
  1980. ? (void) SET_DECL_ASSEMBLER_NAME (DECL2, \
  1981. DECL_ASSEMBLER_NAME (DECL1)) \
  1982. : (void) 0)
  1983. /* Records the section name in a section attribute. Used to pass
  1984. the name from decl_attributes to make_function_rtl and make_decl_rtl. */
  1985. #define DECL_SECTION_NAME(NODE) decl_section_name (NODE)
  1986. /* Nonzero in a decl means that the gimplifier has seen (or placed)
  1987. this variable in a BIND_EXPR. */
  1988. #define DECL_SEEN_IN_BIND_EXPR_P(NODE) \
  1989. (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.seen_in_bind_expr)
  1990. /* Value of the decls's visibility attribute */
  1991. #define DECL_VISIBILITY(NODE) \
  1992. (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility)
  1993. /* Nonzero means that the decl had its visibility specified rather than
  1994. being inferred. */
  1995. #define DECL_VISIBILITY_SPECIFIED(NODE) \
  1996. (DECL_WITH_VIS_CHECK (NODE)->decl_with_vis.visibility_specified)
  1997. /* In a VAR_DECL, the model to use if the data should be allocated from
  1998. thread-local storage. */
  1999. #define DECL_TLS_MODEL(NODE) decl_tls_model (NODE)
  2000. /* In a VAR_DECL, nonzero if the data should be allocated from
  2001. thread-local storage. */
  2002. #define DECL_THREAD_LOCAL_P(NODE) \
  2003. ((TREE_STATIC (NODE) || DECL_EXTERNAL (NODE)) && decl_tls_model (NODE) >= TLS_MODEL_REAL)
  2004. /* In a non-local VAR_DECL with static storage duration, true if the
  2005. variable has an initialization priority. If false, the variable
  2006. will be initialized at the DEFAULT_INIT_PRIORITY. */
  2007. #define DECL_HAS_INIT_PRIORITY_P(NODE) \
  2008. (VAR_DECL_CHECK (NODE)->decl_with_vis.init_priority_p)
  2009. extern tree decl_debug_expr_lookup (tree);
  2010. extern void decl_debug_expr_insert (tree, tree);
  2011. /* For VAR_DECL, this is set to an expression that it was split from. */
  2012. #define DECL_HAS_DEBUG_EXPR_P(NODE) \
  2013. (VAR_DECL_CHECK (NODE)->decl_common.debug_expr_is_from)
  2014. #define DECL_DEBUG_EXPR(NODE) \
  2015. (decl_debug_expr_lookup (VAR_DECL_CHECK (NODE)))
  2016. #define SET_DECL_DEBUG_EXPR(NODE, VAL) \
  2017. (decl_debug_expr_insert (VAR_DECL_CHECK (NODE), VAL))
  2018. extern priority_type decl_init_priority_lookup (tree);
  2019. extern priority_type decl_fini_priority_lookup (tree);
  2020. extern void decl_init_priority_insert (tree, priority_type);
  2021. extern void decl_fini_priority_insert (tree, priority_type);
  2022. /* For a VAR_DECL or FUNCTION_DECL the initialization priority of
  2023. NODE. */
  2024. #define DECL_INIT_PRIORITY(NODE) \
  2025. (decl_init_priority_lookup (NODE))
  2026. /* Set the initialization priority for NODE to VAL. */
  2027. #define SET_DECL_INIT_PRIORITY(NODE, VAL) \
  2028. (decl_init_priority_insert (NODE, VAL))
  2029. /* For a FUNCTION_DECL the finalization priority of NODE. */
  2030. #define DECL_FINI_PRIORITY(NODE) \
  2031. (decl_fini_priority_lookup (NODE))
  2032. /* Set the finalization priority for NODE to VAL. */
  2033. #define SET_DECL_FINI_PRIORITY(NODE, VAL) \
  2034. (decl_fini_priority_insert (NODE, VAL))
  2035. /* The initialization priority for entities for which no explicit
  2036. initialization priority has been specified. */
  2037. #define DEFAULT_INIT_PRIORITY 65535
  2038. /* The maximum allowed initialization priority. */
  2039. #define MAX_INIT_PRIORITY 65535
  2040. /* The largest priority value reserved for use by system runtime
  2041. libraries. */
  2042. #define MAX_RESERVED_INIT_PRIORITY 100
  2043. /* In a VAR_DECL, nonzero if this is a global variable for VOPs. */
  2044. #define VAR_DECL_IS_VIRTUAL_OPERAND(NODE) \
  2045. (VAR_DECL_CHECK (NODE)->base.u.bits.saturating_flag)
  2046. /* In a VAR_DECL, nonzero if this is a non-local frame structure. */
  2047. #define DECL_NONLOCAL_FRAME(NODE) \
  2048. (VAR_DECL_CHECK (NODE)->base.default_def_flag)
  2049. /* In a VAR_DECL, nonzero if this variable is not aliased by any pointer. */
  2050. #define DECL_NONALIASED(NODE) \
  2051. (VAR_DECL_CHECK (NODE)->base.nothrow_flag)
  2052. /* This field is used to reference anything in decl.result and is meant only
  2053. for use by the garbage collector. */
  2054. #define DECL_RESULT_FLD(NODE) \
  2055. (DECL_NON_COMMON_CHECK (NODE)->decl_non_common.result)
  2056. /* The DECL_VINDEX is used for FUNCTION_DECLS in two different ways.
  2057. Before the struct containing the FUNCTION_DECL is laid out,
  2058. DECL_VINDEX may point to a FUNCTION_DECL in a base class which
  2059. is the FUNCTION_DECL which this FUNCTION_DECL will replace as a virtual
  2060. function. When the class is laid out, this pointer is changed
  2061. to an INTEGER_CST node which is suitable for use as an index
  2062. into the virtual function table. */
  2063. #define DECL_VINDEX(NODE) \
  2064. (FUNCTION_DECL_CHECK (NODE)->function_decl.vindex)
  2065. /* In FUNCTION_DECL, holds the decl for the return value. */
  2066. #define DECL_RESULT(NODE) (FUNCTION_DECL_CHECK (NODE)->decl_non_common.result)
  2067. /* In a FUNCTION_DECL, nonzero if the function cannot be inlined. */
  2068. #define DECL_UNINLINABLE(NODE) \
  2069. (FUNCTION_DECL_CHECK (NODE)->function_decl.uninlinable)
  2070. /* In a FUNCTION_DECL, the saved representation of the body of the
  2071. entire function. */
  2072. #define DECL_SAVED_TREE(NODE) \
  2073. (FUNCTION_DECL_CHECK (NODE)->function_decl.saved_tree)
  2074. /* Nonzero in a FUNCTION_DECL means this function should be treated
  2075. as if it were a malloc, meaning it returns a pointer that is
  2076. not an alias. */
  2077. #define DECL_IS_MALLOC(NODE) \
  2078. (FUNCTION_DECL_CHECK (NODE)->function_decl.malloc_flag)
  2079. /* Nonzero in a FUNCTION_DECL means this function should be treated as
  2080. C++ operator new, meaning that it returns a pointer for which we
  2081. should not use type based aliasing. */
  2082. #define DECL_IS_OPERATOR_NEW(NODE) \
  2083. (FUNCTION_DECL_CHECK (NODE)->function_decl.operator_new_flag)
  2084. /* Nonzero in a FUNCTION_DECL means this function may return more
  2085. than once. */
  2086. #define DECL_IS_RETURNS_TWICE(NODE) \
  2087. (FUNCTION_DECL_CHECK (NODE)->function_decl.returns_twice_flag)
  2088. /* Nonzero in a FUNCTION_DECL means this function should be treated
  2089. as "pure" function (like const function, but may read global memory). */
  2090. #define DECL_PURE_P(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.pure_flag)
  2091. /* Nonzero only if one of TREE_READONLY or DECL_PURE_P is nonzero AND
  2092. the const or pure function may not terminate. When this is nonzero
  2093. for a const or pure function, it can be dealt with by cse passes
  2094. but cannot be removed by dce passes since you are not allowed to
  2095. change an infinite looping program into one that terminates without
  2096. error. */
  2097. #define DECL_LOOPING_CONST_OR_PURE_P(NODE) \
  2098. (FUNCTION_DECL_CHECK (NODE)->function_decl.looping_const_or_pure_flag)
  2099. /* Nonzero in a FUNCTION_DECL means this function should be treated
  2100. as "novops" function (function that does not read global memory,
  2101. but may have arbitrary side effects). */
  2102. #define DECL_IS_NOVOPS(NODE) \
  2103. (FUNCTION_DECL_CHECK (NODE)->function_decl.novops_flag)
  2104. /* Used in FUNCTION_DECLs to indicate that they should be run automatically
  2105. at the beginning or end of execution. */
  2106. #define DECL_STATIC_CONSTRUCTOR(NODE) \
  2107. (FUNCTION_DECL_CHECK (NODE)->function_decl.static_ctor_flag)
  2108. #define DECL_STATIC_DESTRUCTOR(NODE) \
  2109. (FUNCTION_DECL_CHECK (NODE)->function_decl.static_dtor_flag)
  2110. /* Used in FUNCTION_DECLs to indicate that function entry and exit should
  2111. be instrumented with calls to support routines. */
  2112. #define DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT(NODE) \
  2113. (FUNCTION_DECL_CHECK (NODE)->function_decl.no_instrument_function_entry_exit)
  2114. /* Used in FUNCTION_DECLs to indicate that limit-stack-* should be
  2115. disabled in this function. */
  2116. #define DECL_NO_LIMIT_STACK(NODE) \
  2117. (FUNCTION_DECL_CHECK (NODE)->function_decl.no_limit_stack)
  2118. /* In a FUNCTION_DECL indicates that a static chain is needed. */
  2119. #define DECL_STATIC_CHAIN(NODE) \
  2120. (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.regdecl_flag)
  2121. /* Nonzero for a decl that cgraph has decided should be inlined into
  2122. at least one call site. It is not meaningful to look at this
  2123. directly; always use cgraph_function_possibly_inlined_p. */
  2124. #define DECL_POSSIBLY_INLINED(DECL) \
  2125. FUNCTION_DECL_CHECK (DECL)->function_decl.possibly_inlined
  2126. /* Nonzero in a FUNCTION_DECL means that this function was declared inline,
  2127. such as via the `inline' keyword in C/C++. This flag controls the linkage
  2128. semantics of 'inline' */
  2129. #define DECL_DECLARED_INLINE_P(NODE) \
  2130. (FUNCTION_DECL_CHECK (NODE)->function_decl.declared_inline_flag)
  2131. /* Nonzero in a FUNCTION_DECL means this function should not get
  2132. -Winline warnings. */
  2133. #define DECL_NO_INLINE_WARNING_P(NODE) \
  2134. (FUNCTION_DECL_CHECK (NODE)->function_decl.no_inline_warning_flag)
  2135. /* Nonzero if a FUNCTION_CODE is a TM load/store. */
  2136. #define BUILTIN_TM_LOAD_STORE_P(FN) \
  2137. ((FN) >= BUILT_IN_TM_STORE_1 && (FN) <= BUILT_IN_TM_LOAD_RFW_LDOUBLE)
  2138. /* Nonzero if a FUNCTION_CODE is a TM load. */
  2139. #define BUILTIN_TM_LOAD_P(FN) \
  2140. ((FN) >= BUILT_IN_TM_LOAD_1 && (FN) <= BUILT_IN_TM_LOAD_RFW_LDOUBLE)
  2141. /* Nonzero if a FUNCTION_CODE is a TM store. */
  2142. #define BUILTIN_TM_STORE_P(FN) \
  2143. ((FN) >= BUILT_IN_TM_STORE_1 && (FN) <= BUILT_IN_TM_STORE_WAW_LDOUBLE)
  2144. #define CASE_BUILT_IN_TM_LOAD(FN) \
  2145. case BUILT_IN_TM_LOAD_##FN: \
  2146. case BUILT_IN_TM_LOAD_RAR_##FN: \
  2147. case BUILT_IN_TM_LOAD_RAW_##FN: \
  2148. case BUILT_IN_TM_LOAD_RFW_##FN
  2149. #define CASE_BUILT_IN_TM_STORE(FN) \
  2150. case BUILT_IN_TM_STORE_##FN: \
  2151. case BUILT_IN_TM_STORE_WAR_##FN: \
  2152. case BUILT_IN_TM_STORE_WAW_##FN
  2153. /* Nonzero in a FUNCTION_DECL that should be always inlined by the inliner
  2154. disregarding size and cost heuristics. This is equivalent to using
  2155. the always_inline attribute without the required diagnostics if the
  2156. function cannot be inlined. */
  2157. #define DECL_DISREGARD_INLINE_LIMITS(NODE) \
  2158. (FUNCTION_DECL_CHECK (NODE)->function_decl.disregard_inline_limits)
  2159. extern vec<tree, va_gc> **decl_debug_args_lookup (tree);
  2160. extern vec<tree, va_gc> **decl_debug_args_insert (tree);
  2161. /* Nonzero if a FUNCTION_DECL has DEBUG arguments attached to it. */
  2162. #define DECL_HAS_DEBUG_ARGS_P(NODE) \
  2163. (FUNCTION_DECL_CHECK (NODE)->function_decl.has_debug_args_flag)
  2164. /* For FUNCTION_DECL, this holds a pointer to a structure ("struct function")
  2165. that describes the status of this function. */
  2166. #define DECL_STRUCT_FUNCTION(NODE) \
  2167. (FUNCTION_DECL_CHECK (NODE)->function_decl.f)
  2168. /* In a FUNCTION_DECL, nonzero means a built in function of a
  2169. standard library or more generally a built in function that is
  2170. recognized by optimizers and expanders.
  2171. Note that it is different from the DECL_IS_BUILTIN accessor. For
  2172. instance, user declared prototypes of C library functions are not
  2173. DECL_IS_BUILTIN but may be DECL_BUILT_IN. */
  2174. #define DECL_BUILT_IN(NODE) (DECL_BUILT_IN_CLASS (NODE) != NOT_BUILT_IN)
  2175. /* For a builtin function, identify which part of the compiler defined it. */
  2176. #define DECL_BUILT_IN_CLASS(NODE) \
  2177. (FUNCTION_DECL_CHECK (NODE)->function_decl.built_in_class)
  2178. /* In FUNCTION_DECL, a chain of ..._DECL nodes. */
  2179. #define DECL_ARGUMENTS(NODE) \
  2180. (FUNCTION_DECL_CHECK (NODE)->function_decl.arguments)
  2181. /* In FUNCTION_DECL, the function specific target options to use when compiling
  2182. this function. */
  2183. #define DECL_FUNCTION_SPECIFIC_TARGET(NODE) \
  2184. (FUNCTION_DECL_CHECK (NODE)->function_decl.function_specific_target)
  2185. /* In FUNCTION_DECL, the function specific optimization options to use when
  2186. compiling this function. */
  2187. #define DECL_FUNCTION_SPECIFIC_OPTIMIZATION(NODE) \
  2188. (FUNCTION_DECL_CHECK (NODE)->function_decl.function_specific_optimization)
  2189. /* In FUNCTION_DECL, this is set if this function has other versions generated
  2190. using "target" attributes. The default version is the one which does not
  2191. have any "target" attribute set. */
  2192. #define DECL_FUNCTION_VERSIONED(NODE)\
  2193. (FUNCTION_DECL_CHECK (NODE)->function_decl.versioned_function)
  2194. /* In FUNCTION_DECL, this is set if this function is a C++ constructor.
  2195. Devirtualization machinery uses this knowledge for determing type of the
  2196. object constructed. Also we assume that constructor address is not
  2197. important. */
  2198. #define DECL_CXX_CONSTRUCTOR_P(NODE)\
  2199. (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.cxx_constructor)
  2200. /* In FUNCTION_DECL, this is set if this function is a C++ destructor.
  2201. Devirtualization machinery uses this to track types in destruction. */
  2202. #define DECL_CXX_DESTRUCTOR_P(NODE)\
  2203. (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.cxx_destructor)
  2204. /* In FUNCTION_DECL that represent an virtual method this is set when
  2205. the method is final. */
  2206. #define DECL_FINAL_P(NODE)\
  2207. (FUNCTION_DECL_CHECK (NODE)->decl_with_vis.final)
  2208. /* The source language of the translation-unit. */
  2209. #define TRANSLATION_UNIT_LANGUAGE(NODE) \
  2210. (TRANSLATION_UNIT_DECL_CHECK (NODE)->translation_unit_decl.language)
  2211. /* TRANSLATION_UNIT_DECL inherits from DECL_MINIMAL. */
  2212. /* For a TYPE_DECL, holds the "original" type. (TREE_TYPE has the copy.) */
  2213. #define DECL_ORIGINAL_TYPE(NODE) \
  2214. (TYPE_DECL_CHECK (NODE)->decl_non_common.result)
  2215. /* In a TYPE_DECL nonzero means the detail info about this type is not dumped
  2216. into stabs. Instead it will generate cross reference ('x') of names.
  2217. This uses the same flag as DECL_EXTERNAL. */
  2218. #define TYPE_DECL_SUPPRESS_DEBUG(NODE) \
  2219. (TYPE_DECL_CHECK (NODE)->decl_common.decl_flag_1)
  2220. /* Getter of the imported declaration associated to the
  2221. IMPORTED_DECL node. */
  2222. #define IMPORTED_DECL_ASSOCIATED_DECL(NODE) \
  2223. (DECL_INITIAL (IMPORTED_DECL_CHECK (NODE)))
  2224. /* Getter of the symbol declaration associated with the
  2225. NAMELIST_DECL node. */
  2226. #define NAMELIST_DECL_ASSOCIATED_DECL(NODE) \
  2227. (DECL_INITIAL (NODE))
  2228. /* A STATEMENT_LIST chains statements together in GENERIC and GIMPLE.
  2229. To reduce overhead, the nodes containing the statements are not trees.
  2230. This avoids the overhead of tree_common on all linked list elements.
  2231. Use the interface in tree-iterator.h to access this node. */
  2232. #define STATEMENT_LIST_HEAD(NODE) \
  2233. (STATEMENT_LIST_CHECK (NODE)->stmt_list.head)
  2234. #define STATEMENT_LIST_TAIL(NODE) \
  2235. (STATEMENT_LIST_CHECK (NODE)->stmt_list.tail)
  2236. #define TREE_OPTIMIZATION(NODE) \
  2237. (&OPTIMIZATION_NODE_CHECK (NODE)->optimization.opts)
  2238. #define TREE_OPTIMIZATION_OPTABS(NODE) \
  2239. (OPTIMIZATION_NODE_CHECK (NODE)->optimization.optabs)
  2240. #define TREE_OPTIMIZATION_BASE_OPTABS(NODE) \
  2241. (OPTIMIZATION_NODE_CHECK (NODE)->optimization.base_optabs)
  2242. /* Return a tree node that encapsulates the optimization options in OPTS. */
  2243. extern tree build_optimization_node (struct gcc_options *opts);
  2244. #define TREE_TARGET_OPTION(NODE) \
  2245. (&TARGET_OPTION_NODE_CHECK (NODE)->target_option.opts)
  2246. #define TREE_TARGET_GLOBALS(NODE) \
  2247. (TARGET_OPTION_NODE_CHECK (NODE)->target_option.globals)
  2248. /* Return a tree node that encapsulates the target options in OPTS. */
  2249. extern tree build_target_option_node (struct gcc_options *opts);
  2250. extern void prepare_target_option_nodes_for_pch (void);
  2251. #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
  2252. inline tree
  2253. tree_check (tree __t, const char *__f, int __l, const char *__g, tree_code __c)
  2254. {
  2255. if (TREE_CODE (__t) != __c)
  2256. tree_check_failed (__t, __f, __l, __g, __c, 0);
  2257. return __t;
  2258. }
  2259. inline tree
  2260. tree_not_check (tree __t, const char *__f, int __l, const char *__g,
  2261. enum tree_code __c)
  2262. {
  2263. if (TREE_CODE (__t) == __c)
  2264. tree_not_check_failed (__t, __f, __l, __g, __c, 0);
  2265. return __t;
  2266. }
  2267. inline tree
  2268. tree_check2 (tree __t, const char *__f, int __l, const char *__g,
  2269. enum tree_code __c1, enum tree_code __c2)
  2270. {
  2271. if (TREE_CODE (__t) != __c1
  2272. && TREE_CODE (__t) != __c2)
  2273. tree_check_failed (__t, __f, __l, __g, __c1, __c2, 0);
  2274. return __t;
  2275. }
  2276. inline tree
  2277. tree_not_check2 (tree __t, const char *__f, int __l, const char *__g,
  2278. enum tree_code __c1, enum tree_code __c2)
  2279. {
  2280. if (TREE_CODE (__t) == __c1
  2281. || TREE_CODE (__t) == __c2)
  2282. tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, 0);
  2283. return __t;
  2284. }
  2285. inline tree
  2286. tree_check3 (tree __t, const char *__f, int __l, const char *__g,
  2287. enum tree_code __c1, enum tree_code __c2, enum tree_code __c3)
  2288. {
  2289. if (TREE_CODE (__t) != __c1
  2290. && TREE_CODE (__t) != __c2
  2291. && TREE_CODE (__t) != __c3)
  2292. tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, 0);
  2293. return __t;
  2294. }
  2295. inline tree
  2296. tree_not_check3 (tree __t, const char *__f, int __l, const char *__g,
  2297. enum tree_code __c1, enum tree_code __c2, enum tree_code __c3)
  2298. {
  2299. if (TREE_CODE (__t) == __c1
  2300. || TREE_CODE (__t) == __c2
  2301. || TREE_CODE (__t) == __c3)
  2302. tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, 0);
  2303. return __t;
  2304. }
  2305. inline tree
  2306. tree_check4 (tree __t, const char *__f, int __l, const char *__g,
  2307. enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
  2308. enum tree_code __c4)
  2309. {
  2310. if (TREE_CODE (__t) != __c1
  2311. && TREE_CODE (__t) != __c2
  2312. && TREE_CODE (__t) != __c3
  2313. && TREE_CODE (__t) != __c4)
  2314. tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, 0);
  2315. return __t;
  2316. }
  2317. inline tree
  2318. tree_not_check4 (tree __t, const char *__f, int __l, const char *__g,
  2319. enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
  2320. enum tree_code __c4)
  2321. {
  2322. if (TREE_CODE (__t) == __c1
  2323. || TREE_CODE (__t) == __c2
  2324. || TREE_CODE (__t) == __c3
  2325. || TREE_CODE (__t) == __c4)
  2326. tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, 0);
  2327. return __t;
  2328. }
  2329. inline tree
  2330. tree_check5 (tree __t, const char *__f, int __l, const char *__g,
  2331. enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
  2332. enum tree_code __c4, enum tree_code __c5)
  2333. {
  2334. if (TREE_CODE (__t) != __c1
  2335. && TREE_CODE (__t) != __c2
  2336. && TREE_CODE (__t) != __c3
  2337. && TREE_CODE (__t) != __c4
  2338. && TREE_CODE (__t) != __c5)
  2339. tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, __c5, 0);
  2340. return __t;
  2341. }
  2342. inline tree
  2343. tree_not_check5 (tree __t, const char *__f, int __l, const char *__g,
  2344. enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
  2345. enum tree_code __c4, enum tree_code __c5)
  2346. {
  2347. if (TREE_CODE (__t) == __c1
  2348. || TREE_CODE (__t) == __c2
  2349. || TREE_CODE (__t) == __c3
  2350. || TREE_CODE (__t) == __c4
  2351. || TREE_CODE (__t) == __c5)
  2352. tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, __c5, 0);
  2353. return __t;
  2354. }
  2355. inline tree
  2356. contains_struct_check (tree __t, const enum tree_node_structure_enum __s,
  2357. const char *__f, int __l, const char *__g)
  2358. {
  2359. if (tree_contains_struct[TREE_CODE (__t)][__s] != 1)
  2360. tree_contains_struct_check_failed (__t, __s, __f, __l, __g);
  2361. return __t;
  2362. }
  2363. inline tree
  2364. tree_class_check (tree __t, const enum tree_code_class __class,
  2365. const char *__f, int __l, const char *__g)
  2366. {
  2367. if (TREE_CODE_CLASS (TREE_CODE (__t)) != __class)
  2368. tree_class_check_failed (__t, __class, __f, __l, __g);
  2369. return __t;
  2370. }
  2371. inline tree
  2372. tree_range_check (tree __t,
  2373. enum tree_code __code1, enum tree_code __code2,
  2374. const char *__f, int __l, const char *__g)
  2375. {
  2376. if (TREE_CODE (__t) < __code1 || TREE_CODE (__t) > __code2)
  2377. tree_range_check_failed (__t, __f, __l, __g, __code1, __code2);
  2378. return __t;
  2379. }
  2380. inline tree
  2381. omp_clause_subcode_check (tree __t, enum omp_clause_code __code,
  2382. const char *__f, int __l, const char *__g)
  2383. {
  2384. if (TREE_CODE (__t) != OMP_CLAUSE)
  2385. tree_check_failed (__t, __f, __l, __g, OMP_CLAUSE, 0);
  2386. if (__t->omp_clause.code != __code)
  2387. omp_clause_check_failed (__t, __f, __l, __g, __code);
  2388. return __t;
  2389. }
  2390. inline tree
  2391. omp_clause_range_check (tree __t,
  2392. enum omp_clause_code __code1,
  2393. enum omp_clause_code __code2,
  2394. const char *__f, int __l, const char *__g)
  2395. {
  2396. if (TREE_CODE (__t) != OMP_CLAUSE)
  2397. tree_check_failed (__t, __f, __l, __g, OMP_CLAUSE, 0);
  2398. if ((int) __t->omp_clause.code < (int) __code1
  2399. || (int) __t->omp_clause.code > (int) __code2)
  2400. omp_clause_range_check_failed (__t, __f, __l, __g, __code1, __code2);
  2401. return __t;
  2402. }
  2403. /* These checks have to be special cased. */
  2404. inline tree
  2405. expr_check (tree __t, const char *__f, int __l, const char *__g)
  2406. {
  2407. char const __c = TREE_CODE_CLASS (TREE_CODE (__t));
  2408. if (!IS_EXPR_CODE_CLASS (__c))
  2409. tree_class_check_failed (__t, tcc_expression, __f, __l, __g);
  2410. return __t;
  2411. }
  2412. /* These checks have to be special cased. */
  2413. inline tree
  2414. non_type_check (tree __t, const char *__f, int __l, const char *__g)
  2415. {
  2416. if (TYPE_P (__t))
  2417. tree_not_class_check_failed (__t, tcc_type, __f, __l, __g);
  2418. return __t;
  2419. }
  2420. inline const HOST_WIDE_INT *
  2421. tree_int_cst_elt_check (const_tree __t, int __i,
  2422. const char *__f, int __l, const char *__g)
  2423. {
  2424. if (TREE_CODE (__t) != INTEGER_CST)
  2425. tree_check_failed (__t, __f, __l, __g, INTEGER_CST, 0);
  2426. if (__i < 0 || __i >= __t->base.u.int_length.extended)
  2427. tree_int_cst_elt_check_failed (__i, __t->base.u.int_length.extended,
  2428. __f, __l, __g);
  2429. return &CONST_CAST_TREE (__t)->int_cst.val[__i];
  2430. }
  2431. inline HOST_WIDE_INT *
  2432. tree_int_cst_elt_check (tree __t, int __i,
  2433. const char *__f, int __l, const char *__g)
  2434. {
  2435. if (TREE_CODE (__t) != INTEGER_CST)
  2436. tree_check_failed (__t, __f, __l, __g, INTEGER_CST, 0);
  2437. if (__i < 0 || __i >= __t->base.u.int_length.extended)
  2438. tree_int_cst_elt_check_failed (__i, __t->base.u.int_length.extended,
  2439. __f, __l, __g);
  2440. return &CONST_CAST_TREE (__t)->int_cst.val[__i];
  2441. }
  2442. /* Workaround -Wstrict-overflow false positive during profiledbootstrap. */
  2443. # if GCC_VERSION >= 4006
  2444. #pragma GCC diagnostic push
  2445. #pragma GCC diagnostic ignored "-Wstrict-overflow"
  2446. #endif
  2447. inline tree *
  2448. tree_vec_elt_check (tree __t, int __i,
  2449. const char *__f, int __l, const char *__g)
  2450. {
  2451. if (TREE_CODE (__t) != TREE_VEC)
  2452. tree_check_failed (__t, __f, __l, __g, TREE_VEC, 0);
  2453. if (__i < 0 || __i >= __t->base.u.length)
  2454. tree_vec_elt_check_failed (__i, __t->base.u.length, __f, __l, __g);
  2455. return &CONST_CAST_TREE (__t)->vec.a[__i];
  2456. }
  2457. # if GCC_VERSION >= 4006
  2458. #pragma GCC diagnostic pop
  2459. #endif
  2460. inline tree *
  2461. omp_clause_elt_check (tree __t, int __i,
  2462. const char *__f, int __l, const char *__g)
  2463. {
  2464. if (TREE_CODE (__t) != OMP_CLAUSE)
  2465. tree_check_failed (__t, __f, __l, __g, OMP_CLAUSE, 0);
  2466. if (__i < 0 || __i >= omp_clause_num_ops [__t->omp_clause.code])
  2467. omp_clause_operand_check_failed (__i, __t, __f, __l, __g);
  2468. return &__t->omp_clause.ops[__i];
  2469. }
  2470. /* These checks have to be special cased. */
  2471. inline tree
  2472. any_integral_type_check (tree __t, const char *__f, int __l, const char *__g)
  2473. {
  2474. if (!ANY_INTEGRAL_TYPE_P (__t))
  2475. tree_check_failed (__t, __f, __l, __g, BOOLEAN_TYPE, ENUMERAL_TYPE,
  2476. INTEGER_TYPE, 0);
  2477. return __t;
  2478. }
  2479. inline const_tree
  2480. tree_check (const_tree __t, const char *__f, int __l, const char *__g,
  2481. tree_code __c)
  2482. {
  2483. if (TREE_CODE (__t) != __c)
  2484. tree_check_failed (__t, __f, __l, __g, __c, 0);
  2485. return __t;
  2486. }
  2487. inline const_tree
  2488. tree_not_check (const_tree __t, const char *__f, int __l, const char *__g,
  2489. enum tree_code __c)
  2490. {
  2491. if (TREE_CODE (__t) == __c)
  2492. tree_not_check_failed (__t, __f, __l, __g, __c, 0);
  2493. return __t;
  2494. }
  2495. inline const_tree
  2496. tree_check2 (const_tree __t, const char *__f, int __l, const char *__g,
  2497. enum tree_code __c1, enum tree_code __c2)
  2498. {
  2499. if (TREE_CODE (__t) != __c1
  2500. && TREE_CODE (__t) != __c2)
  2501. tree_check_failed (__t, __f, __l, __g, __c1, __c2, 0);
  2502. return __t;
  2503. }
  2504. inline const_tree
  2505. tree_not_check2 (const_tree __t, const char *__f, int __l, const char *__g,
  2506. enum tree_code __c1, enum tree_code __c2)
  2507. {
  2508. if (TREE_CODE (__t) == __c1
  2509. || TREE_CODE (__t) == __c2)
  2510. tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, 0);
  2511. return __t;
  2512. }
  2513. inline const_tree
  2514. tree_check3 (const_tree __t, const char *__f, int __l, const char *__g,
  2515. enum tree_code __c1, enum tree_code __c2, enum tree_code __c3)
  2516. {
  2517. if (TREE_CODE (__t) != __c1
  2518. && TREE_CODE (__t) != __c2
  2519. && TREE_CODE (__t) != __c3)
  2520. tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, 0);
  2521. return __t;
  2522. }
  2523. inline const_tree
  2524. tree_not_check3 (const_tree __t, const char *__f, int __l, const char *__g,
  2525. enum tree_code __c1, enum tree_code __c2, enum tree_code __c3)
  2526. {
  2527. if (TREE_CODE (__t) == __c1
  2528. || TREE_CODE (__t) == __c2
  2529. || TREE_CODE (__t) == __c3)
  2530. tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, 0);
  2531. return __t;
  2532. }
  2533. inline const_tree
  2534. tree_check4 (const_tree __t, const char *__f, int __l, const char *__g,
  2535. enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
  2536. enum tree_code __c4)
  2537. {
  2538. if (TREE_CODE (__t) != __c1
  2539. && TREE_CODE (__t) != __c2
  2540. && TREE_CODE (__t) != __c3
  2541. && TREE_CODE (__t) != __c4)
  2542. tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, 0);
  2543. return __t;
  2544. }
  2545. inline const_tree
  2546. tree_not_check4 (const_tree __t, const char *__f, int __l, const char *__g,
  2547. enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
  2548. enum tree_code __c4)
  2549. {
  2550. if (TREE_CODE (__t) == __c1
  2551. || TREE_CODE (__t) == __c2
  2552. || TREE_CODE (__t) == __c3
  2553. || TREE_CODE (__t) == __c4)
  2554. tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, 0);
  2555. return __t;
  2556. }
  2557. inline const_tree
  2558. tree_check5 (const_tree __t, const char *__f, int __l, const char *__g,
  2559. enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
  2560. enum tree_code __c4, enum tree_code __c5)
  2561. {
  2562. if (TREE_CODE (__t) != __c1
  2563. && TREE_CODE (__t) != __c2
  2564. && TREE_CODE (__t) != __c3
  2565. && TREE_CODE (__t) != __c4
  2566. && TREE_CODE (__t) != __c5)
  2567. tree_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, __c5, 0);
  2568. return __t;
  2569. }
  2570. inline const_tree
  2571. tree_not_check5 (const_tree __t, const char *__f, int __l, const char *__g,
  2572. enum tree_code __c1, enum tree_code __c2, enum tree_code __c3,
  2573. enum tree_code __c4, enum tree_code __c5)
  2574. {
  2575. if (TREE_CODE (__t) == __c1
  2576. || TREE_CODE (__t) == __c2
  2577. || TREE_CODE (__t) == __c3
  2578. || TREE_CODE (__t) == __c4
  2579. || TREE_CODE (__t) == __c5)
  2580. tree_not_check_failed (__t, __f, __l, __g, __c1, __c2, __c3, __c4, __c5, 0);
  2581. return __t;
  2582. }
  2583. inline const_tree
  2584. contains_struct_check (const_tree __t, const enum tree_node_structure_enum __s,
  2585. const char *__f, int __l, const char *__g)
  2586. {
  2587. if (tree_contains_struct[TREE_CODE (__t)][__s] != 1)
  2588. tree_contains_struct_check_failed (__t, __s, __f, __l, __g);
  2589. return __t;
  2590. }
  2591. inline const_tree
  2592. tree_class_check (const_tree __t, const enum tree_code_class __class,
  2593. const char *__f, int __l, const char *__g)
  2594. {
  2595. if (TREE_CODE_CLASS (TREE_CODE (__t)) != __class)
  2596. tree_class_check_failed (__t, __class, __f, __l, __g);
  2597. return __t;
  2598. }
  2599. inline const_tree
  2600. tree_range_check (const_tree __t,
  2601. enum tree_code __code1, enum tree_code __code2,
  2602. const char *__f, int __l, const char *__g)
  2603. {
  2604. if (TREE_CODE (__t) < __code1 || TREE_CODE (__t) > __code2)
  2605. tree_range_check_failed (__t, __f, __l, __g, __code1, __code2);
  2606. return __t;
  2607. }
  2608. inline const_tree
  2609. omp_clause_subcode_check (const_tree __t, enum omp_clause_code __code,
  2610. const char *__f, int __l, const char *__g)
  2611. {
  2612. if (TREE_CODE (__t) != OMP_CLAUSE)
  2613. tree_check_failed (__t, __f, __l, __g, OMP_CLAUSE, 0);
  2614. if (__t->omp_clause.code != __code)
  2615. omp_clause_check_failed (__t, __f, __l, __g, __code);
  2616. return __t;
  2617. }
  2618. inline const_tree
  2619. omp_clause_range_check (const_tree __t,
  2620. enum omp_clause_code __code1,
  2621. enum omp_clause_code __code2,
  2622. const char *__f, int __l, const char *__g)
  2623. {
  2624. if (TREE_CODE (__t) != OMP_CLAUSE)
  2625. tree_check_failed (__t, __f, __l, __g, OMP_CLAUSE, 0);
  2626. if ((int) __t->omp_clause.code < (int) __code1
  2627. || (int) __t->omp_clause.code > (int) __code2)
  2628. omp_clause_range_check_failed (__t, __f, __l, __g, __code1, __code2);
  2629. return __t;
  2630. }
  2631. inline const_tree
  2632. expr_check (const_tree __t, const char *__f, int __l, const char *__g)
  2633. {
  2634. char const __c = TREE_CODE_CLASS (TREE_CODE (__t));
  2635. if (!IS_EXPR_CODE_CLASS (__c))
  2636. tree_class_check_failed (__t, tcc_expression, __f, __l, __g);
  2637. return __t;
  2638. }
  2639. inline const_tree
  2640. non_type_check (const_tree __t, const char *__f, int __l, const char *__g)
  2641. {
  2642. if (TYPE_P (__t))
  2643. tree_not_class_check_failed (__t, tcc_type, __f, __l, __g);
  2644. return __t;
  2645. }
  2646. # if GCC_VERSION >= 4006
  2647. #pragma GCC diagnostic push
  2648. #pragma GCC diagnostic ignored "-Wstrict-overflow"
  2649. #endif
  2650. inline const_tree *
  2651. tree_vec_elt_check (const_tree __t, int __i,
  2652. const char *__f, int __l, const char *__g)
  2653. {
  2654. if (TREE_CODE (__t) != TREE_VEC)
  2655. tree_check_failed (__t, __f, __l, __g, TREE_VEC, 0);
  2656. if (__i < 0 || __i >= __t->base.u.length)
  2657. tree_vec_elt_check_failed (__i, __t->base.u.length, __f, __l, __g);
  2658. return CONST_CAST (const_tree *, &__t->vec.a[__i]);
  2659. //return &__t->vec.a[__i];
  2660. }
  2661. # if GCC_VERSION >= 4006
  2662. #pragma GCC diagnostic pop
  2663. #endif
  2664. inline const_tree *
  2665. omp_clause_elt_check (const_tree __t, int __i,
  2666. const char *__f, int __l, const char *__g)
  2667. {
  2668. if (TREE_CODE (__t) != OMP_CLAUSE)
  2669. tree_check_failed (__t, __f, __l, __g, OMP_CLAUSE, 0);
  2670. if (__i < 0 || __i >= omp_clause_num_ops [__t->omp_clause.code])
  2671. omp_clause_operand_check_failed (__i, __t, __f, __l, __g);
  2672. return CONST_CAST (const_tree *, &__t->omp_clause.ops[__i]);
  2673. }
  2674. inline const_tree
  2675. any_integral_type_check (const_tree __t, const char *__f, int __l,
  2676. const char *__g)
  2677. {
  2678. if (!ANY_INTEGRAL_TYPE_P (__t))
  2679. tree_check_failed (__t, __f, __l, __g, BOOLEAN_TYPE, ENUMERAL_TYPE,
  2680. INTEGER_TYPE, 0);
  2681. return __t;
  2682. }
  2683. #endif
  2684. /* Compute the number of operands in an expression node NODE. For
  2685. tcc_vl_exp nodes like CALL_EXPRs, this is stored in the node itself,
  2686. otherwise it is looked up from the node's code. */
  2687. static inline int
  2688. tree_operand_length (const_tree node)
  2689. {
  2690. if (VL_EXP_CLASS_P (node))
  2691. return VL_EXP_OPERAND_LENGTH (node);
  2692. else
  2693. return TREE_CODE_LENGTH (TREE_CODE (node));
  2694. }
  2695. #if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
  2696. /* Special checks for TREE_OPERANDs. */
  2697. inline tree *
  2698. tree_operand_check (tree __t, int __i,
  2699. const char *__f, int __l, const char *__g)
  2700. {
  2701. const_tree __u = EXPR_CHECK (__t);
  2702. if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__u))
  2703. tree_operand_check_failed (__i, __u, __f, __l, __g);
  2704. return &CONST_CAST_TREE (__u)->exp.operands[__i];
  2705. }
  2706. inline tree *
  2707. tree_operand_check_code (tree __t, enum tree_code __code, int __i,
  2708. const char *__f, int __l, const char *__g)
  2709. {
  2710. if (TREE_CODE (__t) != __code)
  2711. tree_check_failed (__t, __f, __l, __g, __code, 0);
  2712. if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__t))
  2713. tree_operand_check_failed (__i, __t, __f, __l, __g);
  2714. return &__t->exp.operands[__i];
  2715. }
  2716. inline const_tree *
  2717. tree_operand_check (const_tree __t, int __i,
  2718. const char *__f, int __l, const char *__g)
  2719. {
  2720. const_tree __u = EXPR_CHECK (__t);
  2721. if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__u))
  2722. tree_operand_check_failed (__i, __u, __f, __l, __g);
  2723. return CONST_CAST (const_tree *, &__u->exp.operands[__i]);
  2724. }
  2725. inline const_tree *
  2726. tree_operand_check_code (const_tree __t, enum tree_code __code, int __i,
  2727. const char *__f, int __l, const char *__g)
  2728. {
  2729. if (TREE_CODE (__t) != __code)
  2730. tree_check_failed (__t, __f, __l, __g, __code, 0);
  2731. if (__i < 0 || __i >= TREE_OPERAND_LENGTH (__t))
  2732. tree_operand_check_failed (__i, __t, __f, __l, __g);
  2733. return CONST_CAST (const_tree *, &__t->exp.operands[__i]);
  2734. }
  2735. #endif
  2736. #define error_mark_node global_trees[TI_ERROR_MARK]
  2737. #define intQI_type_node global_trees[TI_INTQI_TYPE]
  2738. #define intHI_type_node global_trees[TI_INTHI_TYPE]
  2739. #define intSI_type_node global_trees[TI_INTSI_TYPE]
  2740. #define intDI_type_node global_trees[TI_INTDI_TYPE]
  2741. #define intTI_type_node global_trees[TI_INTTI_TYPE]
  2742. #define unsigned_intQI_type_node global_trees[TI_UINTQI_TYPE]
  2743. #define unsigned_intHI_type_node global_trees[TI_UINTHI_TYPE]
  2744. #define unsigned_intSI_type_node global_trees[TI_UINTSI_TYPE]
  2745. #define unsigned_intDI_type_node global_trees[TI_UINTDI_TYPE]
  2746. #define unsigned_intTI_type_node global_trees[TI_UINTTI_TYPE]
  2747. #define atomicQI_type_node global_trees[TI_ATOMICQI_TYPE]
  2748. #define atomicHI_type_node global_trees[TI_ATOMICHI_TYPE]
  2749. #define atomicSI_type_node global_trees[TI_ATOMICSI_TYPE]
  2750. #define atomicDI_type_node global_trees[TI_ATOMICDI_TYPE]
  2751. #define atomicTI_type_node global_trees[TI_ATOMICTI_TYPE]
  2752. #define uint16_type_node global_trees[TI_UINT16_TYPE]
  2753. #define uint32_type_node global_trees[TI_UINT32_TYPE]
  2754. #define uint64_type_node global_trees[TI_UINT64_TYPE]
  2755. #define void_node global_trees[TI_VOID]
  2756. #define integer_zero_node global_trees[TI_INTEGER_ZERO]
  2757. #define integer_one_node global_trees[TI_INTEGER_ONE]
  2758. #define integer_three_node global_trees[TI_INTEGER_THREE]
  2759. #define integer_minus_one_node global_trees[TI_INTEGER_MINUS_ONE]
  2760. #define size_zero_node global_trees[TI_SIZE_ZERO]
  2761. #define size_one_node global_trees[TI_SIZE_ONE]
  2762. #define bitsize_zero_node global_trees[TI_BITSIZE_ZERO]
  2763. #define bitsize_one_node global_trees[TI_BITSIZE_ONE]
  2764. #define bitsize_unit_node global_trees[TI_BITSIZE_UNIT]
  2765. /* Base access nodes. */
  2766. #define access_public_node global_trees[TI_PUBLIC]
  2767. #define access_protected_node global_trees[TI_PROTECTED]
  2768. #define access_private_node global_trees[TI_PRIVATE]
  2769. #define null_pointer_node global_trees[TI_NULL_POINTER]
  2770. #define float_type_node global_trees[TI_FLOAT_TYPE]
  2771. #define double_type_node global_trees[TI_DOUBLE_TYPE]
  2772. #define long_double_type_node global_trees[TI_LONG_DOUBLE_TYPE]
  2773. #define float_ptr_type_node global_trees[TI_FLOAT_PTR_TYPE]
  2774. #define double_ptr_type_node global_trees[TI_DOUBLE_PTR_TYPE]
  2775. #define long_double_ptr_type_node global_trees[TI_LONG_DOUBLE_PTR_TYPE]
  2776. #define integer_ptr_type_node global_trees[TI_INTEGER_PTR_TYPE]
  2777. #define complex_integer_type_node global_trees[TI_COMPLEX_INTEGER_TYPE]
  2778. #define complex_float_type_node global_trees[TI_COMPLEX_FLOAT_TYPE]
  2779. #define complex_double_type_node global_trees[TI_COMPLEX_DOUBLE_TYPE]
  2780. #define complex_long_double_type_node global_trees[TI_COMPLEX_LONG_DOUBLE_TYPE]
  2781. #define pointer_bounds_type_node global_trees[TI_POINTER_BOUNDS_TYPE]
  2782. #define void_type_node global_trees[TI_VOID_TYPE]
  2783. /* The C type `void *'. */
  2784. #define ptr_type_node global_trees[TI_PTR_TYPE]
  2785. /* The C type `const void *'. */
  2786. #define const_ptr_type_node global_trees[TI_CONST_PTR_TYPE]
  2787. /* The C type `size_t'. */
  2788. #define size_type_node global_trees[TI_SIZE_TYPE]
  2789. #define pid_type_node global_trees[TI_PID_TYPE]
  2790. #define ptrdiff_type_node global_trees[TI_PTRDIFF_TYPE]
  2791. #define va_list_type_node global_trees[TI_VA_LIST_TYPE]
  2792. #define va_list_gpr_counter_field global_trees[TI_VA_LIST_GPR_COUNTER_FIELD]
  2793. #define va_list_fpr_counter_field global_trees[TI_VA_LIST_FPR_COUNTER_FIELD]
  2794. /* The C type `FILE *'. */
  2795. #define fileptr_type_node global_trees[TI_FILEPTR_TYPE]
  2796. #define pointer_sized_int_node global_trees[TI_POINTER_SIZED_TYPE]
  2797. #define boolean_type_node global_trees[TI_BOOLEAN_TYPE]
  2798. #define boolean_false_node global_trees[TI_BOOLEAN_FALSE]
  2799. #define boolean_true_node global_trees[TI_BOOLEAN_TRUE]
  2800. /* The decimal floating point types. */
  2801. #define dfloat32_type_node global_trees[TI_DFLOAT32_TYPE]
  2802. #define dfloat64_type_node global_trees[TI_DFLOAT64_TYPE]
  2803. #define dfloat128_type_node global_trees[TI_DFLOAT128_TYPE]
  2804. #define dfloat32_ptr_type_node global_trees[TI_DFLOAT32_PTR_TYPE]
  2805. #define dfloat64_ptr_type_node global_trees[TI_DFLOAT64_PTR_TYPE]
  2806. #define dfloat128_ptr_type_node global_trees[TI_DFLOAT128_PTR_TYPE]
  2807. /* The fixed-point types. */
  2808. #define sat_short_fract_type_node global_trees[TI_SAT_SFRACT_TYPE]
  2809. #define sat_fract_type_node global_trees[TI_SAT_FRACT_TYPE]
  2810. #define sat_long_fract_type_node global_trees[TI_SAT_LFRACT_TYPE]
  2811. #define sat_long_long_fract_type_node global_trees[TI_SAT_LLFRACT_TYPE]
  2812. #define sat_unsigned_short_fract_type_node \
  2813. global_trees[TI_SAT_USFRACT_TYPE]
  2814. #define sat_unsigned_fract_type_node global_trees[TI_SAT_UFRACT_TYPE]
  2815. #define sat_unsigned_long_fract_type_node \
  2816. global_trees[TI_SAT_ULFRACT_TYPE]
  2817. #define sat_unsigned_long_long_fract_type_node \
  2818. global_trees[TI_SAT_ULLFRACT_TYPE]
  2819. #define short_fract_type_node global_trees[TI_SFRACT_TYPE]
  2820. #define fract_type_node global_trees[TI_FRACT_TYPE]
  2821. #define long_fract_type_node global_trees[TI_LFRACT_TYPE]
  2822. #define long_long_fract_type_node global_trees[TI_LLFRACT_TYPE]
  2823. #define unsigned_short_fract_type_node global_trees[TI_USFRACT_TYPE]
  2824. #define unsigned_fract_type_node global_trees[TI_UFRACT_TYPE]
  2825. #define unsigned_long_fract_type_node global_trees[TI_ULFRACT_TYPE]
  2826. #define unsigned_long_long_fract_type_node \
  2827. global_trees[TI_ULLFRACT_TYPE]
  2828. #define sat_short_accum_type_node global_trees[TI_SAT_SACCUM_TYPE]
  2829. #define sat_accum_type_node global_trees[TI_SAT_ACCUM_TYPE]
  2830. #define sat_long_accum_type_node global_trees[TI_SAT_LACCUM_TYPE]
  2831. #define sat_long_long_accum_type_node global_trees[TI_SAT_LLACCUM_TYPE]
  2832. #define sat_unsigned_short_accum_type_node \
  2833. global_trees[TI_SAT_USACCUM_TYPE]
  2834. #define sat_unsigned_accum_type_node global_trees[TI_SAT_UACCUM_TYPE]
  2835. #define sat_unsigned_long_accum_type_node \
  2836. global_trees[TI_SAT_ULACCUM_TYPE]
  2837. #define sat_unsigned_long_long_accum_type_node \
  2838. global_trees[TI_SAT_ULLACCUM_TYPE]
  2839. #define short_accum_type_node global_trees[TI_SACCUM_TYPE]
  2840. #define accum_type_node global_trees[TI_ACCUM_TYPE]
  2841. #define long_accum_type_node global_trees[TI_LACCUM_TYPE]
  2842. #define long_long_accum_type_node global_trees[TI_LLACCUM_TYPE]
  2843. #define unsigned_short_accum_type_node global_trees[TI_USACCUM_TYPE]
  2844. #define unsigned_accum_type_node global_trees[TI_UACCUM_TYPE]
  2845. #define unsigned_long_accum_type_node global_trees[TI_ULACCUM_TYPE]
  2846. #define unsigned_long_long_accum_type_node \
  2847. global_trees[TI_ULLACCUM_TYPE]
  2848. #define qq_type_node global_trees[TI_QQ_TYPE]
  2849. #define hq_type_node global_trees[TI_HQ_TYPE]
  2850. #define sq_type_node global_trees[TI_SQ_TYPE]
  2851. #define dq_type_node global_trees[TI_DQ_TYPE]
  2852. #define tq_type_node global_trees[TI_TQ_TYPE]
  2853. #define uqq_type_node global_trees[TI_UQQ_TYPE]
  2854. #define uhq_type_node global_trees[TI_UHQ_TYPE]
  2855. #define usq_type_node global_trees[TI_USQ_TYPE]
  2856. #define udq_type_node global_trees[TI_UDQ_TYPE]
  2857. #define utq_type_node global_trees[TI_UTQ_TYPE]
  2858. #define sat_qq_type_node global_trees[TI_SAT_QQ_TYPE]
  2859. #define sat_hq_type_node global_trees[TI_SAT_HQ_TYPE]
  2860. #define sat_sq_type_node global_trees[TI_SAT_SQ_TYPE]
  2861. #define sat_dq_type_node global_trees[TI_SAT_DQ_TYPE]
  2862. #define sat_tq_type_node global_trees[TI_SAT_TQ_TYPE]
  2863. #define sat_uqq_type_node global_trees[TI_SAT_UQQ_TYPE]
  2864. #define sat_uhq_type_node global_trees[TI_SAT_UHQ_TYPE]
  2865. #define sat_usq_type_node global_trees[TI_SAT_USQ_TYPE]
  2866. #define sat_udq_type_node global_trees[TI_SAT_UDQ_TYPE]
  2867. #define sat_utq_type_node global_trees[TI_SAT_UTQ_TYPE]
  2868. #define ha_type_node global_trees[TI_HA_TYPE]
  2869. #define sa_type_node global_trees[TI_SA_TYPE]
  2870. #define da_type_node global_trees[TI_DA_TYPE]
  2871. #define ta_type_node global_trees[TI_TA_TYPE]
  2872. #define uha_type_node global_trees[TI_UHA_TYPE]
  2873. #define usa_type_node global_trees[TI_USA_TYPE]
  2874. #define uda_type_node global_trees[TI_UDA_TYPE]
  2875. #define uta_type_node global_trees[TI_UTA_TYPE]
  2876. #define sat_ha_type_node global_trees[TI_SAT_HA_TYPE]
  2877. #define sat_sa_type_node global_trees[TI_SAT_SA_TYPE]
  2878. #define sat_da_type_node global_trees[TI_SAT_DA_TYPE]
  2879. #define sat_ta_type_node global_trees[TI_SAT_TA_TYPE]
  2880. #define sat_uha_type_node global_trees[TI_SAT_UHA_TYPE]
  2881. #define sat_usa_type_node global_trees[TI_SAT_USA_TYPE]
  2882. #define sat_uda_type_node global_trees[TI_SAT_UDA_TYPE]
  2883. #define sat_uta_type_node global_trees[TI_SAT_UTA_TYPE]
  2884. /* The node that should be placed at the end of a parameter list to
  2885. indicate that the function does not take a variable number of
  2886. arguments. The TREE_VALUE will be void_type_node and there will be
  2887. no TREE_CHAIN. Language-independent code should not assume
  2888. anything else about this node. */
  2889. #define void_list_node global_trees[TI_VOID_LIST_NODE]
  2890. #define main_identifier_node global_trees[TI_MAIN_IDENTIFIER]
  2891. #define MAIN_NAME_P(NODE) \
  2892. (IDENTIFIER_NODE_CHECK (NODE) == main_identifier_node)
  2893. /* Optimization options (OPTIMIZATION_NODE) to use for default and current
  2894. functions. */
  2895. #define optimization_default_node global_trees[TI_OPTIMIZATION_DEFAULT]
  2896. #define optimization_current_node global_trees[TI_OPTIMIZATION_CURRENT]
  2897. /* Default/current target options (TARGET_OPTION_NODE). */
  2898. #define target_option_default_node global_trees[TI_TARGET_OPTION_DEFAULT]
  2899. #define target_option_current_node global_trees[TI_TARGET_OPTION_CURRENT]
  2900. /* Default tree list option(), optimize() pragmas to be linked into the
  2901. attribute list. */
  2902. #define current_target_pragma global_trees[TI_CURRENT_TARGET_PRAGMA]
  2903. #define current_optimize_pragma global_trees[TI_CURRENT_OPTIMIZE_PRAGMA]
  2904. #define char_type_node integer_types[itk_char]
  2905. #define signed_char_type_node integer_types[itk_signed_char]
  2906. #define unsigned_char_type_node integer_types[itk_unsigned_char]
  2907. #define short_integer_type_node integer_types[itk_short]
  2908. #define short_unsigned_type_node integer_types[itk_unsigned_short]
  2909. #define integer_type_node integer_types[itk_int]
  2910. #define unsigned_type_node integer_types[itk_unsigned_int]
  2911. #define long_integer_type_node integer_types[itk_long]
  2912. #define long_unsigned_type_node integer_types[itk_unsigned_long]
  2913. #define long_long_integer_type_node integer_types[itk_long_long]
  2914. #define long_long_unsigned_type_node integer_types[itk_unsigned_long_long]
  2915. /* True if NODE is an erroneous expression. */
  2916. #define error_operand_p(NODE) \
  2917. ((NODE) == error_mark_node \
  2918. || ((NODE) && TREE_TYPE ((NODE)) == error_mark_node))
  2919. extern tree decl_assembler_name (tree);
  2920. extern tree decl_comdat_group (const_tree);
  2921. extern tree decl_comdat_group_id (const_tree);
  2922. extern const char *decl_section_name (const_tree);
  2923. extern void set_decl_section_name (tree, const char *);
  2924. extern enum tls_model decl_tls_model (const_tree);
  2925. extern void set_decl_tls_model (tree, enum tls_model);
  2926. /* Compute the number of bytes occupied by 'node'. This routine only
  2927. looks at TREE_CODE and, if the code is TREE_VEC, TREE_VEC_LENGTH. */
  2928. extern size_t tree_size (const_tree);
  2929. /* Compute the number of bytes occupied by a tree with code CODE.
  2930. This function cannot be used for TREE_VEC or INTEGER_CST nodes,
  2931. which are of variable length. */
  2932. extern size_t tree_code_size (enum tree_code);
  2933. /* Allocate and return a new UID from the DECL_UID namespace. */
  2934. extern int allocate_decl_uid (void);
  2935. /* Lowest level primitive for allocating a node.
  2936. The TREE_CODE is the only argument. Contents are initialized
  2937. to zero except for a few of the common fields. */
  2938. extern tree make_node_stat (enum tree_code MEM_STAT_DECL);
  2939. #define make_node(t) make_node_stat (t MEM_STAT_INFO)
  2940. /* Make a copy of a node, with all the same contents. */
  2941. extern tree copy_node_stat (tree MEM_STAT_DECL);
  2942. #define copy_node(t) copy_node_stat (t MEM_STAT_INFO)
  2943. /* Make a copy of a chain of TREE_LIST nodes. */
  2944. extern tree copy_list (tree);
  2945. /* Make a CASE_LABEL_EXPR. */
  2946. extern tree build_case_label (tree, tree, tree);
  2947. /* Make a BINFO. */
  2948. extern tree make_tree_binfo_stat (unsigned MEM_STAT_DECL);
  2949. #define make_tree_binfo(t) make_tree_binfo_stat (t MEM_STAT_INFO)
  2950. /* Make an INTEGER_CST. */
  2951. extern tree make_int_cst_stat (int, int MEM_STAT_DECL);
  2952. #define make_int_cst(LEN, EXT_LEN) \
  2953. make_int_cst_stat (LEN, EXT_LEN MEM_STAT_INFO)
  2954. /* Make a TREE_VEC. */
  2955. extern tree make_tree_vec_stat (int MEM_STAT_DECL);
  2956. #define make_tree_vec(t) make_tree_vec_stat (t MEM_STAT_INFO)
  2957. /* Grow a TREE_VEC. */
  2958. extern tree grow_tree_vec_stat (tree v, int MEM_STAT_DECL);
  2959. #define grow_tree_vec(v, t) grow_tree_vec_stat (v, t MEM_STAT_INFO)
  2960. /* Construct various types of nodes. */
  2961. extern tree build_nt (enum tree_code, ...);
  2962. extern tree build_nt_call_vec (tree, vec<tree, va_gc> *);
  2963. extern tree build0_stat (enum tree_code, tree MEM_STAT_DECL);
  2964. #define build0(c,t) build0_stat (c,t MEM_STAT_INFO)
  2965. extern tree build1_stat (enum tree_code, tree, tree MEM_STAT_DECL);
  2966. #define build1(c,t1,t2) build1_stat (c,t1,t2 MEM_STAT_INFO)
  2967. extern tree build2_stat (enum tree_code, tree, tree, tree MEM_STAT_DECL);
  2968. #define build2(c,t1,t2,t3) build2_stat (c,t1,t2,t3 MEM_STAT_INFO)
  2969. extern tree build3_stat (enum tree_code, tree, tree, tree, tree MEM_STAT_DECL);
  2970. #define build3(c,t1,t2,t3,t4) build3_stat (c,t1,t2,t3,t4 MEM_STAT_INFO)
  2971. extern tree build4_stat (enum tree_code, tree, tree, tree, tree,
  2972. tree MEM_STAT_DECL);
  2973. #define build4(c,t1,t2,t3,t4,t5) build4_stat (c,t1,t2,t3,t4,t5 MEM_STAT_INFO)
  2974. extern tree build5_stat (enum tree_code, tree, tree, tree, tree, tree,
  2975. tree MEM_STAT_DECL);
  2976. #define build5(c,t1,t2,t3,t4,t5,t6) build5_stat (c,t1,t2,t3,t4,t5,t6 MEM_STAT_INFO)
  2977. /* _loc versions of build[1-5]. */
  2978. static inline tree
  2979. build1_stat_loc (location_t loc, enum tree_code code, tree type,
  2980. tree arg1 MEM_STAT_DECL)
  2981. {
  2982. tree t = build1_stat (code, type, arg1 PASS_MEM_STAT);
  2983. if (CAN_HAVE_LOCATION_P (t))
  2984. SET_EXPR_LOCATION (t, loc);
  2985. return t;
  2986. }
  2987. #define build1_loc(l,c,t1,t2) build1_stat_loc (l,c,t1,t2 MEM_STAT_INFO)
  2988. static inline tree
  2989. build2_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0,
  2990. tree arg1 MEM_STAT_DECL)
  2991. {
  2992. tree t = build2_stat (code, type, arg0, arg1 PASS_MEM_STAT);
  2993. if (CAN_HAVE_LOCATION_P (t))
  2994. SET_EXPR_LOCATION (t, loc);
  2995. return t;
  2996. }
  2997. #define build2_loc(l,c,t1,t2,t3) build2_stat_loc (l,c,t1,t2,t3 MEM_STAT_INFO)
  2998. static inline tree
  2999. build3_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0,
  3000. tree arg1, tree arg2 MEM_STAT_DECL)
  3001. {
  3002. tree t = build3_stat (code, type, arg0, arg1, arg2 PASS_MEM_STAT);
  3003. if (CAN_HAVE_LOCATION_P (t))
  3004. SET_EXPR_LOCATION (t, loc);
  3005. return t;
  3006. }
  3007. #define build3_loc(l,c,t1,t2,t3,t4) \
  3008. build3_stat_loc (l,c,t1,t2,t3,t4 MEM_STAT_INFO)
  3009. static inline tree
  3010. build4_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0,
  3011. tree arg1, tree arg2, tree arg3 MEM_STAT_DECL)
  3012. {
  3013. tree t = build4_stat (code, type, arg0, arg1, arg2, arg3 PASS_MEM_STAT);
  3014. if (CAN_HAVE_LOCATION_P (t))
  3015. SET_EXPR_LOCATION (t, loc);
  3016. return t;
  3017. }
  3018. #define build4_loc(l,c,t1,t2,t3,t4,t5) \
  3019. build4_stat_loc (l,c,t1,t2,t3,t4,t5 MEM_STAT_INFO)
  3020. static inline tree
  3021. build5_stat_loc (location_t loc, enum tree_code code, tree type, tree arg0,
  3022. tree arg1, tree arg2, tree arg3, tree arg4 MEM_STAT_DECL)
  3023. {
  3024. tree t = build5_stat (code, type, arg0, arg1, arg2, arg3,
  3025. arg4 PASS_MEM_STAT);
  3026. if (CAN_HAVE_LOCATION_P (t))
  3027. SET_EXPR_LOCATION (t, loc);
  3028. return t;
  3029. }
  3030. #define build5_loc(l,c,t1,t2,t3,t4,t5,t6) \
  3031. build5_stat_loc (l,c,t1,t2,t3,t4,t5,t6 MEM_STAT_INFO)
  3032. extern tree build_var_debug_value_stat (tree, tree MEM_STAT_DECL);
  3033. #define build_var_debug_value(t1,t2) \
  3034. build_var_debug_value_stat (t1,t2 MEM_STAT_INFO)
  3035. /* Constructs double_int from tree CST. */
  3036. extern tree double_int_to_tree (tree, double_int);
  3037. extern tree wide_int_to_tree (tree type, const wide_int_ref &cst);
  3038. extern tree force_fit_type (tree, const wide_int_ref &, int, bool);
  3039. /* Create an INT_CST node with a CST value zero extended. */
  3040. /* static inline */
  3041. extern tree build_int_cst (tree, HOST_WIDE_INT);
  3042. extern tree build_int_cstu (tree type, unsigned HOST_WIDE_INT cst);
  3043. extern tree build_int_cst_type (tree, HOST_WIDE_INT);
  3044. extern tree make_vector_stat (unsigned MEM_STAT_DECL);
  3045. #define make_vector(n) make_vector_stat (n MEM_STAT_INFO)
  3046. extern tree build_vector_stat (tree, tree * MEM_STAT_DECL);
  3047. #define build_vector(t,v) build_vector_stat (t, v MEM_STAT_INFO)
  3048. extern tree build_vector_from_ctor (tree, vec<constructor_elt, va_gc> *);
  3049. extern tree build_vector_from_val (tree, tree);
  3050. extern tree build_constructor (tree, vec<constructor_elt, va_gc> *);
  3051. extern tree build_constructor_single (tree, tree, tree);
  3052. extern tree build_constructor_from_list (tree, tree);
  3053. extern tree build_constructor_va (tree, int, ...);
  3054. extern tree build_real_from_int_cst (tree, const_tree);
  3055. extern tree build_complex (tree, tree, tree);
  3056. extern tree build_one_cst (tree);
  3057. extern tree build_minus_one_cst (tree);
  3058. extern tree build_all_ones_cst (tree);
  3059. extern tree build_zero_cst (tree);
  3060. extern tree build_string (int, const char *);
  3061. extern tree build_tree_list_stat (tree, tree MEM_STAT_DECL);
  3062. #define build_tree_list(t, q) build_tree_list_stat (t, q MEM_STAT_INFO)
  3063. extern tree build_tree_list_vec_stat (const vec<tree, va_gc> *MEM_STAT_DECL);
  3064. #define build_tree_list_vec(v) build_tree_list_vec_stat (v MEM_STAT_INFO)
  3065. extern tree build_decl_stat (location_t, enum tree_code,
  3066. tree, tree MEM_STAT_DECL);
  3067. extern tree build_fn_decl (const char *, tree);
  3068. #define build_decl(l,c,t,q) build_decl_stat (l, c, t, q MEM_STAT_INFO)
  3069. extern tree build_translation_unit_decl (tree);
  3070. extern tree build_block (tree, tree, tree, tree);
  3071. extern tree build_empty_stmt (location_t);
  3072. extern tree build_omp_clause (location_t, enum omp_clause_code);
  3073. extern tree build_vl_exp_stat (enum tree_code, int MEM_STAT_DECL);
  3074. #define build_vl_exp(c, n) build_vl_exp_stat (c, n MEM_STAT_INFO)
  3075. extern tree build_call_nary (tree, tree, int, ...);
  3076. extern tree build_call_valist (tree, tree, int, va_list);
  3077. #define build_call_array(T1,T2,N,T3)\
  3078. build_call_array_loc (UNKNOWN_LOCATION, T1, T2, N, T3)
  3079. extern tree build_call_array_loc (location_t, tree, tree, int, const tree *);
  3080. extern tree build_call_vec (tree, tree, vec<tree, va_gc> *);
  3081. extern tree build_call_expr_loc_array (location_t, tree, int, tree *);
  3082. extern tree build_call_expr_loc_vec (location_t, tree, vec<tree, va_gc> *);
  3083. extern tree build_call_expr_loc (location_t, tree, int, ...);
  3084. extern tree build_call_expr (tree, int, ...);
  3085. extern tree build_call_expr_internal_loc (location_t, enum internal_fn,
  3086. tree, int, ...);
  3087. extern tree build_string_literal (int, const char *);
  3088. /* Construct various nodes representing data types. */
  3089. extern tree signed_or_unsigned_type_for (int, tree);
  3090. extern tree signed_type_for (tree);
  3091. extern tree unsigned_type_for (tree);
  3092. extern tree truth_type_for (tree);
  3093. extern tree build_pointer_type_for_mode (tree, machine_mode, bool);
  3094. extern tree build_pointer_type (tree);
  3095. extern tree build_reference_type_for_mode (tree, machine_mode, bool);
  3096. extern tree build_reference_type (tree);
  3097. extern tree build_vector_type_for_mode (tree, machine_mode);
  3098. extern tree build_vector_type (tree innertype, int nunits);
  3099. extern tree build_opaque_vector_type (tree innertype, int nunits);
  3100. extern tree build_index_type (tree);
  3101. extern tree build_array_type (tree, tree);
  3102. extern tree build_nonshared_array_type (tree, tree);
  3103. extern tree build_array_type_nelts (tree, unsigned HOST_WIDE_INT);
  3104. extern tree build_function_type (tree, tree);
  3105. extern tree build_function_type_list (tree, ...);
  3106. extern tree build_varargs_function_type_list (tree, ...);
  3107. extern tree build_function_type_array (tree, int, tree *);
  3108. extern tree build_varargs_function_type_array (tree, int, tree *);
  3109. #define build_function_type_vec(RET, V) \
  3110. build_function_type_array (RET, vec_safe_length (V), vec_safe_address (V))
  3111. #define build_varargs_function_type_vec(RET, V) \
  3112. build_varargs_function_type_array (RET, vec_safe_length (V), \
  3113. vec_safe_address (V))
  3114. extern tree build_method_type_directly (tree, tree, tree);
  3115. extern tree build_method_type (tree, tree);
  3116. extern tree build_offset_type (tree, tree);
  3117. extern tree build_complex_type (tree);
  3118. extern tree array_type_nelts (const_tree);
  3119. extern tree value_member (tree, tree);
  3120. extern tree purpose_member (const_tree, tree);
  3121. extern bool vec_member (const_tree, vec<tree, va_gc> *);
  3122. extern tree chain_index (int, tree);
  3123. extern int attribute_list_equal (const_tree, const_tree);
  3124. extern int attribute_list_contained (const_tree, const_tree);
  3125. extern int tree_int_cst_equal (const_tree, const_tree);
  3126. extern bool tree_fits_shwi_p (const_tree)
  3127. #ifndef ENABLE_TREE_CHECKING
  3128. ATTRIBUTE_PURE /* tree_fits_shwi_p is pure only when checking is disabled. */
  3129. #endif
  3130. ;
  3131. extern bool tree_fits_uhwi_p (const_tree)
  3132. #ifndef ENABLE_TREE_CHECKING
  3133. ATTRIBUTE_PURE /* tree_fits_uhwi_p is pure only when checking is disabled. */
  3134. #endif
  3135. ;
  3136. extern HOST_WIDE_INT tree_to_shwi (const_tree);
  3137. extern unsigned HOST_WIDE_INT tree_to_uhwi (const_tree);
  3138. #if !defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 4003)
  3139. extern inline __attribute__ ((__gnu_inline__)) HOST_WIDE_INT
  3140. tree_to_shwi (const_tree t)
  3141. {
  3142. gcc_assert (tree_fits_shwi_p (t));
  3143. return TREE_INT_CST_LOW (t);
  3144. }
  3145. extern inline __attribute__ ((__gnu_inline__)) unsigned HOST_WIDE_INT
  3146. tree_to_uhwi (const_tree t)
  3147. {
  3148. gcc_assert (tree_fits_uhwi_p (t));
  3149. return TREE_INT_CST_LOW (t);
  3150. }
  3151. #endif
  3152. extern int tree_int_cst_sgn (const_tree);
  3153. extern int tree_int_cst_sign_bit (const_tree);
  3154. extern unsigned int tree_int_cst_min_precision (tree, signop);
  3155. extern tree strip_array_types (tree);
  3156. extern tree excess_precision_type (tree);
  3157. extern bool valid_constant_size_p (const_tree);
  3158. /* From expmed.c. Since rtl.h is included after tree.h, we can't
  3159. put the prototype here. Rtl.h does declare the prototype if
  3160. tree.h had been included. */
  3161. extern tree make_tree (tree, rtx);
  3162. /* Return a type like TTYPE except that its TYPE_ATTRIBUTES
  3163. is ATTRIBUTE.
  3164. Such modified types already made are recorded so that duplicates
  3165. are not made. */
  3166. extern tree build_type_attribute_variant (tree, tree);
  3167. extern tree build_decl_attribute_variant (tree, tree);
  3168. extern tree build_type_attribute_qual_variant (tree, tree, int);
  3169. /* Return 0 if the attributes for two types are incompatible, 1 if they
  3170. are compatible, and 2 if they are nearly compatible (which causes a
  3171. warning to be generated). */
  3172. extern int comp_type_attributes (const_tree, const_tree);
  3173. /* Default versions of target-overridable functions. */
  3174. extern tree merge_decl_attributes (tree, tree);
  3175. extern tree merge_type_attributes (tree, tree);
  3176. /* This function is a private implementation detail of lookup_attribute()
  3177. and you should never call it directly. */
  3178. extern tree private_lookup_attribute (const char *, size_t, tree);
  3179. /* This function is a private implementation detail
  3180. of lookup_attribute_by_prefix() and you should never call it directly. */
  3181. extern tree private_lookup_attribute_by_prefix (const char *, size_t, tree);
  3182. /* Given an attribute name ATTR_NAME and a list of attributes LIST,
  3183. return a pointer to the attribute's list element if the attribute
  3184. is part of the list, or NULL_TREE if not found. If the attribute
  3185. appears more than once, this only returns the first occurrence; the
  3186. TREE_CHAIN of the return value should be passed back in if further
  3187. occurrences are wanted. ATTR_NAME must be in the form 'text' (not
  3188. '__text__'). */
  3189. static inline tree
  3190. lookup_attribute (const char *attr_name, tree list)
  3191. {
  3192. gcc_checking_assert (attr_name[0] != '_');
  3193. /* In most cases, list is NULL_TREE. */
  3194. if (list == NULL_TREE)
  3195. return NULL_TREE;
  3196. else
  3197. /* Do the strlen() before calling the out-of-line implementation.
  3198. In most cases attr_name is a string constant, and the compiler
  3199. will optimize the strlen() away. */
  3200. return private_lookup_attribute (attr_name, strlen (attr_name), list);
  3201. }
  3202. /* Given an attribute name ATTR_NAME and a list of attributes LIST,
  3203. return a pointer to the attribute's list first element if the attribute
  3204. starts with ATTR_NAME. ATTR_NAME must be in the form 'text' (not
  3205. '__text__'). */
  3206. static inline tree
  3207. lookup_attribute_by_prefix (const char *attr_name, tree list)
  3208. {
  3209. gcc_checking_assert (attr_name[0] != '_');
  3210. /* In most cases, list is NULL_TREE. */
  3211. if (list == NULL_TREE)
  3212. return NULL_TREE;
  3213. else
  3214. return private_lookup_attribute_by_prefix (attr_name, strlen (attr_name),
  3215. list);
  3216. }
  3217. /* This function is a private implementation detail of
  3218. is_attribute_p() and you should never call it directly. */
  3219. extern bool private_is_attribute_p (const char *, size_t, const_tree);
  3220. /* Given an identifier node IDENT and a string ATTR_NAME, return true
  3221. if the identifier node is a valid attribute name for the string.
  3222. ATTR_NAME must be in the form 'text' (not '__text__'). IDENT could
  3223. be the identifier for 'text' or for '__text__'. */
  3224. static inline bool
  3225. is_attribute_p (const char *attr_name, const_tree ident)
  3226. {
  3227. gcc_checking_assert (attr_name[0] != '_');
  3228. /* Do the strlen() before calling the out-of-line implementation.
  3229. In most cases attr_name is a string constant, and the compiler
  3230. will optimize the strlen() away. */
  3231. return private_is_attribute_p (attr_name, strlen (attr_name), ident);
  3232. }
  3233. /* Remove any instances of attribute ATTR_NAME in LIST and return the
  3234. modified list. ATTR_NAME must be in the form 'text' (not
  3235. '__text__'). */
  3236. extern tree remove_attribute (const char *, tree);
  3237. /* Given two attributes lists, return a list of their union. */
  3238. extern tree merge_attributes (tree, tree);
  3239. #if TARGET_DLLIMPORT_DECL_ATTRIBUTES
  3240. /* Given two Windows decl attributes lists, possibly including
  3241. dllimport, return a list of their union . */
  3242. extern tree merge_dllimport_decl_attributes (tree, tree);
  3243. /* Handle a "dllimport" or "dllexport" attribute. */
  3244. extern tree handle_dll_attribute (tree *, tree, tree, int, bool *);
  3245. #endif
  3246. /* Returns true iff unqualified CAND and BASE are equivalent. */
  3247. extern bool check_base_type (const_tree cand, const_tree base);
  3248. /* Check whether CAND is suitable to be returned from get_qualified_type
  3249. (BASE, TYPE_QUALS). */
  3250. extern bool check_qualified_type (const_tree, const_tree, int);
  3251. /* Return a version of the TYPE, qualified as indicated by the
  3252. TYPE_QUALS, if one exists. If no qualified version exists yet,
  3253. return NULL_TREE. */
  3254. extern tree get_qualified_type (tree, int);
  3255. /* Like get_qualified_type, but creates the type if it does not
  3256. exist. This function never returns NULL_TREE. */
  3257. extern tree build_qualified_type (tree, int);
  3258. /* Create a variant of type T with alignment ALIGN. */
  3259. extern tree build_aligned_type (tree, unsigned int);
  3260. /* Like build_qualified_type, but only deals with the `const' and
  3261. `volatile' qualifiers. This interface is retained for backwards
  3262. compatibility with the various front-ends; new code should use
  3263. build_qualified_type instead. */
  3264. #define build_type_variant(TYPE, CONST_P, VOLATILE_P) \
  3265. build_qualified_type ((TYPE), \
  3266. ((CONST_P) ? TYPE_QUAL_CONST : 0) \
  3267. | ((VOLATILE_P) ? TYPE_QUAL_VOLATILE : 0))
  3268. /* Make a copy of a type node. */
  3269. extern tree build_distinct_type_copy (tree);
  3270. extern tree build_variant_type_copy (tree);
  3271. /* Given a hashcode and a ..._TYPE node (for which the hashcode was made),
  3272. return a canonicalized ..._TYPE node, so that duplicates are not made.
  3273. How the hash code is computed is up to the caller, as long as any two
  3274. callers that could hash identical-looking type nodes agree. */
  3275. extern tree type_hash_canon (unsigned int, tree);
  3276. extern tree convert (tree, tree);
  3277. extern unsigned int expr_align (const_tree);
  3278. extern tree size_in_bytes (const_tree);
  3279. extern HOST_WIDE_INT int_size_in_bytes (const_tree);
  3280. extern HOST_WIDE_INT max_int_size_in_bytes (const_tree);
  3281. extern tree bit_position (const_tree);
  3282. extern tree byte_position (const_tree);
  3283. extern HOST_WIDE_INT int_byte_position (const_tree);
  3284. #define sizetype sizetype_tab[(int) stk_sizetype]
  3285. #define bitsizetype sizetype_tab[(int) stk_bitsizetype]
  3286. #define ssizetype sizetype_tab[(int) stk_ssizetype]
  3287. #define sbitsizetype sizetype_tab[(int) stk_sbitsizetype]
  3288. #define size_int(L) size_int_kind (L, stk_sizetype)
  3289. #define ssize_int(L) size_int_kind (L, stk_ssizetype)
  3290. #define bitsize_int(L) size_int_kind (L, stk_bitsizetype)
  3291. #define sbitsize_int(L) size_int_kind (L, stk_sbitsizetype)
  3292. /* Type for sizes of data-type. */
  3293. #define BITS_PER_UNIT_LOG \
  3294. ((BITS_PER_UNIT > 1) + (BITS_PER_UNIT > 2) + (BITS_PER_UNIT > 4) \
  3295. + (BITS_PER_UNIT > 8) + (BITS_PER_UNIT > 16) + (BITS_PER_UNIT > 32) \
  3296. + (BITS_PER_UNIT > 64) + (BITS_PER_UNIT > 128) + (BITS_PER_UNIT > 256))
  3297. /* Concatenate two lists (chains of TREE_LIST nodes) X and Y
  3298. by making the last node in X point to Y.
  3299. Returns X, except if X is 0 returns Y. */
  3300. extern tree chainon (tree, tree);
  3301. /* Make a new TREE_LIST node from specified PURPOSE, VALUE and CHAIN. */
  3302. extern tree tree_cons_stat (tree, tree, tree MEM_STAT_DECL);
  3303. #define tree_cons(t,q,w) tree_cons_stat (t,q,w MEM_STAT_INFO)
  3304. /* Return the last tree node in a chain. */
  3305. extern tree tree_last (tree);
  3306. /* Reverse the order of elements in a chain, and return the new head. */
  3307. extern tree nreverse (tree);
  3308. /* Returns the length of a chain of nodes
  3309. (number of chain pointers to follow before reaching a null pointer). */
  3310. extern int list_length (const_tree);
  3311. /* Returns the first FIELD_DECL in a type. */
  3312. extern tree first_field (const_tree);
  3313. /* Given an initializer INIT, return TRUE if INIT is zero or some
  3314. aggregate of zeros. Otherwise return FALSE. */
  3315. extern bool initializer_zerop (const_tree);
  3316. /* Given a vector VEC, return its first element if all elements are
  3317. the same. Otherwise return NULL_TREE. */
  3318. extern tree uniform_vector_p (const_tree);
  3319. /* Given a CONSTRUCTOR CTOR, return the element values as a vector. */
  3320. extern vec<tree, va_gc> *ctor_to_vec (tree);
  3321. /* integer_zerop (tree x) is nonzero if X is an integer constant of value 0. */
  3322. extern int integer_zerop (const_tree);
  3323. /* integer_onep (tree x) is nonzero if X is an integer constant of value 1. */
  3324. extern int integer_onep (const_tree);
  3325. /* integer_onep (tree x) is nonzero if X is an integer constant of value 1, or
  3326. a vector or complex where each part is 1. */
  3327. extern int integer_each_onep (const_tree);
  3328. /* integer_all_onesp (tree x) is nonzero if X is an integer constant
  3329. all of whose significant bits are 1. */
  3330. extern int integer_all_onesp (const_tree);
  3331. /* integer_minus_onep (tree x) is nonzero if X is an integer constant of
  3332. value -1. */
  3333. extern int integer_minus_onep (const_tree);
  3334. /* integer_pow2p (tree x) is nonzero is X is an integer constant with
  3335. exactly one bit 1. */
  3336. extern int integer_pow2p (const_tree);
  3337. /* integer_nonzerop (tree x) is nonzero if X is an integer constant
  3338. with a nonzero value. */
  3339. extern int integer_nonzerop (const_tree);
  3340. /* integer_truep (tree x) is nonzero if X is an integer constant of value 1 or
  3341. a vector where each element is an integer constant of value -1. */
  3342. extern int integer_truep (const_tree);
  3343. extern bool cst_and_fits_in_hwi (const_tree);
  3344. extern tree num_ending_zeros (const_tree);
  3345. /* fixed_zerop (tree x) is nonzero if X is a fixed-point constant of
  3346. value 0. */
  3347. extern int fixed_zerop (const_tree);
  3348. /* staticp (tree x) is nonzero if X is a reference to data allocated
  3349. at a fixed address in memory. Returns the outermost data. */
  3350. extern tree staticp (tree);
  3351. /* save_expr (EXP) returns an expression equivalent to EXP
  3352. but it can be used multiple times within context CTX
  3353. and only evaluate EXP once. */
  3354. extern tree save_expr (tree);
  3355. /* Look inside EXPR into any simple arithmetic operations. Return the
  3356. outermost non-arithmetic or non-invariant node. */
  3357. extern tree skip_simple_arithmetic (tree);
  3358. /* Look inside EXPR into simple arithmetic operations involving constants.
  3359. Return the outermost non-arithmetic or non-constant node. */
  3360. extern tree skip_simple_constant_arithmetic (tree);
  3361. /* Return which tree structure is used by T. */
  3362. enum tree_node_structure_enum tree_node_structure (const_tree);
  3363. /* Return true if EXP contains a PLACEHOLDER_EXPR, i.e. if it represents a
  3364. size or offset that depends on a field within a record. */
  3365. extern bool contains_placeholder_p (const_tree);
  3366. /* This macro calls the above function but short-circuits the common
  3367. case of a constant to save time. Also check for null. */
  3368. #define CONTAINS_PLACEHOLDER_P(EXP) \
  3369. ((EXP) != 0 && ! TREE_CONSTANT (EXP) && contains_placeholder_p (EXP))
  3370. /* Return true if any part of the structure of TYPE involves a PLACEHOLDER_EXPR
  3371. directly. This includes size, bounds, qualifiers (for QUAL_UNION_TYPE) and
  3372. field positions. */
  3373. extern bool type_contains_placeholder_p (tree);
  3374. /* Given a tree EXP, find all occurrences of references to fields
  3375. in a PLACEHOLDER_EXPR and place them in vector REFS without
  3376. duplicates. Also record VAR_DECLs and CONST_DECLs. Note that
  3377. we assume here that EXP contains only arithmetic expressions
  3378. or CALL_EXPRs with PLACEHOLDER_EXPRs occurring only in their
  3379. argument list. */
  3380. extern void find_placeholder_in_expr (tree, vec<tree> *);
  3381. /* This macro calls the above function but short-circuits the common
  3382. case of a constant to save time and also checks for NULL. */
  3383. #define FIND_PLACEHOLDER_IN_EXPR(EXP, V) \
  3384. do { \
  3385. if((EXP) && !TREE_CONSTANT (EXP)) \
  3386. find_placeholder_in_expr (EXP, V); \
  3387. } while (0)
  3388. /* Given a tree EXP, a FIELD_DECL F, and a replacement value R,
  3389. return a tree with all occurrences of references to F in a
  3390. PLACEHOLDER_EXPR replaced by R. Also handle VAR_DECLs and
  3391. CONST_DECLs. Note that we assume here that EXP contains only
  3392. arithmetic expressions or CALL_EXPRs with PLACEHOLDER_EXPRs
  3393. occurring only in their argument list. */
  3394. extern tree substitute_in_expr (tree, tree, tree);
  3395. /* This macro calls the above function but short-circuits the common
  3396. case of a constant to save time and also checks for NULL. */
  3397. #define SUBSTITUTE_IN_EXPR(EXP, F, R) \
  3398. ((EXP) == 0 || TREE_CONSTANT (EXP) ? (EXP) : substitute_in_expr (EXP, F, R))
  3399. /* Similar, but look for a PLACEHOLDER_EXPR in EXP and find a replacement
  3400. for it within OBJ, a tree that is an object or a chain of references. */
  3401. extern tree substitute_placeholder_in_expr (tree, tree);
  3402. /* This macro calls the above function but short-circuits the common
  3403. case of a constant to save time and also checks for NULL. */
  3404. #define SUBSTITUTE_PLACEHOLDER_IN_EXPR(EXP, OBJ) \
  3405. ((EXP) == 0 || TREE_CONSTANT (EXP) ? (EXP) \
  3406. : substitute_placeholder_in_expr (EXP, OBJ))
  3407. /* stabilize_reference (EXP) returns a reference equivalent to EXP
  3408. but it can be used multiple times
  3409. and only evaluate the subexpressions once. */
  3410. extern tree stabilize_reference (tree);
  3411. /* Return EXP, stripped of any conversions to wider types
  3412. in such a way that the result of converting to type FOR_TYPE
  3413. is the same as if EXP were converted to FOR_TYPE.
  3414. If FOR_TYPE is 0, it signifies EXP's type. */
  3415. extern tree get_unwidened (tree, tree);
  3416. /* Return OP or a simpler expression for a narrower value
  3417. which can be sign-extended or zero-extended to give back OP.
  3418. Store in *UNSIGNEDP_PTR either 1 if the value should be zero-extended
  3419. or 0 if the value should be sign-extended. */
  3420. extern tree get_narrower (tree, int *);
  3421. /* Return true if T is an expression that get_inner_reference handles. */
  3422. static inline bool
  3423. handled_component_p (const_tree t)
  3424. {
  3425. switch (TREE_CODE (t))
  3426. {
  3427. case COMPONENT_REF:
  3428. case BIT_FIELD_REF:
  3429. case ARRAY_REF:
  3430. case ARRAY_RANGE_REF:
  3431. case REALPART_EXPR:
  3432. case IMAGPART_EXPR:
  3433. case VIEW_CONVERT_EXPR:
  3434. return true;
  3435. default:
  3436. return false;
  3437. }
  3438. }
  3439. /* Given a DECL or TYPE, return the scope in which it was declared, or
  3440. NUL_TREE if there is no containing scope. */
  3441. extern tree get_containing_scope (const_tree);
  3442. /* Return the FUNCTION_DECL which provides this _DECL with its context,
  3443. or zero if none. */
  3444. extern tree decl_function_context (const_tree);
  3445. /* Return the RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE which provides
  3446. this _DECL with its context, or zero if none. */
  3447. extern tree decl_type_context (const_tree);
  3448. /* Return 1 if EXPR is the real constant zero. */
  3449. extern int real_zerop (const_tree);
  3450. /* Initialize the iterator I with arguments from function FNDECL */
  3451. static inline void
  3452. function_args_iter_init (function_args_iterator *i, const_tree fntype)
  3453. {
  3454. i->next = TYPE_ARG_TYPES (fntype);
  3455. }
  3456. /* Return a pointer that holds the next argument if there are more arguments to
  3457. handle, otherwise return NULL. */
  3458. static inline tree *
  3459. function_args_iter_cond_ptr (function_args_iterator *i)
  3460. {
  3461. return (i->next) ? &TREE_VALUE (i->next) : NULL;
  3462. }
  3463. /* Return the next argument if there are more arguments to handle, otherwise
  3464. return NULL. */
  3465. static inline tree
  3466. function_args_iter_cond (function_args_iterator *i)
  3467. {
  3468. return (i->next) ? TREE_VALUE (i->next) : NULL_TREE;
  3469. }
  3470. /* Advance to the next argument. */
  3471. static inline void
  3472. function_args_iter_next (function_args_iterator *i)
  3473. {
  3474. gcc_assert (i->next != NULL_TREE);
  3475. i->next = TREE_CHAIN (i->next);
  3476. }
  3477. /* We set BLOCK_SOURCE_LOCATION only to inlined function entry points. */
  3478. static inline bool
  3479. inlined_function_outer_scope_p (const_tree block)
  3480. {
  3481. return LOCATION_LOCUS (BLOCK_SOURCE_LOCATION (block)) != UNKNOWN_LOCATION;
  3482. }
  3483. /* Loop over all function arguments of FNTYPE. In each iteration, PTR is set
  3484. to point to the next tree element. ITER is an instance of
  3485. function_args_iterator used to iterate the arguments. */
  3486. #define FOREACH_FUNCTION_ARGS_PTR(FNTYPE, PTR, ITER) \
  3487. for (function_args_iter_init (&(ITER), (FNTYPE)); \
  3488. (PTR = function_args_iter_cond_ptr (&(ITER))) != NULL; \
  3489. function_args_iter_next (&(ITER)))
  3490. /* Loop over all function arguments of FNTYPE. In each iteration, TREE is set
  3491. to the next tree element. ITER is an instance of function_args_iterator
  3492. used to iterate the arguments. */
  3493. #define FOREACH_FUNCTION_ARGS(FNTYPE, TREE, ITER) \
  3494. for (function_args_iter_init (&(ITER), (FNTYPE)); \
  3495. (TREE = function_args_iter_cond (&(ITER))) != NULL_TREE; \
  3496. function_args_iter_next (&(ITER)))
  3497. /* In tree.c */
  3498. extern unsigned crc32_string (unsigned, const char *);
  3499. extern unsigned crc32_byte (unsigned, char);
  3500. extern unsigned crc32_unsigned (unsigned, unsigned);
  3501. extern void clean_symbol_name (char *);
  3502. extern tree get_file_function_name (const char *);
  3503. extern tree get_callee_fndecl (const_tree);
  3504. extern int type_num_arguments (const_tree);
  3505. extern bool associative_tree_code (enum tree_code);
  3506. extern bool commutative_tree_code (enum tree_code);
  3507. extern bool commutative_ternary_tree_code (enum tree_code);
  3508. extern tree upper_bound_in_type (tree, tree);
  3509. extern tree lower_bound_in_type (tree, tree);
  3510. extern int operand_equal_for_phi_arg_p (const_tree, const_tree);
  3511. extern tree create_artificial_label (location_t);
  3512. extern const char *get_name (tree);
  3513. extern bool stdarg_p (const_tree);
  3514. extern bool prototype_p (tree);
  3515. extern bool is_typedef_decl (tree x);
  3516. extern bool typedef_variant_p (tree);
  3517. extern bool auto_var_in_fn_p (const_tree, const_tree);
  3518. extern tree build_low_bits_mask (tree, unsigned);
  3519. extern bool tree_nop_conversion_p (const_tree, const_tree);
  3520. extern tree tree_strip_nop_conversions (tree);
  3521. extern tree tree_strip_sign_nop_conversions (tree);
  3522. extern const_tree strip_invariant_refs (const_tree);
  3523. extern tree lhd_gcc_personality (void);
  3524. extern void assign_assembler_name_if_neeeded (tree);
  3525. extern void warn_deprecated_use (tree, tree);
  3526. extern void cache_integer_cst (tree);
  3527. /* Return the memory model from a host integer. */
  3528. static inline enum memmodel
  3529. memmodel_from_int (unsigned HOST_WIDE_INT val)
  3530. {
  3531. return (enum memmodel) (val & MEMMODEL_MASK);
  3532. }
  3533. /* Return the base memory model from a host integer. */
  3534. static inline enum memmodel
  3535. memmodel_base (unsigned HOST_WIDE_INT val)
  3536. {
  3537. return (enum memmodel) (val & MEMMODEL_BASE_MASK);
  3538. }
  3539. /* Return TRUE if the memory model is RELAXED. */
  3540. static inline bool
  3541. is_mm_relaxed (enum memmodel model)
  3542. {
  3543. return (model & MEMMODEL_BASE_MASK) == MEMMODEL_RELAXED;
  3544. }
  3545. /* Return TRUE if the memory model is CONSUME. */
  3546. static inline bool
  3547. is_mm_consume (enum memmodel model)
  3548. {
  3549. return (model & MEMMODEL_BASE_MASK) == MEMMODEL_CONSUME;
  3550. }
  3551. /* Return TRUE if the memory model is ACQUIRE. */
  3552. static inline bool
  3553. is_mm_acquire (enum memmodel model)
  3554. {
  3555. return (model & MEMMODEL_BASE_MASK) == MEMMODEL_ACQUIRE;
  3556. }
  3557. /* Return TRUE if the memory model is RELEASE. */
  3558. static inline bool
  3559. is_mm_release (enum memmodel model)
  3560. {
  3561. return (model & MEMMODEL_BASE_MASK) == MEMMODEL_RELEASE;
  3562. }
  3563. /* Return TRUE if the memory model is ACQ_REL. */
  3564. static inline bool
  3565. is_mm_acq_rel (enum memmodel model)
  3566. {
  3567. return (model & MEMMODEL_BASE_MASK) == MEMMODEL_ACQ_REL;
  3568. }
  3569. /* Return TRUE if the memory model is SEQ_CST. */
  3570. static inline bool
  3571. is_mm_seq_cst (enum memmodel model)
  3572. {
  3573. return (model & MEMMODEL_BASE_MASK) == MEMMODEL_SEQ_CST;
  3574. }
  3575. /* Return TRUE if the memory model is a SYNC variant. */
  3576. static inline bool
  3577. is_mm_sync (enum memmodel model)
  3578. {
  3579. return (model & MEMMODEL_SYNC);
  3580. }
  3581. /* Compare and hash for any structure which begins with a canonical
  3582. pointer. Assumes all pointers are interchangeable, which is sort
  3583. of already assumed by gcc elsewhere IIRC. */
  3584. static inline int
  3585. struct_ptr_eq (const void *a, const void *b)
  3586. {
  3587. const void * const * x = (const void * const *) a;
  3588. const void * const * y = (const void * const *) b;
  3589. return *x == *y;
  3590. }
  3591. static inline hashval_t
  3592. struct_ptr_hash (const void *a)
  3593. {
  3594. const void * const * x = (const void * const *) a;
  3595. return (intptr_t)*x >> 4;
  3596. }
  3597. /* Return nonzero if CODE is a tree code that represents a truth value. */
  3598. static inline bool
  3599. truth_value_p (enum tree_code code)
  3600. {
  3601. return (TREE_CODE_CLASS (code) == tcc_comparison
  3602. || code == TRUTH_AND_EXPR || code == TRUTH_ANDIF_EXPR
  3603. || code == TRUTH_OR_EXPR || code == TRUTH_ORIF_EXPR
  3604. || code == TRUTH_XOR_EXPR || code == TRUTH_NOT_EXPR);
  3605. }
  3606. /* Return whether TYPE is a type suitable for an offset for
  3607. a POINTER_PLUS_EXPR. */
  3608. static inline bool
  3609. ptrofftype_p (tree type)
  3610. {
  3611. return (INTEGRAL_TYPE_P (type)
  3612. && TYPE_PRECISION (type) == TYPE_PRECISION (sizetype)
  3613. && TYPE_UNSIGNED (type) == TYPE_UNSIGNED (sizetype));
  3614. }
  3615. extern tree strip_float_extensions (tree);
  3616. extern int really_constant_p (const_tree);
  3617. extern bool decl_address_invariant_p (const_tree);
  3618. extern bool decl_address_ip_invariant_p (const_tree);
  3619. extern bool int_fits_type_p (const_tree, const_tree);
  3620. #ifndef GENERATOR_FILE
  3621. extern void get_type_static_bounds (const_tree, mpz_t, mpz_t);
  3622. #endif
  3623. extern bool variably_modified_type_p (tree, tree);
  3624. extern int tree_log2 (const_tree);
  3625. extern int tree_floor_log2 (const_tree);
  3626. extern unsigned int tree_ctz (const_tree);
  3627. extern int simple_cst_equal (const_tree, const_tree);
  3628. namespace inchash
  3629. {
  3630. extern void add_expr (const_tree, hash &);
  3631. }
  3632. /* Compat version until all callers are converted. Return hash for
  3633. TREE with SEED. */
  3634. static inline hashval_t iterative_hash_expr(const_tree tree, hashval_t seed)
  3635. {
  3636. inchash::hash hstate (seed);
  3637. inchash::add_expr (tree, hstate);
  3638. return hstate.end ();
  3639. }
  3640. extern int compare_tree_int (const_tree, unsigned HOST_WIDE_INT);
  3641. extern int type_list_equal (const_tree, const_tree);
  3642. extern int chain_member (const_tree, const_tree);
  3643. extern void dump_tree_statistics (void);
  3644. extern void recompute_tree_invariant_for_addr_expr (tree);
  3645. extern bool needs_to_live_in_memory (const_tree);
  3646. extern tree reconstruct_complex_type (tree, tree);
  3647. extern int real_onep (const_tree);
  3648. extern int real_minus_onep (const_tree);
  3649. extern void init_ttree (void);
  3650. extern void build_common_tree_nodes (bool, bool);
  3651. extern void build_common_builtin_nodes (void);
  3652. extern tree build_nonstandard_integer_type (unsigned HOST_WIDE_INT, int);
  3653. extern tree build_range_type (tree, tree, tree);
  3654. extern tree build_nonshared_range_type (tree, tree, tree);
  3655. extern bool subrange_type_for_debug_p (const_tree, tree *, tree *);
  3656. extern HOST_WIDE_INT int_cst_value (const_tree);
  3657. extern tree tree_block (tree);
  3658. extern void tree_set_block (tree, tree);
  3659. extern location_t *block_nonartificial_location (tree);
  3660. extern location_t tree_nonartificial_location (tree);
  3661. extern tree block_ultimate_origin (const_tree);
  3662. extern tree get_binfo_at_offset (tree, HOST_WIDE_INT, tree);
  3663. extern bool virtual_method_call_p (tree);
  3664. extern tree obj_type_ref_class (tree ref);
  3665. extern bool types_same_for_odr (const_tree type1, const_tree type2,
  3666. bool strict=false);
  3667. extern bool contains_bitfld_component_ref_p (const_tree);
  3668. extern bool type_in_anonymous_namespace_p (const_tree);
  3669. extern bool block_may_fallthru (const_tree);
  3670. extern void using_eh_for_cleanups (void);
  3671. extern bool using_eh_for_cleanups_p (void);
  3672. extern const char *get_tree_code_name (enum tree_code);
  3673. extern void set_call_expr_flags (tree, int);
  3674. extern tree walk_tree_1 (tree*, walk_tree_fn, void*, hash_set<tree>*,
  3675. walk_tree_lh);
  3676. extern tree walk_tree_without_duplicates_1 (tree*, walk_tree_fn, void*,
  3677. walk_tree_lh);
  3678. #define walk_tree(a,b,c,d) \
  3679. walk_tree_1 (a, b, c, d, NULL)
  3680. #define walk_tree_without_duplicates(a,b,c) \
  3681. walk_tree_without_duplicates_1 (a, b, c, NULL)
  3682. extern tree get_base_address (tree t);
  3683. extern tree drop_tree_overflow (tree);
  3684. extern int tree_map_base_eq (const void *, const void *);
  3685. extern unsigned int tree_map_base_hash (const void *);
  3686. extern int tree_map_base_marked_p (const void *);
  3687. #define tree_map_eq tree_map_base_eq
  3688. extern unsigned int tree_map_hash (const void *);
  3689. #define tree_map_marked_p tree_map_base_marked_p
  3690. #define tree_decl_map_eq tree_map_base_eq
  3691. extern unsigned int tree_decl_map_hash (const void *);
  3692. #define tree_decl_map_marked_p tree_map_base_marked_p
  3693. struct tree_decl_map_cache_hasher : ggc_cache_hasher<tree_decl_map *>
  3694. {
  3695. static hashval_t hash (tree_decl_map *m) { return tree_decl_map_hash (m); }
  3696. static bool
  3697. equal (tree_decl_map *a, tree_decl_map *b)
  3698. {
  3699. return tree_decl_map_eq (a, b);
  3700. }
  3701. static void
  3702. handle_cache_entry (tree_decl_map *&m)
  3703. {
  3704. extern void gt_ggc_mx (tree_decl_map *&);
  3705. if (m == HTAB_EMPTY_ENTRY || m == HTAB_DELETED_ENTRY)
  3706. return;
  3707. else if (ggc_marked_p (m->base.from))
  3708. gt_ggc_mx (m);
  3709. else
  3710. m = static_cast<tree_decl_map *> (HTAB_DELETED_ENTRY);
  3711. }
  3712. };
  3713. #define tree_int_map_eq tree_map_base_eq
  3714. #define tree_int_map_hash tree_map_base_hash
  3715. #define tree_int_map_marked_p tree_map_base_marked_p
  3716. #define tree_vec_map_eq tree_map_base_eq
  3717. #define tree_vec_map_hash tree_decl_map_hash
  3718. #define tree_vec_map_marked_p tree_map_base_marked_p
  3719. /* Initialize the abstract argument list iterator object ITER with the
  3720. arguments from CALL_EXPR node EXP. */
  3721. static inline void
  3722. init_call_expr_arg_iterator (tree exp, call_expr_arg_iterator *iter)
  3723. {
  3724. iter->t = exp;
  3725. iter->n = call_expr_nargs (exp);
  3726. iter->i = 0;
  3727. }
  3728. static inline void
  3729. init_const_call_expr_arg_iterator (const_tree exp, const_call_expr_arg_iterator *iter)
  3730. {
  3731. iter->t = exp;
  3732. iter->n = call_expr_nargs (exp);
  3733. iter->i = 0;
  3734. }
  3735. /* Return the next argument from abstract argument list iterator object ITER,
  3736. and advance its state. Return NULL_TREE if there are no more arguments. */
  3737. static inline tree
  3738. next_call_expr_arg (call_expr_arg_iterator *iter)
  3739. {
  3740. tree result;
  3741. if (iter->i >= iter->n)
  3742. return NULL_TREE;
  3743. result = CALL_EXPR_ARG (iter->t, iter->i);
  3744. iter->i++;
  3745. return result;
  3746. }
  3747. static inline const_tree
  3748. next_const_call_expr_arg (const_call_expr_arg_iterator *iter)
  3749. {
  3750. const_tree result;
  3751. if (iter->i >= iter->n)
  3752. return NULL_TREE;
  3753. result = CALL_EXPR_ARG (iter->t, iter->i);
  3754. iter->i++;
  3755. return result;
  3756. }
  3757. /* Initialize the abstract argument list iterator object ITER, then advance
  3758. past and return the first argument. Useful in for expressions, e.g.
  3759. for (arg = first_call_expr_arg (exp, &iter); arg;
  3760. arg = next_call_expr_arg (&iter)) */
  3761. static inline tree
  3762. first_call_expr_arg (tree exp, call_expr_arg_iterator *iter)
  3763. {
  3764. init_call_expr_arg_iterator (exp, iter);
  3765. return next_call_expr_arg (iter);
  3766. }
  3767. static inline const_tree
  3768. first_const_call_expr_arg (const_tree exp, const_call_expr_arg_iterator *iter)
  3769. {
  3770. init_const_call_expr_arg_iterator (exp, iter);
  3771. return next_const_call_expr_arg (iter);
  3772. }
  3773. /* Test whether there are more arguments in abstract argument list iterator
  3774. ITER, without changing its state. */
  3775. static inline bool
  3776. more_call_expr_args_p (const call_expr_arg_iterator *iter)
  3777. {
  3778. return (iter->i < iter->n);
  3779. }
  3780. /* Iterate through each argument ARG of CALL_EXPR CALL, using variable ITER
  3781. (of type call_expr_arg_iterator) to hold the iteration state. */
  3782. #define FOR_EACH_CALL_EXPR_ARG(arg, iter, call) \
  3783. for ((arg) = first_call_expr_arg ((call), &(iter)); (arg); \
  3784. (arg) = next_call_expr_arg (&(iter)))
  3785. #define FOR_EACH_CONST_CALL_EXPR_ARG(arg, iter, call) \
  3786. for ((arg) = first_const_call_expr_arg ((call), &(iter)); (arg); \
  3787. (arg) = next_const_call_expr_arg (&(iter)))
  3788. /* Return true if tree node T is a language-specific node. */
  3789. static inline bool
  3790. is_lang_specific (tree t)
  3791. {
  3792. return TREE_CODE (t) == LANG_TYPE || TREE_CODE (t) >= NUM_TREE_CODES;
  3793. }
  3794. /* Valid builtin number. */
  3795. #define BUILTIN_VALID_P(FNCODE) \
  3796. (IN_RANGE ((int)FNCODE, ((int)BUILT_IN_NONE) + 1, ((int) END_BUILTINS) - 1))
  3797. /* Return the tree node for an explicit standard builtin function or NULL. */
  3798. static inline tree
  3799. builtin_decl_explicit (enum built_in_function fncode)
  3800. {
  3801. gcc_checking_assert (BUILTIN_VALID_P (fncode));
  3802. return builtin_info[(size_t)fncode].decl;
  3803. }
  3804. /* Return the tree node for an implicit builtin function or NULL. */
  3805. static inline tree
  3806. builtin_decl_implicit (enum built_in_function fncode)
  3807. {
  3808. size_t uns_fncode = (size_t)fncode;
  3809. gcc_checking_assert (BUILTIN_VALID_P (fncode));
  3810. if (!builtin_info[uns_fncode].implicit_p)
  3811. return NULL_TREE;
  3812. return builtin_info[uns_fncode].decl;
  3813. }
  3814. /* Set explicit builtin function nodes and whether it is an implicit
  3815. function. */
  3816. static inline void
  3817. set_builtin_decl (enum built_in_function fncode, tree decl, bool implicit_p)
  3818. {
  3819. size_t ufncode = (size_t)fncode;
  3820. gcc_checking_assert (BUILTIN_VALID_P (fncode)
  3821. && (decl != NULL_TREE || !implicit_p));
  3822. builtin_info[ufncode].decl = decl;
  3823. builtin_info[ufncode].implicit_p = implicit_p;
  3824. builtin_info[ufncode].declared_p = false;
  3825. }
  3826. /* Set the implicit flag for a builtin function. */
  3827. static inline void
  3828. set_builtin_decl_implicit_p (enum built_in_function fncode, bool implicit_p)
  3829. {
  3830. size_t uns_fncode = (size_t)fncode;
  3831. gcc_checking_assert (BUILTIN_VALID_P (fncode)
  3832. && builtin_info[uns_fncode].decl != NULL_TREE);
  3833. builtin_info[uns_fncode].implicit_p = implicit_p;
  3834. }
  3835. /* Set the declared flag for a builtin function. */
  3836. static inline void
  3837. set_builtin_decl_declared_p (enum built_in_function fncode, bool declared_p)
  3838. {
  3839. size_t uns_fncode = (size_t)fncode;
  3840. gcc_checking_assert (BUILTIN_VALID_P (fncode)
  3841. && builtin_info[uns_fncode].decl != NULL_TREE);
  3842. builtin_info[uns_fncode].declared_p = declared_p;
  3843. }
  3844. /* Return whether the standard builtin function can be used as an explicit
  3845. function. */
  3846. static inline bool
  3847. builtin_decl_explicit_p (enum built_in_function fncode)
  3848. {
  3849. gcc_checking_assert (BUILTIN_VALID_P (fncode));
  3850. return (builtin_info[(size_t)fncode].decl != NULL_TREE);
  3851. }
  3852. /* Return whether the standard builtin function can be used implicitly. */
  3853. static inline bool
  3854. builtin_decl_implicit_p (enum built_in_function fncode)
  3855. {
  3856. size_t uns_fncode = (size_t)fncode;
  3857. gcc_checking_assert (BUILTIN_VALID_P (fncode));
  3858. return (builtin_info[uns_fncode].decl != NULL_TREE
  3859. && builtin_info[uns_fncode].implicit_p);
  3860. }
  3861. /* Return whether the standard builtin function was declared. */
  3862. static inline bool
  3863. builtin_decl_declared_p (enum built_in_function fncode)
  3864. {
  3865. size_t uns_fncode = (size_t)fncode;
  3866. gcc_checking_assert (BUILTIN_VALID_P (fncode));
  3867. return (builtin_info[uns_fncode].decl != NULL_TREE
  3868. && builtin_info[uns_fncode].declared_p);
  3869. }
  3870. /* Return true if T (assumed to be a DECL) is a global variable.
  3871. A variable is considered global if its storage is not automatic. */
  3872. static inline bool
  3873. is_global_var (const_tree t)
  3874. {
  3875. return (TREE_STATIC (t) || DECL_EXTERNAL (t));
  3876. }
  3877. /* Return true if VAR may be aliased. A variable is considered as
  3878. maybe aliased if it has its address taken by the local TU
  3879. or possibly by another TU and might be modified through a pointer. */
  3880. static inline bool
  3881. may_be_aliased (const_tree var)
  3882. {
  3883. return (TREE_CODE (var) != CONST_DECL
  3884. && (TREE_PUBLIC (var)
  3885. || DECL_EXTERNAL (var)
  3886. || TREE_ADDRESSABLE (var))
  3887. && !((TREE_STATIC (var) || TREE_PUBLIC (var) || DECL_EXTERNAL (var))
  3888. && ((TREE_READONLY (var)
  3889. && !TYPE_NEEDS_CONSTRUCTING (TREE_TYPE (var)))
  3890. || (TREE_CODE (var) == VAR_DECL
  3891. && DECL_NONALIASED (var)))));
  3892. }
  3893. /* Return pointer to optimization flags of FNDECL. */
  3894. static inline struct cl_optimization *
  3895. opts_for_fn (const_tree fndecl)
  3896. {
  3897. tree fn_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (fndecl);
  3898. if (fn_opts == NULL_TREE)
  3899. fn_opts = optimization_default_node;
  3900. return TREE_OPTIMIZATION (fn_opts);
  3901. }
  3902. /* Return pointer to target flags of FNDECL. */
  3903. static inline cl_target_option *
  3904. target_opts_for_fn (const_tree fndecl)
  3905. {
  3906. tree fn_opts = DECL_FUNCTION_SPECIFIC_TARGET (fndecl);
  3907. if (fn_opts == NULL_TREE)
  3908. fn_opts = target_option_default_node;
  3909. return fn_opts == NULL_TREE ? NULL : TREE_TARGET_OPTION (fn_opts);
  3910. }
  3911. /* opt flag for function FNDECL, e.g. opts_for_fn (fndecl, optimize) is
  3912. the optimization level of function fndecl. */
  3913. #define opt_for_fn(fndecl, opt) (opts_for_fn (fndecl)->x_##opt)
  3914. /* For anonymous aggregate types, we need some sort of name to
  3915. hold on to. In practice, this should not appear, but it should
  3916. not be harmful if it does. */
  3917. #ifndef NO_DOT_IN_LABEL
  3918. #define ANON_AGGRNAME_FORMAT "._%d"
  3919. #define ANON_AGGRNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '.' \
  3920. && IDENTIFIER_POINTER (ID_NODE)[1] == '_')
  3921. #else /* NO_DOT_IN_LABEL */
  3922. #ifndef NO_DOLLAR_IN_LABEL
  3923. #define ANON_AGGRNAME_FORMAT "$_%d"
  3924. #define ANON_AGGRNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '$' \
  3925. && IDENTIFIER_POINTER (ID_NODE)[1] == '_')
  3926. #else /* NO_DOLLAR_IN_LABEL */
  3927. #define ANON_AGGRNAME_PREFIX "__anon_"
  3928. #define ANON_AGGRNAME_P(ID_NODE) \
  3929. (!strncmp (IDENTIFIER_POINTER (ID_NODE), ANON_AGGRNAME_PREFIX, \
  3930. sizeof (ANON_AGGRNAME_PREFIX) - 1))
  3931. #define ANON_AGGRNAME_FORMAT "__anon_%d"
  3932. #endif /* NO_DOLLAR_IN_LABEL */
  3933. #endif /* NO_DOT_IN_LABEL */
  3934. /* The tree and const_tree overload templates. */
  3935. namespace wi
  3936. {
  3937. template <>
  3938. struct int_traits <const_tree>
  3939. {
  3940. static const enum precision_type precision_type = VAR_PRECISION;
  3941. static const bool host_dependent_precision = false;
  3942. static const bool is_sign_extended = false;
  3943. static unsigned int get_precision (const_tree);
  3944. static wi::storage_ref decompose (HOST_WIDE_INT *, unsigned int,
  3945. const_tree);
  3946. };
  3947. template <>
  3948. struct int_traits <tree> : public int_traits <const_tree> {};
  3949. template <int N>
  3950. class extended_tree
  3951. {
  3952. private:
  3953. const_tree m_t;
  3954. public:
  3955. extended_tree (const_tree);
  3956. unsigned int get_precision () const;
  3957. const HOST_WIDE_INT *get_val () const;
  3958. unsigned int get_len () const;
  3959. };
  3960. template <int N>
  3961. struct int_traits <extended_tree <N> >
  3962. {
  3963. static const enum precision_type precision_type = CONST_PRECISION;
  3964. static const bool host_dependent_precision = false;
  3965. static const bool is_sign_extended = true;
  3966. static const unsigned int precision = N;
  3967. };
  3968. generic_wide_int <extended_tree <WIDE_INT_MAX_PRECISION> >
  3969. to_widest (const_tree);
  3970. generic_wide_int <extended_tree <ADDR_MAX_PRECISION> > to_offset (const_tree);
  3971. }
  3972. inline unsigned int
  3973. wi::int_traits <const_tree>::get_precision (const_tree tcst)
  3974. {
  3975. return TYPE_PRECISION (TREE_TYPE (tcst));
  3976. }
  3977. /* Convert the tree_cst X into a wide_int of PRECISION. */
  3978. inline wi::storage_ref
  3979. wi::int_traits <const_tree>::decompose (HOST_WIDE_INT *,
  3980. unsigned int precision, const_tree x)
  3981. {
  3982. return wi::storage_ref (&TREE_INT_CST_ELT (x, 0), TREE_INT_CST_NUNITS (x),
  3983. precision);
  3984. }
  3985. inline generic_wide_int <wi::extended_tree <WIDE_INT_MAX_PRECISION> >
  3986. wi::to_widest (const_tree t)
  3987. {
  3988. return t;
  3989. }
  3990. inline generic_wide_int <wi::extended_tree <ADDR_MAX_PRECISION> >
  3991. wi::to_offset (const_tree t)
  3992. {
  3993. return t;
  3994. }
  3995. template <int N>
  3996. inline wi::extended_tree <N>::extended_tree (const_tree t)
  3997. : m_t (t)
  3998. {
  3999. gcc_checking_assert (TYPE_PRECISION (TREE_TYPE (t)) <= N);
  4000. }
  4001. template <int N>
  4002. inline unsigned int
  4003. wi::extended_tree <N>::get_precision () const
  4004. {
  4005. return N;
  4006. }
  4007. template <int N>
  4008. inline const HOST_WIDE_INT *
  4009. wi::extended_tree <N>::get_val () const
  4010. {
  4011. return &TREE_INT_CST_ELT (m_t, 0);
  4012. }
  4013. template <int N>
  4014. inline unsigned int
  4015. wi::extended_tree <N>::get_len () const
  4016. {
  4017. if (N == ADDR_MAX_PRECISION)
  4018. return TREE_INT_CST_OFFSET_NUNITS (m_t);
  4019. else if (N >= WIDE_INT_MAX_PRECISION)
  4020. return TREE_INT_CST_EXT_NUNITS (m_t);
  4021. else
  4022. /* This class is designed to be used for specific output precisions
  4023. and needs to be as fast as possible, so there is no fallback for
  4024. other casees. */
  4025. gcc_unreachable ();
  4026. }
  4027. namespace wi
  4028. {
  4029. template <typename T>
  4030. bool fits_to_tree_p (const T &x, const_tree);
  4031. wide_int min_value (const_tree);
  4032. wide_int max_value (const_tree);
  4033. wide_int from_mpz (const_tree, mpz_t, bool);
  4034. }
  4035. template <typename T>
  4036. bool
  4037. wi::fits_to_tree_p (const T &x, const_tree type)
  4038. {
  4039. if (TYPE_SIGN (type) == UNSIGNED)
  4040. return eq_p (x, zext (x, TYPE_PRECISION (type)));
  4041. else
  4042. return eq_p (x, sext (x, TYPE_PRECISION (type)));
  4043. }
  4044. /* Produce the smallest number that is represented in TYPE. The precision
  4045. and sign are taken from TYPE. */
  4046. inline wide_int
  4047. wi::min_value (const_tree type)
  4048. {
  4049. return min_value (TYPE_PRECISION (type), TYPE_SIGN (type));
  4050. }
  4051. /* Produce the largest number that is represented in TYPE. The precision
  4052. and sign are taken from TYPE. */
  4053. inline wide_int
  4054. wi::max_value (const_tree type)
  4055. {
  4056. return max_value (TYPE_PRECISION (type), TYPE_SIGN (type));
  4057. }
  4058. /* Return true if INTEGER_CST T1 is less than INTEGER_CST T2,
  4059. extending both according to their respective TYPE_SIGNs. */
  4060. inline bool
  4061. tree_int_cst_lt (const_tree t1, const_tree t2)
  4062. {
  4063. return wi::lts_p (wi::to_widest (t1), wi::to_widest (t2));
  4064. }
  4065. /* Return true if INTEGER_CST T1 is less than or equal to INTEGER_CST T2,
  4066. extending both according to their respective TYPE_SIGNs. */
  4067. inline bool
  4068. tree_int_cst_le (const_tree t1, const_tree t2)
  4069. {
  4070. return wi::les_p (wi::to_widest (t1), wi::to_widest (t2));
  4071. }
  4072. /* Returns -1 if T1 < T2, 0 if T1 == T2, and 1 if T1 > T2. T1 and T2
  4073. are both INTEGER_CSTs and their values are extended according to their
  4074. respective TYPE_SIGNs. */
  4075. inline int
  4076. tree_int_cst_compare (const_tree t1, const_tree t2)
  4077. {
  4078. return wi::cmps (wi::to_widest (t1), wi::to_widest (t2));
  4079. }
  4080. /* FIXME - These declarations belong in builtins.h, expr.h and emit-rtl.h,
  4081. but none of these files are allowed to be included from front ends.
  4082. They should be split in two. One suitable for the FEs, the other suitable
  4083. for the BE. */
  4084. /* Assign the RTX to declaration. */
  4085. extern void set_decl_rtl (tree, rtx);
  4086. extern bool complete_ctor_at_level_p (const_tree, HOST_WIDE_INT, const_tree);
  4087. /* Return a tree representing the upper bound of the array mentioned in
  4088. EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
  4089. extern tree array_ref_up_bound (tree);
  4090. extern tree build_personality_function (const char *);
  4091. /* Given an expression EXP that is a handled_component_p,
  4092. look for the ultimate containing object, which is returned and specify
  4093. the access position and size. */
  4094. extern tree get_inner_reference (tree, HOST_WIDE_INT *, HOST_WIDE_INT *,
  4095. tree *, machine_mode *, int *, int *,
  4096. bool);
  4097. /* Return a tree representing the lower bound of the array mentioned in
  4098. EXP, an ARRAY_REF or an ARRAY_RANGE_REF. */
  4099. extern tree array_ref_low_bound (tree);
  4100. struct GTY(()) int_n_trees_t {
  4101. /* These parts are initialized at runtime */
  4102. tree signed_type;
  4103. tree unsigned_type;
  4104. };
  4105. /* This is also in machmode.h */
  4106. extern bool int_n_enabled_p[NUM_INT_N_ENTS];
  4107. extern GTY(()) struct int_n_trees_t int_n_trees[NUM_INT_N_ENTS];
  4108. /* Like bit_position, but return as an integer. It must be representable in
  4109. that way (since it could be a signed value, we don't have the
  4110. option of returning -1 like int_size_in_byte can. */
  4111. inline HOST_WIDE_INT
  4112. int_bit_position (const_tree field)
  4113. {
  4114. return (wi::lshift (wi::to_offset (DECL_FIELD_OFFSET (field)), BITS_PER_UNIT_LOG)
  4115. + wi::to_offset (DECL_FIELD_BIT_OFFSET (field))).to_shwi ();
  4116. }
  4117. extern void gt_ggc_mx (tree &);
  4118. extern void gt_pch_nx (tree &);
  4119. extern void gt_pch_nx (tree &, gt_pointer_operator, void *);
  4120. #endif /* GCC_TREE_H */