diff options
| author | karpinski <marcinpkarpinski@gmail.com> | 2016-12-30 12:22:11 +0100 |
|---|---|---|
| committer | karpinski <marcinpkarpinski@gmail.com> | 2016-12-30 16:36:50 +0100 |
| commit | c72d859e4f27c4b4c4be349091f5c71058ac1cd4 (patch) | |
| tree | b0c02a7b5296402dbe98f817629719ef32dc069b /src/rustllvm/rustllvm.h | |
| parent | 7f2d2afa9196ba6314a29e58d5324dbd9923c75e (diff) | |
| download | rust-c72d859e4f27c4b4c4be349091f5c71058ac1cd4.tar.gz rust-c72d859e4f27c4b4c4be349091f5c71058ac1cd4.zip | |
Ran clang-format on src/rustllvm with llvm as the coding style.
Diffstat (limited to 'src/rustllvm/rustllvm.h')
| -rw-r--r-- | src/rustllvm/rustllvm.h | 140 |
1 files changed, 68 insertions, 72 deletions
diff --git a/src/rustllvm/rustllvm.h b/src/rustllvm/rustllvm.h index 8f7e0e3d918..d296266be0f 100644 --- a/src/rustllvm/rustllvm.h +++ b/src/rustllvm/rustllvm.h @@ -8,50 +8,52 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. +#include "llvm-c/BitReader.h" +#include "llvm-c/Core.h" +#include "llvm-c/ExecutionEngine.h" +#include "llvm-c/Object.h" +#include "llvm/ADT/ArrayRef.h" +#include "llvm/ADT/DenseSet.h" +#include "llvm/ADT/Triple.h" +#include "llvm/Analysis/Lint.h" +#include "llvm/Analysis/Passes.h" +#include "llvm/ExecutionEngine/ExecutionEngine.h" +#include "llvm/ExecutionEngine/Interpreter.h" +#include "llvm/ExecutionEngine/MCJIT.h" #include "llvm/IR/IRBuilder.h" #include "llvm/IR/InlineAsm.h" -#include "llvm/IR/LLVMContext.h" -#include "llvm/IR/Module.h" #include "llvm/IR/InlineAsm.h" #include "llvm/IR/LLVMContext.h" -#include "llvm/Analysis/Passes.h" -#include "llvm/Analysis/Lint.h" -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/Triple.h" -#include "llvm/ADT/DenseSet.h" +#include "llvm/IR/LLVMContext.h" +#include "llvm/IR/Module.h" #include "llvm/Support/CommandLine.h" -#include "llvm/Support/FormattedStream.h" -#include "llvm/Support/Timer.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/Support/TargetSelect.h" -#include "llvm/Support/TargetRegistry.h" -#include "llvm/Support/SourceMgr.h" -#include "llvm/Support/Host.h" #include "llvm/Support/Debug.h" #include "llvm/Support/DynamicLibrary.h" +#include "llvm/Support/FormattedStream.h" +#include "llvm/Support/Host.h" #include "llvm/Support/Memory.h" -#include "llvm/ExecutionEngine/ExecutionEngine.h" -#include "llvm/ExecutionEngine/MCJIT.h" -#include "llvm/ExecutionEngine/Interpreter.h" +#include "llvm/Support/SourceMgr.h" +#include "llvm/Support/TargetRegistry.h" +#include "llvm/Support/TargetSelect.h" +#include "llvm/Support/Timer.h" +#include "llvm/Support/raw_ostream.h" #include "llvm/Target/TargetMachine.h" #include "llvm/Target/TargetOptions.h" -#include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/Instrumentation.h" +#include "llvm/Transforms/Scalar.h" #include "llvm/Transforms/Vectorize.h" -#include "llvm-c/Core.h" -#include "llvm-c/BitReader.h" -#include "llvm-c/ExecutionEngine.h" -#include "llvm-c/Object.h" -#define LLVM_VERSION_GE(major, minor) \ - (LLVM_VERSION_MAJOR > (major) || LLVM_VERSION_MAJOR == (major) && LLVM_VERSION_MINOR >= (minor)) +#define LLVM_VERSION_GE(major, minor) \ + (LLVM_VERSION_MAJOR > (major) || \ + LLVM_VERSION_MAJOR == (major) && LLVM_VERSION_MINOR >= (minor)) -#define LLVM_VERSION_EQ(major, minor) \ +#define LLVM_VERSION_EQ(major, minor) \ (LLVM_VERSION_MAJOR == (major) && LLVM_VERSION_MINOR == (minor)) -#define LLVM_VERSION_LE(major, minor) \ - (LLVM_VERSION_MAJOR < (major) || LLVM_VERSION_MAJOR == (major) && LLVM_VERSION_MINOR <= (minor)) +#define LLVM_VERSION_LE(major, minor) \ + (LLVM_VERSION_MAJOR < (major) || \ + LLVM_VERSION_MAJOR == (major) && LLVM_VERSION_MINOR <= (minor)) #if LLVM_VERSION_GE(3, 7) #include "llvm/IR/LegacyPassManager.h" @@ -66,39 +68,36 @@ #include "llvm/Bitcode/ReaderWriter.h" #endif -#include "llvm/IR/IRPrintingPasses.h" -#include "llvm/IR/DebugInfo.h" #include "llvm/IR/DIBuilder.h" +#include "llvm/IR/DebugInfo.h" +#include "llvm/IR/IRPrintingPasses.h" #include "llvm/Linker/Linker.h" -void LLVMRustSetLastError(const char*); +void LLVMRustSetLastError(const char *); -enum class LLVMRustResult { - Success, - Failure -}; +enum class LLVMRustResult { Success, Failure }; enum LLVMRustAttribute { - AlwaysInline = 0, - ByVal = 1, - Cold = 2, - InlineHint = 3, - MinSize = 4, - Naked = 5, - NoAlias = 6, - NoCapture = 7, - NoInline = 8, - NonNull = 9, - NoRedZone = 10, - NoReturn = 11, - NoUnwind = 12, - OptimizeForSize = 13, - ReadOnly = 14, - SExt = 15, - StructRet = 16, - UWTable = 17, - ZExt = 18, - InReg = 19, + AlwaysInline = 0, + ByVal = 1, + Cold = 2, + InlineHint = 3, + MinSize = 4, + Naked = 5, + NoAlias = 6, + NoCapture = 7, + NoInline = 8, + NonNull = 9, + NoRedZone = 10, + NoReturn = 11, + NoUnwind = 12, + OptimizeForSize = 13, + ReadOnly = 14, + SExt = 15, + StructRet = 16, + UWTable = 17, + ZExt = 18, + InReg = 19, }; typedef struct OpaqueRustString *RustStringRef; @@ -107,28 +106,25 @@ typedef struct LLVMOpaqueDebugLoc *LLVMDebugLocRef; typedef struct LLVMOpaqueSMDiagnostic *LLVMSMDiagnosticRef; typedef struct LLVMOpaqueRustJITMemoryManager *LLVMRustJITMemoryManagerRef; -extern "C" void -rust_llvm_string_write_impl(RustStringRef str, const char *ptr, size_t size); +extern "C" void rust_llvm_string_write_impl(RustStringRef str, const char *ptr, + size_t size); -class raw_rust_string_ostream : public llvm::raw_ostream { - RustStringRef str; - uint64_t pos; +class raw_rust_string_ostream : public llvm::raw_ostream { + RustStringRef str; + uint64_t pos; - void write_impl(const char *ptr, size_t size) override { - rust_llvm_string_write_impl(str, ptr, size); - pos += size; - } + void write_impl(const char *ptr, size_t size) override { + rust_llvm_string_write_impl(str, ptr, size); + pos += size; + } - uint64_t current_pos() const override { - return pos; - } + uint64_t current_pos() const override { return pos; } public: - explicit raw_rust_string_ostream(RustStringRef str) - : str(str), pos(0) { } + explicit raw_rust_string_ostream(RustStringRef str) : str(str), pos(0) {} - ~raw_rust_string_ostream() { - // LLVM requires this. - flush(); - } + ~raw_rust_string_ostream() { + // LLVM requires this. + flush(); + } }; |
