[llvm] r328394 - Fix layering by moving Support/CodeGenCWrappers.h to Target
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 23 16:58:21 PDT 2018
Author: dblaikie
Date: Fri Mar 23 16:58:21 2018
New Revision: 328394
URL: http://llvm.org/viewvc/llvm-project?rev=328394&view=rev
Log:
Fix layering by moving Support/CodeGenCWrappers.h to Target
This includes llvm-c/TargetMachine.h which is logically part of
libTarget (since libTarget implements llvm-c/TargetMachine.h's
functions).
Added:
llvm/trunk/include/llvm/Target/CodeGenCWrappers.h
- copied, changed from r328393, llvm/trunk/include/llvm/Support/CodeGenCWrappers.h
Removed:
llvm/trunk/include/llvm/Support/CodeGenCWrappers.h
Modified:
llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp
llvm/trunk/lib/Target/TargetMachineC.cpp
Removed: llvm/trunk/include/llvm/Support/CodeGenCWrappers.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/CodeGenCWrappers.h?rev=328393&view=auto
==============================================================================
--- llvm/trunk/include/llvm/Support/CodeGenCWrappers.h (original)
+++ llvm/trunk/include/llvm/Support/CodeGenCWrappers.h (removed)
@@ -1,62 +0,0 @@
-//===- llvm/Support/CodeGenCWrappers.h - CodeGen C Wrappers -----*- C++ -*-===//
-//
-// The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines C bindings wrappers for enums in llvm/Support/CodeGen.h
-// that need them. The wrappers are separated to avoid adding an indirect
-// dependency on llvm/Config/Targets.def to CodeGen.h.
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_SUPPORT_CODEGENCWRAPPERS_H
-#define LLVM_SUPPORT_CODEGENCWRAPPERS_H
-
-#include "llvm-c/TargetMachine.h"
-#include "llvm/ADT/Optional.h"
-#include "llvm/Support/CodeGen.h"
-#include "llvm/Support/ErrorHandling.h"
-
-namespace llvm {
-
-inline Optional<CodeModel::Model> unwrap(LLVMCodeModel Model, bool &JIT) {
- JIT = false;
- switch (Model) {
- case LLVMCodeModelJITDefault:
- JIT = true;
- LLVM_FALLTHROUGH;
- case LLVMCodeModelDefault:
- return None;
- case LLVMCodeModelSmall:
- return CodeModel::Small;
- case LLVMCodeModelKernel:
- return CodeModel::Kernel;
- case LLVMCodeModelMedium:
- return CodeModel::Medium;
- case LLVMCodeModelLarge:
- return CodeModel::Large;
- }
- return CodeModel::Small;
-}
-
-inline LLVMCodeModel wrap(CodeModel::Model Model) {
- switch (Model) {
- case CodeModel::Small:
- return LLVMCodeModelSmall;
- case CodeModel::Kernel:
- return LLVMCodeModelKernel;
- case CodeModel::Medium:
- return LLVMCodeModelMedium;
- case CodeModel::Large:
- return LLVMCodeModelLarge;
- }
- llvm_unreachable("Bad CodeModel!");
-}
-
-} // end llvm namespace
-
-#endif
Copied: llvm/trunk/include/llvm/Target/CodeGenCWrappers.h (from r328393, llvm/trunk/include/llvm/Support/CodeGenCWrappers.h)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/CodeGenCWrappers.h?p2=llvm/trunk/include/llvm/Target/CodeGenCWrappers.h&p1=llvm/trunk/include/llvm/Support/CodeGenCWrappers.h&r1=328393&r2=328394&rev=328394&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/CodeGenCWrappers.h (original)
+++ llvm/trunk/include/llvm/Target/CodeGenCWrappers.h Fri Mar 23 16:58:21 2018
@@ -1,4 +1,4 @@
-//===- llvm/Support/CodeGenCWrappers.h - CodeGen C Wrappers -----*- C++ -*-===//
+//===- llvm/Target/CodeGenCWrappers.h - CodeGen C Wrappers ------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -13,8 +13,8 @@
//
//===----------------------------------------------------------------------===//
-#ifndef LLVM_SUPPORT_CODEGENCWRAPPERS_H
-#define LLVM_SUPPORT_CODEGENCWRAPPERS_H
+#ifndef LLVM_TARGET_CODEGENCWRAPPERS_H
+#define LLVM_TARGET_CODEGENCWRAPPERS_H
#include "llvm-c/TargetMachine.h"
#include "llvm/ADT/Optional.h"
Modified: llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp?rev=328394&r1=328393&r2=328394&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/ExecutionEngineBindings.cpp Fri Mar 23 16:58:21 2018
@@ -17,8 +17,8 @@
#include "llvm/ExecutionEngine/RTDyldMemoryManager.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Module.h"
-#include "llvm/Support/CodeGenCWrappers.h"
#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Target/CodeGenCWrappers.h"
#include "llvm/Target/TargetOptions.h"
#include <cstring>
Modified: llvm/trunk/lib/Target/TargetMachineC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachineC.cpp?rev=328394&r1=328393&r2=328394&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetMachineC.cpp (original)
+++ llvm/trunk/lib/Target/TargetMachineC.cpp Fri Mar 23 16:58:21 2018
@@ -18,12 +18,12 @@
#include "llvm/IR/DataLayout.h"
#include "llvm/IR/LegacyPassManager.h"
#include "llvm/IR/Module.h"
-#include "llvm/Support/CodeGenCWrappers.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FormattedStream.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/TargetRegistry.h"
#include "llvm/Support/raw_ostream.h"
+#include "llvm/Target/CodeGenCWrappers.h"
#include "llvm/Target/TargetMachine.h"
#include <cassert>
#include <cstdlib>
More information about the llvm-commits
mailing list