From 520d1e6c6be80b2da632e7be45b4d8d2b25415e4 Mon Sep 17 00:00:00 2001
From: Daniel Dunbar
Date: Fri, 11 Dec 2009 23:04:35 +0000
Subject: [PATCH] Update docs/comments/utils/examples to refer to clang -cc1
instead of clang-cc.
llvm-svn: 91176
---
.../PrintFunctionNames/PrintFunctionNames.cpp | 4 +-
clang/examples/PrintFunctionNames/README.txt | 4 +-
clang/include/clang/Frontend/ASTConsumers.h | 6 +-
clang/lib/Frontend/CompilerInstance.cpp | 2 +-
clang/utils/TestUtils/pch-test.pl | 8 +--
clang/www/analyzer/installation.html | 10 +--
clang/www/get_started.html | 69 +++++++------------
clang/www/hacking.html | 1 -
8 files changed, 42 insertions(+), 62 deletions(-)
diff --git a/clang/examples/PrintFunctionNames/PrintFunctionNames.cpp b/clang/examples/PrintFunctionNames/PrintFunctionNames.cpp
index a103c63704af..5b7b66a4f7ff 100644
--- a/clang/examples/PrintFunctionNames/PrintFunctionNames.cpp
+++ b/clang/examples/PrintFunctionNames/PrintFunctionNames.cpp
@@ -7,8 +7,8 @@
//
//===----------------------------------------------------------------------===//
//
-// Example clang-cc plugin which simply prints the names of all the top-level
-// decls in the input file.
+// Example clang plugin which simply prints the names of all the top-level decls
+// in the input file.
//
//===----------------------------------------------------------------------===//
diff --git a/clang/examples/PrintFunctionNames/README.txt b/clang/examples/PrintFunctionNames/README.txt
index 2859eeff5579..ee6f7e865e91 100644
--- a/clang/examples/PrintFunctionNames/README.txt
+++ b/clang/examples/PrintFunctionNames/README.txt
@@ -1,4 +1,4 @@
-This is a simple example demonstrating how to use clang-cc's facility for
+This is a simple example demonstrating how to use clang's facility for
providing AST consumers using a plugin.
You will probably need to build clang so that it exports all symbols (disable
@@ -6,5 +6,5 @@ TOOL_NO_EXPORT in the tools/clang Makefile).
Once the plugin is built, you can run it using:
--
-$ clang-cc -load path/to/PrintFunctionNames.so -plugin=print-fns some-input-file.c
+$ clang -cc1 -load path/to/PrintFunctionNames.so -plugin=print-fns some-input-file.c
--
diff --git a/clang/include/clang/Frontend/ASTConsumers.h b/clang/include/clang/Frontend/ASTConsumers.h
index 26efa9745600..20bf83ee0456 100644
--- a/clang/include/clang/Frontend/ASTConsumers.h
+++ b/clang/include/clang/Frontend/ASTConsumers.h
@@ -94,9 +94,9 @@ ASTConsumer *CreateHTMLPrinter(llvm::raw_ostream *OS, Preprocessor &PP,
bool SyntaxHighlight = true,
bool HighlightMacros = true);
-// PCH generator: generates a precompiled header file; this file can be
-// used later with the PCHReader (clang-cc option -include-pch)
-// to speed up compile times.
+// PCH generator: generates a precompiled header file; this file can be used
+// later with the PCHReader (clang -cc1 option -include-pch) to speed up compile
+// times.
ASTConsumer *CreatePCHGenerator(const Preprocessor &PP,
llvm::raw_ostream *OS,
const char *isysroot = 0);
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index f36a56032b29..2a6a8a8750d2 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -95,7 +95,7 @@ static void SetUpBuildDumpLog(const DiagnosticOptions &DiagOpts,
return;
}
- (*OS) << "clang-cc command line arguments: ";
+ (*OS) << "clang -cc1 command line arguments: ";
for (unsigned i = 0; i != argc; ++i)
(*OS) << argv[i] << ' ';
(*OS) << '\n';
diff --git a/clang/utils/TestUtils/pch-test.pl b/clang/utils/TestUtils/pch-test.pl
index 2e17117a2a29..e097c5c00c09 100755
--- a/clang/utils/TestUtils/pch-test.pl
+++ b/clang/utils/TestUtils/pch-test.pl
@@ -1,7 +1,7 @@
#!/usr/bin/perl -w
# This tiny little script, which should be run from the clang
-# directory (with clang-cc in your patch), tries to take each
+# directory (with clang in your patch), tries to take each
# compilable Clang test and build a PCH file from that test, then read
# and dump the contents of the PCH file just created.
use POSIX;
@@ -17,12 +17,12 @@ sub testfiles($$) {
@files = `ls test/*/*.$suffix`;
foreach $file (@files) {
chomp($file);
- my $code = system("clang-cc -fsyntax-only -x $language $file > /dev/null 2>&1");
+ my $code = system("clang- -fsyntax-only -x $language $file > /dev/null 2>&1");
if ($code == 0) {
print(".");
- $code = system("clang-cc -emit-pch -x $language -o $file.pch $file > /dev/null 2>&1");
+ $code = system("clang -cc1 -emit-pch -x $language -o $file.pch $file > /dev/null 2>&1");
if ($code == 0) {
- $code = system("clang-cc -include-pch $file.pch -x $language -ast-dump /dev/null > /dev/null 2>&1");
+ $code = system("clang -cc1 -include-pch $file.pch -x $language -ast-dump /dev/null > /dev/null 2>&1");
if ($code == 0) {
$passed++;
} elsif (($code & 0xFF) == SIGINT) {
diff --git a/clang/www/analyzer/installation.html b/clang/www/analyzer/installation.html
index 81f45514fc01..d2be711a4860 100644
--- a/clang/www/analyzer/installation.html
+++ b/clang/www/analyzer/installation.html
@@ -87,13 +87,13 @@ source code.
-- The locations of the clang-cc and clang binaries.
+
- The location of the clang binary.
For example, if you built a Debug build of LLVM/Clang, the
-resultant binaries will be in $(OBJDIR)/Debug (where $(OBJDIR)
-is often the same as the root source directory). You can also do
-make install to install the LLVM/Clang libaries and binaries to
-the installation directory of your choice (specified when you run
+resultantclang binary will be in $(OBJDIR)/Debug
+(where $(OBJDIR) is often the same as the root source directory). You
+can also do make install to install the LLVM/Clang libaries and
+binaries to the installation directory of your choice (specified when you run
configure).
- The locations of the scan-build and scan-view
diff --git a/clang/www/get_started.html b/clang/www/get_started.html
index b7df928d27a8..f750fa09216c 100644
--- a/clang/www/get_started.html
+++ b/clang/www/get_started.html
@@ -73,22 +73,12 @@ follows:
Try it out (assuming you add llvm/Debug/bin to your path):
- - clang-cc --help
- - clang-cc file.c -fsyntax-only (check for correctness)
- - clang-cc file.c -ast-dump (internal debug dump of ast)
- - clang-cc file.c -ast-view (set up graphviz
- and rebuild llvm first)
- - clang-cc file.c -emit-llvm (print out unoptimized llvm code)
- - clang-cc file.c -emit-llvm -o - | llvm-as | opt -std-compile-opts |
- llvm-dis (print out optimized llvm code)
- - clang-cc file.c -emit-llvm -o - | llvm-as | opt -std-compile-opts | llc
- > file.s (output native machine code)
+ - clang --help
+ - clang file.c -fsyntax-only (check for correctness)
+ - clang file.c -S -emit-llvm -o - (print out unoptimized llvm code)
+ - clang file.c -S -emit-llvm -o - -O3
+ - clang file.c -S -O3 -o - (output native machine code)
- Note: Here clang-cc is the "low-level" frontend
- executable that is similar in purpose to cc1. Clang also has a high-level compiler driver that acts as a drop-in
- replacement for gcc.
Note that the C front-end uses LLVM, but does not depend on llvm-gcc. If you
@@ -159,10 +149,8 @@ Visual Studio:
Build Clang:
- Open LLVM.sln in Visual Studio.
- - Build the "clang-cc" project for just the compiler front end.
- Alternatively, build the "clang" project for the compiler driver
- (note that the driver is currently broken on Windows),
- or the "ALL_BUILD" project to build everything, including tools.
+ - Build the "clang" project for just the compiler driver and front end, or
+ the "ALL_BUILD" project to build everything, including tools.
Try it out (assuming you added llvm/debug/bin to your path). (See the
running examples from above.)
@@ -175,13 +163,11 @@ Visual Studio:
to the latest code base, use the svn update command in both the
llvm and llvm\tools\clang directories, as they are separate repositories.
-High-Level Compiler Driver (Drop-in Substitute for GCC)
+Clang Compiler Driver (Drop-in Substitute for GCC)
-While the clang-cc executable is a low-level frontend executable
-that can perform code generation, program analysis, and other actions, it is not
-designed to be a drop-in replacement for GCC's cc. For this purpose,
-use the high-level driver, aptly named clang. Here are some
-examples of how to use the high-level driver:
+
The clang tool is the compiler driver and front-end, which is
+designed to be a drop-in replacement for the gcc command. Here are
+some examples of how to use the high-level driver:
@@ -201,12 +187,6 @@ hello world
Examples of using Clang
-The high-level driver clang is designed to understand most of GCC's
-options, and the lower-level clang-cc executable also directly takes
-many of GCC's options. You can see which options clang-cc accepts with
-'clang-cc --help'. Here are a few examples of using clang and
-clang-cc:
-