---
id: 4545
title: "Implementing a Custom Directive Handler in Clang"
source_domain: blog.quarkslab.com
source_url: "https://blog.quarkslab.com/implementing-a-custom-directive-handler-in-clang.html"
published_at: "2016-03-27T22:00:00Z"
tags: ["obfuscation", "tooling", "llvm", "compilers", "clang", "pragma"]
phying_url: "https://phying.com/item/4545"
lang: en
---

# Implementing a Custom Directive Handler in Clang

## Summary

How-to on implementing a custom #pragma directive handler in clang, used to drive an LLVM-based obfuscator while keeping sources compilable elsewhere; a tour of the preprocessing and parsing stages.

## Intelligence Metadata

- **Sources:** blog.quarkslab.com
- **Published:** 2016-03-27T22:00:00Z
- **Original:** https://blog.quarkslab.com/implementing-a-custom-directive-handler-in-clang.html
- **Phying News:** https://phying.com/item/4545
