diff --git a/cmake_example/CMakeLists.txt b/cmake_example/CMakeLists.txt index 032b4a7..9613ca1 100644 --- a/cmake_example/CMakeLists.txt +++ b/cmake_example/CMakeLists.txt @@ -12,6 +12,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall -O3 -mcmodel=medium") set(SOURCE_FILES example.c + C://msys64//clang64//include//math.h ) @@ -25,4 +26,5 @@ find_package(Clava REQUIRED) # Call AutoPar #clava_weave(example SeparateFunctions.mjs) -clava_weave(example ExtractSymbols.mjs) +#clava_weave(example ExtractSymbols.mjs) +clava_weave(example ExtractHeaderInfo.mjs FLAGS -pi -ist 0) diff --git a/cmake_example/ExtractHeaderInfo.mjs b/cmake_example/ExtractHeaderInfo.mjs new file mode 100644 index 0000000..ffd8bdb --- /dev/null +++ b/cmake_example/ExtractHeaderInfo.mjs @@ -0,0 +1,13 @@ +laraImport("weaver.Query"); + +for (const f of Query.search("file", "math.h").search("function", n => !n.startsWith("_"))) { + + console.log(f.name + " -> " + f.type + "\n"); + const functionType = f.functionType; +// console.log("F TYPE: " + functionType.joinPointType) + console.log("Params: \n"); + for(const p of functionType.paramTypes) { + console.log(p.code + "\n"); + } + console.log("Return: " + functionType.returnType.code + "\n"); +} diff --git a/cmake_example/example.c b/cmake_example/example.c index bbe7cd0..bdf6be7 100644 --- a/cmake_example/example.c +++ b/cmake_example/example.c @@ -1,3 +1,5 @@ +#include "math.h" + static int global = 0; struct s { diff --git a/cmake_example/test.clava b/cmake_example/test.clava new file mode 100644 index 0000000..0b96b5c --- /dev/null +++ b/cmake_example/test.clava @@ -0,0 +1,239 @@ + + LaraI Options + + + workspace + + + example.c + C:\msys64\clang64\include\math.h + + + + + library includes + + + + + + main + + + + output + + + + parsingNumThreads + 0 + + + libcCxxMode + SYSTEM + + + cudaGpuArch + sm_30 + + + parseIncludes + true + + + javascript + false + + + Disable Remote Dependencies + false + + + joptions_current_folder_path + + + + Generate Modified Code Only + false + + + parallelParsing + true + + + api_autoload + true + + + continueOnParsingErrors + false + + + Weaved code foldername + woven_code + + + external_dependencies + + + + + + Disable Weaving + false + + + metrics + + + false + + + + C/C++ Standard + GNUXX11 + + + workspace_extra + + + + Clava Custom Resources + false + + + restrict mode + false + + + loc + false + + + Disable Code Generation + true + + + log + + + false + + + + autoimportjs + false + + + Clean intermediate files + true + + + systemIncludesThreshold + 2 + + + argv + + + + tools + + + false + + + + jsEngine + GRAALVM_COMPAT + + + flatOutputFolder + false + + + bundle_tags + + + + customClangAstDumperExe + + + + Compiler Flags + + + + Compiler Flags in list format + + + -Wno-narrowing + -Wno-deprecated-register + -Wno-unused-value + + + + + Check C/CXX Syntax + false + + + aspect + ExtractHeaderInfo.mjs + + + ignoreHeaderIncludes + + + + + + cudaPath + + + + stack trace + true + + + include + + + + + + debug + false + + + Disable Clava Info + false + + + Copy files in sources + false + + + Generate CMake Integration Helper Files + false + + + verbose + warnings + + + header includes + + + + + + report + + + false + + + + false + \ No newline at end of file