[PATCH] D35776: clang/Basic/TargetInfo.h: Sink llvm/IR/DataLayout.h into implementations.
NAKAMURA Takumi via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Jul 23 06:29:18 PDT 2017
chapuni created this revision.
Herald added a subscriber: nhaehnle.
It loosens dependencies of Clang_Basic from LLVM_intrinsic.
Repository:
rL LLVM
https://reviews.llvm.org/D35776
Files:
cfe/trunk/include/clang/Basic/TargetInfo.h
cfe/trunk/lib/AST/Mangle.cpp
cfe/trunk/lib/Basic/TargetInfo.cpp
cfe/trunk/lib/Basic/Targets/AMDGPU.cpp
cfe/trunk/lib/Frontend/InitPreprocessor.cpp
Index: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
===================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp
@@ -25,6 +25,7 @@
#include "clang/Lex/PreprocessorOptions.h"
#include "clang/Serialization/ASTReader.h"
#include "llvm/ADT/APFloat.h"
+#include "llvm/IR/DataLayout.h"
using namespace clang;
static bool MacroBodyEndsInBackslash(StringRef MacroBody) {
Index: cfe/trunk/lib/Basic/Targets/AMDGPU.cpp
===================================================================
--- cfe/trunk/lib/Basic/Targets/AMDGPU.cpp
+++ cfe/trunk/lib/Basic/Targets/AMDGPU.cpp
@@ -18,6 +18,7 @@
#include "clang/Basic/TargetBuiltins.h"
#include "clang/Frontend/CodeGenOptions.h"
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/IR/DataLayout.h"
using namespace clang;
using namespace clang::targets;
Index: cfe/trunk/lib/Basic/TargetInfo.cpp
===================================================================
--- cfe/trunk/lib/Basic/TargetInfo.cpp
+++ cfe/trunk/lib/Basic/TargetInfo.cpp
@@ -17,6 +17,7 @@
#include "clang/Basic/LangOptions.h"
#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/STLExtras.h"
+#include "llvm/IR/DataLayout.h"
#include "llvm/Support/ErrorHandling.h"
#include <cstdlib>
using namespace clang;
@@ -112,6 +113,10 @@
// Out of line virtual dtor for TargetInfo.
TargetInfo::~TargetInfo() {}
+void TargetInfo::resetDataLayout(StringRef DL) {
+ DataLayout.reset(new llvm::DataLayout(DL));
+}
+
/// getTypeName - Return the user string for the specified integer type enum.
/// For example, SignedShort -> "short".
const char *TargetInfo::getTypeName(IntType T) {
Index: cfe/trunk/lib/AST/Mangle.cpp
===================================================================
--- cfe/trunk/lib/AST/Mangle.cpp
+++ cfe/trunk/lib/AST/Mangle.cpp
@@ -22,6 +22,7 @@
#include "clang/Basic/SourceManager.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/ADT/StringExtras.h"
+#include "llvm/IR/DataLayout.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
Index: cfe/trunk/include/clang/Basic/TargetInfo.h
===================================================================
--- cfe/trunk/include/clang/Basic/TargetInfo.h
+++ cfe/trunk/include/clang/Basic/TargetInfo.h
@@ -21,21 +21,22 @@
#include "clang/Basic/TargetCXXABI.h"
#include "clang/Basic/TargetOptions.h"
#include "clang/Basic/VersionTuple.h"
+#include "llvm/ADT/APFloat.h"
#include "llvm/ADT/APInt.h"
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/IntrusiveRefCntPtr.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/SmallSet.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Triple.h"
-#include "llvm/IR/DataLayout.h"
#include "llvm/Support/DataTypes.h"
#include <cassert>
#include <string>
#include <vector>
namespace llvm {
-struct fltSemantics;
+class DataLayout;
}
namespace clang {
@@ -101,9 +102,7 @@
// TargetInfo Constructor. Default initializes all fields.
TargetInfo(const llvm::Triple &T);
- void resetDataLayout(StringRef DL) {
- DataLayout.reset(new llvm::DataLayout(DL));
- }
+ void resetDataLayout(StringRef DL);
public:
/// \brief Construct a target for the given options.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35776.107827.patch
Type: text/x-patch
Size: 3296 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170723/4dd077a8/attachment-0001.bin>
More information about the cfe-commits
mailing list