All Projects → madhur13490 → LLVM-Metadata-Visualizer

madhur13490 / LLVM-Metadata-Visualizer

Licence: other
LLVM Metadata Visualizer

Programming Languages

C++
36643 projects - #6 most used programming language
Makefile
30231 projects
HTML
75241 projects

Projects that are alternatives of or similar to LLVM-Metadata-Visualizer

bl
Simple imperative programming language created for fun.
Stars: ✭ 57 (+185%)
Mutual labels:  llvm, llvm-ir
dart-tags
ID3 Tag parser written on the pure dart language.
Stars: ✭ 35 (+75%)
Mutual labels:  metadata, metadata-extraction
Mcsema
Framework for lifting x86, amd64, aarch64, sparc32, and sparc64 program binaries to LLVM bitcode
Stars: ✭ 2,198 (+10890%)
Mutual labels:  llvm, llvm-ir
llvm-hs-typed
Type Safe LLVM IR ( Experimental )
Stars: ✭ 47 (+135%)
Mutual labels:  llvm, llvm-ir
llvm-semantics
Formal semantics of LLVM IR in K
Stars: ✭ 42 (+110%)
Mutual labels:  llvm, llvm-ir
llvm-brainfuck
Brainfuck compiler based on LLVM API
Stars: ✭ 27 (+35%)
Mutual labels:  llvm, llvm-ir
EmbedSanitizer
EmbedSantizer is a runtime race detection tool which extends ThreadSanitizer to detect data races in 32-bit ARM applications.
Stars: ✭ 16 (-20%)
Mutual labels:  llvm, llvm-clang
llvm-kaleidoscope
LLVM Tutorial: Kaleidoscope (Implementing a Language with LLVM)
Stars: ✭ 124 (+520%)
Mutual labels:  llvm, llvm-ir
exempi
Exempi: XMP SDK (freedesktop mirror)
Stars: ✭ 19 (-5%)
Mutual labels:  metadata, metadata-extraction
YouTube-MA
💾 YouTube video metadata archiver written in Golang
Stars: ✭ 17 (-15%)
Mutual labels:  metadata, metadata-extraction
go-xmp
A native Go SDK for the Extensible Metadata Platform (XMP)
Stars: ✭ 36 (+80%)
Mutual labels:  metadata, metadata-extraction
database-metadata-bind
A library for binding information from java.sql.DatabaseMetadata
Stars: ✭ 17 (-15%)
Mutual labels:  metadata, metadata-extraction
LLAST
A high level LLVM IR AST provider for GraphEngine JIT.
Stars: ✭ 21 (+5%)
Mutual labels:  llvm, llvm-ir
doc
Design documents related to the decompilation pipeline.
Stars: ✭ 23 (+15%)
Mutual labels:  llvm, llvm-ir
TinyCompiler
c compiler based on flex(lex), bison(yacc) and LLVM, supports LLVM IR and obj code generation. 基于flex,bison以及LLVM,使用c++11实现的类C语法编译器, 支持生成中间代码及可执行文件.
Stars: ✭ 162 (+710%)
Mutual labels:  llvm, llvm-ir
audio-tag-analyzer
Extracts metadata music metadata found in audio files
Stars: ✭ 18 (-10%)
Mutual labels:  metadata
alpenhorn
Bootstrapping Secure Communication without Leaking Metadata
Stars: ✭ 69 (+245%)
Mutual labels:  metadata
aWsm
WebAssembly ahead-of-time compiler and runtime. Focuses on generating fast code, simplicity, and portability.
Stars: ✭ 177 (+785%)
Mutual labels:  llvm
sp-metadata
🔬 SharePoint Metadata Tracker
Stars: ✭ 12 (-40%)
Mutual labels:  metadata
jingle
🔔 Jingle is a dynamically-typed, multi-paradigm programming language designed for humans and machines.
Stars: ✭ 34 (+70%)
Mutual labels:  llvm

LLVM-Metadata-Visualizer

This project will help you to visualize LLVM metadata dumped by front-end like Clang.

Metadata node emitted in IR file usually refers to other metadata nodes and this may make it hard to comprehend the information. This tool will take a LLVM IR file, parse it to find metadata nodes and dump a dot file which will have a graphical representation of whole metadata. Each metadata node present in the file will be a vertex in the graph. An undirected edge connects two nodes if one of them refers to the other. Vertex in the graph tries to depict as detailed information as possible in the form of a table where each row is an attribute present in the metadata node.

Please report issues.

Pre-requisites

  • It has just one make file so Linux! (or Windows if you can run makefile with cygwin or so)
  • GCC 7.2/Clang 5 (for improved regex support)
  • dot program (to get a .png file)

How to use the tool?

  • make all will give you an executable called visualizer in bin/
  • Invoke it as
    bin/visualizer <IR-filename> <DOT-filename>
  • Next, use the standard dot program to get a .png file like
    dot <DOT-filename> -Tpng -o <PNG-filename>

if you think you have the right setup, go ahead and fire make example to experience quickly. Image file will be present in images folder.

Example

The following C code

void foo() {
  int X = 21;
  int Y = 22;
  {
    int Z = 23;
    Z = X;
  }
  X = Y;
}

when compiled to LLVM IR with -g will look like

; ModuleID = 'a.cpp'
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"

%"class.std::ios_base::Init" = type { i8 }

@_ZStL8__ioinit = internal global %"class.std::ios_base::Init" zeroinitializer, align 1
@__dso_handle = external global i8
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 65535, void ()* @_GLOBAL__sub_I_a.cpp, i8* null }]
                                                                                                                                                                              ; Function Attrs: uwtable                                                                                                                                                     define internal void @__cxx_global_var_init() #0 section ".text.startup" !dbg !37 {
  call void @_ZNSt8ios_base4InitC1Ev(%"class.std::ios_base::Init"* @_ZStL8__ioinit), !dbg !410                                                                                  %1 = call i32 @__cxa_atexit(void (i8*)* bitcast (void (%"class.std::ios_base::Init"*)* @_ZNSt8ios_base4InitD1Ev to void (i8*)*), i8* getelementptr inbounds (%"class.std::ios_base::Init", %"class.std::ios_base::Init"* @_ZStL8__ioinit, i32 0, i32 0), i8* @__dso_handle) #2, !dbg !411
  ret void, !dbg !410                                                                                                                                                         }                                                                                                                                                                             
declare void @_ZNSt8ios_base4InitC1Ev(%"class.std::ios_base::Init"*) #1

declare void @_ZNSt8ios_base4InitD1Ev(%"class.std::ios_base::Init"*) #1
...
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)", isOptimized: false, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !36, globals: !46, imports: !48)
!1 = !DIFile(filename: "a.cpp", directory: "/home/madhura/visualizer")
!2 = !{}
!3 = !{!4, !6, !8, !16, !17, !19, !23}
!4 = !DICompositeType(tag: DW_TAG_structure_type, file: !5, line: 82, size: 64, align: 32, flags: DIFlagFwdDecl, identifier: "_ZTS11__mbstate_t")
!5 = !DIFile(filename: "/usr/include/wchar.h", directory: "/home/madhura/visualizer")
!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "_IO_FILE", file: !7, line: 44, flags: DIFlagFwdDecl, identifier: "_ZTS8_IO_FILE")
!7 = !DIFile(filename: "/usr/include/stdio.h", directory: "/home/madhura/visualizer")
!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "__va_list_tag", file: !1, size: 192, align: 64, elements: !9, identifier: "_ZTS13__va_list_tag")
!9 = !{!10, !12, !13, !15}
!10 = !DIDerivedType(tag: DW_TAG_member, name: "gp_offset", scope: !"_ZTS13__va_list_tag", file: !1, baseType: !11, size: 32, align: 32)

(The IR is truncated for demonstration purpose)

This tool will give you the following picture. Image description

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].