Skip to content

Commit

Permalink
Clean up includes in clang_parser
Browse files Browse the repository at this point in the history
* Dedup includes that are done in both clang_parser.h and
clang_parser.cpp
* Move includes only used for tests into test file

An added benefit is that it should improve compile times.
  • Loading branch information
danobi authored and mmarchini committed Jun 5, 2019
1 parent a540fba commit 374c240
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions src/clang_parser.cpp
@@ -1,11 +1,9 @@
#include <clang-c/Index.h>
#include <iostream>
#include <string.h>

#include "llvm/Config/llvm-config.h"

#include "ast.h"
#include "bpftrace.h"
#include "clang_parser.h"
#include "types.h"
#include "utils.h"
Expand Down
4 changes: 0 additions & 4 deletions src/clang_parser.h
@@ -1,16 +1,12 @@
#pragma once

#include <clang-c/Index.h>

#include "struct.h"
#include "bpftrace.h"

namespace bpftrace {

namespace ast { class Program; }

using StructMap = std::map<std::string, Struct>;

class ClangParser
{
public:
Expand Down
3 changes: 3 additions & 0 deletions tests/clang_parser.cpp
Expand Up @@ -2,11 +2,14 @@
#include "clang_parser.h"
#include "driver.h"
#include "bpftrace.h"
#include "struct.h"

namespace bpftrace {
namespace test {
namespace clang_parser {

using StructMap = std::map<std::string, Struct>;

static void parse(const std::string &input, BPFtrace &bpftrace, bool result = true)
{
auto extended_input = input + "kprobe:sys_read { 1 }";
Expand Down

0 comments on commit 374c240

Please sign in to comment.