aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2013-01-14 17:21:00 +0000
committerDouglas Gregor <dgregor@apple.com>2013-01-14 17:21:00 +0000
commit6ddfca91e04e62089d685b31533b9a2d677d9a5e (patch)
treeb803eaa1d88091fd5b65134468b8e922c1deb773 /clang/lib/CodeGen/CodeGenModule.h
parent3778f27b2302c69ce1d9d4af70aab60143fd5b54 (diff)
downloadllvm-6ddfca91e04e62089d685b31533b9a2d677d9a5e.zip
llvm-6ddfca91e04e62089d685b31533b9a2d677d9a5e.tar.gz
llvm-6ddfca91e04e62089d685b31533b9a2d677d9a5e.tar.bz2
Implement parsing, AST, (de-)serialization, and placeholder global
metadata for linking against the libraries/frameworks for imported modules. The module map language is extended with a new "link" directive that specifies what library or framework to link against when a module is imported, e.g., link "clangAST" or link framework "MyFramework" Importing the corresponding module (or any of its submodules) will eventually link against the named library/framework. For now, I've added some placeholder global metadata that encodes the imported libraries/frameworks, so that we can test that this information gets through to the IR. The format of the data is still under discussion. llvm-svn: 172437
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h
index 34fa19c..0d644a7 100644
--- a/clang/lib/CodeGen/CodeGenModule.h
+++ b/clang/lib/CodeGen/CodeGenModule.h
@@ -23,7 +23,9 @@
#include "clang/AST/Mangle.h"
#include "clang/Basic/ABI.h"
#include "clang/Basic/LangOptions.h"
+#include "clang/Basic/Module.h"
#include "llvm/ADT/DenseMap.h"
+#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringMap.h"
#include "llvm/IR/Module.h"
@@ -66,6 +68,7 @@ namespace clang {
class AnnotateAttr;
class CXXDestructorDecl;
class MangleBuffer;
+ class Module;
namespace CodeGen {
@@ -313,6 +316,12 @@ class CodeGenModule : public CodeGenTypeCache {
/// run on termination.
std::vector<std::pair<llvm::WeakVH,llvm::Constant*> > CXXGlobalDtors;
+ /// \brief The complete set of modules that has been imported.
+ llvm::SetVector<clang::Module *> ImportedModules;
+
+ /// \brief The set of libraries to link against.
+ std::vector<clang::Module::LinkLibrary> LinkLibraries;
+
/// @name Cache for Objective-C runtime types
/// @{
@@ -989,6 +998,9 @@ private:
/// references to global which may otherwise be optimized out.
void EmitLLVMUsed();
+ /// \brief Emit the set of libraries to link against.
+ void EmitLinkLibraries();
+
void EmitDeclMetadata();
/// EmitCoverageFile - Emit the llvm.gcov metadata used to tell LLVM where