{"id":{"repo_id":"ku","oai_identifier":"oai:kuscholarworks.ku.edu:1808/36879"},"canonical_url":"https://search.ndltd.org/etd/ku/oai:kuscholarworks.ku.edu:1808/36879","repository":{"repo_id":"ku","name":"University of Kansas","base_url":"https://kuscholarworks.ku.edu/server/oai/request"},"display":{"title":"Source-to-Source Refactoring Framework for Local and Global Variables","abstract":"A global variable in C/C++ programs is one that is declared outside a function, and whose scope extends the lifetime of the entire program. Global variables have been shown to cause problems for program maintainability, extensibility, dependence, verification, and thread-safety. Consequently, the use of global variables has been disparaged in many programming textbooks and coding guides. However, employing global variables can also make coding more convenient. We have found that the use of global variables remains unabated and extensive in most real-world software programs. In this work we present our source-to-source refactoring tool to automatically detect and localize global variables in a program. Our tool implements a compiler based transformation algorithm that finds the best location to move and redefine each global variable as a local. For each global variable, our algorithm initializes the corresponding new local variable, and passes it as an argument to all functions that need it, and updates the source code lines that used the original global variable to now instead use the corresponding local or function argument, thus maintaining the original program semantics. In this work we further characterize the nature of how global variables are employed in common benchmark programs. We further study the effect of our transformation on static program properties, such as the change in the number of function arguments and visibility of program state. Additionally, we also quantify the effect of localizing global variables on dynamic program characteristics, including the change in data and stack memory usage and runtime program performance.","abstract_html":"A global variable in C/C++ programs is one that is declared outside a function, and whose scope extends the lifetime of the entire program. Global variables have been shown to cause problems for program maintainability, extensibility, dependence, verification, and thread-safety. Consequently, the use of global variables has been disparaged in many programming textbooks and coding guides. However, employing global variables can also make coding more convenient. We have found that the use of global variables remains unabated and extensive in most real-world software programs. In this work we present our source-to-source refactoring tool to automatically detect and localize global variables in a program. Our tool implements a compiler based transformation algorithm that finds the best location to move and redefine each global variable as a local. For each global variable, our algorithm initializes the corresponding new local variable, and passes it as an argument to all functions that need it, and updates the source code lines that used the original global variable to now instead use the corresponding local or function argument, thus maintaining the original program semantics. In this work we further characterize the nature of how global variables are employed in common benchmark programs. We further study the effect of our transformation on static program properties, such as the change in the number of function arguments and visibility of program state. Additionally, we also quantify the effect of localizing global variables on dynamic program characteristics, including the change in data and stack memory usage and runtime program performance.","abstract_has_math":false,"creators":["Sankaranarayanan, Hemaiyer"],"institution":"University of Kansas","degree_name":"M.S.","degree_level":null,"degree_discipline":"Electrical Engineering & Computer Science","degree_department":null,"school":null,"contributors":[],"advisors":["Kulkarni, Prasad"],"committee_chairs":[],"committee_members":["Gill, Andrew","Fu, Xin"],"year":2012,"date_issued":"2012-01-01","date_published":"2012-01-01","updated_at":"2026-11-19T05:00:05Z","subjects":["Computer engineering","Computer science","global","llvm","refactoring","variable"],"languages":["en"],"rights":["embargoedAccess","Copyright held by the author."],"rights_urls":[],"identifier_entries":[{"key":"dc:identifier.other","label":"Dc Identifier Other","values":["https://www.proquest.com/docview/1015030078"],"render_values":[{"text":"https://www.proquest.com/docview/1015030078","href":"https://www.proquest.com/docview/1015030078","code":true}]}],"person_identifier_entries":[]},"links":{"outbound_url":"https://hdl.handle.net/1808/36879","outbound_label":"Handle","outbound_source":"dc:identifier.uri","record_url":"https://hdl.handle.net/1808/36879","record_label":"Repository record","record_kind":"handle","record_source":"dc:identifier.uri","access_status":null,"embargo_until":null,"access_note":null},"oai_pmh_record":{"url":"https://union.ndltd.org/oai-pmh/?verb=GetRecord&metadataPrefix=oai_dc&identifier=oai%3Aunion.ndltd.org%3Arepo%3Aku%3Aoai%3Akuscholarworks.ku.edu%3A1808%2F36879","prefix":"oai_dc"},"source_record":{"url":"https://kuscholarworks.ku.edu/server/oai/request?verb=GetRecord&metadataPrefix=dim&identifier=oai%3Akuscholarworks.ku.edu%3A1808%2F36879","prefix":"dim"},"metadata_groups":[{"id":"people","label":"People","entries":[{"key":"dc:contributor.advisor","label":"Advisor","values":["Kulkarni, Prasad"]},{"key":"dc:contributor.committeemember","label":"Committee Member","values":["Gill, Andrew","Fu, Xin"]},{"key":"dc:creator","label":"Author","values":["Sankaranarayanan, Hemaiyer"]}]},{"id":"academic_context","label":"Academic Context","entries":[{"key":"dc:date.accessioned","label":"Dc Date Accessioned","values":["2026-04-13T03:27:02Z"]},{"key":"dc:date.available","label":"Dc Date Available","values":["2026-04-13T03:27:02Z"]},{"key":"dc:date.issued","label":"Date","values":["2012-01-01"]},{"key":"dc:date.submitted","label":"Dc Date Submitted","values":["2012"]},{"key":"dc:publisher","label":"Institution","values":["University of Kansas"]},{"key":"dc:type","label":"Dc Type","values":["Thesis"]},{"key":"thesis:degree_discipline","label":"Discipline","values":["Electrical Engineering & Computer Science"]},{"key":"thesis:degree_name","label":"Degree Name","values":["M.S."]}]},{"id":"subjects_keywords","label":"Subjects and Keywords","entries":[{"key":"dc:subject","label":"Dc Subject","values":["Computer engineering","Computer science","global","llvm","refactoring","variable"]}]},{"id":"language_rights","label":"Language and Rights","entries":[{"key":"dc:language.iso","label":"Language (ISO)","values":["en"]},{"key":"dc:rights","label":"Dc Rights","values":["Copyright held by the author."]},{"key":"dc:rights.accessrights","label":"Access Rights","values":["embargoedAccess"]}]},{"id":"identifiers","label":"Identifiers","entries":[{"key":"dc:identifier.other","label":"Dc Identifier Other","values":["https://www.proquest.com/docview/1015030078"]},{"key":"dc:identifier.uri","label":"Identifier URI","values":["https://hdl.handle.net/1808/36879"]}]},{"id":"additional","label":"Additional Metadata","entries":[{"key":"dc:description.abstract","label":"Abstract","values":["A global variable in C/C++ programs is one that is declared outside a function, and whose scope extends the lifetime of the entire program. Global variables have been shown to cause problems for program maintainability, extensibility, dependence, verification, and thread-safety. Consequently, the use of global variables has been disparaged in many programming textbooks and coding guides. However, employing global variables can also make coding more convenient. We have found that the use of global variables remains unabated and extensive in most real-world software programs. In this work we present our source-to-source refactoring tool to automatically detect and localize global variables in a program. Our tool implements a compiler based transformation algorithm that finds the best location to move and redefine each global variable as a local. For each global variable, our algorithm initializes the corresponding new local variable, and passes it as an argument to all functions that need it, and updates the source code lines that used the original global variable to now instead use the corresponding local or function argument, thus maintaining the original program semantics. In this work we further characterize the nature of how global variables are employed in common benchmark programs. We further study the effect of our transformation on static program properties, such as the change in the number of function arguments and visibility of program state. Additionally, we also quantify the effect of localizing global variables on dynamic program characteristics, including the change in data and stack memory usage and runtime program performance."]},{"key":"dc:description.note","label":"Dc Description Note","values":["This item contains archived web content."]},{"key":"dc:format.extent","label":"Dc Format Extent","values":["61 pages"]},{"key":"dc:title","label":"Title","values":["Source-to-Source Refactoring Framework for Local and Global Variables"]},{"key":"dspace:entity.type","label":"Dspace Entity Type","values":["Publication"]},{"key":"local:admin","label":"Local Admin","values":["This item does not meet KU Open Access policy criteria."]}]}],"canonical_facts":{"dc:contributor.advisor":["Kulkarni, Prasad"],"dc:contributor.committeemember":["Gill, Andrew","Fu, Xin"],"dc:creator":["Sankaranarayanan, Hemaiyer"],"dc:date.accessioned":["2026-04-13T03:27:02Z"],"dc:date.available":["2026-04-13T03:27:02Z"],"dc:date.issued":["2012-01-01"],"dc:date.submitted":["2012"],"dc:description.abstract":["A global variable in C/C++ programs is one that is declared outside a function, and whose scope extends the lifetime of the entire program. Global variables have been shown to cause problems for program maintainability, extensibility, dependence, verification, and thread-safety. Consequently, the use of global variables has been disparaged in many programming textbooks and coding guides. However, employing global variables can also make coding more convenient. We have found that the use of global variables remains unabated and extensive in most real-world software programs. In this work we present our source-to-source refactoring tool to automatically detect and localize global variables in a program. Our tool implements a compiler based transformation algorithm that finds the best location to move and redefine each global variable as a local. For each global variable, our algorithm initializes the corresponding new local variable, and passes it as an argument to all functions that need it, and updates the source code lines that used the original global variable to now instead use the corresponding local or function argument, thus maintaining the original program semantics. In this work we further characterize the nature of how global variables are employed in common benchmark programs. We further study the effect of our transformation on static program properties, such as the change in the number of function arguments and visibility of program state. Additionally, we also quantify the effect of localizing global variables on dynamic program characteristics, including the change in data and stack memory usage and runtime program performance."],"dc:description.note":["This item contains archived web content."],"dc:format.extent":["61 pages"],"dc:identifier.other":["https://www.proquest.com/docview/1015030078"],"dc:identifier.uri":["https://hdl.handle.net/1808/36879"],"dc:language.iso":["en"],"dc:publisher":["University of Kansas"],"dc:rights":["Copyright held by the author."],"dc:rights.accessrights":["embargoedAccess"],"dc:subject":["Computer engineering","Computer science","global","llvm","refactoring","variable"],"dc:title":["Source-to-Source Refactoring Framework for Local and Global Variables"],"dc:type":["Thesis"],"dspace:entity.type":["Publication"],"local:admin":["This item does not meet KU Open Access policy criteria."],"thesis:degree_discipline":["Electrical Engineering & Computer Science"],"thesis:degree_name":["M.S."]},"updated_at":"2026-11-19T05:00:05Z"}