This repository has been archived on 2024-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
pacciani/src/asmgen.h
Stefano Sanfilippo 3b5a9be6b9 Emit position independent code by default, to enable support for shared libraries and PIE.
PIE is now default on Ubuntu LTS. PIC can be disabled with --no-pic.
2018-12-25 14:12:35 +01:00

31 lines
878 B
C++

#ifndef MONICELLI_ASMGEN_H
#define MONICELLI_ASMGEN_H
// Copyright 2017 the Monicelli project authors. All rights reserved.
// Use of this source code is governed by a GPLv3 license, see LICENSE.txt.
#include "llvm/IR/Module.h"
#include "llvm/Target/TargetMachine.h"
#include <string>
#include <vector>
namespace monicelli {
void registerTargets();
llvm::TargetMachine* getTargetMachine(const std::string& triple, const std::string& cpu,
const std::string& features, bool emit_pic);
void writeAssembly(const std::string& to_filename, llvm::Module* module,
llvm::TargetMachine* target_machine);
#ifdef MONICELLI_ENABLE_LINKER
void linkAssembly(const std::string& output_name, const std::vector<std::string>& object_files,
bool keep_object_files = false);
#endif
} // namespace monicelli
#endif