Skip to content

Source-to-source transformation of C programs to implement call-by-name parameter passing method. The tool is built using clang AST and relies on Clang ASTVisitor (for reading the code) and Rewriter (for rewriting the code). The code is modified by appropriately adding nodes in the clang AST.

Notifications You must be signed in to change notification settings

shwetaiisc/call-by-name-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

*****************************CONTENT**********************************
Directories:
	1. call-by-name: contains the implementation source
	2. build: build directory
	3. testcases: contains c programs for testing
Files:
	call-by-name/callByName.cpp: source implementation
	check.sh: a script to check the source-to-source conversion
		  for all testcases.


 
********************************BUILD*********************************
(1) Update the following paths based on your installation:
	LLVM_SRC_PATH
	LLVM_BUILD_PATH
	LLVM_BIN_PATH

	For Example:
	LLVM_SRC_PATH := /home/panwar/work/compiler_project/llvm-project/
	LLVM_BUILD_PATH := /home/panwar/work/compiler_project/llvm-project/build
	LLVM_BIN_PATH 	:= $(LLVM_BUILD_PATH)/bin

(2) Compile using "make"

**********************************RUN*********************************
Suppy a file name to run. For example:
./build/callByName test.c

This will generate an "output.c" file in current directory. The output
file contains the transformed code that uses call-by-name calling convention
for parameter passing.

***************************TESTING ALL TESTCASES*********************
Run the following commands:
	1. chmod +x check.sh
	2. ./check.sh

This will execute code transformation, compile and run the output c code
for all test cases.

******************************CleanUp*********************************
clean using "make clean"

About

Source-to-source transformation of C programs to implement call-by-name parameter passing method. The tool is built using clang AST and relies on Clang ASTVisitor (for reading the code) and Rewriter (for rewriting the code). The code is modified by appropriately adding nodes in the clang AST.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published