[LLVM-C] Add DIBuilder bindings to create import declarations

Summary: Add bindings to create import declarations for modules, functions, types, and other entities.  This wraps the conveniences available in the existing DIBuilder API, but these seem C++-specific.

Reviewers: whitequark, harlanhaskins, deadalnix

Reviewed By: whitequark

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D46167

llvm-svn: 331123
diff --git a/llvm/tools/llvm-c-test/debuginfo.c b/llvm/tools/llvm-c-test/debuginfo.c
index 411c495..0c3410d 100644
--- a/llvm/tools/llvm-c-test/debuginfo.c
+++ b/llvm/tools/llvm-c-test/debuginfo.c
@@ -36,6 +36,19 @@
                               "/test/include/llvm-c-test.h", 27,
                               "", 0);
 
+  LLVMMetadataRef OtherModule =
+    LLVMDIBuilderCreateModule(DIB, CompileUnit,
+                              "llvm-c-test-import", 18,
+                              "", 0,
+                              "/test/include/llvm-c-test-import.h", 34,
+                              "", 0);
+  LLVMMetadataRef ImportedModule =
+    LLVMDIBuilderCreateImportedModuleFromModule(DIB, Module, OtherModule,
+                                                File, 42);
+  LLVMMetadataRef AliasImportedModule =
+    LLVMDIBuilderCreateImportedModuleFromAlias(DIB, Module, ImportedModule,
+                                               File, 42);
+
   LLVMMetadataRef Int64Ty =
     LLVMDIBuilderCreateBasicType(DIB, "Int64", 5, 64, 0);
   LLVMMetadataRef GlobalVarValueExpr =