From 6df60a9effe4d20a48cfd9d105c0ab3c5dc3e690 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Wed, 7 Jun 2006 20:00:19 +0000 Subject: For PR780: Break the "IncludeFile" mechanism into its own header file and adjust other files accordingly. Use this facility for the IntrinsicInst problem which was the subject of PR800. More to follow on this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28709 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/AliasAnalysis.cpp | 1 + lib/Support/IncludeFile.cpp | 20 ++++++++++++++++++++ lib/System/IncludeFile.cpp | 20 ++++++++++++++++++++ lib/VMCore/IntrinsicInst.cpp | 4 ++++ lib/VMCore/Pass.cpp | 3 --- 5 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 lib/Support/IncludeFile.cpp create mode 100644 lib/System/IncludeFile.cpp (limited to 'lib') diff --git a/lib/Analysis/AliasAnalysis.cpp b/lib/Analysis/AliasAnalysis.cpp index 6d5a37515d..2abcbde74e 100644 --- a/lib/Analysis/AliasAnalysis.cpp +++ b/lib/Analysis/AliasAnalysis.cpp @@ -25,6 +25,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Analysis/AliasAnalysis.h" +#include "llvm/Pass.h" #include "llvm/BasicBlock.h" #include "llvm/Instructions.h" #include "llvm/Type.h" diff --git a/lib/Support/IncludeFile.cpp b/lib/Support/IncludeFile.cpp new file mode 100644 index 0000000000..d4729176f4 --- /dev/null +++ b/lib/Support/IncludeFile.cpp @@ -0,0 +1,20 @@ +//===- lib/Support/IncludeFile.cpp - Ensure Linking Of Implementation -----===// +// +// The LLVM Compiler Infrastructure +// +// This file was developed by Reid Spencer and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements the IncludeFile constructor. +// +//===----------------------------------------------------------------------===// + +#include "llvm/Support/IncludeFile.h" + +using namespace llvm; + +// This constructor is used to ensure linking of other modules. See the +// llvm/Support/IncludeFile.h header for details. +IncludeFile::IncludeFile(void*) {} diff --git a/lib/System/IncludeFile.cpp b/lib/System/IncludeFile.cpp new file mode 100644 index 0000000000..d4729176f4 --- /dev/null +++ b/lib/System/IncludeFile.cpp @@ -0,0 +1,20 @@ +//===- lib/Support/IncludeFile.cpp - Ensure Linking Of Implementation -----===// +// +// The LLVM Compiler Infrastructure +// +// This file was developed by Reid Spencer and is distributed under the +// University of Illinois Open Source License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file implements the IncludeFile constructor. +// +//===----------------------------------------------------------------------===// + +#include "llvm/Support/IncludeFile.h" + +using namespace llvm; + +// This constructor is used to ensure linking of other modules. See the +// llvm/Support/IncludeFile.h header for details. +IncludeFile::IncludeFile(void*) {} diff --git a/lib/VMCore/IntrinsicInst.cpp b/lib/VMCore/IntrinsicInst.cpp index 2c2c5a96ed..b4395e1cd3 100644 --- a/lib/VMCore/IntrinsicInst.cpp +++ b/lib/VMCore/IntrinsicInst.cpp @@ -71,3 +71,7 @@ std::string DbgStopPointInst::getDirectory() const { } //===----------------------------------------------------------------------===// +/// LinkIntrinsicInstStub -- This is a hack to make sure that programs that +/// #include IntrinsicInst.h also link this file. See Support/IncludeFile.h +/// for further details. +char llvm::LinkIntrinsicInstStub; diff --git a/lib/VMCore/Pass.cpp b/lib/VMCore/Pass.cpp index 9fed647543..a7160f1f1e 100644 --- a/lib/VMCore/Pass.cpp +++ b/lib/VMCore/Pass.cpp @@ -23,9 +23,6 @@ #include using namespace llvm; -// IncludeFile - Stub function used to help linking out. -IncludeFile::IncludeFile(void*) {} - //===----------------------------------------------------------------------===// // AnalysisID Class Implementation // -- cgit v1.2.3