Use clang's preprocessor, rather than forking a process to run cpp

on Mac/Linux (and not having a built-in preprocessor solution at all
on Windows.)  Fixes issue #32.
This commit is contained in:
Pete Couperus
2011-07-04 08:35:31 +01:00
committed by Matt Pharr
parent fe7717ab67
commit fac50ba454
3 changed files with 81 additions and 75 deletions

View File

@@ -41,6 +41,11 @@
#include "ispc.h"
namespace llvm
{
class raw_string_ostream;
}
class Module {
public:
/** The name of the source file being compiled should be passed as the
@@ -108,6 +113,8 @@ private:
bool writeHeader(const char *filename);
bool writeObjectFileOrAssembly(OutputType outputType, const char *filename);
void execPreprocessor(const char *infilename, llvm::raw_string_ostream* ostream) const;
};
#endif // ISPC_MODULE_H