ldc/driver/dcomputecodegenerator.h
Nicholas Wilson ae6ff33fc1 [dcomptue] codegen (#2126)
* code generation

* simplify logic

* apply clang-format

* Undo completely inane choice by clang-format

* Guard the use of the command line args.
2017-05-24 08:55:32 +08:00

31 lines
880 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//===-- driver/dcomputecodegenerator.h - LDC --------------------*- C++ -*-===//
//
// LDC the LLVM D compiler
//
// This file is distributed under the BSD-style LDC license. See the LICENSE
// file for details.
//
//===----------------------------------------------------------------------===//
#ifndef LDC_DRIVER_DCOMPUTECODEGENERATOR_H
#define LDC_DRIVER_DCOMPUTECODEGENERATOR_H
#include "gen/dcompute/target.h"
#include "llvm/ADT/SmallVector.h"
// gets run on modules marked @compute
// All @compute D modules are emitted into one LLVM module once per target.
class DComputeCodeGenManager {
llvm::LLVMContext &ctx;
llvm::SmallVector<DComputeTarget *, 2> targets;
DComputeTarget *createComputeTarget(const std::string &s);
public:
void emit(Module *m);
void writeModules();
DComputeCodeGenManager(llvm::LLVMContext &c);
};
#endif