trick/trick_source/codegen/Interface_Code_Gen/Utilities.hh
Scott Fennell f825dc00fc
Merge test branch into master (#1047)
* #1041 filter -W workaround for ICG linking to LLVM 10 libclang-cpp.so (#1044)

* 1043 drg checkpoint memory leak (#1045)

* #1043 drg fix drg checkpoint memory leak

* 947 sie generation rework (#1046)

generate  S_sie.resource at during build instead of runtime
2020-09-01 15:55:19 -05:00

33 lines
1.1 KiB
C++

#ifndef UTILITIES_HH
#define UTILITIES_HH
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Basic/FileManager.h"
#include "clang/Basic/SourceLocation.h"
#include "HeaderSearchDirs.hh"
enum Color {
ERROR = 31,
WARNING = 33,
INFO = 34,
SKIP = 95
};
std::string sanitize(const std::string&) ;
std::string trim( const std::string& str, const std::string& whitespace = " \t\n\r" ) ;
bool isInUserCode( clang::CompilerInstance & ci , clang::SourceLocation sl , HeaderSearchDirs & hsd ) ;
bool isInUserOrTrickCode( clang::CompilerInstance & ci , clang::SourceLocation sl , HeaderSearchDirs & hsd ) ;
std::string getFileName( clang::CompilerInstance & ci , clang::SourceLocation sl , HeaderSearchDirs & hsd ) ;
char * almostRealPath( const std::string& in_path ) ;
char * almostRealPath( const char * in_path ) ;
std::string color(const Color& color, const std::string& text);
std::string bold(const std::string& text);
std::string underline(const std::string& text);
std::string underline(const std::string& text, unsigned length);
std::string quote(const std::string& text);
std::string & replace_special_chars( std::string & str);
#endif