Browse Source

some cleaning in the used libraries

Andrea Gussoni 8 years ago
parent
commit
d57efe3407
7 changed files with 23 additions and 29 deletions
  1. 4 0
      source/Ast.cpp
  2. 1 6
      source/Ast.h
  3. 5 0
      source/Lexer.cpp
  4. 1 5
      source/Lexer.h
  5. 3 14
      source/Main.cpp
  6. 6 0
      source/Parser.cpp
  7. 3 4
      source/Parser.h

+ 4 - 0
source/Ast.cpp

@@ -1,3 +1,7 @@
+// LLVM includes
+#include "llvm/IR/Verifier.h"
+
+// Local includes
 #include "Ast.h"
 #include "Parser.h"
 

+ 1 - 6
source/Ast.h

@@ -1,16 +1,11 @@
 #ifndef _AST_H
 #define _AST_H
 
+//LLVM includes
 #include "llvm/ADT/STLExtras.h"
 #include "llvm/IR/IRBuilder.h"
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
-#include "llvm/IR/Verifier.h"
-#include <cctype>
-#include <cstdio>
-#include <map>
-#include <string>
-#include <vector>
 
 using namespace llvm;
 

+ 5 - 0
source/Lexer.cpp

@@ -1,3 +1,8 @@
+// Standard includes
+#include <cctype>
+#include <cstdio>
+
+// Local includes
 #include "Lexer.h"
 
 /// gettok - Return the next token from standard input.

+ 1 - 5
source/Lexer.h

@@ -1,12 +1,8 @@
 #ifndef _LEXER_H
 #define _LEXER_H
 
-#include <cctype>
-#include <cstdio>
-#include <map>
+// Standard includes
 #include <string>
-#include <vector>
-#include "Ast.h"
 
 namespace lexer{
 // The lexer returns tokens [0-255] if it is an unknown character, otherwise one

+ 3 - 14
source/Main.cpp

@@ -1,23 +1,12 @@
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/IR/IRBuilder.h"
-#include "llvm/IR/LLVMContext.h"
-#include "llvm/IR/Module.h"
-#include "llvm/IR/Verifier.h"
-#include <cctype>
+// Standard includes
 #include <cstdio>
-#include <map>
-#include <string>
-#include <vector>
+
+// Local includes
 #include "Ast.h"
-#include "Lexer.h"
 #include "Parser.h"
 
-using namespace llvm;
-using namespace ast;
-using namespace lexer;
 using namespace parser;
 
-
 namespace helper {
 // Cloning make_unique here until it's standard in C++14.
 // Using a namespace to avoid conflicting with MSVC's std::make_unique (which

+ 6 - 0
source/Parser.cpp

@@ -1,4 +1,10 @@
+// Standard includes
+#include <cstdio>
+#include <stdexcept>
+
+// Local includes
 #include "Parser.h"
+#include "Lexer.h"
 
 using namespace lexer;
 namespace parser{

+ 3 - 4
source/Parser.h

@@ -1,11 +1,10 @@
 #ifndef _PARSER_H
 #define _PARSER_H
 
-#include <cstdio>
+// Standard includes
 #include <map>
-#include <string>
-#include <vector>
-#include "Lexer.h"
+
+// Local includes
 #include "Ast.h"
 
 using namespace ast;