1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818 |
- /* Gimple IR definitions.
- Copyright (C) 2007-2015 Free Software Foundation, Inc.
- Contributed by Aldy Hernandez <aldyh@redhat.com>
- This file is part of GCC.
- GCC is free software; you can redistribute it and/or modify it under
- the terms of the GNU General Public License as published by the Free
- Software Foundation; either version 3, or (at your option) any later
- version.
- GCC is distributed in the hope that it will be useful, but WITHOUT ANY
- WARRANTY; without even the implied warranty of MERCHANTABILITY or
- FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- for more details.
- You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3. If not see
- <http://www.gnu.org/licenses/>. */
- #ifndef GCC_GIMPLE_H
- #define GCC_GIMPLE_H
- typedef gimple gimple_seq_node;
- enum gimple_code {
- #define DEFGSCODE(SYM, STRING, STRUCT) SYM,
- #include "gimple.def"
- #undef DEFGSCODE
- LAST_AND_UNUSED_GIMPLE_CODE
- };
- extern const char *const gimple_code_name[];
- extern const unsigned char gimple_rhs_class_table[];
- /* Error out if a gimple tuple is addressed incorrectly. */
- #if defined ENABLE_GIMPLE_CHECKING
- #define gcc_gimple_checking_assert(EXPR) gcc_assert (EXPR)
- extern void gimple_check_failed (const_gimple, const char *, int, \
- const char *, enum gimple_code, \
- enum tree_code) ATTRIBUTE_NORETURN;
- #define GIMPLE_CHECK(GS, CODE) \
- do { \
- const_gimple __gs = (GS); \
- if (gimple_code (__gs) != (CODE)) \
- gimple_check_failed (__gs, __FILE__, __LINE__, __FUNCTION__, \
- (CODE), ERROR_MARK); \
- } while (0)
- #else /* not ENABLE_GIMPLE_CHECKING */
- #define gcc_gimple_checking_assert(EXPR) ((void)(0 && (EXPR)))
- #define GIMPLE_CHECK(GS, CODE) (void)0
- #endif
- /* Class of GIMPLE expressions suitable for the RHS of assignments. See
- get_gimple_rhs_class. */
- enum gimple_rhs_class
- {
- GIMPLE_INVALID_RHS, /* The expression cannot be used on the RHS. */
- GIMPLE_TERNARY_RHS, /* The expression is a ternary operation. */
- GIMPLE_BINARY_RHS, /* The expression is a binary operation. */
- GIMPLE_UNARY_RHS, /* The expression is a unary operation. */
- GIMPLE_SINGLE_RHS /* The expression is a single object (an SSA
- name, a _DECL, a _REF, etc. */
- };
- /* Specific flags for individual GIMPLE statements. These flags are
- always stored in gimple_statement_base.subcode and they may only be
- defined for statement codes that do not use subcodes.
- Values for the masks can overlap as long as the overlapping values
- are never used in the same statement class.
- The maximum mask value that can be defined is 1 << 15 (i.e., each
- statement code can hold up to 16 bitflags).
- Keep this list sorted. */
- enum gf_mask {
- GF_ASM_INPUT = 1 << 0,
- GF_ASM_VOLATILE = 1 << 1,
- GF_CALL_FROM_THUNK = 1 << 0,
- GF_CALL_RETURN_SLOT_OPT = 1 << 1,
- GF_CALL_TAILCALL = 1 << 2,
- GF_CALL_VA_ARG_PACK = 1 << 3,
- GF_CALL_NOTHROW = 1 << 4,
- GF_CALL_ALLOCA_FOR_VAR = 1 << 5,
- GF_CALL_INTERNAL = 1 << 6,
- GF_CALL_CTRL_ALTERING = 1 << 7,
- GF_CALL_WITH_BOUNDS = 1 << 8,
- GF_OMP_PARALLEL_COMBINED = 1 << 0,
- GF_OMP_FOR_KIND_MASK = (1 << 3) - 1,
- GF_OMP_FOR_KIND_FOR = 0,
- GF_OMP_FOR_KIND_DISTRIBUTE = 1,
- GF_OMP_FOR_KIND_CILKFOR = 2,
- GF_OMP_FOR_KIND_OACC_LOOP = 3,
- /* Flag for SIMD variants of OMP_FOR kinds. */
- GF_OMP_FOR_SIMD = 1 << 2,
- GF_OMP_FOR_KIND_SIMD = GF_OMP_FOR_SIMD | 0,
- GF_OMP_FOR_KIND_CILKSIMD = GF_OMP_FOR_SIMD | 1,
- GF_OMP_FOR_COMBINED = 1 << 3,
- GF_OMP_FOR_COMBINED_INTO = 1 << 4,
- GF_OMP_TARGET_KIND_MASK = (1 << 3) - 1,
- GF_OMP_TARGET_KIND_REGION = 0,
- GF_OMP_TARGET_KIND_DATA = 1,
- GF_OMP_TARGET_KIND_UPDATE = 2,
- GF_OMP_TARGET_KIND_OACC_PARALLEL = 3,
- GF_OMP_TARGET_KIND_OACC_KERNELS = 4,
- GF_OMP_TARGET_KIND_OACC_DATA = 5,
- GF_OMP_TARGET_KIND_OACC_UPDATE = 6,
- GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA = 7,
- /* True on an GIMPLE_OMP_RETURN statement if the return does not require
- a thread synchronization via some sort of barrier. The exact barrier
- that would otherwise be emitted is dependent on the OMP statement with
- which this return is associated. */
- GF_OMP_RETURN_NOWAIT = 1 << 0,
- GF_OMP_SECTION_LAST = 1 << 0,
- GF_OMP_ATOMIC_NEED_VALUE = 1 << 0,
- GF_OMP_ATOMIC_SEQ_CST = 1 << 1,
- GF_PREDICT_TAKEN = 1 << 15
- };
- /* Currently, there are only two types of gimple debug stmt. Others are
- envisioned, for example, to enable the generation of is_stmt notes
- in line number information, to mark sequence points, etc. This
- subcode is to be used to tell them apart. */
- enum gimple_debug_subcode {
- GIMPLE_DEBUG_BIND = 0,
- GIMPLE_DEBUG_SOURCE_BIND = 1
- };
- /* Masks for selecting a pass local flag (PLF) to work on. These
- masks are used by gimple_set_plf and gimple_plf. */
- enum plf_mask {
- GF_PLF_1 = 1 << 0,
- GF_PLF_2 = 1 << 1
- };
- /* Data structure definitions for GIMPLE tuples. NOTE: word markers
- are for 64 bit hosts. */
- struct GTY((desc ("gimple_statement_structure (&%h)"), tag ("GSS_BASE"),
- chain_next ("%h.next"), variable_size))
- gimple_statement_base
- {
- /* [ WORD 1 ]
- Main identifying code for a tuple. */
- ENUM_BITFIELD(gimple_code) code : 8;
- /* Nonzero if a warning should not be emitted on this tuple. */
- unsigned int no_warning : 1;
- /* Nonzero if this tuple has been visited. Passes are responsible
- for clearing this bit before using it. */
- unsigned int visited : 1;
- /* Nonzero if this tuple represents a non-temporal move. */
- unsigned int nontemporal_move : 1;
- /* Pass local flags. These flags are free for any pass to use as
- they see fit. Passes should not assume that these flags contain
- any useful value when the pass starts. Any initial state that
- the pass requires should be set on entry to the pass. See
- gimple_set_plf and gimple_plf for usage. */
- unsigned int plf : 2;
- /* Nonzero if this statement has been modified and needs to have its
- operands rescanned. */
- unsigned modified : 1;
- /* Nonzero if this statement contains volatile operands. */
- unsigned has_volatile_ops : 1;
- /* Padding to get subcode to 16 bit alignment. */
- unsigned pad : 1;
- /* The SUBCODE field can be used for tuple-specific flags for tuples
- that do not require subcodes. Note that SUBCODE should be at
- least as wide as tree codes, as several tuples store tree codes
- in there. */
- unsigned int subcode : 16;
- /* UID of this statement. This is used by passes that want to
- assign IDs to statements. It must be assigned and used by each
- pass. By default it should be assumed to contain garbage. */
- unsigned uid;
- /* [ WORD 2 ]
- Locus information for debug info. */
- location_t location;
- /* Number of operands in this tuple. */
- unsigned num_ops;
- /* [ WORD 3 ]
- Basic block holding this statement. */
- basic_block bb;
- /* [ WORD 4-5 ]
- Linked lists of gimple statements. The next pointers form
- a NULL terminated list, the prev pointers are a cyclic list.
- A gimple statement is hence also a double-ended list of
- statements, with the pointer itself being the first element,
- and the prev pointer being the last. */
- gimple next;
- gimple GTY((skip)) prev;
- };
- /* Base structure for tuples with operands. */
- /* This gimple subclass has no tag value. */
- struct GTY(())
- gimple_statement_with_ops_base : public gimple_statement_base
- {
- /* [ WORD 1-6 ] : base class */
- /* [ WORD 7 ]
- SSA operand vectors. NOTE: It should be possible to
- amalgamate these vectors with the operand vector OP. However,
- the SSA operand vectors are organized differently and contain
- more information (like immediate use chaining). */
- struct use_optype_d GTY((skip (""))) *use_ops;
- };
- /* Statements that take register operands. */
- struct GTY((tag("GSS_WITH_OPS")))
- gimple_statement_with_ops : public gimple_statement_with_ops_base
- {
- /* [ WORD 1-7 ] : base class */
- /* [ WORD 8 ]
- Operand vector. NOTE! This must always be the last field
- of this structure. In particular, this means that this
- structure cannot be embedded inside another one. */
- tree GTY((length ("%h.num_ops"))) op[1];
- };
- /* Base for statements that take both memory and register operands. */
- struct GTY((tag("GSS_WITH_MEM_OPS_BASE")))
- gimple_statement_with_memory_ops_base : public gimple_statement_with_ops_base
- {
- /* [ WORD 1-7 ] : base class */
- /* [ WORD 8-9 ]
- Virtual operands for this statement. The GC will pick them
- up via the ssa_names array. */
- tree GTY((skip (""))) vdef;
- tree GTY((skip (""))) vuse;
- };
- /* Statements that take both memory and register operands. */
- struct GTY((tag("GSS_WITH_MEM_OPS")))
- gimple_statement_with_memory_ops :
- public gimple_statement_with_memory_ops_base
- {
- /* [ WORD 1-9 ] : base class */
- /* [ WORD 10 ]
- Operand vector. NOTE! This must always be the last field
- of this structure. In particular, this means that this
- structure cannot be embedded inside another one. */
- tree GTY((length ("%h.num_ops"))) op[1];
- };
- /* Call statements that take both memory and register operands. */
- struct GTY((tag("GSS_CALL")))
- gcall : public gimple_statement_with_memory_ops_base
- {
- /* [ WORD 1-9 ] : base class */
- /* [ WORD 10-13 ] */
- struct pt_solution call_used;
- struct pt_solution call_clobbered;
- /* [ WORD 14 ] */
- union GTY ((desc ("%1.subcode & GF_CALL_INTERNAL"))) {
- tree GTY ((tag ("0"))) fntype;
- enum internal_fn GTY ((tag ("GF_CALL_INTERNAL"))) internal_fn;
- } u;
- /* [ WORD 15 ]
- Operand vector. NOTE! This must always be the last field
- of this structure. In particular, this means that this
- structure cannot be embedded inside another one. */
- tree GTY((length ("%h.num_ops"))) op[1];
- };
- /* OMP statements. */
- struct GTY((tag("GSS_OMP")))
- gimple_statement_omp : public gimple_statement_base
- {
- /* [ WORD 1-6 ] : base class */
- /* [ WORD 7 ] */
- gimple_seq body;
- };
- /* GIMPLE_BIND */
- struct GTY((tag("GSS_BIND")))
- gbind : public gimple_statement_base
- {
- /* [ WORD 1-6 ] : base class */
- /* [ WORD 7 ]
- Variables declared in this scope. */
- tree vars;
- /* [ WORD 8 ]
- This is different than the BLOCK field in gimple_statement_base,
- which is analogous to TREE_BLOCK (i.e., the lexical block holding
- this statement). This field is the equivalent of BIND_EXPR_BLOCK
- in tree land (i.e., the lexical scope defined by this bind). See
- gimple-low.c. */
- tree block;
- /* [ WORD 9 ] */
- gimple_seq body;
- };
- /* GIMPLE_CATCH */
- struct GTY((tag("GSS_CATCH")))
- gcatch : public gimple_statement_base
- {
- /* [ WORD 1-6 ] : base class */
- /* [ WORD 7 ] */
- tree types;
- /* [ WORD 8 ] */
- gimple_seq handler;
- };
- /* GIMPLE_EH_FILTER */
- struct GTY((tag("GSS_EH_FILTER")))
- geh_filter : public gimple_statement_base
- {
- /* [ WORD 1-6 ] : base class */
- /* [ WORD 7 ]
- Filter types. */
- tree types;
- /* [ WORD 8 ]
- Failure actions. */
- gimple_seq failure;
- };
- /* GIMPLE_EH_ELSE */
- struct GTY((tag("GSS_EH_ELSE")))
- geh_else : public gimple_statement_base
- {
- /* [ WORD 1-6 ] : base class */
- /* [ WORD 7,8 ] */
- gimple_seq n_body, e_body;
- };
- /* GIMPLE_EH_MUST_NOT_THROW */
- struct GTY((tag("GSS_EH_MNT")))
- geh_mnt : public gimple_statement_base
- {
- /* [ WORD 1-6 ] : base class */
- /* [ WORD 7 ] Abort function decl. */
- tree fndecl;
- };
- /* GIMPLE_PHI */
- struct GTY((tag("GSS_PHI")))
- gphi : public gimple_statement_base
- {
- /* [ WORD 1-6 ] : base class */
- /* [ WORD 7 ] */
- unsigned capacity;
- unsigned nargs;
- /* [ WORD 8 ] */
- tree result;
- /* [ WORD 9 ] */
- struct phi_arg_d GTY ((length ("%h.nargs"))) args[1];
- };
- /* GIMPLE_RESX, GIMPLE_EH_DISPATCH */
- struct GTY((tag("GSS_EH_CTRL")))
- gimple_statement_eh_ctrl : public gimple_statement_base
- {
- /* [ WORD 1-6 ] : base class */
- /* [ WORD 7 ]
- Exception region number. */
- int region;
- };
- struct GTY((tag("GSS_EH_CTRL")))
- gresx : public gimple_statement_eh_ctrl
- {
- /* No extra fields; adds invariant:
- stmt->code == GIMPLE_RESX. */
- };
- struct GTY((tag("GSS_EH_CTRL")))
- geh_dispatch : public gimple_statement_eh_ctrl
- {
- /* No extra fields; adds invariant:
- stmt->code == GIMPLE_EH_DISPATH. */
- };
- /* GIMPLE_TRY */
- struct GTY((tag("GSS_TRY")))
- gtry : public gimple_statement_base
- {
- /* [ WORD 1-6 ] : base class */
- /* [ WORD 7 ]
- Expression to evaluate. */
- gimple_seq eval;
- /* [ WORD 8 ]
- Cleanup expression. */
- gimple_seq cleanup;
- };
- /* Kind of GIMPLE_TRY statements. */
- enum gimple_try_flags
- {
- /* A try/catch. */
- GIMPLE_TRY_CATCH = 1 << 0,
- /* A try/finally. */
- GIMPLE_TRY_FINALLY = 1 << 1,
- GIMPLE_TRY_KIND = GIMPLE_TRY_CATCH | GIMPLE_TRY_FINALLY,
- /* Analogous to TRY_CATCH_IS_CLEANUP. */
- GIMPLE_TRY_CATCH_IS_CLEANUP = 1 << 2
- };
- /* GIMPLE_WITH_CLEANUP_EXPR */
- struct GTY((tag("GSS_WCE")))
- gimple_statement_wce : public gimple_statement_base
- {
- /* [ WORD 1-6 ] : base class */
- /* Subcode: CLEANUP_EH_ONLY. True if the cleanup should only be
- executed if an exception is thrown, not on normal exit of its
- scope. This flag is analogous to the CLEANUP_EH_ONLY flag
- in TARGET_EXPRs. */
- /* [ WORD 7 ]
- Cleanup expression. */
- gimple_seq cleanup;
- };
- /* GIMPLE_ASM */
- struct GTY((tag("GSS_ASM")))
- gasm : public gimple_statement_with_memory_ops_base
- {
- /* [ WORD 1-9 ] : base class */
- /* [ WORD 10 ]
- __asm__ statement. */
- const char *string;
- /* [ WORD 11 ]
- Number of inputs, outputs, clobbers, labels. */
- unsigned char ni;
- unsigned char no;
- unsigned char nc;
- unsigned char nl;
- /* [ WORD 12 ]
- Operand vector. NOTE! This must always be the last field
- of this structure. In particular, this means that this
- structure cannot be embedded inside another one. */
- tree GTY((length ("%h.num_ops"))) op[1];
- };
- /* GIMPLE_OMP_CRITICAL */
- struct GTY((tag("GSS_OMP_CRITICAL")))
- gomp_critical : public gimple_statement_omp
- {
- /* [ WORD 1-7 ] : base class */
- /* [ WORD 8 ]
- Critical section name. */
- tree name;
- };
- struct GTY(()) gimple_omp_for_iter {
- /* Condition code. */
- enum tree_code cond;
- /* Index variable. */
- tree index;
- /* Initial value. */
- tree initial;
- /* Final value. */
- tree final;
- /* Increment. */
- tree incr;
- };
- /* GIMPLE_OMP_FOR */
- struct GTY((tag("GSS_OMP_FOR")))
- gomp_for : public gimple_statement_omp
- {
- /* [ WORD 1-7 ] : base class */
- /* [ WORD 8 ] */
- tree clauses;
- /* [ WORD 9 ]
- Number of elements in iter array. */
- size_t collapse;
- /* [ WORD 10 ] */
- struct gimple_omp_for_iter * GTY((length ("%h.collapse"))) iter;
- /* [ WORD 11 ]
- Pre-body evaluated before the loop body begins. */
- gimple_seq pre_body;
- };
- /* GIMPLE_OMP_PARALLEL, GIMPLE_OMP_TARGET, GIMPLE_OMP_TASK */
- struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
- gimple_statement_omp_parallel_layout : public gimple_statement_omp
- {
- /* [ WORD 1-7 ] : base class */
- /* [ WORD 8 ]
- Clauses. */
- tree clauses;
- /* [ WORD 9 ]
- Child function holding the body of the parallel region. */
- tree child_fn;
- /* [ WORD 10 ]
- Shared data argument. */
- tree data_arg;
- };
- /* GIMPLE_OMP_PARALLEL or GIMPLE_TASK */
- struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
- gimple_statement_omp_taskreg : public gimple_statement_omp_parallel_layout
- {
- /* No extra fields; adds invariant:
- stmt->code == GIMPLE_OMP_PARALLEL
- || stmt->code == GIMPLE_OMP_TASK. */
- };
- /* GIMPLE_OMP_PARALLEL */
- struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
- gomp_parallel : public gimple_statement_omp_taskreg
- {
- /* No extra fields; adds invariant:
- stmt->code == GIMPLE_OMP_PARALLEL. */
- };
- /* GIMPLE_OMP_TARGET */
- struct GTY((tag("GSS_OMP_PARALLEL_LAYOUT")))
- gomp_target : public gimple_statement_omp_parallel_layout
- {
- /* No extra fields; adds invariant:
- stmt->code == GIMPLE_OMP_TARGET. */
- };
- /* GIMPLE_OMP_TASK */
- struct GTY((tag("GSS_OMP_TASK")))
- gomp_task : public gimple_statement_omp_taskreg
- {
- /* [ WORD 1-10 ] : base class */
- /* [ WORD 11 ]
- Child function holding firstprivate initialization if needed. */
- tree copy_fn;
- /* [ WORD 12-13 ]
- Size and alignment in bytes of the argument data block. */
- tree arg_size;
- tree arg_align;
- };
- /* GIMPLE_OMP_SECTION */
- /* Uses struct gimple_statement_omp. */
- /* GIMPLE_OMP_SECTIONS */
- struct GTY((tag("GSS_OMP_SECTIONS")))
- gomp_sections : public gimple_statement_omp
- {
- /* [ WORD 1-7 ] : base class */
- /* [ WORD 8 ] */
- tree clauses;
- /* [ WORD 9 ]
- The control variable used for deciding which of the sections to
- execute. */
- tree control;
- };
- /* GIMPLE_OMP_CONTINUE.
- Note: This does not inherit from gimple_statement_omp, because we
- do not need the body field. */
- struct GTY((tag("GSS_OMP_CONTINUE")))
- gomp_continue : public gimple_statement_base
- {
- /* [ WORD 1-6 ] : base class */
- /* [ WORD 7 ] */
- tree control_def;
- /* [ WORD 8 ] */
- tree control_use;
- };
- /* GIMPLE_OMP_SINGLE, GIMPLE_OMP_TEAMS */
- struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
- gimple_statement_omp_single_layout : public gimple_statement_omp
- {
- /* [ WORD 1-7 ] : base class */
- /* [ WORD 7 ] */
- tree clauses;
- };
- struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
- gomp_single : public gimple_statement_omp_single_layout
- {
- /* No extra fields; adds invariant:
- stmt->code == GIMPLE_OMP_SINGLE. */
- };
- struct GTY((tag("GSS_OMP_SINGLE_LAYOUT")))
- gomp_teams : public gimple_statement_omp_single_layout
- {
- /* No extra fields; adds invariant:
- stmt->code == GIMPLE_OMP_TEAMS. */
- };
- /* GIMPLE_OMP_ATOMIC_LOAD.
- Note: This is based on gimple_statement_base, not g_s_omp, because g_s_omp
- contains a sequence, which we don't need here. */
- struct GTY((tag("GSS_OMP_ATOMIC_LOAD")))
- gomp_atomic_load : public gimple_statement_base
- {
- /* [ WORD 1-6 ] : base class */
- /* [ WORD 7-8 ] */
- tree rhs, lhs;
- };
- /* GIMPLE_OMP_ATOMIC_STORE.
- See note on GIMPLE_OMP_ATOMIC_LOAD. */
- struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
- gimple_statement_omp_atomic_store_layout : public gimple_statement_base
- {
- /* [ WORD 1-6 ] : base class */
- /* [ WORD 7 ] */
- tree val;
- };
- struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
- gomp_atomic_store :
- public gimple_statement_omp_atomic_store_layout
- {
- /* No extra fields; adds invariant:
- stmt->code == GIMPLE_OMP_ATOMIC_STORE. */
- };
- struct GTY((tag("GSS_OMP_ATOMIC_STORE_LAYOUT")))
- gimple_statement_omp_return :
- public gimple_statement_omp_atomic_store_layout
- {
- /* No extra fields; adds invariant:
- stmt->code == GIMPLE_OMP_RETURN. */
- };
- /* GIMPLE_TRANSACTION. */
- /* Bits to be stored in the GIMPLE_TRANSACTION subcode. */
- /* The __transaction_atomic was declared [[outer]] or it is
- __transaction_relaxed. */
- #define GTMA_IS_OUTER (1u << 0)
- #define GTMA_IS_RELAXED (1u << 1)
- #define GTMA_DECLARATION_MASK (GTMA_IS_OUTER | GTMA_IS_RELAXED)
- /* The transaction is seen to not have an abort. */
- #define GTMA_HAVE_ABORT (1u << 2)
- /* The transaction is seen to have loads or stores. */
- #define GTMA_HAVE_LOAD (1u << 3)
- #define GTMA_HAVE_STORE (1u << 4)
- /* The transaction MAY enter serial irrevocable mode in its dynamic scope. */
- #define GTMA_MAY_ENTER_IRREVOCABLE (1u << 5)
- /* The transaction WILL enter serial irrevocable mode.
- An irrevocable block post-dominates the entire transaction, such
- that all invocations of the transaction will go serial-irrevocable.
- In such case, we don't bother instrumenting the transaction, and
- tell the runtime that it should begin the transaction in
- serial-irrevocable mode. */
- #define GTMA_DOES_GO_IRREVOCABLE (1u << 6)
- /* The transaction contains no instrumentation code whatsover, most
- likely because it is guaranteed to go irrevocable upon entry. */
- #define GTMA_HAS_NO_INSTRUMENTATION (1u << 7)
- struct GTY((tag("GSS_TRANSACTION")))
- gtransaction : public gimple_statement_with_memory_ops_base
- {
- /* [ WORD 1-9 ] : base class */
- /* [ WORD 10 ] */
- gimple_seq body;
- /* [ WORD 11 ] */
- tree label;
- };
- #define DEFGSSTRUCT(SYM, STRUCT, HAS_TREE_OP) SYM,
- enum gimple_statement_structure_enum {
- #include "gsstruct.def"
- LAST_GSS_ENUM
- };
- #undef DEFGSSTRUCT
- /* A statement with the invariant that
- stmt->code == GIMPLE_COND
- i.e. a conditional jump statement. */
- struct GTY((tag("GSS_WITH_OPS")))
- gcond : public gimple_statement_with_ops
- {
- /* no additional fields; this uses the layout for GSS_WITH_OPS. */
- };
- /* A statement with the invariant that
- stmt->code == GIMPLE_DEBUG
- i.e. a debug statement. */
- struct GTY((tag("GSS_WITH_OPS")))
- gdebug : public gimple_statement_with_ops
- {
- /* no additional fields; this uses the layout for GSS_WITH_OPS. */
- };
- /* A statement with the invariant that
- stmt->code == GIMPLE_GOTO
- i.e. a goto statement. */
- struct GTY((tag("GSS_WITH_OPS")))
- ggoto : public gimple_statement_with_ops
- {
- /* no additional fields; this uses the layout for GSS_WITH_OPS. */
- };
- /* A statement with the invariant that
- stmt->code == GIMPLE_LABEL
- i.e. a label statement. */
- struct GTY((tag("GSS_WITH_OPS")))
- glabel : public gimple_statement_with_ops
- {
- /* no additional fields; this uses the layout for GSS_WITH_OPS. */
- };
- /* A statement with the invariant that
- stmt->code == GIMPLE_SWITCH
- i.e. a switch statement. */
- struct GTY((tag("GSS_WITH_OPS")))
- gswitch : public gimple_statement_with_ops
- {
- /* no additional fields; this uses the layout for GSS_WITH_OPS. */
- };
- /* A statement with the invariant that
- stmt->code == GIMPLE_ASSIGN
- i.e. an assignment statement. */
- struct GTY((tag("GSS_WITH_MEM_OPS")))
- gassign : public gimple_statement_with_memory_ops
- {
- /* no additional fields; this uses the layout for GSS_WITH_MEM_OPS. */
- };
- /* A statement with the invariant that
- stmt->code == GIMPLE_RETURN
- i.e. a return statement. */
- struct GTY((tag("GSS_WITH_MEM_OPS")))
- greturn : public gimple_statement_with_memory_ops
- {
- /* no additional fields; this uses the layout for GSS_WITH_MEM_OPS. */
- };
- template <>
- template <>
- inline bool
- is_a_helper <gasm *>::test (gimple gs)
- {
- return gs->code == GIMPLE_ASM;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gassign *>::test (gimple gs)
- {
- return gs->code == GIMPLE_ASSIGN;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gbind *>::test (gimple gs)
- {
- return gs->code == GIMPLE_BIND;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gcall *>::test (gimple gs)
- {
- return gs->code == GIMPLE_CALL;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gcatch *>::test (gimple gs)
- {
- return gs->code == GIMPLE_CATCH;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gcond *>::test (gimple gs)
- {
- return gs->code == GIMPLE_COND;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gdebug *>::test (gimple gs)
- {
- return gs->code == GIMPLE_DEBUG;
- }
- template <>
- template <>
- inline bool
- is_a_helper <ggoto *>::test (gimple gs)
- {
- return gs->code == GIMPLE_GOTO;
- }
- template <>
- template <>
- inline bool
- is_a_helper <glabel *>::test (gimple gs)
- {
- return gs->code == GIMPLE_LABEL;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gresx *>::test (gimple gs)
- {
- return gs->code == GIMPLE_RESX;
- }
- template <>
- template <>
- inline bool
- is_a_helper <geh_dispatch *>::test (gimple gs)
- {
- return gs->code == GIMPLE_EH_DISPATCH;
- }
- template <>
- template <>
- inline bool
- is_a_helper <geh_else *>::test (gimple gs)
- {
- return gs->code == GIMPLE_EH_ELSE;
- }
- template <>
- template <>
- inline bool
- is_a_helper <geh_filter *>::test (gimple gs)
- {
- return gs->code == GIMPLE_EH_FILTER;
- }
- template <>
- template <>
- inline bool
- is_a_helper <geh_mnt *>::test (gimple gs)
- {
- return gs->code == GIMPLE_EH_MUST_NOT_THROW;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gomp_atomic_load *>::test (gimple gs)
- {
- return gs->code == GIMPLE_OMP_ATOMIC_LOAD;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gomp_atomic_store *>::test (gimple gs)
- {
- return gs->code == GIMPLE_OMP_ATOMIC_STORE;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gimple_statement_omp_return *>::test (gimple gs)
- {
- return gs->code == GIMPLE_OMP_RETURN;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gomp_continue *>::test (gimple gs)
- {
- return gs->code == GIMPLE_OMP_CONTINUE;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gomp_critical *>::test (gimple gs)
- {
- return gs->code == GIMPLE_OMP_CRITICAL;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gomp_for *>::test (gimple gs)
- {
- return gs->code == GIMPLE_OMP_FOR;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gimple_statement_omp_taskreg *>::test (gimple gs)
- {
- return gs->code == GIMPLE_OMP_PARALLEL || gs->code == GIMPLE_OMP_TASK;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gomp_parallel *>::test (gimple gs)
- {
- return gs->code == GIMPLE_OMP_PARALLEL;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gomp_target *>::test (gimple gs)
- {
- return gs->code == GIMPLE_OMP_TARGET;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gomp_sections *>::test (gimple gs)
- {
- return gs->code == GIMPLE_OMP_SECTIONS;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gomp_single *>::test (gimple gs)
- {
- return gs->code == GIMPLE_OMP_SINGLE;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gomp_teams *>::test (gimple gs)
- {
- return gs->code == GIMPLE_OMP_TEAMS;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gomp_task *>::test (gimple gs)
- {
- return gs->code == GIMPLE_OMP_TASK;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gphi *>::test (gimple gs)
- {
- return gs->code == GIMPLE_PHI;
- }
- template <>
- template <>
- inline bool
- is_a_helper <greturn *>::test (gimple gs)
- {
- return gs->code == GIMPLE_RETURN;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gswitch *>::test (gimple gs)
- {
- return gs->code == GIMPLE_SWITCH;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gtransaction *>::test (gimple gs)
- {
- return gs->code == GIMPLE_TRANSACTION;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gtry *>::test (gimple gs)
- {
- return gs->code == GIMPLE_TRY;
- }
- template <>
- template <>
- inline bool
- is_a_helper <gimple_statement_wce *>::test (gimple gs)
- {
- return gs->code == GIMPLE_WITH_CLEANUP_EXPR;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gasm *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_ASM;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gbind *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_BIND;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gcall *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_CALL;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gcatch *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_CATCH;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gresx *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_RESX;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const geh_dispatch *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_EH_DISPATCH;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const geh_filter *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_EH_FILTER;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gomp_atomic_load *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_OMP_ATOMIC_LOAD;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gomp_atomic_store *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_OMP_ATOMIC_STORE;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gimple_statement_omp_return *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_OMP_RETURN;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gomp_continue *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_OMP_CONTINUE;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gomp_critical *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_OMP_CRITICAL;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gomp_for *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_OMP_FOR;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gimple_statement_omp_taskreg *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_OMP_PARALLEL || gs->code == GIMPLE_OMP_TASK;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gomp_parallel *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_OMP_PARALLEL;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gomp_target *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_OMP_TARGET;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gomp_sections *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_OMP_SECTIONS;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gomp_single *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_OMP_SINGLE;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gomp_teams *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_OMP_TEAMS;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gomp_task *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_OMP_TASK;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gphi *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_PHI;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gtransaction *>::test (const_gimple gs)
- {
- return gs->code == GIMPLE_TRANSACTION;
- }
- /* Offset in bytes to the location of the operand vector.
- Zero if there is no operand vector for this tuple structure. */
- extern size_t const gimple_ops_offset_[];
- /* Map GIMPLE codes to GSS codes. */
- extern enum gimple_statement_structure_enum const gss_for_code_[];
- /* This variable holds the currently expanded gimple statement for purposes
- of comminucating the profile info to the builtin expanders. */
- extern gimple currently_expanding_gimple_stmt;
- #define gimple_alloc(c, n) gimple_alloc_stat (c, n MEM_STAT_INFO)
- gimple gimple_alloc_stat (enum gimple_code, unsigned MEM_STAT_DECL);
- greturn *gimple_build_return (tree);
- void gimple_call_reset_alias_info (gcall *);
- gcall *gimple_build_call_vec (tree, vec<tree> );
- gcall *gimple_build_call (tree, unsigned, ...);
- gcall *gimple_build_call_valist (tree, unsigned, va_list);
- gcall *gimple_build_call_internal (enum internal_fn, unsigned, ...);
- gcall *gimple_build_call_internal_vec (enum internal_fn, vec<tree> );
- gcall *gimple_build_call_from_tree (tree);
- gassign *gimple_build_assign (tree, tree CXX_MEM_STAT_INFO);
- gassign *gimple_build_assign (tree, enum tree_code,
- tree, tree, tree CXX_MEM_STAT_INFO);
- gassign *gimple_build_assign (tree, enum tree_code,
- tree, tree CXX_MEM_STAT_INFO);
- gassign *gimple_build_assign (tree, enum tree_code, tree CXX_MEM_STAT_INFO);
- gcond *gimple_build_cond (enum tree_code, tree, tree, tree, tree);
- gcond *gimple_build_cond_from_tree (tree, tree, tree);
- void gimple_cond_set_condition_from_tree (gcond *, tree);
- glabel *gimple_build_label (tree label);
- ggoto *gimple_build_goto (tree dest);
- gimple gimple_build_nop (void);
- gbind *gimple_build_bind (tree, gimple_seq, tree);
- gasm *gimple_build_asm_vec (const char *, vec<tree, va_gc> *,
- vec<tree, va_gc> *, vec<tree, va_gc> *,
- vec<tree, va_gc> *);
- gcatch *gimple_build_catch (tree, gimple_seq);
- geh_filter *gimple_build_eh_filter (tree, gimple_seq);
- geh_mnt *gimple_build_eh_must_not_throw (tree);
- geh_else *gimple_build_eh_else (gimple_seq, gimple_seq);
- gtry *gimple_build_try (gimple_seq, gimple_seq,
- enum gimple_try_flags);
- gimple gimple_build_wce (gimple_seq);
- gresx *gimple_build_resx (int);
- gswitch *gimple_build_switch_nlabels (unsigned, tree, tree);
- gswitch *gimple_build_switch (tree, tree, vec<tree> );
- geh_dispatch *gimple_build_eh_dispatch (int);
- gdebug *gimple_build_debug_bind_stat (tree, tree, gimple MEM_STAT_DECL);
- #define gimple_build_debug_bind(var,val,stmt) \
- gimple_build_debug_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
- gdebug *gimple_build_debug_source_bind_stat (tree, tree, gimple MEM_STAT_DECL);
- #define gimple_build_debug_source_bind(var,val,stmt) \
- gimple_build_debug_source_bind_stat ((var), (val), (stmt) MEM_STAT_INFO)
- gomp_critical *gimple_build_omp_critical (gimple_seq, tree);
- gomp_for *gimple_build_omp_for (gimple_seq, int, tree, size_t, gimple_seq);
- gomp_parallel *gimple_build_omp_parallel (gimple_seq, tree, tree, tree);
- gomp_task *gimple_build_omp_task (gimple_seq, tree, tree, tree, tree,
- tree, tree);
- gimple gimple_build_omp_section (gimple_seq);
- gimple gimple_build_omp_master (gimple_seq);
- gimple gimple_build_omp_taskgroup (gimple_seq);
- gomp_continue *gimple_build_omp_continue (tree, tree);
- gimple gimple_build_omp_ordered (gimple_seq);
- gimple gimple_build_omp_return (bool);
- gomp_sections *gimple_build_omp_sections (gimple_seq, tree);
- gimple gimple_build_omp_sections_switch (void);
- gomp_single *gimple_build_omp_single (gimple_seq, tree);
- gomp_target *gimple_build_omp_target (gimple_seq, int, tree);
- gomp_teams *gimple_build_omp_teams (gimple_seq, tree);
- gomp_atomic_load *gimple_build_omp_atomic_load (tree, tree);
- gomp_atomic_store *gimple_build_omp_atomic_store (tree);
- gtransaction *gimple_build_transaction (gimple_seq, tree);
- gimple gimple_build_predict (enum br_predictor, enum prediction);
- extern void gimple_seq_add_stmt (gimple_seq *, gimple);
- extern void gimple_seq_add_stmt_without_update (gimple_seq *, gimple);
- void gimple_seq_add_seq (gimple_seq *, gimple_seq);
- void gimple_seq_add_seq_without_update (gimple_seq *, gimple_seq);
- extern void annotate_all_with_location_after (gimple_seq, gimple_stmt_iterator,
- location_t);
- extern void annotate_all_with_location (gimple_seq, location_t);
- bool empty_body_p (gimple_seq);
- gimple_seq gimple_seq_copy (gimple_seq);
- bool gimple_call_same_target_p (const_gimple, const_gimple);
- int gimple_call_flags (const_gimple);
- int gimple_call_arg_flags (const gcall *, unsigned);
- int gimple_call_return_flags (const gcall *);
- bool gimple_assign_copy_p (gimple);
- bool gimple_assign_ssa_name_copy_p (gimple);
- bool gimple_assign_unary_nop_p (gimple);
- void gimple_set_bb (gimple, basic_block);
- void gimple_assign_set_rhs_from_tree (gimple_stmt_iterator *, tree);
- void gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *, enum tree_code,
- tree, tree, tree);
- tree gimple_get_lhs (const_gimple);
- void gimple_set_lhs (gimple, tree);
- gimple gimple_copy (gimple);
- bool gimple_has_side_effects (const_gimple);
- bool gimple_could_trap_p_1 (gimple, bool, bool);
- bool gimple_could_trap_p (gimple);
- bool gimple_assign_rhs_could_trap_p (gimple);
- extern void dump_gimple_statistics (void);
- unsigned get_gimple_rhs_num_ops (enum tree_code);
- extern tree canonicalize_cond_expr_cond (tree);
- gcall *gimple_call_copy_skip_args (gcall *, bitmap);
- extern bool gimple_compare_field_offset (tree, tree);
- extern tree gimple_unsigned_type (tree);
- extern tree gimple_signed_type (tree);
- extern alias_set_type gimple_get_alias_set (tree);
- extern bool gimple_ior_addresses_taken (bitmap, gimple);
- extern bool gimple_builtin_call_types_compatible_p (const_gimple, tree);
- extern bool gimple_call_builtin_p (const_gimple);
- extern bool gimple_call_builtin_p (const_gimple, enum built_in_class);
- extern bool gimple_call_builtin_p (const_gimple, enum built_in_function);
- extern bool gimple_asm_clobbers_memory_p (const gasm *);
- extern void dump_decl_set (FILE *, bitmap);
- extern bool nonfreeing_call_p (gimple);
- extern bool infer_nonnull_range (gimple, tree, bool, bool);
- extern void sort_case_labels (vec<tree>);
- extern void preprocess_case_label_vec_for_gimple (vec<tree>, tree, tree *);
- extern void gimple_seq_set_location (gimple_seq, location_t);
- extern void gimple_seq_discard (gimple_seq);
- extern void maybe_remove_unused_call_args (struct function *, gimple);
- /* Formal (expression) temporary table handling: multiple occurrences of
- the same scalar expression are evaluated into the same temporary. */
- typedef struct gimple_temp_hash_elt
- {
- tree val; /* Key */
- tree temp; /* Value */
- } elt_t;
- /* Get the number of the next statement uid to be allocated. */
- static inline unsigned int
- gimple_stmt_max_uid (struct function *fn)
- {
- return fn->last_stmt_uid;
- }
- /* Set the number of the next statement uid to be allocated. */
- static inline void
- set_gimple_stmt_max_uid (struct function *fn, unsigned int maxid)
- {
- fn->last_stmt_uid = maxid;
- }
- /* Set the number of the next statement uid to be allocated. */
- static inline unsigned int
- inc_gimple_stmt_max_uid (struct function *fn)
- {
- return fn->last_stmt_uid++;
- }
- /* Return the first node in GIMPLE sequence S. */
- static inline gimple_seq_node
- gimple_seq_first (gimple_seq s)
- {
- return s;
- }
- /* Return the first statement in GIMPLE sequence S. */
- static inline gimple
- gimple_seq_first_stmt (gimple_seq s)
- {
- gimple_seq_node n = gimple_seq_first (s);
- return n;
- }
- /* Return the first statement in GIMPLE sequence S as a gbind *,
- verifying that it has code GIMPLE_BIND in a checked build. */
- static inline gbind *
- gimple_seq_first_stmt_as_a_bind (gimple_seq s)
- {
- gimple_seq_node n = gimple_seq_first (s);
- return as_a <gbind *> (n);
- }
- /* Return the last node in GIMPLE sequence S. */
- static inline gimple_seq_node
- gimple_seq_last (gimple_seq s)
- {
- return s ? s->prev : NULL;
- }
- /* Return the last statement in GIMPLE sequence S. */
- static inline gimple
- gimple_seq_last_stmt (gimple_seq s)
- {
- gimple_seq_node n = gimple_seq_last (s);
- return n;
- }
- /* Set the last node in GIMPLE sequence *PS to LAST. */
- static inline void
- gimple_seq_set_last (gimple_seq *ps, gimple_seq_node last)
- {
- (*ps)->prev = last;
- }
- /* Set the first node in GIMPLE sequence *PS to FIRST. */
- static inline void
- gimple_seq_set_first (gimple_seq *ps, gimple_seq_node first)
- {
- *ps = first;
- }
- /* Return true if GIMPLE sequence S is empty. */
- static inline bool
- gimple_seq_empty_p (gimple_seq s)
- {
- return s == NULL;
- }
- /* Allocate a new sequence and initialize its first element with STMT. */
- static inline gimple_seq
- gimple_seq_alloc_with_stmt (gimple stmt)
- {
- gimple_seq seq = NULL;
- gimple_seq_add_stmt (&seq, stmt);
- return seq;
- }
- /* Returns the sequence of statements in BB. */
- static inline gimple_seq
- bb_seq (const_basic_block bb)
- {
- return (!(bb->flags & BB_RTL)) ? bb->il.gimple.seq : NULL;
- }
- static inline gimple_seq *
- bb_seq_addr (basic_block bb)
- {
- return (!(bb->flags & BB_RTL)) ? &bb->il.gimple.seq : NULL;
- }
- /* Sets the sequence of statements in BB to SEQ. */
- static inline void
- set_bb_seq (basic_block bb, gimple_seq seq)
- {
- gcc_checking_assert (!(bb->flags & BB_RTL));
- bb->il.gimple.seq = seq;
- }
- /* Return the code for GIMPLE statement G. */
- static inline enum gimple_code
- gimple_code (const_gimple g)
- {
- return g->code;
- }
- /* Return the GSS code used by a GIMPLE code. */
- static inline enum gimple_statement_structure_enum
- gss_for_code (enum gimple_code code)
- {
- gcc_gimple_checking_assert ((unsigned int)code < LAST_AND_UNUSED_GIMPLE_CODE);
- return gss_for_code_[code];
- }
- /* Return which GSS code is used by GS. */
- static inline enum gimple_statement_structure_enum
- gimple_statement_structure (gimple gs)
- {
- return gss_for_code (gimple_code (gs));
- }
- /* Return true if statement G has sub-statements. This is only true for
- High GIMPLE statements. */
- static inline bool
- gimple_has_substatements (gimple g)
- {
- switch (gimple_code (g))
- {
- case GIMPLE_BIND:
- case GIMPLE_CATCH:
- case GIMPLE_EH_FILTER:
- case GIMPLE_EH_ELSE:
- case GIMPLE_TRY:
- case GIMPLE_OMP_FOR:
- case GIMPLE_OMP_MASTER:
- case GIMPLE_OMP_TASKGROUP:
- case GIMPLE_OMP_ORDERED:
- case GIMPLE_OMP_SECTION:
- case GIMPLE_OMP_PARALLEL:
- case GIMPLE_OMP_TASK:
- case GIMPLE_OMP_SECTIONS:
- case GIMPLE_OMP_SINGLE:
- case GIMPLE_OMP_TARGET:
- case GIMPLE_OMP_TEAMS:
- case GIMPLE_OMP_CRITICAL:
- case GIMPLE_WITH_CLEANUP_EXPR:
- case GIMPLE_TRANSACTION:
- return true;
- default:
- return false;
- }
- }
- /* Return the basic block holding statement G. */
- static inline basic_block
- gimple_bb (const_gimple g)
- {
- return g->bb;
- }
- /* Return the lexical scope block holding statement G. */
- static inline tree
- gimple_block (const_gimple g)
- {
- return LOCATION_BLOCK (g->location);
- }
- /* Set BLOCK to be the lexical scope block holding statement G. */
- static inline void
- gimple_set_block (gimple g, tree block)
- {
- if (block)
- g->location =
- COMBINE_LOCATION_DATA (line_table, g->location, block);
- else
- g->location = LOCATION_LOCUS (g->location);
- }
- /* Return location information for statement G. */
- static inline location_t
- gimple_location (const_gimple g)
- {
- return g->location;
- }
- /* Return location information for statement G if g is not NULL.
- Otherwise, UNKNOWN_LOCATION is returned. */
- static inline location_t
- gimple_location_safe (const_gimple g)
- {
- return g ? gimple_location (g) : UNKNOWN_LOCATION;
- }
- /* Return pointer to location information for statement G. */
- static inline const location_t *
- gimple_location_ptr (const_gimple g)
- {
- return &g->location;
- }
- /* Set location information for statement G. */
- static inline void
- gimple_set_location (gimple g, location_t location)
- {
- g->location = location;
- }
- /* Return true if G contains location information. */
- static inline bool
- gimple_has_location (const_gimple g)
- {
- return LOCATION_LOCUS (gimple_location (g)) != UNKNOWN_LOCATION;
- }
- /* Return the file name of the location of STMT. */
- static inline const char *
- gimple_filename (const_gimple stmt)
- {
- return LOCATION_FILE (gimple_location (stmt));
- }
- /* Return the line number of the location of STMT. */
- static inline int
- gimple_lineno (const_gimple stmt)
- {
- return LOCATION_LINE (gimple_location (stmt));
- }
- /* Determine whether SEQ is a singleton. */
- static inline bool
- gimple_seq_singleton_p (gimple_seq seq)
- {
- return ((gimple_seq_first (seq) != NULL)
- && (gimple_seq_first (seq) == gimple_seq_last (seq)));
- }
- /* Return true if no warnings should be emitted for statement STMT. */
- static inline bool
- gimple_no_warning_p (const_gimple stmt)
- {
- return stmt->no_warning;
- }
- /* Set the no_warning flag of STMT to NO_WARNING. */
- static inline void
- gimple_set_no_warning (gimple stmt, bool no_warning)
- {
- stmt->no_warning = (unsigned) no_warning;
- }
- /* Set the visited status on statement STMT to VISITED_P.
- Please note that this 'visited' property of the gimple statement is
- supposed to be undefined at pass boundaries. This means that a
- given pass should not assume it contains any useful value when the
- pass starts and thus can set it to any value it sees fit.
- You can learn more about the visited property of the gimple
- statement by reading the comments of the 'visited' data member of
- struct gimple statement_base.
- */
- static inline void
- gimple_set_visited (gimple stmt, bool visited_p)
- {
- stmt->visited = (unsigned) visited_p;
- }
- /* Return the visited status for statement STMT.
- Please note that this 'visited' property of the gimple statement is
- supposed to be undefined at pass boundaries. This means that a
- given pass should not assume it contains any useful value when the
- pass starts and thus can set it to any value it sees fit.
- You can learn more about the visited property of the gimple
- statement by reading the comments of the 'visited' data member of
- struct gimple statement_base. */
- static inline bool
- gimple_visited_p (gimple stmt)
- {
- return stmt->visited;
- }
- /* Set pass local flag PLF on statement STMT to VAL_P.
- Please note that this PLF property of the gimple statement is
- supposed to be undefined at pass boundaries. This means that a
- given pass should not assume it contains any useful value when the
- pass starts and thus can set it to any value it sees fit.
- You can learn more about the PLF property by reading the comment of
- the 'plf' data member of struct gimple_statement_structure. */
- static inline void
- gimple_set_plf (gimple stmt, enum plf_mask plf, bool val_p)
- {
- if (val_p)
- stmt->plf |= (unsigned int) plf;
- else
- stmt->plf &= ~((unsigned int) plf);
- }
- /* Return the value of pass local flag PLF on statement STMT.
- Please note that this 'plf' property of the gimple statement is
- supposed to be undefined at pass boundaries. This means that a
- given pass should not assume it contains any useful value when the
- pass starts and thus can set it to any value it sees fit.
- You can learn more about the plf property by reading the comment of
- the 'plf' data member of struct gimple_statement_structure. */
- static inline unsigned int
- gimple_plf (gimple stmt, enum plf_mask plf)
- {
- return stmt->plf & ((unsigned int) plf);
- }
- /* Set the UID of statement.
- Please note that this UID property is supposed to be undefined at
- pass boundaries. This means that a given pass should not assume it
- contains any useful value when the pass starts and thus can set it
- to any value it sees fit. */
- static inline void
- gimple_set_uid (gimple g, unsigned uid)
- {
- g->uid = uid;
- }
- /* Return the UID of statement.
- Please note that this UID property is supposed to be undefined at
- pass boundaries. This means that a given pass should not assume it
- contains any useful value when the pass starts and thus can set it
- to any value it sees fit. */
- static inline unsigned
- gimple_uid (const_gimple g)
- {
- return g->uid;
- }
- /* Make statement G a singleton sequence. */
- static inline void
- gimple_init_singleton (gimple g)
- {
- g->next = NULL;
- g->prev = g;
- }
- /* Return true if GIMPLE statement G has register or memory operands. */
- static inline bool
- gimple_has_ops (const_gimple g)
- {
- return gimple_code (g) >= GIMPLE_COND && gimple_code (g) <= GIMPLE_RETURN;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gimple_statement_with_ops *>::test (const_gimple gs)
- {
- return gimple_has_ops (gs);
- }
- template <>
- template <>
- inline bool
- is_a_helper <gimple_statement_with_ops *>::test (gimple gs)
- {
- return gimple_has_ops (gs);
- }
- /* Return true if GIMPLE statement G has memory operands. */
- static inline bool
- gimple_has_mem_ops (const_gimple g)
- {
- return gimple_code (g) >= GIMPLE_ASSIGN && gimple_code (g) <= GIMPLE_RETURN;
- }
- template <>
- template <>
- inline bool
- is_a_helper <const gimple_statement_with_memory_ops *>::test (const_gimple gs)
- {
- return gimple_has_mem_ops (gs);
- }
- template <>
- template <>
- inline bool
- is_a_helper <gimple_statement_with_memory_ops *>::test (gimple gs)
- {
- return gimple_has_mem_ops (gs);
- }
- /* Return the set of USE operands for statement G. */
- static inline struct use_optype_d *
- gimple_use_ops (const_gimple g)
- {
- const gimple_statement_with_ops *ops_stmt =
- dyn_cast <const gimple_statement_with_ops *> (g);
- if (!ops_stmt)
- return NULL;
- return ops_stmt->use_ops;
- }
- /* Set USE to be the set of USE operands for statement G. */
- static inline void
- gimple_set_use_ops (gimple g, struct use_optype_d *use)
- {
- gimple_statement_with_ops *ops_stmt =
- as_a <gimple_statement_with_ops *> (g);
- ops_stmt->use_ops = use;
- }
- /* Return the single VUSE operand of the statement G. */
- static inline tree
- gimple_vuse (const_gimple g)
- {
- const gimple_statement_with_memory_ops *mem_ops_stmt =
- dyn_cast <const gimple_statement_with_memory_ops *> (g);
- if (!mem_ops_stmt)
- return NULL_TREE;
- return mem_ops_stmt->vuse;
- }
- /* Return the single VDEF operand of the statement G. */
- static inline tree
- gimple_vdef (const_gimple g)
- {
- const gimple_statement_with_memory_ops *mem_ops_stmt =
- dyn_cast <const gimple_statement_with_memory_ops *> (g);
- if (!mem_ops_stmt)
- return NULL_TREE;
- return mem_ops_stmt->vdef;
- }
- /* Return the single VUSE operand of the statement G. */
- static inline tree *
- gimple_vuse_ptr (gimple g)
- {
- gimple_statement_with_memory_ops *mem_ops_stmt =
- dyn_cast <gimple_statement_with_memory_ops *> (g);
- if (!mem_ops_stmt)
- return NULL;
- return &mem_ops_stmt->vuse;
- }
- /* Return the single VDEF operand of the statement G. */
- static inline tree *
- gimple_vdef_ptr (gimple g)
- {
- gimple_statement_with_memory_ops *mem_ops_stmt =
- dyn_cast <gimple_statement_with_memory_ops *> (g);
- if (!mem_ops_stmt)
- return NULL;
- return &mem_ops_stmt->vdef;
- }
- /* Set the single VUSE operand of the statement G. */
- static inline void
- gimple_set_vuse (gimple g, tree vuse)
- {
- gimple_statement_with_memory_ops *mem_ops_stmt =
- as_a <gimple_statement_with_memory_ops *> (g);
- mem_ops_stmt->vuse = vuse;
- }
- /* Set the single VDEF operand of the statement G. */
- static inline void
- gimple_set_vdef (gimple g, tree vdef)
- {
- gimple_statement_with_memory_ops *mem_ops_stmt =
- as_a <gimple_statement_with_memory_ops *> (g);
- mem_ops_stmt->vdef = vdef;
- }
- /* Return true if statement G has operands and the modified field has
- been set. */
- static inline bool
- gimple_modified_p (const_gimple g)
- {
- return (gimple_has_ops (g)) ? (bool) g->modified : false;
- }
- /* Set the MODIFIED flag to MODIFIEDP, iff the gimple statement G has
- a MODIFIED field. */
- static inline void
- gimple_set_modified (gimple s, bool modifiedp)
- {
- if (gimple_has_ops (s))
- s->modified = (unsigned) modifiedp;
- }
- /* Return the tree code for the expression computed by STMT. This is
- only valid for GIMPLE_COND, GIMPLE_CALL and GIMPLE_ASSIGN. For
- GIMPLE_CALL, return CALL_EXPR as the expression code for
- consistency. This is useful when the caller needs to deal with the
- three kinds of computation that GIMPLE supports. */
- static inline enum tree_code
- gimple_expr_code (const_gimple stmt)
- {
- enum gimple_code code = gimple_code (stmt);
- if (code == GIMPLE_ASSIGN || code == GIMPLE_COND)
- return (enum tree_code) stmt->subcode;
- else
- {
- gcc_gimple_checking_assert (code == GIMPLE_CALL);
- return CALL_EXPR;
- }
- }
- /* Return true if statement STMT contains volatile operands. */
- static inline bool
- gimple_has_volatile_ops (const_gimple stmt)
- {
- if (gimple_has_mem_ops (stmt))
- return stmt->has_volatile_ops;
- else
- return false;
- }
- /* Set the HAS_VOLATILE_OPS flag to VOLATILEP. */
- static inline void
- gimple_set_has_volatile_ops (gimple stmt, bool volatilep)
- {
- if (gimple_has_mem_ops (stmt))
- stmt->has_volatile_ops = (unsigned) volatilep;
- }
- /* Return true if STMT is in a transaction. */
- static inline bool
- gimple_in_transaction (gimple stmt)
- {
- return bb_in_transaction (gimple_bb (stmt));
- }
- /* Return true if statement STMT may access memory. */
- static inline bool
- gimple_references_memory_p (gimple stmt)
- {
- return gimple_has_mem_ops (stmt) && gimple_vuse (stmt);
- }
- /* Return the subcode for OMP statement S. */
- static inline unsigned
- gimple_omp_subcode (const_gimple s)
- {
- gcc_gimple_checking_assert (gimple_code (s) >= GIMPLE_OMP_ATOMIC_LOAD
- && gimple_code (s) <= GIMPLE_OMP_TEAMS);
- return s->subcode;
- }
- /* Set the subcode for OMP statement S to SUBCODE. */
- static inline void
- gimple_omp_set_subcode (gimple s, unsigned int subcode)
- {
- /* We only have 16 bits for the subcode. Assert that we are not
- overflowing it. */
- gcc_gimple_checking_assert (subcode < (1 << 16));
- s->subcode = subcode;
- }
- /* Set the nowait flag on OMP_RETURN statement S. */
- static inline void
- gimple_omp_return_set_nowait (gimple s)
- {
- GIMPLE_CHECK (s, GIMPLE_OMP_RETURN);
- s->subcode |= GF_OMP_RETURN_NOWAIT;
- }
- /* Return true if OMP return statement G has the GF_OMP_RETURN_NOWAIT
- flag set. */
- static inline bool
- gimple_omp_return_nowait_p (const_gimple g)
- {
- GIMPLE_CHECK (g, GIMPLE_OMP_RETURN);
- return (gimple_omp_subcode (g) & GF_OMP_RETURN_NOWAIT) != 0;
- }
- /* Set the LHS of OMP return. */
- static inline void
- gimple_omp_return_set_lhs (gimple g, tree lhs)
- {
- gimple_statement_omp_return *omp_return_stmt =
- as_a <gimple_statement_omp_return *> (g);
- omp_return_stmt->val = lhs;
- }
- /* Get the LHS of OMP return. */
- static inline tree
- gimple_omp_return_lhs (const_gimple g)
- {
- const gimple_statement_omp_return *omp_return_stmt =
- as_a <const gimple_statement_omp_return *> (g);
- return omp_return_stmt->val;
- }
- /* Return a pointer to the LHS of OMP return. */
- static inline tree *
- gimple_omp_return_lhs_ptr (gimple g)
- {
- gimple_statement_omp_return *omp_return_stmt =
- as_a <gimple_statement_omp_return *> (g);
- return &omp_return_stmt->val;
- }
- /* Return true if OMP section statement G has the GF_OMP_SECTION_LAST
- flag set. */
- static inline bool
- gimple_omp_section_last_p (const_gimple g)
- {
- GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
- return (gimple_omp_subcode (g) & GF_OMP_SECTION_LAST) != 0;
- }
- /* Set the GF_OMP_SECTION_LAST flag on G. */
- static inline void
- gimple_omp_section_set_last (gimple g)
- {
- GIMPLE_CHECK (g, GIMPLE_OMP_SECTION);
- g->subcode |= GF_OMP_SECTION_LAST;
- }
- /* Return true if OMP parallel statement G has the
- GF_OMP_PARALLEL_COMBINED flag set. */
- static inline bool
- gimple_omp_parallel_combined_p (const_gimple g)
- {
- GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
- return (gimple_omp_subcode (g) & GF_OMP_PARALLEL_COMBINED) != 0;
- }
- /* Set the GF_OMP_PARALLEL_COMBINED field in G depending on the boolean
- value of COMBINED_P. */
- static inline void
- gimple_omp_parallel_set_combined_p (gimple g, bool combined_p)
- {
- GIMPLE_CHECK (g, GIMPLE_OMP_PARALLEL);
- if (combined_p)
- g->subcode |= GF_OMP_PARALLEL_COMBINED;
- else
- g->subcode &= ~GF_OMP_PARALLEL_COMBINED;
- }
- /* Return true if OMP atomic load/store statement G has the
- GF_OMP_ATOMIC_NEED_VALUE flag set. */
- static inline bool
- gimple_omp_atomic_need_value_p (const_gimple g)
- {
- if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
- GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
- return (gimple_omp_subcode (g) & GF_OMP_ATOMIC_NEED_VALUE) != 0;
- }
- /* Set the GF_OMP_ATOMIC_NEED_VALUE flag on G. */
- static inline void
- gimple_omp_atomic_set_need_value (gimple g)
- {
- if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
- GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
- g->subcode |= GF_OMP_ATOMIC_NEED_VALUE;
- }
- /* Return true if OMP atomic load/store statement G has the
- GF_OMP_ATOMIC_SEQ_CST flag set. */
- static inline bool
- gimple_omp_atomic_seq_cst_p (const_gimple g)
- {
- if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
- GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
- return (gimple_omp_subcode (g) & GF_OMP_ATOMIC_SEQ_CST) != 0;
- }
- /* Set the GF_OMP_ATOMIC_SEQ_CST flag on G. */
- static inline void
- gimple_omp_atomic_set_seq_cst (gimple g)
- {
- if (gimple_code (g) != GIMPLE_OMP_ATOMIC_LOAD)
- GIMPLE_CHECK (g, GIMPLE_OMP_ATOMIC_STORE);
- g->subcode |= GF_OMP_ATOMIC_SEQ_CST;
- }
- /* Return the number of operands for statement GS. */
- static inline unsigned
- gimple_num_ops (const_gimple gs)
- {
- return gs->num_ops;
- }
- /* Set the number of operands for statement GS. */
- static inline void
- gimple_set_num_ops (gimple gs, unsigned num_ops)
- {
- gs->num_ops = num_ops;
- }
- /* Return the array of operands for statement GS. */
- static inline tree *
- gimple_ops (gimple gs)
- {
- size_t off;
- /* All the tuples have their operand vector at the very bottom
- of the structure. Note that those structures that do not
- have an operand vector have a zero offset. */
- off = gimple_ops_offset_[gimple_statement_structure (gs)];
- gcc_gimple_checking_assert (off != 0);
- return (tree *) ((char *) gs + off);
- }
- /* Return operand I for statement GS. */
- static inline tree
- gimple_op (const_gimple gs, unsigned i)
- {
- if (gimple_has_ops (gs))
- {
- gcc_gimple_checking_assert (i < gimple_num_ops (gs));
- return gimple_ops (CONST_CAST_GIMPLE (gs))[i];
- }
- else
- return NULL_TREE;
- }
- /* Return a pointer to operand I for statement GS. */
- static inline tree *
- gimple_op_ptr (const_gimple gs, unsigned i)
- {
- if (gimple_has_ops (gs))
- {
- gcc_gimple_checking_assert (i < gimple_num_ops (gs));
- return gimple_ops (CONST_CAST_GIMPLE (gs)) + i;
- }
- else
- return NULL;
- }
- /* Set operand I of statement GS to OP. */
- static inline void
- gimple_set_op (gimple gs, unsigned i, tree op)
- {
- gcc_gimple_checking_assert (gimple_has_ops (gs) && i < gimple_num_ops (gs));
- /* Note. It may be tempting to assert that OP matches
- is_gimple_operand, but that would be wrong. Different tuples
- accept slightly different sets of tree operands. Each caller
- should perform its own validation. */
- gimple_ops (gs)[i] = op;
- }
- /* Return true if GS is a GIMPLE_ASSIGN. */
- static inline bool
- is_gimple_assign (const_gimple gs)
- {
- return gimple_code (gs) == GIMPLE_ASSIGN;
- }
- /* Determine if expression CODE is one of the valid expressions that can
- be used on the RHS of GIMPLE assignments. */
- static inline enum gimple_rhs_class
- get_gimple_rhs_class (enum tree_code code)
- {
- return (enum gimple_rhs_class) gimple_rhs_class_table[(int) code];
- }
- /* Return the LHS of assignment statement GS. */
- static inline tree
- gimple_assign_lhs (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- return gimple_op (gs, 0);
- }
- /* Return a pointer to the LHS of assignment statement GS. */
- static inline tree *
- gimple_assign_lhs_ptr (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- return gimple_op_ptr (gs, 0);
- }
- /* Set LHS to be the LHS operand of assignment statement GS. */
- static inline void
- gimple_assign_set_lhs (gimple gs, tree lhs)
- {
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- gimple_set_op (gs, 0, lhs);
- if (lhs && TREE_CODE (lhs) == SSA_NAME)
- SSA_NAME_DEF_STMT (lhs) = gs;
- }
- /* Return the first operand on the RHS of assignment statement GS. */
- static inline tree
- gimple_assign_rhs1 (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- return gimple_op (gs, 1);
- }
- /* Return a pointer to the first operand on the RHS of assignment
- statement GS. */
- static inline tree *
- gimple_assign_rhs1_ptr (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- return gimple_op_ptr (gs, 1);
- }
- /* Set RHS to be the first operand on the RHS of assignment statement GS. */
- static inline void
- gimple_assign_set_rhs1 (gimple gs, tree rhs)
- {
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- gimple_set_op (gs, 1, rhs);
- }
- /* Return the second operand on the RHS of assignment statement GS.
- If GS does not have two operands, NULL is returned instead. */
- static inline tree
- gimple_assign_rhs2 (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- if (gimple_num_ops (gs) >= 3)
- return gimple_op (gs, 2);
- else
- return NULL_TREE;
- }
- /* Return a pointer to the second operand on the RHS of assignment
- statement GS. */
- static inline tree *
- gimple_assign_rhs2_ptr (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- return gimple_op_ptr (gs, 2);
- }
- /* Set RHS to be the second operand on the RHS of assignment statement GS. */
- static inline void
- gimple_assign_set_rhs2 (gimple gs, tree rhs)
- {
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- gimple_set_op (gs, 2, rhs);
- }
- /* Return the third operand on the RHS of assignment statement GS.
- If GS does not have two operands, NULL is returned instead. */
- static inline tree
- gimple_assign_rhs3 (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- if (gimple_num_ops (gs) >= 4)
- return gimple_op (gs, 3);
- else
- return NULL_TREE;
- }
- /* Return a pointer to the third operand on the RHS of assignment
- statement GS. */
- static inline tree *
- gimple_assign_rhs3_ptr (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- return gimple_op_ptr (gs, 3);
- }
- /* Set RHS to be the third operand on the RHS of assignment statement GS. */
- static inline void
- gimple_assign_set_rhs3 (gimple gs, tree rhs)
- {
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- gimple_set_op (gs, 3, rhs);
- }
- /* A wrapper around 3 operand gimple_assign_set_rhs_with_ops, for callers
- which expect to see only two operands. */
- static inline void
- gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code,
- tree op1, tree op2)
- {
- gimple_assign_set_rhs_with_ops (gsi, code, op1, op2, NULL);
- }
- /* A wrapper around 3 operand gimple_assign_set_rhs_with_ops, for callers
- which expect to see only one operands. */
- static inline void
- gimple_assign_set_rhs_with_ops (gimple_stmt_iterator *gsi, enum tree_code code,
- tree op1)
- {
- gimple_assign_set_rhs_with_ops (gsi, code, op1, NULL, NULL);
- }
- /* Returns true if GS is a nontemporal move. */
- static inline bool
- gimple_assign_nontemporal_move_p (const gassign *gs)
- {
- return gs->nontemporal_move;
- }
- /* Sets nontemporal move flag of GS to NONTEMPORAL. */
- static inline void
- gimple_assign_set_nontemporal_move (gimple gs, bool nontemporal)
- {
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- gs->nontemporal_move = nontemporal;
- }
- /* Return the code of the expression computed on the rhs of assignment
- statement GS. In case that the RHS is a single object, returns the
- tree code of the object. */
- static inline enum tree_code
- gimple_assign_rhs_code (const_gimple gs)
- {
- enum tree_code code;
- GIMPLE_CHECK (gs, GIMPLE_ASSIGN);
- code = (enum tree_code) gs->subcode;
- /* While we initially set subcode to the TREE_CODE of the rhs for
- GIMPLE_SINGLE_RHS assigns we do not update that subcode to stay
- in sync when we rewrite stmts into SSA form or do SSA propagations. */
- if (get_gimple_rhs_class (code) == GIMPLE_SINGLE_RHS)
- code = TREE_CODE (gimple_assign_rhs1 (gs));
- return code;
- }
- /* Set CODE to be the code for the expression computed on the RHS of
- assignment S. */
- static inline void
- gimple_assign_set_rhs_code (gimple s, enum tree_code code)
- {
- GIMPLE_CHECK (s, GIMPLE_ASSIGN);
- s->subcode = code;
- }
- /* Return the gimple rhs class of the code of the expression computed on
- the rhs of assignment statement GS.
- This will never return GIMPLE_INVALID_RHS. */
- static inline enum gimple_rhs_class
- gimple_assign_rhs_class (const_gimple gs)
- {
- return get_gimple_rhs_class (gimple_assign_rhs_code (gs));
- }
- /* Return true if GS is an assignment with a singleton RHS, i.e.,
- there is no operator associated with the assignment itself.
- Unlike gimple_assign_copy_p, this predicate returns true for
- any RHS operand, including those that perform an operation
- and do not have the semantics of a copy, such as COND_EXPR. */
- static inline bool
- gimple_assign_single_p (const_gimple gs)
- {
- return (is_gimple_assign (gs)
- && gimple_assign_rhs_class (gs) == GIMPLE_SINGLE_RHS);
- }
- /* Return true if GS performs a store to its lhs. */
- static inline bool
- gimple_store_p (const_gimple gs)
- {
- tree lhs = gimple_get_lhs (gs);
- return lhs && !is_gimple_reg (lhs);
- }
- /* Return true if GS is an assignment that loads from its rhs1. */
- static inline bool
- gimple_assign_load_p (const_gimple gs)
- {
- tree rhs;
- if (!gimple_assign_single_p (gs))
- return false;
- rhs = gimple_assign_rhs1 (gs);
- if (TREE_CODE (rhs) == WITH_SIZE_EXPR)
- return true;
- rhs = get_base_address (rhs);
- return (DECL_P (rhs)
- || TREE_CODE (rhs) == MEM_REF || TREE_CODE (rhs) == TARGET_MEM_REF);
- }
- /* Return true if S is a type-cast assignment. */
- static inline bool
- gimple_assign_cast_p (const_gimple s)
- {
- if (is_gimple_assign (s))
- {
- enum tree_code sc = gimple_assign_rhs_code (s);
- return CONVERT_EXPR_CODE_P (sc)
- || sc == VIEW_CONVERT_EXPR
- || sc == FIX_TRUNC_EXPR;
- }
- return false;
- }
- /* Return true if S is a clobber statement. */
- static inline bool
- gimple_clobber_p (const_gimple s)
- {
- return gimple_assign_single_p (s)
- && TREE_CLOBBER_P (gimple_assign_rhs1 (s));
- }
- /* Return true if GS is a GIMPLE_CALL. */
- static inline bool
- is_gimple_call (const_gimple gs)
- {
- return gimple_code (gs) == GIMPLE_CALL;
- }
- /* Return the LHS of call statement GS. */
- static inline tree
- gimple_call_lhs (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_CALL);
- return gimple_op (gs, 0);
- }
- /* Return a pointer to the LHS of call statement GS. */
- static inline tree *
- gimple_call_lhs_ptr (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_CALL);
- return gimple_op_ptr (gs, 0);
- }
- /* Set LHS to be the LHS operand of call statement GS. */
- static inline void
- gimple_call_set_lhs (gimple gs, tree lhs)
- {
- GIMPLE_CHECK (gs, GIMPLE_CALL);
- gimple_set_op (gs, 0, lhs);
- if (lhs && TREE_CODE (lhs) == SSA_NAME)
- SSA_NAME_DEF_STMT (lhs) = gs;
- }
- /* Return true if call GS calls an internal-only function, as enumerated
- by internal_fn. */
- static inline bool
- gimple_call_internal_p (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_CALL);
- return (gs->subcode & GF_CALL_INTERNAL) != 0;
- }
- /* Return true if call GS is marked as instrumented by
- Pointer Bounds Checker. */
- static inline bool
- gimple_call_with_bounds_p (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_CALL);
- return (gs->subcode & GF_CALL_WITH_BOUNDS) != 0;
- }
- /* If INSTRUMENTED_P is true, marm statement GS as instrumented by
- Pointer Bounds Checker. */
- static inline void
- gimple_call_set_with_bounds (gimple gs, bool with_bounds)
- {
- GIMPLE_CHECK (gs, GIMPLE_CALL);
- if (with_bounds)
- gs->subcode |= GF_CALL_WITH_BOUNDS;
- else
- gs->subcode &= ~GF_CALL_WITH_BOUNDS;
- }
- /* Return the target of internal call GS. */
- static inline enum internal_fn
- gimple_call_internal_fn (const_gimple gs)
- {
- gcc_gimple_checking_assert (gimple_call_internal_p (gs));
- return static_cast <const gcall *> (gs)->u.internal_fn;
- }
- /* If CTRL_ALTERING_P is true, mark GIMPLE_CALL S to be a stmt
- that could alter control flow. */
- static inline void
- gimple_call_set_ctrl_altering (gimple s, bool ctrl_altering_p)
- {
- GIMPLE_CHECK (s, GIMPLE_CALL);
- if (ctrl_altering_p)
- s->subcode |= GF_CALL_CTRL_ALTERING;
- else
- s->subcode &= ~GF_CALL_CTRL_ALTERING;
- }
- /* Return true if call GS calls an func whose GF_CALL_CTRL_ALTERING
- flag is set. Such call could not be a stmt in the middle of a bb. */
- static inline bool
- gimple_call_ctrl_altering_p (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_CALL);
- return (gs->subcode & GF_CALL_CTRL_ALTERING) != 0;
- }
- /* Return the function type of the function called by GS. */
- static inline tree
- gimple_call_fntype (const_gimple gs)
- {
- const gcall *call_stmt = as_a <const gcall *> (gs);
- if (gimple_call_internal_p (gs))
- return NULL_TREE;
- return call_stmt->u.fntype;
- }
- /* Set the type of the function called by CALL_STMT to FNTYPE. */
- static inline void
- gimple_call_set_fntype (gcall *call_stmt, tree fntype)
- {
- gcc_gimple_checking_assert (!gimple_call_internal_p (call_stmt));
- call_stmt->u.fntype = fntype;
- }
- /* Return the tree node representing the function called by call
- statement GS. */
- static inline tree
- gimple_call_fn (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_CALL);
- return gimple_op (gs, 1);
- }
- /* Return a pointer to the tree node representing the function called by call
- statement GS. */
- static inline tree *
- gimple_call_fn_ptr (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_CALL);
- return gimple_op_ptr (gs, 1);
- }
- /* Set FN to be the function called by call statement GS. */
- static inline void
- gimple_call_set_fn (gcall *gs, tree fn)
- {
- gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
- gimple_set_op (gs, 1, fn);
- }
- /* Set FNDECL to be the function called by call statement GS. */
- static inline void
- gimple_call_set_fndecl (gimple gs, tree decl)
- {
- GIMPLE_CHECK (gs, GIMPLE_CALL);
- gcc_gimple_checking_assert (!gimple_call_internal_p (gs));
- gimple_set_op (gs, 1, build_fold_addr_expr_loc (gimple_location (gs), decl));
- }
- /* Set internal function FN to be the function called by call statement CALL_STMT. */
- static inline void
- gimple_call_set_internal_fn (gcall *call_stmt, enum internal_fn fn)
- {
- gcc_gimple_checking_assert (gimple_call_internal_p (call_stmt));
- call_stmt->u.internal_fn = fn;
- }
- /* If a given GIMPLE_CALL's callee is a FUNCTION_DECL, return it.
- Otherwise return NULL. This function is analogous to
- get_callee_fndecl in tree land. */
- static inline tree
- gimple_call_fndecl (const_gimple gs)
- {
- return gimple_call_addr_fndecl (gimple_call_fn (gs));
- }
- /* Return the type returned by call statement GS. */
- static inline tree
- gimple_call_return_type (const gcall *gs)
- {
- tree type = gimple_call_fntype (gs);
- if (type == NULL_TREE)
- return TREE_TYPE (gimple_call_lhs (gs));
- /* The type returned by a function is the type of its
- function type. */
- return TREE_TYPE (type);
- }
- /* Return the static chain for call statement GS. */
- static inline tree
- gimple_call_chain (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_CALL);
- return gimple_op (gs, 2);
- }
- /* Return a pointer to the static chain for call statement CALL_STMT. */
- static inline tree *
- gimple_call_chain_ptr (const gcall *call_stmt)
- {
- return gimple_op_ptr (call_stmt, 2);
- }
- /* Set CHAIN to be the static chain for call statement CALL_STMT. */
- static inline void
- gimple_call_set_chain (gcall *call_stmt, tree chain)
- {
- gimple_set_op (call_stmt, 2, chain);
- }
- /* Return the number of arguments used by call statement GS. */
- static inline unsigned
- gimple_call_num_args (const_gimple gs)
- {
- unsigned num_ops;
- GIMPLE_CHECK (gs, GIMPLE_CALL);
- num_ops = gimple_num_ops (gs);
- return num_ops - 3;
- }
- /* Return the argument at position INDEX for call statement GS. */
- static inline tree
- gimple_call_arg (const_gimple gs, unsigned index)
- {
- GIMPLE_CHECK (gs, GIMPLE_CALL);
- return gimple_op (gs, index + 3);
- }
- /* Return a pointer to the argument at position INDEX for call
- statement GS. */
- static inline tree *
- gimple_call_arg_ptr (const_gimple gs, unsigned index)
- {
- GIMPLE_CHECK (gs, GIMPLE_CALL);
- return gimple_op_ptr (gs, index + 3);
- }
- /* Set ARG to be the argument at position INDEX for call statement GS. */
- static inline void
- gimple_call_set_arg (gimple gs, unsigned index, tree arg)
- {
- GIMPLE_CHECK (gs, GIMPLE_CALL);
- gimple_set_op (gs, index + 3, arg);
- }
- /* If TAIL_P is true, mark call statement S as being a tail call
- (i.e., a call just before the exit of a function). These calls are
- candidate for tail call optimization. */
- static inline void
- gimple_call_set_tail (gcall *s, bool tail_p)
- {
- if (tail_p)
- s->subcode |= GF_CALL_TAILCALL;
- else
- s->subcode &= ~GF_CALL_TAILCALL;
- }
- /* Return true if GIMPLE_CALL S is marked as a tail call. */
- static inline bool
- gimple_call_tail_p (gcall *s)
- {
- return (s->subcode & GF_CALL_TAILCALL) != 0;
- }
- /* If RETURN_SLOT_OPT_P is true mark GIMPLE_CALL S as valid for return
- slot optimization. This transformation uses the target of the call
- expansion as the return slot for calls that return in memory. */
- static inline void
- gimple_call_set_return_slot_opt (gcall *s, bool return_slot_opt_p)
- {
- if (return_slot_opt_p)
- s->subcode |= GF_CALL_RETURN_SLOT_OPT;
- else
- s->subcode &= ~GF_CALL_RETURN_SLOT_OPT;
- }
- /* Return true if S is marked for return slot optimization. */
- static inline bool
- gimple_call_return_slot_opt_p (gcall *s)
- {
- return (s->subcode & GF_CALL_RETURN_SLOT_OPT) != 0;
- }
- /* If FROM_THUNK_P is true, mark GIMPLE_CALL S as being the jump from a
- thunk to the thunked-to function. */
- static inline void
- gimple_call_set_from_thunk (gcall *s, bool from_thunk_p)
- {
- if (from_thunk_p)
- s->subcode |= GF_CALL_FROM_THUNK;
- else
- s->subcode &= ~GF_CALL_FROM_THUNK;
- }
- /* Return true if GIMPLE_CALL S is a jump from a thunk. */
- static inline bool
- gimple_call_from_thunk_p (gcall *s)
- {
- return (s->subcode & GF_CALL_FROM_THUNK) != 0;
- }
- /* If PASS_ARG_PACK_P is true, GIMPLE_CALL S is a stdarg call that needs the
- argument pack in its argument list. */
- static inline void
- gimple_call_set_va_arg_pack (gcall *s, bool pass_arg_pack_p)
- {
- if (pass_arg_pack_p)
- s->subcode |= GF_CALL_VA_ARG_PACK;
- else
- s->subcode &= ~GF_CALL_VA_ARG_PACK;
- }
- /* Return true if GIMPLE_CALL S is a stdarg call that needs the
- argument pack in its argument list. */
- static inline bool
- gimple_call_va_arg_pack_p (gcall *s)
- {
- return (s->subcode & GF_CALL_VA_ARG_PACK) != 0;
- }
- /* Return true if S is a noreturn call. */
- static inline bool
- gimple_call_noreturn_p (gimple s)
- {
- GIMPLE_CHECK (s, GIMPLE_CALL);
- return (gimple_call_flags (s) & ECF_NORETURN) != 0;
- }
- /* If NOTHROW_P is true, GIMPLE_CALL S is a call that is known to not throw
- even if the called function can throw in other cases. */
- static inline void
- gimple_call_set_nothrow (gcall *s, bool nothrow_p)
- {
- if (nothrow_p)
- s->subcode |= GF_CALL_NOTHROW;
- else
- s->subcode &= ~GF_CALL_NOTHROW;
- }
- /* Return true if S is a nothrow call. */
- static inline bool
- gimple_call_nothrow_p (gcall *s)
- {
- return (gimple_call_flags (s) & ECF_NOTHROW) != 0;
- }
- /* If FOR_VAR is true, GIMPLE_CALL S is a call to builtin_alloca that
- is known to be emitted for VLA objects. Those are wrapped by
- stack_save/stack_restore calls and hence can't lead to unbounded
- stack growth even when they occur in loops. */
- static inline void
- gimple_call_set_alloca_for_var (gcall *s, bool for_var)
- {
- if (for_var)
- s->subcode |= GF_CALL_ALLOCA_FOR_VAR;
- else
- s->subcode &= ~GF_CALL_ALLOCA_FOR_VAR;
- }
- /* Return true of S is a call to builtin_alloca emitted for VLA objects. */
- static inline bool
- gimple_call_alloca_for_var_p (gcall *s)
- {
- return (s->subcode & GF_CALL_ALLOCA_FOR_VAR) != 0;
- }
- /* Copy all the GF_CALL_* flags from ORIG_CALL to DEST_CALL. */
- static inline void
- gimple_call_copy_flags (gcall *dest_call, gcall *orig_call)
- {
- dest_call->subcode = orig_call->subcode;
- }
- /* Return a pointer to the points-to solution for the set of call-used
- variables of the call CALL_STMT. */
- static inline struct pt_solution *
- gimple_call_use_set (gcall *call_stmt)
- {
- return &call_stmt->call_used;
- }
- /* Return a pointer to the points-to solution for the set of call-used
- variables of the call CALL_STMT. */
- static inline struct pt_solution *
- gimple_call_clobber_set (gcall *call_stmt)
- {
- return &call_stmt->call_clobbered;
- }
- /* Returns true if this is a GIMPLE_ASSIGN or a GIMPLE_CALL with a
- non-NULL lhs. */
- static inline bool
- gimple_has_lhs (gimple stmt)
- {
- return (is_gimple_assign (stmt)
- || (is_gimple_call (stmt)
- && gimple_call_lhs (stmt) != NULL_TREE));
- }
- /* Return the code of the predicate computed by conditional statement GS. */
- static inline enum tree_code
- gimple_cond_code (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_COND);
- return (enum tree_code) gs->subcode;
- }
- /* Set CODE to be the predicate code for the conditional statement GS. */
- static inline void
- gimple_cond_set_code (gcond *gs, enum tree_code code)
- {
- gs->subcode = code;
- }
- /* Return the LHS of the predicate computed by conditional statement GS. */
- static inline tree
- gimple_cond_lhs (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_COND);
- return gimple_op (gs, 0);
- }
- /* Return the pointer to the LHS of the predicate computed by conditional
- statement GS. */
- static inline tree *
- gimple_cond_lhs_ptr (const gcond *gs)
- {
- return gimple_op_ptr (gs, 0);
- }
- /* Set LHS to be the LHS operand of the predicate computed by
- conditional statement GS. */
- static inline void
- gimple_cond_set_lhs (gcond *gs, tree lhs)
- {
- gimple_set_op (gs, 0, lhs);
- }
- /* Return the RHS operand of the predicate computed by conditional GS. */
- static inline tree
- gimple_cond_rhs (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_COND);
- return gimple_op (gs, 1);
- }
- /* Return the pointer to the RHS operand of the predicate computed by
- conditional GS. */
- static inline tree *
- gimple_cond_rhs_ptr (const gcond *gs)
- {
- return gimple_op_ptr (gs, 1);
- }
- /* Set RHS to be the RHS operand of the predicate computed by
- conditional statement GS. */
- static inline void
- gimple_cond_set_rhs (gcond *gs, tree rhs)
- {
- gimple_set_op (gs, 1, rhs);
- }
- /* Return the label used by conditional statement GS when its
- predicate evaluates to true. */
- static inline tree
- gimple_cond_true_label (const gcond *gs)
- {
- return gimple_op (gs, 2);
- }
- /* Set LABEL to be the label used by conditional statement GS when its
- predicate evaluates to true. */
- static inline void
- gimple_cond_set_true_label (gcond *gs, tree label)
- {
- gimple_set_op (gs, 2, label);
- }
- /* Set LABEL to be the label used by conditional statement GS when its
- predicate evaluates to false. */
- static inline void
- gimple_cond_set_false_label (gcond *gs, tree label)
- {
- gimple_set_op (gs, 3, label);
- }
- /* Return the label used by conditional statement GS when its
- predicate evaluates to false. */
- static inline tree
- gimple_cond_false_label (const gcond *gs)
- {
- return gimple_op (gs, 3);
- }
- /* Set the conditional COND_STMT to be of the form 'if (1 == 0)'. */
- static inline void
- gimple_cond_make_false (gcond *gs)
- {
- gimple_cond_set_lhs (gs, boolean_true_node);
- gimple_cond_set_rhs (gs, boolean_false_node);
- gs->subcode = EQ_EXPR;
- }
- /* Set the conditional COND_STMT to be of the form 'if (1 == 1)'. */
- static inline void
- gimple_cond_make_true (gcond *gs)
- {
- gimple_cond_set_lhs (gs, boolean_true_node);
- gimple_cond_set_rhs (gs, boolean_true_node);
- gs->subcode = EQ_EXPR;
- }
- /* Check if conditional statemente GS is of the form 'if (1 == 1)',
- 'if (0 == 0)', 'if (1 != 0)' or 'if (0 != 1)' */
- static inline bool
- gimple_cond_true_p (const gcond *gs)
- {
- tree lhs = gimple_cond_lhs (gs);
- tree rhs = gimple_cond_rhs (gs);
- enum tree_code code = gimple_cond_code (gs);
- if (lhs != boolean_true_node && lhs != boolean_false_node)
- return false;
- if (rhs != boolean_true_node && rhs != boolean_false_node)
- return false;
- if (code == NE_EXPR && lhs != rhs)
- return true;
- if (code == EQ_EXPR && lhs == rhs)
- return true;
- return false;
- }
- /* Check if conditional statement GS is of the form 'if (1 != 1)',
- 'if (0 != 0)', 'if (1 == 0)' or 'if (0 == 1)' */
- static inline bool
- gimple_cond_false_p (const gcond *gs)
- {
- tree lhs = gimple_cond_lhs (gs);
- tree rhs = gimple_cond_rhs (gs);
- enum tree_code code = gimple_cond_code (gs);
- if (lhs != boolean_true_node && lhs != boolean_false_node)
- return false;
- if (rhs != boolean_true_node && rhs != boolean_false_node)
- return false;
- if (code == NE_EXPR && lhs == rhs)
- return true;
- if (code == EQ_EXPR && lhs != rhs)
- return true;
- return false;
- }
- /* Set the code, LHS and RHS of GIMPLE_COND STMT from CODE, LHS and RHS. */
- static inline void
- gimple_cond_set_condition (gcond *stmt, enum tree_code code, tree lhs,
- tree rhs)
- {
- gimple_cond_set_code (stmt, code);
- gimple_cond_set_lhs (stmt, lhs);
- gimple_cond_set_rhs (stmt, rhs);
- }
- /* Return the LABEL_DECL node used by GIMPLE_LABEL statement GS. */
- static inline tree
- gimple_label_label (const glabel *gs)
- {
- return gimple_op (gs, 0);
- }
- /* Set LABEL to be the LABEL_DECL node used by GIMPLE_LABEL statement
- GS. */
- static inline void
- gimple_label_set_label (glabel *gs, tree label)
- {
- gimple_set_op (gs, 0, label);
- }
- /* Return the destination of the unconditional jump GS. */
- static inline tree
- gimple_goto_dest (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_GOTO);
- return gimple_op (gs, 0);
- }
- /* Set DEST to be the destination of the unconditonal jump GS. */
- static inline void
- gimple_goto_set_dest (ggoto *gs, tree dest)
- {
- gimple_set_op (gs, 0, dest);
- }
- /* Return the variables declared in the GIMPLE_BIND statement GS. */
- static inline tree
- gimple_bind_vars (const gbind *bind_stmt)
- {
- return bind_stmt->vars;
- }
- /* Set VARS to be the set of variables declared in the GIMPLE_BIND
- statement GS. */
- static inline void
- gimple_bind_set_vars (gbind *bind_stmt, tree vars)
- {
- bind_stmt->vars = vars;
- }
- /* Append VARS to the set of variables declared in the GIMPLE_BIND
- statement GS. */
- static inline void
- gimple_bind_append_vars (gbind *bind_stmt, tree vars)
- {
- bind_stmt->vars = chainon (bind_stmt->vars, vars);
- }
- static inline gimple_seq *
- gimple_bind_body_ptr (gbind *bind_stmt)
- {
- return &bind_stmt->body;
- }
- /* Return the GIMPLE sequence contained in the GIMPLE_BIND statement GS. */
- static inline gimple_seq
- gimple_bind_body (gbind *gs)
- {
- return *gimple_bind_body_ptr (gs);
- }
- /* Set SEQ to be the GIMPLE sequence contained in the GIMPLE_BIND
- statement GS. */
- static inline void
- gimple_bind_set_body (gbind *bind_stmt, gimple_seq seq)
- {
- bind_stmt->body = seq;
- }
- /* Append a statement to the end of a GIMPLE_BIND's body. */
- static inline void
- gimple_bind_add_stmt (gbind *bind_stmt, gimple stmt)
- {
- gimple_seq_add_stmt (&bind_stmt->body, stmt);
- }
- /* Append a sequence of statements to the end of a GIMPLE_BIND's body. */
- static inline void
- gimple_bind_add_seq (gbind *bind_stmt, gimple_seq seq)
- {
- gimple_seq_add_seq (&bind_stmt->body, seq);
- }
- /* Return the TREE_BLOCK node associated with GIMPLE_BIND statement
- GS. This is analogous to the BIND_EXPR_BLOCK field in trees. */
- static inline tree
- gimple_bind_block (const gbind *bind_stmt)
- {
- return bind_stmt->block;
- }
- /* Set BLOCK to be the TREE_BLOCK node associated with GIMPLE_BIND
- statement GS. */
- static inline void
- gimple_bind_set_block (gbind *bind_stmt, tree block)
- {
- gcc_gimple_checking_assert (block == NULL_TREE
- || TREE_CODE (block) == BLOCK);
- bind_stmt->block = block;
- }
- /* Return the number of input operands for GIMPLE_ASM ASM_STMT. */
- static inline unsigned
- gimple_asm_ninputs (const gasm *asm_stmt)
- {
- return asm_stmt->ni;
- }
- /* Return the number of output operands for GIMPLE_ASM ASM_STMT. */
- static inline unsigned
- gimple_asm_noutputs (const gasm *asm_stmt)
- {
- return asm_stmt->no;
- }
- /* Return the number of clobber operands for GIMPLE_ASM ASM_STMT. */
- static inline unsigned
- gimple_asm_nclobbers (const gasm *asm_stmt)
- {
- return asm_stmt->nc;
- }
- /* Return the number of label operands for GIMPLE_ASM ASM_STMT. */
- static inline unsigned
- gimple_asm_nlabels (const gasm *asm_stmt)
- {
- return asm_stmt->nl;
- }
- /* Return input operand INDEX of GIMPLE_ASM ASM_STMT. */
- static inline tree
- gimple_asm_input_op (const gasm *asm_stmt, unsigned index)
- {
- gcc_gimple_checking_assert (index < asm_stmt->ni);
- return gimple_op (asm_stmt, index + asm_stmt->no);
- }
- /* Return a pointer to input operand INDEX of GIMPLE_ASM ASM_STMT. */
- static inline tree *
- gimple_asm_input_op_ptr (const gasm *asm_stmt, unsigned index)
- {
- gcc_gimple_checking_assert (index < asm_stmt->ni);
- return gimple_op_ptr (asm_stmt, index + asm_stmt->no);
- }
- /* Set IN_OP to be input operand INDEX in GIMPLE_ASM ASM_STMT. */
- static inline void
- gimple_asm_set_input_op (gasm *asm_stmt, unsigned index, tree in_op)
- {
- gcc_gimple_checking_assert (index < asm_stmt->ni
- && TREE_CODE (in_op) == TREE_LIST);
- gimple_set_op (asm_stmt, index + asm_stmt->no, in_op);
- }
- /* Return output operand INDEX of GIMPLE_ASM ASM_STMT. */
- static inline tree
- gimple_asm_output_op (const gasm *asm_stmt, unsigned index)
- {
- gcc_gimple_checking_assert (index < asm_stmt->no);
- return gimple_op (asm_stmt, index);
- }
- /* Return a pointer to output operand INDEX of GIMPLE_ASM ASM_STMT. */
- static inline tree *
- gimple_asm_output_op_ptr (const gasm *asm_stmt, unsigned index)
- {
- gcc_gimple_checking_assert (index < asm_stmt->no);
- return gimple_op_ptr (asm_stmt, index);
- }
- /* Set OUT_OP to be output operand INDEX in GIMPLE_ASM ASM_STMT. */
- static inline void
- gimple_asm_set_output_op (gasm *asm_stmt, unsigned index, tree out_op)
- {
- gcc_gimple_checking_assert (index < asm_stmt->no
- && TREE_CODE (out_op) == TREE_LIST);
- gimple_set_op (asm_stmt, index, out_op);
- }
- /* Return clobber operand INDEX of GIMPLE_ASM ASM_STMT. */
- static inline tree
- gimple_asm_clobber_op (const gasm *asm_stmt, unsigned index)
- {
- gcc_gimple_checking_assert (index < asm_stmt->nc);
- return gimple_op (asm_stmt, index + asm_stmt->ni + asm_stmt->no);
- }
- /* Set CLOBBER_OP to be clobber operand INDEX in GIMPLE_ASM ASM_STMT. */
- static inline void
- gimple_asm_set_clobber_op (gasm *asm_stmt, unsigned index, tree clobber_op)
- {
- gcc_gimple_checking_assert (index < asm_stmt->nc
- && TREE_CODE (clobber_op) == TREE_LIST);
- gimple_set_op (asm_stmt, index + asm_stmt->ni + asm_stmt->no, clobber_op);
- }
- /* Return label operand INDEX of GIMPLE_ASM ASM_STMT. */
- static inline tree
- gimple_asm_label_op (const gasm *asm_stmt, unsigned index)
- {
- gcc_gimple_checking_assert (index < asm_stmt->nl);
- return gimple_op (asm_stmt, index + asm_stmt->ni + asm_stmt->nc);
- }
- /* Set LABEL_OP to be label operand INDEX in GIMPLE_ASM ASM_STMT. */
- static inline void
- gimple_asm_set_label_op (gasm *asm_stmt, unsigned index, tree label_op)
- {
- gcc_gimple_checking_assert (index < asm_stmt->nl
- && TREE_CODE (label_op) == TREE_LIST);
- gimple_set_op (asm_stmt, index + asm_stmt->ni + asm_stmt->nc, label_op);
- }
- /* Return the string representing the assembly instruction in
- GIMPLE_ASM ASM_STMT. */
- static inline const char *
- gimple_asm_string (const gasm *asm_stmt)
- {
- return asm_stmt->string;
- }
- /* Return true ASM_STMT ASM_STMT is an asm statement marked volatile. */
- static inline bool
- gimple_asm_volatile_p (const gasm *asm_stmt)
- {
- return (asm_stmt->subcode & GF_ASM_VOLATILE) != 0;
- }
- /* If VOLATLE_P is true, mark asm statement ASM_STMT as volatile. */
- static inline void
- gimple_asm_set_volatile (gasm *asm_stmt, bool volatile_p)
- {
- if (volatile_p)
- asm_stmt->subcode |= GF_ASM_VOLATILE;
- else
- asm_stmt->subcode &= ~GF_ASM_VOLATILE;
- }
- /* If INPUT_P is true, mark asm ASM_STMT as an ASM_INPUT. */
- static inline void
- gimple_asm_set_input (gasm *asm_stmt, bool input_p)
- {
- if (input_p)
- asm_stmt->subcode |= GF_ASM_INPUT;
- else
- asm_stmt->subcode &= ~GF_ASM_INPUT;
- }
- /* Return true if asm ASM_STMT is an ASM_INPUT. */
- static inline bool
- gimple_asm_input_p (const gasm *asm_stmt)
- {
- return (asm_stmt->subcode & GF_ASM_INPUT) != 0;
- }
- /* Return the types handled by GIMPLE_CATCH statement CATCH_STMT. */
- static inline tree
- gimple_catch_types (const gcatch *catch_stmt)
- {
- return catch_stmt->types;
- }
- /* Return a pointer to the types handled by GIMPLE_CATCH statement CATCH_STMT. */
- static inline tree *
- gimple_catch_types_ptr (gcatch *catch_stmt)
- {
- return &catch_stmt->types;
- }
- /* Return a pointer to the GIMPLE sequence representing the body of
- the handler of GIMPLE_CATCH statement CATCH_STMT. */
- static inline gimple_seq *
- gimple_catch_handler_ptr (gcatch *catch_stmt)
- {
- return &catch_stmt->handler;
- }
- /* Return the GIMPLE sequence representing the body of the handler of
- GIMPLE_CATCH statement CATCH_STMT. */
- static inline gimple_seq
- gimple_catch_handler (gcatch *catch_stmt)
- {
- return *gimple_catch_handler_ptr (catch_stmt);
- }
- /* Set T to be the set of types handled by GIMPLE_CATCH CATCH_STMT. */
- static inline void
- gimple_catch_set_types (gcatch *catch_stmt, tree t)
- {
- catch_stmt->types = t;
- }
- /* Set HANDLER to be the body of GIMPLE_CATCH CATCH_STMT. */
- static inline void
- gimple_catch_set_handler (gcatch *catch_stmt, gimple_seq handler)
- {
- catch_stmt->handler = handler;
- }
- /* Return the types handled by GIMPLE_EH_FILTER statement GS. */
- static inline tree
- gimple_eh_filter_types (const_gimple gs)
- {
- const geh_filter *eh_filter_stmt = as_a <const geh_filter *> (gs);
- return eh_filter_stmt->types;
- }
- /* Return a pointer to the types handled by GIMPLE_EH_FILTER statement
- GS. */
- static inline tree *
- gimple_eh_filter_types_ptr (gimple gs)
- {
- geh_filter *eh_filter_stmt = as_a <geh_filter *> (gs);
- return &eh_filter_stmt->types;
- }
- /* Return a pointer to the sequence of statement to execute when
- GIMPLE_EH_FILTER statement fails. */
- static inline gimple_seq *
- gimple_eh_filter_failure_ptr (gimple gs)
- {
- geh_filter *eh_filter_stmt = as_a <geh_filter *> (gs);
- return &eh_filter_stmt->failure;
- }
- /* Return the sequence of statement to execute when GIMPLE_EH_FILTER
- statement fails. */
- static inline gimple_seq
- gimple_eh_filter_failure (gimple gs)
- {
- return *gimple_eh_filter_failure_ptr (gs);
- }
- /* Set TYPES to be the set of types handled by GIMPLE_EH_FILTER
- EH_FILTER_STMT. */
- static inline void
- gimple_eh_filter_set_types (geh_filter *eh_filter_stmt, tree types)
- {
- eh_filter_stmt->types = types;
- }
- /* Set FAILURE to be the sequence of statements to execute on failure
- for GIMPLE_EH_FILTER EH_FILTER_STMT. */
- static inline void
- gimple_eh_filter_set_failure (geh_filter *eh_filter_stmt,
- gimple_seq failure)
- {
- eh_filter_stmt->failure = failure;
- }
- /* Get the function decl to be called by the MUST_NOT_THROW region. */
- static inline tree
- gimple_eh_must_not_throw_fndecl (geh_mnt *eh_mnt_stmt)
- {
- return eh_mnt_stmt->fndecl;
- }
- /* Set the function decl to be called by GS to DECL. */
- static inline void
- gimple_eh_must_not_throw_set_fndecl (geh_mnt *eh_mnt_stmt,
- tree decl)
- {
- eh_mnt_stmt->fndecl = decl;
- }
- /* GIMPLE_EH_ELSE accessors. */
- static inline gimple_seq *
- gimple_eh_else_n_body_ptr (geh_else *eh_else_stmt)
- {
- return &eh_else_stmt->n_body;
- }
- static inline gimple_seq
- gimple_eh_else_n_body (geh_else *eh_else_stmt)
- {
- return *gimple_eh_else_n_body_ptr (eh_else_stmt);
- }
- static inline gimple_seq *
- gimple_eh_else_e_body_ptr (geh_else *eh_else_stmt)
- {
- return &eh_else_stmt->e_body;
- }
- static inline gimple_seq
- gimple_eh_else_e_body (geh_else *eh_else_stmt)
- {
- return *gimple_eh_else_e_body_ptr (eh_else_stmt);
- }
- static inline void
- gimple_eh_else_set_n_body (geh_else *eh_else_stmt, gimple_seq seq)
- {
- eh_else_stmt->n_body = seq;
- }
- static inline void
- gimple_eh_else_set_e_body (geh_else *eh_else_stmt, gimple_seq seq)
- {
- eh_else_stmt->e_body = seq;
- }
- /* GIMPLE_TRY accessors. */
- /* Return the kind of try block represented by GIMPLE_TRY GS. This is
- either GIMPLE_TRY_CATCH or GIMPLE_TRY_FINALLY. */
- static inline enum gimple_try_flags
- gimple_try_kind (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_TRY);
- return (enum gimple_try_flags) (gs->subcode & GIMPLE_TRY_KIND);
- }
- /* Set the kind of try block represented by GIMPLE_TRY GS. */
- static inline void
- gimple_try_set_kind (gtry *gs, enum gimple_try_flags kind)
- {
- gcc_gimple_checking_assert (kind == GIMPLE_TRY_CATCH
- || kind == GIMPLE_TRY_FINALLY);
- if (gimple_try_kind (gs) != kind)
- gs->subcode = (unsigned int) kind;
- }
- /* Return the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
- static inline bool
- gimple_try_catch_is_cleanup (const_gimple gs)
- {
- gcc_gimple_checking_assert (gimple_try_kind (gs) == GIMPLE_TRY_CATCH);
- return (gs->subcode & GIMPLE_TRY_CATCH_IS_CLEANUP) != 0;
- }
- /* Return a pointer to the sequence of statements used as the
- body for GIMPLE_TRY GS. */
- static inline gimple_seq *
- gimple_try_eval_ptr (gimple gs)
- {
- gtry *try_stmt = as_a <gtry *> (gs);
- return &try_stmt->eval;
- }
- /* Return the sequence of statements used as the body for GIMPLE_TRY GS. */
- static inline gimple_seq
- gimple_try_eval (gimple gs)
- {
- return *gimple_try_eval_ptr (gs);
- }
- /* Return a pointer to the sequence of statements used as the cleanup body for
- GIMPLE_TRY GS. */
- static inline gimple_seq *
- gimple_try_cleanup_ptr (gimple gs)
- {
- gtry *try_stmt = as_a <gtry *> (gs);
- return &try_stmt->cleanup;
- }
- /* Return the sequence of statements used as the cleanup body for
- GIMPLE_TRY GS. */
- static inline gimple_seq
- gimple_try_cleanup (gimple gs)
- {
- return *gimple_try_cleanup_ptr (gs);
- }
- /* Set the GIMPLE_TRY_CATCH_IS_CLEANUP flag. */
- static inline void
- gimple_try_set_catch_is_cleanup (gtry *g, bool catch_is_cleanup)
- {
- gcc_gimple_checking_assert (gimple_try_kind (g) == GIMPLE_TRY_CATCH);
- if (catch_is_cleanup)
- g->subcode |= GIMPLE_TRY_CATCH_IS_CLEANUP;
- else
- g->subcode &= ~GIMPLE_TRY_CATCH_IS_CLEANUP;
- }
- /* Set EVAL to be the sequence of statements to use as the body for
- GIMPLE_TRY TRY_STMT. */
- static inline void
- gimple_try_set_eval (gtry *try_stmt, gimple_seq eval)
- {
- try_stmt->eval = eval;
- }
- /* Set CLEANUP to be the sequence of statements to use as the cleanup
- body for GIMPLE_TRY TRY_STMT. */
- static inline void
- gimple_try_set_cleanup (gtry *try_stmt, gimple_seq cleanup)
- {
- try_stmt->cleanup = cleanup;
- }
- /* Return a pointer to the cleanup sequence for cleanup statement GS. */
- static inline gimple_seq *
- gimple_wce_cleanup_ptr (gimple gs)
- {
- gimple_statement_wce *wce_stmt = as_a <gimple_statement_wce *> (gs);
- return &wce_stmt->cleanup;
- }
- /* Return the cleanup sequence for cleanup statement GS. */
- static inline gimple_seq
- gimple_wce_cleanup (gimple gs)
- {
- return *gimple_wce_cleanup_ptr (gs);
- }
- /* Set CLEANUP to be the cleanup sequence for GS. */
- static inline void
- gimple_wce_set_cleanup (gimple gs, gimple_seq cleanup)
- {
- gimple_statement_wce *wce_stmt = as_a <gimple_statement_wce *> (gs);
- wce_stmt->cleanup = cleanup;
- }
- /* Return the CLEANUP_EH_ONLY flag for a WCE tuple. */
- static inline bool
- gimple_wce_cleanup_eh_only (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
- return gs->subcode != 0;
- }
- /* Set the CLEANUP_EH_ONLY flag for a WCE tuple. */
- static inline void
- gimple_wce_set_cleanup_eh_only (gimple gs, bool eh_only_p)
- {
- GIMPLE_CHECK (gs, GIMPLE_WITH_CLEANUP_EXPR);
- gs->subcode = (unsigned int) eh_only_p;
- }
- /* Return the maximum number of arguments supported by GIMPLE_PHI GS. */
- static inline unsigned
- gimple_phi_capacity (const_gimple gs)
- {
- const gphi *phi_stmt = as_a <const gphi *> (gs);
- return phi_stmt->capacity;
- }
- /* Return the number of arguments in GIMPLE_PHI GS. This must always
- be exactly the number of incoming edges for the basic block holding
- GS. */
- static inline unsigned
- gimple_phi_num_args (const_gimple gs)
- {
- const gphi *phi_stmt = as_a <const gphi *> (gs);
- return phi_stmt->nargs;
- }
- /* Return the SSA name created by GIMPLE_PHI GS. */
- static inline tree
- gimple_phi_result (const_gimple gs)
- {
- const gphi *phi_stmt = as_a <const gphi *> (gs);
- return phi_stmt->result;
- }
- /* Return a pointer to the SSA name created by GIMPLE_PHI GS. */
- static inline tree *
- gimple_phi_result_ptr (gimple gs)
- {
- gphi *phi_stmt = as_a <gphi *> (gs);
- return &phi_stmt->result;
- }
- /* Set RESULT to be the SSA name created by GIMPLE_PHI PHI. */
- static inline void
- gimple_phi_set_result (gphi *phi, tree result)
- {
- phi->result = result;
- if (result && TREE_CODE (result) == SSA_NAME)
- SSA_NAME_DEF_STMT (result) = phi;
- }
- /* Return the PHI argument corresponding to incoming edge INDEX for
- GIMPLE_PHI GS. */
- static inline struct phi_arg_d *
- gimple_phi_arg (gimple gs, unsigned index)
- {
- gphi *phi_stmt = as_a <gphi *> (gs);
- gcc_gimple_checking_assert (index <= phi_stmt->capacity);
- return &(phi_stmt->args[index]);
- }
- /* Set PHIARG to be the argument corresponding to incoming edge INDEX
- for GIMPLE_PHI PHI. */
- static inline void
- gimple_phi_set_arg (gphi *phi, unsigned index, struct phi_arg_d * phiarg)
- {
- gcc_gimple_checking_assert (index <= phi->nargs);
- phi->args[index] = *phiarg;
- }
- /* Return the PHI nodes for basic block BB, or NULL if there are no
- PHI nodes. */
- static inline gimple_seq
- phi_nodes (const_basic_block bb)
- {
- gcc_checking_assert (!(bb->flags & BB_RTL));
- return bb->il.gimple.phi_nodes;
- }
- /* Return a pointer to the PHI nodes for basic block BB. */
- static inline gimple_seq *
- phi_nodes_ptr (basic_block bb)
- {
- gcc_checking_assert (!(bb->flags & BB_RTL));
- return &bb->il.gimple.phi_nodes;
- }
- /* Return the tree operand for argument I of PHI node GS. */
- static inline tree
- gimple_phi_arg_def (gimple gs, size_t index)
- {
- return gimple_phi_arg (gs, index)->def;
- }
- /* Return a pointer to the tree operand for argument I of phi node PHI. */
- static inline tree *
- gimple_phi_arg_def_ptr (gphi *phi, size_t index)
- {
- return &gimple_phi_arg (phi, index)->def;
- }
- /* Return the edge associated with argument I of phi node PHI. */
- static inline edge
- gimple_phi_arg_edge (gphi *phi, size_t i)
- {
- return EDGE_PRED (gimple_bb (phi), i);
- }
- /* Return the source location of gimple argument I of phi node PHI. */
- static inline source_location
- gimple_phi_arg_location (gphi *phi, size_t i)
- {
- return gimple_phi_arg (phi, i)->locus;
- }
- /* Return the source location of the argument on edge E of phi node PHI. */
- static inline source_location
- gimple_phi_arg_location_from_edge (gphi *phi, edge e)
- {
- return gimple_phi_arg (phi, e->dest_idx)->locus;
- }
- /* Set the source location of gimple argument I of phi node PHI to LOC. */
- static inline void
- gimple_phi_arg_set_location (gphi *phi, size_t i, source_location loc)
- {
- gimple_phi_arg (phi, i)->locus = loc;
- }
- /* Return TRUE if argument I of phi node PHI has a location record. */
- static inline bool
- gimple_phi_arg_has_location (gphi *phi, size_t i)
- {
- return gimple_phi_arg_location (phi, i) != UNKNOWN_LOCATION;
- }
- /* Return the region number for GIMPLE_RESX RESX_STMT. */
- static inline int
- gimple_resx_region (const gresx *resx_stmt)
- {
- return resx_stmt->region;
- }
- /* Set REGION to be the region number for GIMPLE_RESX RESX_STMT. */
- static inline void
- gimple_resx_set_region (gresx *resx_stmt, int region)
- {
- resx_stmt->region = region;
- }
- /* Return the region number for GIMPLE_EH_DISPATCH EH_DISPATCH_STMT. */
- static inline int
- gimple_eh_dispatch_region (const geh_dispatch *eh_dispatch_stmt)
- {
- return eh_dispatch_stmt->region;
- }
- /* Set REGION to be the region number for GIMPLE_EH_DISPATCH
- EH_DISPATCH_STMT. */
- static inline void
- gimple_eh_dispatch_set_region (geh_dispatch *eh_dispatch_stmt, int region)
- {
- eh_dispatch_stmt->region = region;
- }
- /* Return the number of labels associated with the switch statement GS. */
- static inline unsigned
- gimple_switch_num_labels (const gswitch *gs)
- {
- unsigned num_ops;
- GIMPLE_CHECK (gs, GIMPLE_SWITCH);
- num_ops = gimple_num_ops (gs);
- gcc_gimple_checking_assert (num_ops > 1);
- return num_ops - 1;
- }
- /* Set NLABELS to be the number of labels for the switch statement GS. */
- static inline void
- gimple_switch_set_num_labels (gswitch *g, unsigned nlabels)
- {
- GIMPLE_CHECK (g, GIMPLE_SWITCH);
- gimple_set_num_ops (g, nlabels + 1);
- }
- /* Return the index variable used by the switch statement GS. */
- static inline tree
- gimple_switch_index (const gswitch *gs)
- {
- return gimple_op (gs, 0);
- }
- /* Return a pointer to the index variable for the switch statement GS. */
- static inline tree *
- gimple_switch_index_ptr (const gswitch *gs)
- {
- return gimple_op_ptr (gs, 0);
- }
- /* Set INDEX to be the index variable for switch statement GS. */
- static inline void
- gimple_switch_set_index (gswitch *gs, tree index)
- {
- GIMPLE_CHECK (gs, GIMPLE_SWITCH);
- gcc_gimple_checking_assert (SSA_VAR_P (index) || CONSTANT_CLASS_P (index));
- gimple_set_op (gs, 0, index);
- }
- /* Return the label numbered INDEX. The default label is 0, followed by any
- labels in a switch statement. */
- static inline tree
- gimple_switch_label (const gswitch *gs, unsigned index)
- {
- GIMPLE_CHECK (gs, GIMPLE_SWITCH);
- gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1);
- return gimple_op (gs, index + 1);
- }
- /* Set the label number INDEX to LABEL. 0 is always the default label. */
- static inline void
- gimple_switch_set_label (gswitch *gs, unsigned index, tree label)
- {
- GIMPLE_CHECK (gs, GIMPLE_SWITCH);
- gcc_gimple_checking_assert (gimple_num_ops (gs) > index + 1
- && (label == NULL_TREE
- || TREE_CODE (label) == CASE_LABEL_EXPR));
- gimple_set_op (gs, index + 1, label);
- }
- /* Return the default label for a switch statement. */
- static inline tree
- gimple_switch_default_label (const gswitch *gs)
- {
- tree label = gimple_switch_label (gs, 0);
- gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
- return label;
- }
- /* Set the default label for a switch statement. */
- static inline void
- gimple_switch_set_default_label (gswitch *gs, tree label)
- {
- gcc_checking_assert (!CASE_LOW (label) && !CASE_HIGH (label));
- gimple_switch_set_label (gs, 0, label);
- }
- /* Return true if GS is a GIMPLE_DEBUG statement. */
- static inline bool
- is_gimple_debug (const_gimple gs)
- {
- return gimple_code (gs) == GIMPLE_DEBUG;
- }
- /* Return true if S is a GIMPLE_DEBUG BIND statement. */
- static inline bool
- gimple_debug_bind_p (const_gimple s)
- {
- if (is_gimple_debug (s))
- return s->subcode == GIMPLE_DEBUG_BIND;
- return false;
- }
- /* Return the variable bound in a GIMPLE_DEBUG bind statement. */
- static inline tree
- gimple_debug_bind_get_var (gimple dbg)
- {
- GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
- gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
- return gimple_op (dbg, 0);
- }
- /* Return the value bound to the variable in a GIMPLE_DEBUG bind
- statement. */
- static inline tree
- gimple_debug_bind_get_value (gimple dbg)
- {
- GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
- gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
- return gimple_op (dbg, 1);
- }
- /* Return a pointer to the value bound to the variable in a
- GIMPLE_DEBUG bind statement. */
- static inline tree *
- gimple_debug_bind_get_value_ptr (gimple dbg)
- {
- GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
- gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
- return gimple_op_ptr (dbg, 1);
- }
- /* Set the variable bound in a GIMPLE_DEBUG bind statement. */
- static inline void
- gimple_debug_bind_set_var (gimple dbg, tree var)
- {
- GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
- gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
- gimple_set_op (dbg, 0, var);
- }
- /* Set the value bound to the variable in a GIMPLE_DEBUG bind
- statement. */
- static inline void
- gimple_debug_bind_set_value (gimple dbg, tree value)
- {
- GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
- gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
- gimple_set_op (dbg, 1, value);
- }
- /* The second operand of a GIMPLE_DEBUG_BIND, when the value was
- optimized away. */
- #define GIMPLE_DEBUG_BIND_NOVALUE NULL_TREE /* error_mark_node */
- /* Remove the value bound to the variable in a GIMPLE_DEBUG bind
- statement. */
- static inline void
- gimple_debug_bind_reset_value (gimple dbg)
- {
- GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
- gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
- gimple_set_op (dbg, 1, GIMPLE_DEBUG_BIND_NOVALUE);
- }
- /* Return true if the GIMPLE_DEBUG bind statement is bound to a
- value. */
- static inline bool
- gimple_debug_bind_has_value_p (gimple dbg)
- {
- GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
- gcc_gimple_checking_assert (gimple_debug_bind_p (dbg));
- return gimple_op (dbg, 1) != GIMPLE_DEBUG_BIND_NOVALUE;
- }
- #undef GIMPLE_DEBUG_BIND_NOVALUE
- /* Return true if S is a GIMPLE_DEBUG SOURCE BIND statement. */
- static inline bool
- gimple_debug_source_bind_p (const_gimple s)
- {
- if (is_gimple_debug (s))
- return s->subcode == GIMPLE_DEBUG_SOURCE_BIND;
- return false;
- }
- /* Return the variable bound in a GIMPLE_DEBUG source bind statement. */
- static inline tree
- gimple_debug_source_bind_get_var (gimple dbg)
- {
- GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
- gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
- return gimple_op (dbg, 0);
- }
- /* Return the value bound to the variable in a GIMPLE_DEBUG source bind
- statement. */
- static inline tree
- gimple_debug_source_bind_get_value (gimple dbg)
- {
- GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
- gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
- return gimple_op (dbg, 1);
- }
- /* Return a pointer to the value bound to the variable in a
- GIMPLE_DEBUG source bind statement. */
- static inline tree *
- gimple_debug_source_bind_get_value_ptr (gimple dbg)
- {
- GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
- gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
- return gimple_op_ptr (dbg, 1);
- }
- /* Set the variable bound in a GIMPLE_DEBUG source bind statement. */
- static inline void
- gimple_debug_source_bind_set_var (gimple dbg, tree var)
- {
- GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
- gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
- gimple_set_op (dbg, 0, var);
- }
- /* Set the value bound to the variable in a GIMPLE_DEBUG source bind
- statement. */
- static inline void
- gimple_debug_source_bind_set_value (gimple dbg, tree value)
- {
- GIMPLE_CHECK (dbg, GIMPLE_DEBUG);
- gcc_gimple_checking_assert (gimple_debug_source_bind_p (dbg));
- gimple_set_op (dbg, 1, value);
- }
- /* Return the line number for EXPR, or return -1 if we have no line
- number information for it. */
- static inline int
- get_lineno (const_gimple stmt)
- {
- location_t loc;
- if (!stmt)
- return -1;
- loc = gimple_location (stmt);
- if (loc == UNKNOWN_LOCATION)
- return -1;
- return LOCATION_LINE (loc);
- }
- /* Return a pointer to the body for the OMP statement GS. */
- static inline gimple_seq *
- gimple_omp_body_ptr (gimple gs)
- {
- return &static_cast <gimple_statement_omp *> (gs)->body;
- }
- /* Return the body for the OMP statement GS. */
- static inline gimple_seq
- gimple_omp_body (gimple gs)
- {
- return *gimple_omp_body_ptr (gs);
- }
- /* Set BODY to be the body for the OMP statement GS. */
- static inline void
- gimple_omp_set_body (gimple gs, gimple_seq body)
- {
- static_cast <gimple_statement_omp *> (gs)->body = body;
- }
- /* Return the name associated with OMP_CRITICAL statement CRIT_STMT. */
- static inline tree
- gimple_omp_critical_name (const gomp_critical *crit_stmt)
- {
- return crit_stmt->name;
- }
- /* Return a pointer to the name associated with OMP critical statement GS. */
- static inline tree *
- gimple_omp_critical_name_ptr (gomp_critical *crit_stmt)
- {
- return &crit_stmt->name;
- }
- /* Set NAME to be the name associated with OMP critical statement GS. */
- static inline void
- gimple_omp_critical_set_name (gomp_critical *crit_stmt, tree name)
- {
- crit_stmt->name = name;
- }
- /* Return the kind of the OMP_FOR statemement G. */
- static inline int
- gimple_omp_for_kind (const_gimple g)
- {
- GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
- return (gimple_omp_subcode (g) & GF_OMP_FOR_KIND_MASK);
- }
- /* Set the kind of the OMP_FOR statement G. */
- static inline void
- gimple_omp_for_set_kind (gomp_for *g, int kind)
- {
- g->subcode = (g->subcode & ~GF_OMP_FOR_KIND_MASK)
- | (kind & GF_OMP_FOR_KIND_MASK);
- }
- /* Return true if OMP_FOR statement G has the
- GF_OMP_FOR_COMBINED flag set. */
- static inline bool
- gimple_omp_for_combined_p (const_gimple g)
- {
- GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
- return (gimple_omp_subcode (g) & GF_OMP_FOR_COMBINED) != 0;
- }
- /* Set the GF_OMP_FOR_COMBINED field in the OMP_FOR statement G depending on
- the boolean value of COMBINED_P. */
- static inline void
- gimple_omp_for_set_combined_p (gomp_for *g, bool combined_p)
- {
- if (combined_p)
- g->subcode |= GF_OMP_FOR_COMBINED;
- else
- g->subcode &= ~GF_OMP_FOR_COMBINED;
- }
- /* Return true if the OMP_FOR statement G has the
- GF_OMP_FOR_COMBINED_INTO flag set. */
- static inline bool
- gimple_omp_for_combined_into_p (const_gimple g)
- {
- GIMPLE_CHECK (g, GIMPLE_OMP_FOR);
- return (gimple_omp_subcode (g) & GF_OMP_FOR_COMBINED_INTO) != 0;
- }
- /* Set the GF_OMP_FOR_COMBINED_INTO field in the OMP_FOR statement G depending
- on the boolean value of COMBINED_P. */
- static inline void
- gimple_omp_for_set_combined_into_p (gomp_for *g, bool combined_p)
- {
- if (combined_p)
- g->subcode |= GF_OMP_FOR_COMBINED_INTO;
- else
- g->subcode &= ~GF_OMP_FOR_COMBINED_INTO;
- }
- /* Return the clauses associated with the OMP_FOR statement GS. */
- static inline tree
- gimple_omp_for_clauses (const_gimple gs)
- {
- const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
- return omp_for_stmt->clauses;
- }
- /* Return a pointer to the clauses associated with the OMP_FOR statement
- GS. */
- static inline tree *
- gimple_omp_for_clauses_ptr (gimple gs)
- {
- gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
- return &omp_for_stmt->clauses;
- }
- /* Set CLAUSES to be the list of clauses associated with the OMP_FOR statement
- GS. */
- static inline void
- gimple_omp_for_set_clauses (gimple gs, tree clauses)
- {
- gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
- omp_for_stmt->clauses = clauses;
- }
- /* Get the collapse count of the OMP_FOR statement GS. */
- static inline size_t
- gimple_omp_for_collapse (gimple gs)
- {
- gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
- return omp_for_stmt->collapse;
- }
- /* Return the condition code associated with the OMP_FOR statement GS. */
- static inline enum tree_code
- gimple_omp_for_cond (const_gimple gs, size_t i)
- {
- const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
- gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
- return omp_for_stmt->iter[i].cond;
- }
- /* Set COND to be the condition code for the OMP_FOR statement GS. */
- static inline void
- gimple_omp_for_set_cond (gimple gs, size_t i, enum tree_code cond)
- {
- gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
- gcc_gimple_checking_assert (TREE_CODE_CLASS (cond) == tcc_comparison
- && i < omp_for_stmt->collapse);
- omp_for_stmt->iter[i].cond = cond;
- }
- /* Return the index variable for the OMP_FOR statement GS. */
- static inline tree
- gimple_omp_for_index (const_gimple gs, size_t i)
- {
- const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
- gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
- return omp_for_stmt->iter[i].index;
- }
- /* Return a pointer to the index variable for the OMP_FOR statement GS. */
- static inline tree *
- gimple_omp_for_index_ptr (gimple gs, size_t i)
- {
- gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
- gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
- return &omp_for_stmt->iter[i].index;
- }
- /* Set INDEX to be the index variable for the OMP_FOR statement GS. */
- static inline void
- gimple_omp_for_set_index (gimple gs, size_t i, tree index)
- {
- gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
- gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
- omp_for_stmt->iter[i].index = index;
- }
- /* Return the initial value for the OMP_FOR statement GS. */
- static inline tree
- gimple_omp_for_initial (const_gimple gs, size_t i)
- {
- const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
- gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
- return omp_for_stmt->iter[i].initial;
- }
- /* Return a pointer to the initial value for the OMP_FOR statement GS. */
- static inline tree *
- gimple_omp_for_initial_ptr (gimple gs, size_t i)
- {
- gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
- gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
- return &omp_for_stmt->iter[i].initial;
- }
- /* Set INITIAL to be the initial value for the OMP_FOR statement GS. */
- static inline void
- gimple_omp_for_set_initial (gimple gs, size_t i, tree initial)
- {
- gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
- gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
- omp_for_stmt->iter[i].initial = initial;
- }
- /* Return the final value for the OMP_FOR statement GS. */
- static inline tree
- gimple_omp_for_final (const_gimple gs, size_t i)
- {
- const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
- gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
- return omp_for_stmt->iter[i].final;
- }
- /* Return a pointer to the final value for the OMP_FOR statement GS. */
- static inline tree *
- gimple_omp_for_final_ptr (gimple gs, size_t i)
- {
- gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
- gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
- return &omp_for_stmt->iter[i].final;
- }
- /* Set FINAL to be the final value for the OMP_FOR statement GS. */
- static inline void
- gimple_omp_for_set_final (gimple gs, size_t i, tree final)
- {
- gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
- gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
- omp_for_stmt->iter[i].final = final;
- }
- /* Return the increment value for the OMP_FOR statement GS. */
- static inline tree
- gimple_omp_for_incr (const_gimple gs, size_t i)
- {
- const gomp_for *omp_for_stmt = as_a <const gomp_for *> (gs);
- gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
- return omp_for_stmt->iter[i].incr;
- }
- /* Return a pointer to the increment value for the OMP_FOR statement GS. */
- static inline tree *
- gimple_omp_for_incr_ptr (gimple gs, size_t i)
- {
- gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
- gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
- return &omp_for_stmt->iter[i].incr;
- }
- /* Set INCR to be the increment value for the OMP_FOR statement GS. */
- static inline void
- gimple_omp_for_set_incr (gimple gs, size_t i, tree incr)
- {
- gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
- gcc_gimple_checking_assert (i < omp_for_stmt->collapse);
- omp_for_stmt->iter[i].incr = incr;
- }
- /* Return a pointer to the sequence of statements to execute before the OMP_FOR
- statement GS starts. */
- static inline gimple_seq *
- gimple_omp_for_pre_body_ptr (gimple gs)
- {
- gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
- return &omp_for_stmt->pre_body;
- }
- /* Return the sequence of statements to execute before the OMP_FOR
- statement GS starts. */
- static inline gimple_seq
- gimple_omp_for_pre_body (gimple gs)
- {
- return *gimple_omp_for_pre_body_ptr (gs);
- }
- /* Set PRE_BODY to be the sequence of statements to execute before the
- OMP_FOR statement GS starts. */
- static inline void
- gimple_omp_for_set_pre_body (gimple gs, gimple_seq pre_body)
- {
- gomp_for *omp_for_stmt = as_a <gomp_for *> (gs);
- omp_for_stmt->pre_body = pre_body;
- }
- /* Return the clauses associated with OMP_PARALLEL GS. */
- static inline tree
- gimple_omp_parallel_clauses (const_gimple gs)
- {
- const gomp_parallel *omp_parallel_stmt = as_a <const gomp_parallel *> (gs);
- return omp_parallel_stmt->clauses;
- }
- /* Return a pointer to the clauses associated with OMP_PARALLEL_STMT. */
- static inline tree *
- gimple_omp_parallel_clauses_ptr (gomp_parallel *omp_parallel_stmt)
- {
- return &omp_parallel_stmt->clauses;
- }
- /* Set CLAUSES to be the list of clauses associated with OMP_PARALLEL_STMT. */
- static inline void
- gimple_omp_parallel_set_clauses (gomp_parallel *omp_parallel_stmt,
- tree clauses)
- {
- omp_parallel_stmt->clauses = clauses;
- }
- /* Return the child function used to hold the body of OMP_PARALLEL_STMT. */
- static inline tree
- gimple_omp_parallel_child_fn (const gomp_parallel *omp_parallel_stmt)
- {
- return omp_parallel_stmt->child_fn;
- }
- /* Return a pointer to the child function used to hold the body of
- OMP_PARALLEL_STMT. */
- static inline tree *
- gimple_omp_parallel_child_fn_ptr (gomp_parallel *omp_parallel_stmt)
- {
- return &omp_parallel_stmt->child_fn;
- }
- /* Set CHILD_FN to be the child function for OMP_PARALLEL_STMT. */
- static inline void
- gimple_omp_parallel_set_child_fn (gomp_parallel *omp_parallel_stmt,
- tree child_fn)
- {
- omp_parallel_stmt->child_fn = child_fn;
- }
- /* Return the artificial argument used to send variables and values
- from the parent to the children threads in OMP_PARALLEL_STMT. */
- static inline tree
- gimple_omp_parallel_data_arg (const gomp_parallel *omp_parallel_stmt)
- {
- return omp_parallel_stmt->data_arg;
- }
- /* Return a pointer to the data argument for OMP_PARALLEL_STMT. */
- static inline tree *
- gimple_omp_parallel_data_arg_ptr (gomp_parallel *omp_parallel_stmt)
- {
- return &omp_parallel_stmt->data_arg;
- }
- /* Set DATA_ARG to be the data argument for OMP_PARALLEL_STMT. */
- static inline void
- gimple_omp_parallel_set_data_arg (gomp_parallel *omp_parallel_stmt,
- tree data_arg)
- {
- omp_parallel_stmt->data_arg = data_arg;
- }
- /* Return the clauses associated with OMP_TASK GS. */
- static inline tree
- gimple_omp_task_clauses (const_gimple gs)
- {
- const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
- return omp_task_stmt->clauses;
- }
- /* Return a pointer to the clauses associated with OMP_TASK GS. */
- static inline tree *
- gimple_omp_task_clauses_ptr (gimple gs)
- {
- gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
- return &omp_task_stmt->clauses;
- }
- /* Set CLAUSES to be the list of clauses associated with OMP_TASK
- GS. */
- static inline void
- gimple_omp_task_set_clauses (gimple gs, tree clauses)
- {
- gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
- omp_task_stmt->clauses = clauses;
- }
- /* Return the child function used to hold the body of OMP_TASK GS. */
- static inline tree
- gimple_omp_task_child_fn (const_gimple gs)
- {
- const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
- return omp_task_stmt->child_fn;
- }
- /* Return a pointer to the child function used to hold the body of
- OMP_TASK GS. */
- static inline tree *
- gimple_omp_task_child_fn_ptr (gimple gs)
- {
- gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
- return &omp_task_stmt->child_fn;
- }
- /* Set CHILD_FN to be the child function for OMP_TASK GS. */
- static inline void
- gimple_omp_task_set_child_fn (gimple gs, tree child_fn)
- {
- gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
- omp_task_stmt->child_fn = child_fn;
- }
- /* Return the artificial argument used to send variables and values
- from the parent to the children threads in OMP_TASK GS. */
- static inline tree
- gimple_omp_task_data_arg (const_gimple gs)
- {
- const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
- return omp_task_stmt->data_arg;
- }
- /* Return a pointer to the data argument for OMP_TASK GS. */
- static inline tree *
- gimple_omp_task_data_arg_ptr (gimple gs)
- {
- gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
- return &omp_task_stmt->data_arg;
- }
- /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
- static inline void
- gimple_omp_task_set_data_arg (gimple gs, tree data_arg)
- {
- gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
- omp_task_stmt->data_arg = data_arg;
- }
- /* Return the clauses associated with OMP_TASK GS. */
- static inline tree
- gimple_omp_taskreg_clauses (const_gimple gs)
- {
- const gimple_statement_omp_taskreg *omp_taskreg_stmt
- = as_a <const gimple_statement_omp_taskreg *> (gs);
- return omp_taskreg_stmt->clauses;
- }
- /* Return a pointer to the clauses associated with OMP_TASK GS. */
- static inline tree *
- gimple_omp_taskreg_clauses_ptr (gimple gs)
- {
- gimple_statement_omp_taskreg *omp_taskreg_stmt
- = as_a <gimple_statement_omp_taskreg *> (gs);
- return &omp_taskreg_stmt->clauses;
- }
- /* Set CLAUSES to be the list of clauses associated with OMP_TASK
- GS. */
- static inline void
- gimple_omp_taskreg_set_clauses (gimple gs, tree clauses)
- {
- gimple_statement_omp_taskreg *omp_taskreg_stmt
- = as_a <gimple_statement_omp_taskreg *> (gs);
- omp_taskreg_stmt->clauses = clauses;
- }
- /* Return the child function used to hold the body of OMP_TASK GS. */
- static inline tree
- gimple_omp_taskreg_child_fn (const_gimple gs)
- {
- const gimple_statement_omp_taskreg *omp_taskreg_stmt
- = as_a <const gimple_statement_omp_taskreg *> (gs);
- return omp_taskreg_stmt->child_fn;
- }
- /* Return a pointer to the child function used to hold the body of
- OMP_TASK GS. */
- static inline tree *
- gimple_omp_taskreg_child_fn_ptr (gimple gs)
- {
- gimple_statement_omp_taskreg *omp_taskreg_stmt
- = as_a <gimple_statement_omp_taskreg *> (gs);
- return &omp_taskreg_stmt->child_fn;
- }
- /* Set CHILD_FN to be the child function for OMP_TASK GS. */
- static inline void
- gimple_omp_taskreg_set_child_fn (gimple gs, tree child_fn)
- {
- gimple_statement_omp_taskreg *omp_taskreg_stmt
- = as_a <gimple_statement_omp_taskreg *> (gs);
- omp_taskreg_stmt->child_fn = child_fn;
- }
- /* Return the artificial argument used to send variables and values
- from the parent to the children threads in OMP_TASK GS. */
- static inline tree
- gimple_omp_taskreg_data_arg (const_gimple gs)
- {
- const gimple_statement_omp_taskreg *omp_taskreg_stmt
- = as_a <const gimple_statement_omp_taskreg *> (gs);
- return omp_taskreg_stmt->data_arg;
- }
- /* Return a pointer to the data argument for OMP_TASK GS. */
- static inline tree *
- gimple_omp_taskreg_data_arg_ptr (gimple gs)
- {
- gimple_statement_omp_taskreg *omp_taskreg_stmt
- = as_a <gimple_statement_omp_taskreg *> (gs);
- return &omp_taskreg_stmt->data_arg;
- }
- /* Set DATA_ARG to be the data argument for OMP_TASK GS. */
- static inline void
- gimple_omp_taskreg_set_data_arg (gimple gs, tree data_arg)
- {
- gimple_statement_omp_taskreg *omp_taskreg_stmt
- = as_a <gimple_statement_omp_taskreg *> (gs);
- omp_taskreg_stmt->data_arg = data_arg;
- }
- /* Return the copy function used to hold the body of OMP_TASK GS. */
- static inline tree
- gimple_omp_task_copy_fn (const_gimple gs)
- {
- const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
- return omp_task_stmt->copy_fn;
- }
- /* Return a pointer to the copy function used to hold the body of
- OMP_TASK GS. */
- static inline tree *
- gimple_omp_task_copy_fn_ptr (gimple gs)
- {
- gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
- return &omp_task_stmt->copy_fn;
- }
- /* Set CHILD_FN to be the copy function for OMP_TASK GS. */
- static inline void
- gimple_omp_task_set_copy_fn (gimple gs, tree copy_fn)
- {
- gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
- omp_task_stmt->copy_fn = copy_fn;
- }
- /* Return size of the data block in bytes in OMP_TASK GS. */
- static inline tree
- gimple_omp_task_arg_size (const_gimple gs)
- {
- const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
- return omp_task_stmt->arg_size;
- }
- /* Return a pointer to the data block size for OMP_TASK GS. */
- static inline tree *
- gimple_omp_task_arg_size_ptr (gimple gs)
- {
- gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
- return &omp_task_stmt->arg_size;
- }
- /* Set ARG_SIZE to be the data block size for OMP_TASK GS. */
- static inline void
- gimple_omp_task_set_arg_size (gimple gs, tree arg_size)
- {
- gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
- omp_task_stmt->arg_size = arg_size;
- }
- /* Return align of the data block in bytes in OMP_TASK GS. */
- static inline tree
- gimple_omp_task_arg_align (const_gimple gs)
- {
- const gomp_task *omp_task_stmt = as_a <const gomp_task *> (gs);
- return omp_task_stmt->arg_align;
- }
- /* Return a pointer to the data block align for OMP_TASK GS. */
- static inline tree *
- gimple_omp_task_arg_align_ptr (gimple gs)
- {
- gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
- return &omp_task_stmt->arg_align;
- }
- /* Set ARG_SIZE to be the data block align for OMP_TASK GS. */
- static inline void
- gimple_omp_task_set_arg_align (gimple gs, tree arg_align)
- {
- gomp_task *omp_task_stmt = as_a <gomp_task *> (gs);
- omp_task_stmt->arg_align = arg_align;
- }
- /* Return the clauses associated with OMP_SINGLE GS. */
- static inline tree
- gimple_omp_single_clauses (const_gimple gs)
- {
- const gomp_single *omp_single_stmt = as_a <const gomp_single *> (gs);
- return omp_single_stmt->clauses;
- }
- /* Return a pointer to the clauses associated with OMP_SINGLE GS. */
- static inline tree *
- gimple_omp_single_clauses_ptr (gimple gs)
- {
- gomp_single *omp_single_stmt = as_a <gomp_single *> (gs);
- return &omp_single_stmt->clauses;
- }
- /* Set CLAUSES to be the clauses associated with OMP_SINGLE_STMT. */
- static inline void
- gimple_omp_single_set_clauses (gomp_single *omp_single_stmt, tree clauses)
- {
- omp_single_stmt->clauses = clauses;
- }
- /* Return the clauses associated with OMP_TARGET GS. */
- static inline tree
- gimple_omp_target_clauses (const_gimple gs)
- {
- const gomp_target *omp_target_stmt = as_a <const gomp_target *> (gs);
- return omp_target_stmt->clauses;
- }
- /* Return a pointer to the clauses associated with OMP_TARGET GS. */
- static inline tree *
- gimple_omp_target_clauses_ptr (gimple gs)
- {
- gomp_target *omp_target_stmt = as_a <gomp_target *> (gs);
- return &omp_target_stmt->clauses;
- }
- /* Set CLAUSES to be the clauses associated with OMP_TARGET_STMT. */
- static inline void
- gimple_omp_target_set_clauses (gomp_target *omp_target_stmt,
- tree clauses)
- {
- omp_target_stmt->clauses = clauses;
- }
- /* Return the kind of the OMP_TARGET G. */
- static inline int
- gimple_omp_target_kind (const_gimple g)
- {
- GIMPLE_CHECK (g, GIMPLE_OMP_TARGET);
- return (gimple_omp_subcode (g) & GF_OMP_TARGET_KIND_MASK);
- }
- /* Set the kind of the OMP_TARGET G. */
- static inline void
- gimple_omp_target_set_kind (gomp_target *g, int kind)
- {
- g->subcode = (g->subcode & ~GF_OMP_TARGET_KIND_MASK)
- | (kind & GF_OMP_TARGET_KIND_MASK);
- }
- /* Return the child function used to hold the body of OMP_TARGET_STMT. */
- static inline tree
- gimple_omp_target_child_fn (const gomp_target *omp_target_stmt)
- {
- return omp_target_stmt->child_fn;
- }
- /* Return a pointer to the child function used to hold the body of
- OMP_TARGET_STMT. */
- static inline tree *
- gimple_omp_target_child_fn_ptr (gomp_target *omp_target_stmt)
- {
- return &omp_target_stmt->child_fn;
- }
- /* Set CHILD_FN to be the child function for OMP_TARGET_STMT. */
- static inline void
- gimple_omp_target_set_child_fn (gomp_target *omp_target_stmt,
- tree child_fn)
- {
- omp_target_stmt->child_fn = child_fn;
- }
- /* Return the artificial argument used to send variables and values
- from the parent to the children threads in OMP_TARGET_STMT. */
- static inline tree
- gimple_omp_target_data_arg (const gomp_target *omp_target_stmt)
- {
- return omp_target_stmt->data_arg;
- }
- /* Return a pointer to the data argument for OMP_TARGET GS. */
- static inline tree *
- gimple_omp_target_data_arg_ptr (gomp_target *omp_target_stmt)
- {
- return &omp_target_stmt->data_arg;
- }
- /* Set DATA_ARG to be the data argument for OMP_TARGET_STMT. */
- static inline void
- gimple_omp_target_set_data_arg (gomp_target *omp_target_stmt,
- tree data_arg)
- {
- omp_target_stmt->data_arg = data_arg;
- }
- /* Return the clauses associated with OMP_TEAMS GS. */
- static inline tree
- gimple_omp_teams_clauses (const_gimple gs)
- {
- const gomp_teams *omp_teams_stmt = as_a <const gomp_teams *> (gs);
- return omp_teams_stmt->clauses;
- }
- /* Return a pointer to the clauses associated with OMP_TEAMS GS. */
- static inline tree *
- gimple_omp_teams_clauses_ptr (gimple gs)
- {
- gomp_teams *omp_teams_stmt = as_a <gomp_teams *> (gs);
- return &omp_teams_stmt->clauses;
- }
- /* Set CLAUSES to be the clauses associated with OMP_TEAMS_STMT. */
- static inline void
- gimple_omp_teams_set_clauses (gomp_teams *omp_teams_stmt, tree clauses)
- {
- omp_teams_stmt->clauses = clauses;
- }
- /* Return the clauses associated with OMP_SECTIONS GS. */
- static inline tree
- gimple_omp_sections_clauses (const_gimple gs)
- {
- const gomp_sections *omp_sections_stmt = as_a <const gomp_sections *> (gs);
- return omp_sections_stmt->clauses;
- }
- /* Return a pointer to the clauses associated with OMP_SECTIONS GS. */
- static inline tree *
- gimple_omp_sections_clauses_ptr (gimple gs)
- {
- gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
- return &omp_sections_stmt->clauses;
- }
- /* Set CLAUSES to be the set of clauses associated with OMP_SECTIONS
- GS. */
- static inline void
- gimple_omp_sections_set_clauses (gimple gs, tree clauses)
- {
- gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
- omp_sections_stmt->clauses = clauses;
- }
- /* Return the control variable associated with the GIMPLE_OMP_SECTIONS
- in GS. */
- static inline tree
- gimple_omp_sections_control (const_gimple gs)
- {
- const gomp_sections *omp_sections_stmt = as_a <const gomp_sections *> (gs);
- return omp_sections_stmt->control;
- }
- /* Return a pointer to the clauses associated with the GIMPLE_OMP_SECTIONS
- GS. */
- static inline tree *
- gimple_omp_sections_control_ptr (gimple gs)
- {
- gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
- return &omp_sections_stmt->control;
- }
- /* Set CONTROL to be the set of clauses associated with the
- GIMPLE_OMP_SECTIONS in GS. */
- static inline void
- gimple_omp_sections_set_control (gimple gs, tree control)
- {
- gomp_sections *omp_sections_stmt = as_a <gomp_sections *> (gs);
- omp_sections_stmt->control = control;
- }
- /* Set the value being stored in an atomic store. */
- static inline void
- gimple_omp_atomic_store_set_val (gomp_atomic_store *store_stmt, tree val)
- {
- store_stmt->val = val;
- }
- /* Return the value being stored in an atomic store. */
- static inline tree
- gimple_omp_atomic_store_val (const gomp_atomic_store *store_stmt)
- {
- return store_stmt->val;
- }
- /* Return a pointer to the value being stored in an atomic store. */
- static inline tree *
- gimple_omp_atomic_store_val_ptr (gomp_atomic_store *store_stmt)
- {
- return &store_stmt->val;
- }
- /* Set the LHS of an atomic load. */
- static inline void
- gimple_omp_atomic_load_set_lhs (gomp_atomic_load *load_stmt, tree lhs)
- {
- load_stmt->lhs = lhs;
- }
- /* Get the LHS of an atomic load. */
- static inline tree
- gimple_omp_atomic_load_lhs (const gomp_atomic_load *load_stmt)
- {
- return load_stmt->lhs;
- }
- /* Return a pointer to the LHS of an atomic load. */
- static inline tree *
- gimple_omp_atomic_load_lhs_ptr (gomp_atomic_load *load_stmt)
- {
- return &load_stmt->lhs;
- }
- /* Set the RHS of an atomic load. */
- static inline void
- gimple_omp_atomic_load_set_rhs (gomp_atomic_load *load_stmt, tree rhs)
- {
- load_stmt->rhs = rhs;
- }
- /* Get the RHS of an atomic load. */
- static inline tree
- gimple_omp_atomic_load_rhs (const gomp_atomic_load *load_stmt)
- {
- return load_stmt->rhs;
- }
- /* Return a pointer to the RHS of an atomic load. */
- static inline tree *
- gimple_omp_atomic_load_rhs_ptr (gomp_atomic_load *load_stmt)
- {
- return &load_stmt->rhs;
- }
- /* Get the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
- static inline tree
- gimple_omp_continue_control_def (const gomp_continue *cont_stmt)
- {
- return cont_stmt->control_def;
- }
- /* The same as above, but return the address. */
- static inline tree *
- gimple_omp_continue_control_def_ptr (gomp_continue *cont_stmt)
- {
- return &cont_stmt->control_def;
- }
- /* Set the definition of the control variable in a GIMPLE_OMP_CONTINUE. */
- static inline void
- gimple_omp_continue_set_control_def (gomp_continue *cont_stmt, tree def)
- {
- cont_stmt->control_def = def;
- }
- /* Get the use of the control variable in a GIMPLE_OMP_CONTINUE. */
- static inline tree
- gimple_omp_continue_control_use (const gomp_continue *cont_stmt)
- {
- return cont_stmt->control_use;
- }
- /* The same as above, but return the address. */
- static inline tree *
- gimple_omp_continue_control_use_ptr (gomp_continue *cont_stmt)
- {
- return &cont_stmt->control_use;
- }
- /* Set the use of the control variable in a GIMPLE_OMP_CONTINUE. */
- static inline void
- gimple_omp_continue_set_control_use (gomp_continue *cont_stmt, tree use)
- {
- cont_stmt->control_use = use;
- }
- /* Return a pointer to the body for the GIMPLE_TRANSACTION statement
- TRANSACTION_STMT. */
- static inline gimple_seq *
- gimple_transaction_body_ptr (gtransaction *transaction_stmt)
- {
- return &transaction_stmt->body;
- }
- /* Return the body for the GIMPLE_TRANSACTION statement TRANSACTION_STMT. */
- static inline gimple_seq
- gimple_transaction_body (gtransaction *transaction_stmt)
- {
- return *gimple_transaction_body_ptr (transaction_stmt);
- }
- /* Return the label associated with a GIMPLE_TRANSACTION. */
- static inline tree
- gimple_transaction_label (const gtransaction *transaction_stmt)
- {
- return transaction_stmt->label;
- }
- static inline tree *
- gimple_transaction_label_ptr (gtransaction *transaction_stmt)
- {
- return &transaction_stmt->label;
- }
- /* Return the subcode associated with a GIMPLE_TRANSACTION. */
- static inline unsigned int
- gimple_transaction_subcode (const gtransaction *transaction_stmt)
- {
- return transaction_stmt->subcode;
- }
- /* Set BODY to be the body for the GIMPLE_TRANSACTION statement
- TRANSACTION_STMT. */
- static inline void
- gimple_transaction_set_body (gtransaction *transaction_stmt,
- gimple_seq body)
- {
- transaction_stmt->body = body;
- }
- /* Set the label associated with a GIMPLE_TRANSACTION. */
- static inline void
- gimple_transaction_set_label (gtransaction *transaction_stmt, tree label)
- {
- transaction_stmt->label = label;
- }
- /* Set the subcode associated with a GIMPLE_TRANSACTION. */
- static inline void
- gimple_transaction_set_subcode (gtransaction *transaction_stmt,
- unsigned int subcode)
- {
- transaction_stmt->subcode = subcode;
- }
- /* Return a pointer to the return value for GIMPLE_RETURN GS. */
- static inline tree *
- gimple_return_retval_ptr (const greturn *gs)
- {
- return gimple_op_ptr (gs, 0);
- }
- /* Return the return value for GIMPLE_RETURN GS. */
- static inline tree
- gimple_return_retval (const greturn *gs)
- {
- return gimple_op (gs, 0);
- }
- /* Set RETVAL to be the return value for GIMPLE_RETURN GS. */
- static inline void
- gimple_return_set_retval (greturn *gs, tree retval)
- {
- gimple_set_op (gs, 0, retval);
- }
- /* Return the return bounds for GIMPLE_RETURN GS. */
- static inline tree
- gimple_return_retbnd (const_gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_RETURN);
- return gimple_op (gs, 1);
- }
- /* Set RETVAL to be the return bounds for GIMPLE_RETURN GS. */
- static inline void
- gimple_return_set_retbnd (gimple gs, tree retval)
- {
- GIMPLE_CHECK (gs, GIMPLE_RETURN);
- gimple_set_op (gs, 1, retval);
- }
- /* Returns true when the gimple statement STMT is any of the OMP types. */
- #define CASE_GIMPLE_OMP \
- case GIMPLE_OMP_PARALLEL: \
- case GIMPLE_OMP_TASK: \
- case GIMPLE_OMP_FOR: \
- case GIMPLE_OMP_SECTIONS: \
- case GIMPLE_OMP_SECTIONS_SWITCH: \
- case GIMPLE_OMP_SINGLE: \
- case GIMPLE_OMP_TARGET: \
- case GIMPLE_OMP_TEAMS: \
- case GIMPLE_OMP_SECTION: \
- case GIMPLE_OMP_MASTER: \
- case GIMPLE_OMP_TASKGROUP: \
- case GIMPLE_OMP_ORDERED: \
- case GIMPLE_OMP_CRITICAL: \
- case GIMPLE_OMP_RETURN: \
- case GIMPLE_OMP_ATOMIC_LOAD: \
- case GIMPLE_OMP_ATOMIC_STORE: \
- case GIMPLE_OMP_CONTINUE
- static inline bool
- is_gimple_omp (const_gimple stmt)
- {
- switch (gimple_code (stmt))
- {
- CASE_GIMPLE_OMP:
- return true;
- default:
- return false;
- }
- }
- /* Return true if the OMP gimple statement STMT is any of the OpenACC types
- specifically. */
- static inline bool
- is_gimple_omp_oacc (const_gimple stmt)
- {
- gcc_assert (is_gimple_omp (stmt));
- switch (gimple_code (stmt))
- {
- case GIMPLE_OMP_FOR:
- switch (gimple_omp_for_kind (stmt))
- {
- case GF_OMP_FOR_KIND_OACC_LOOP:
- return true;
- default:
- return false;
- }
- case GIMPLE_OMP_TARGET:
- switch (gimple_omp_target_kind (stmt))
- {
- case GF_OMP_TARGET_KIND_OACC_PARALLEL:
- case GF_OMP_TARGET_KIND_OACC_KERNELS:
- case GF_OMP_TARGET_KIND_OACC_DATA:
- case GF_OMP_TARGET_KIND_OACC_UPDATE:
- case GF_OMP_TARGET_KIND_OACC_ENTER_EXIT_DATA:
- return true;
- default:
- return false;
- }
- default:
- return false;
- }
- }
- /* Return true if the OMP gimple statement STMT is offloaded. */
- static inline bool
- is_gimple_omp_offloaded (const_gimple stmt)
- {
- gcc_assert (is_gimple_omp (stmt));
- switch (gimple_code (stmt))
- {
- case GIMPLE_OMP_TARGET:
- switch (gimple_omp_target_kind (stmt))
- {
- case GF_OMP_TARGET_KIND_REGION:
- case GF_OMP_TARGET_KIND_OACC_PARALLEL:
- case GF_OMP_TARGET_KIND_OACC_KERNELS:
- return true;
- default:
- return false;
- }
- default:
- return false;
- }
- }
- /* Returns TRUE if statement G is a GIMPLE_NOP. */
- static inline bool
- gimple_nop_p (const_gimple g)
- {
- return gimple_code (g) == GIMPLE_NOP;
- }
- /* Return true if GS is a GIMPLE_RESX. */
- static inline bool
- is_gimple_resx (const_gimple gs)
- {
- return gimple_code (gs) == GIMPLE_RESX;
- }
- /* Return the predictor of GIMPLE_PREDICT statement GS. */
- static inline enum br_predictor
- gimple_predict_predictor (gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_PREDICT);
- return (enum br_predictor) (gs->subcode & ~GF_PREDICT_TAKEN);
- }
- /* Set the predictor of GIMPLE_PREDICT statement GS to PREDICT. */
- static inline void
- gimple_predict_set_predictor (gimple gs, enum br_predictor predictor)
- {
- GIMPLE_CHECK (gs, GIMPLE_PREDICT);
- gs->subcode = (gs->subcode & GF_PREDICT_TAKEN)
- | (unsigned) predictor;
- }
- /* Return the outcome of GIMPLE_PREDICT statement GS. */
- static inline enum prediction
- gimple_predict_outcome (gimple gs)
- {
- GIMPLE_CHECK (gs, GIMPLE_PREDICT);
- return (gs->subcode & GF_PREDICT_TAKEN) ? TAKEN : NOT_TAKEN;
- }
- /* Set the outcome of GIMPLE_PREDICT statement GS to OUTCOME. */
- static inline void
- gimple_predict_set_outcome (gimple gs, enum prediction outcome)
- {
- GIMPLE_CHECK (gs, GIMPLE_PREDICT);
- if (outcome == TAKEN)
- gs->subcode |= GF_PREDICT_TAKEN;
- else
- gs->subcode &= ~GF_PREDICT_TAKEN;
- }
- /* Return the type of the main expression computed by STMT. Return
- void_type_node if the statement computes nothing. */
- static inline tree
- gimple_expr_type (const_gimple stmt)
- {
- enum gimple_code code = gimple_code (stmt);
- if (code == GIMPLE_ASSIGN || code == GIMPLE_CALL)
- {
- tree type;
- /* In general we want to pass out a type that can be substituted
- for both the RHS and the LHS types if there is a possibly
- useless conversion involved. That means returning the
- original RHS type as far as we can reconstruct it. */
- if (code == GIMPLE_CALL)
- {
- const gcall *call_stmt = as_a <const gcall *> (stmt);
- if (gimple_call_internal_p (call_stmt)
- && gimple_call_internal_fn (call_stmt) == IFN_MASK_STORE)
- type = TREE_TYPE (gimple_call_arg (call_stmt, 3));
- else
- type = gimple_call_return_type (call_stmt);
- }
- else
- switch (gimple_assign_rhs_code (stmt))
- {
- case POINTER_PLUS_EXPR:
- type = TREE_TYPE (gimple_assign_rhs1 (stmt));
- break;
- default:
- /* As fallback use the type of the LHS. */
- type = TREE_TYPE (gimple_get_lhs (stmt));
- break;
- }
- return type;
- }
- else if (code == GIMPLE_COND)
- return boolean_type_node;
- else
- return void_type_node;
- }
- /* Enum and arrays used for allocation stats. Keep in sync with
- gimple.c:gimple_alloc_kind_names. */
- enum gimple_alloc_kind
- {
- gimple_alloc_kind_assign, /* Assignments. */
- gimple_alloc_kind_phi, /* PHI nodes. */
- gimple_alloc_kind_cond, /* Conditionals. */
- gimple_alloc_kind_rest, /* Everything else. */
- gimple_alloc_kind_all
- };
- extern int gimple_alloc_counts[];
- extern int gimple_alloc_sizes[];
- /* Return the allocation kind for a given stmt CODE. */
- static inline enum gimple_alloc_kind
- gimple_alloc_kind (enum gimple_code code)
- {
- switch (code)
- {
- case GIMPLE_ASSIGN:
- return gimple_alloc_kind_assign;
- case GIMPLE_PHI:
- return gimple_alloc_kind_phi;
- case GIMPLE_COND:
- return gimple_alloc_kind_cond;
- default:
- return gimple_alloc_kind_rest;
- }
- }
- /* Return true if a location should not be emitted for this statement
- by annotate_all_with_location. */
- static inline bool
- gimple_do_not_emit_location_p (gimple g)
- {
- return gimple_plf (g, GF_PLF_1);
- }
- /* Mark statement G so a location will not be emitted by
- annotate_one_with_location. */
- static inline void
- gimple_set_do_not_emit_location (gimple g)
- {
- /* The PLF flags are initialized to 0 when a new tuple is created,
- so no need to initialize it anywhere. */
- gimple_set_plf (g, GF_PLF_1, true);
- }
- /* Macros for showing usage statistics. */
- #define SCALE(x) ((unsigned long) ((x) < 1024*10 \
- ? (x) \
- : ((x) < 1024*1024*10 \
- ? (x) / 1024 \
- : (x) / (1024*1024))))
- #define LABEL(x) ((x) < 1024*10 ? 'b' : ((x) < 1024*1024*10 ? 'k' : 'M'))
- #endif /* GCC_GIMPLE_H */
|