]> granicus.if.org Git - clang/commitdiff
Add examples dir, built with BUILD_EXAMPLES=1 (Makefiles, no CMake equivalent yet).
authorDaniel Dunbar <daniel@zuster.org>
Sun, 15 Nov 2009 00:22:33 +0000 (00:22 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Sun, 15 Nov 2009 00:22:33 +0000 (00:22 +0000)
Move tools/wpa to examples/wpa, and unbreak its build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88825 91177308-0d34-0410-b5e6-96231b3b80d8

Makefile
examples/Makefile [new file with mode: 0644]
examples/wpa/CMakeLists.txt [moved from tools/wpa/CMakeLists.txt with 100% similarity]
examples/wpa/Makefile [moved from tools/wpa/Makefile with 100% similarity]
examples/wpa/clang-wpa.cpp [moved from tools/wpa/clang-wpa.cpp with 94% similarity]

index 22fe214705cd946ea8a28debe1f642e8437781cf..17ccc7320ec8dee3838da333efc458afe2ef6e2f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,12 @@
 LEVEL = ../..
 DIRS := include lib tools docs
 
+PARALLEL_DIRS :=
+
+ifeq ($(BUILD_EXAMPLES),1)
+  PARALLEL_DIRS += examples
+endif
+
 include $(LEVEL)/Makefile.common
 
 ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
diff --git a/examples/Makefile b/examples/Makefile
new file mode 100644 (file)
index 0000000..e6ae4b3
--- /dev/null
@@ -0,0 +1,14 @@
+##===- examples/Makefile -----------------------------------*- Makefile -*-===##
+#
+#                     The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License. See LICENSE.TXT for details.
+#
+##===----------------------------------------------------------------------===##
+
+LEVEL = ../../..
+
+PARALLEL_DIRS := wpa
+
+include $(LEVEL)/Makefile.common
similarity index 100%
rename from tools/wpa/Makefile
rename to examples/wpa/Makefile
similarity index 94%
rename from tools/wpa/clang-wpa.cpp
rename to examples/wpa/clang-wpa.cpp
index 346634b6f61786b08a2566037eb26d91f33322db..4a0fe49939535b1b7d4928bdc808566dda0ee161 100644 (file)
@@ -34,7 +34,6 @@ int main(int argc, char **argv) {
     return 0;
 
   TextDiagnosticBuffer DiagClient;
-  Diagnostic Diags(&DiagClient);
 
   for (unsigned i = 0, e = InputFilenames.size(); i != e; ++i) {
     const std::string &InFile = InputFilenames[i];
@@ -42,7 +41,7 @@ int main(int argc, char **argv) {
     std::string ErrMsg;
     llvm::OwningPtr<ASTUnit> AST;
 
-    AST.reset(ASTUnit::LoadFromPCHFile(InFile, Diags, FileMgr, &ErrMsg));
+    AST.reset(ASTUnit::LoadFromPCHFile(InFile, &ErrMsg, &DiagClient));
 
     if (!AST) {
       llvm::errs() << "[" << InFile << "] error: " << ErrMsg << '\n';