• Home
  • History
  • Annotate
  • only in /external/clang/lib/Frontend/
History log of /external/clang/lib/Frontend/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a4de17562d13d7a8188108243c4cfbd52f33229a 04-Mar-2016 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r256229

http://b/26987366

(cherry picked from commit 87d948ecccffea9e9e37d0d053b246e2d6d6c47b)

Change-Id: I10ca401a280e905253aafabad9118693a2f24ffb
STMerge.cpp
STUnit.cpp
ndroid.mk
MakeLists.txt
acheTokens.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
ependencyFile.cpp
iagnosticRenderer.cpp
rontendAction.cpp
rontendActions.cpp
eaderIncludeGen.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
ogDiagnosticPrinter.cpp
oduleDependencyCollector.cpp
ultiplexConsumer.cpp
CHContainerOperations.cpp
rintPreprocessedOutput.cpp
ewrite/FixItRewriter.cpp
ewrite/FrontendActions.cpp
ewrite/InclusionRewriter.cpp
ewrite/RewriteModernObjC.cpp
ewrite/RewriteObjC.cpp
erializedDiagnosticPrinter.cpp
estModuleFileExtension.cpp
estModuleFileExtension.h
extDiagnostic.cpp
b6d6993e6e6d3daf4d9876794254d20a134e37c2 01-Jul-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r239765

Change-Id: I0393bcc952590a7226af8c4b58534a8ee5fd2d99
STMerge.cpp
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
ependencyFile.cpp
rontendAction.cpp
rontendActions.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
ultiplexConsumer.cpp
rintPreprocessedOutput.cpp
ewrite/InclusionRewriter.cpp
ewrite/RewriteObjC.cpp
extDiagnostic.cpp
extDiagnosticBuffer.cpp
erifyDiagnosticConsumer.cpp
e9a54b6cc25f564aa5c99b62e888e484cede3959 20-May-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master Clang with patches for fp16

Cherry-pick Clang revision r237406

Change-Id: I8670bec201bf76b426495884ed80b9280ac85023
ompilerInvocation.cpp
58878f85ab89b13e9eea4af3ccf055e42c557bc8 06-May-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r235153

Change-Id: Ia94bbcb6da7c75b6e7c2afedd1001094d62a7324
STUnit.cpp
acheTokens.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
rontendAction.cpp
rontendActions.cpp
eaderIncludeGen.cpp
nitHeaderSearch.cpp
ewrite/RewriteModernObjC.cpp
ewrite/RewriteObjC.cpp
erializedDiagnosticPrinter.cpp
erifyDiagnosticConsumer.cpp
3ea9e33ea25e0c2b12db56418ba3f994eb662c04 08-Apr-2015 Pirama Arumuga Nainar <pirama@google.com> Update aosp/master clang for rebase to r233350

Change-Id: I12d4823f10bc9e445b8b86e7721b71f98d1df442
STUnit.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
rontendAction.cpp
rontendActions.cpp
rontendOptions.cpp
nitHeaderSearch.cpp
oduleDependencyCollector.cpp
ultiplexConsumer.cpp
ewrite/RewriteModernObjC.cpp
ewrite/RewriteObjC.cpp
erializedDiagnosticPrinter.cpp
0e2c34f92f00628d48968dfea096d36381f494cb 23-Mar-2015 Stephen Hines <srhines@google.com> Update aosp/master clang for rebase to r230699.

Change-Id: I6a546ab3d4ae37119eebb735e102cca4f80ab520
STConsumers.cpp
STUnit.cpp
odeGenOptions.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
rontendAction.cpp
rontendActions.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
oduleDependencyCollector.cpp
ultiplexConsumer.cpp
rintPreprocessedOutput.cpp
ewrite/InclusionRewriter.cpp
ewrite/RewriteModernObjC.cpp
ewrite/RewriteObjC.cpp
erializedDiagnosticPrinter.cpp
erializedDiagnosticReader.cpp
extDiagnostic.cpp
176edba5311f6eff0cad2631449885ddf4fbc9ea 01-Dec-2014 Stephen Hines <srhines@google.com> Update aosp/master Clang for rebase to r222490.

Change-Id: Ic557ac55e97fbf6ee08771c7b7c3594777b0aefd
STConsumers.cpp
STMerge.cpp
STUnit.cpp
ndroid.mk
MakeLists.txt
acheTokens.cpp
hainedIncludesSource.cpp
odeGenOptions.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
ependencyFile.cpp
ependencyGraph.cpp
iagnosticRenderer.cpp
rontendAction.cpp
rontendActions.cpp
eaderIncludeGen.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
ogDiagnosticPrinter.cpp
akefile
oduleDependencyCollector.cpp
ultiplexConsumer.cpp
rintPreprocessedOutput.cpp
ewrite/Android.mk
ewrite/CMakeLists.txt
ewrite/FixItRewriter.cpp
ewrite/FrontendActions.cpp
ewrite/HTMLPrint.cpp
ewrite/InclusionRewriter.cpp
ewrite/Makefile
ewrite/RewriteMacros.cpp
ewrite/RewriteModernObjC.cpp
ewrite/RewriteObjC.cpp
ewrite/RewriteTest.cpp
erializedDiagnosticPrinter.cpp
erializedDiagnosticReader.cpp
extDiagnostic.cpp
extDiagnosticPrinter.cpp
erifyDiagnosticConsumer.cpp
e559960d1ce602c55b8a4800068148f0ccf5defd 19-Sep-2014 Tong Shen <endlessroad@google.com> Add libclang for target.

Change-Id: I3dc5de6c1a4e7f5ba64196dd8ee0965ef10d4e8b
ndroid.mk
c568f1e98938584c0ef0b12ae5018ff7d90a4072 21-Jul-2014 Stephen Hines <srhines@google.com> Update Clang for rebase to r212749.

This also fixes a small issue with arm_neon.h not being generated always.

Includes a cherry-pick of:
r213450 - fixes mac-specific header issue
r213126 - removes a default -Bsymbolic on Android

Change-Id: I2a790a0f5d3b2aab11de596fc3a74e7cbc99081d
STUnit.cpp
ndroid.mk
MakeLists.txt
acheTokens.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
ependencyFile.cpp
iagnosticRenderer.cpp
rontendAction.cpp
rontendActions.cpp
eaderIncludeGen.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
ogDiagnosticPrinter.cpp
oduleDependencyCollector.cpp
rintPreprocessedOutput.cpp
extDiagnostic.cpp
extDiagnosticPrinter.cpp
erifyDiagnosticConsumer.cpp
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
STConsumers.cpp
STUnit.cpp
ndroid.mk
MakeLists.txt
acheTokens.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
ependencyFile.cpp
ependencyGraph.cpp
iagnosticRenderer.cpp
rontendAction.cpp
rontendActions.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
angStandards.cpp
ogDiagnosticPrinter.cpp
ultiplexConsumer.cpp
rintPreprocessedOutput.cpp
erializedDiagnosticPrinter.cpp
extDiagnosticBuffer.cpp
extDiagnosticPrinter.cpp
erifyDiagnosticConsumer.cpp
arnings.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
STConsumers.cpp
STMerge.cpp
STUnit.cpp
ndroid.mk
MakeLists.txt
acheTokens.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
ependencyFile.cpp
ependencyGraph.cpp
iagnosticRenderer.cpp
rontendAction.cpp
rontendActions.cpp
eaderIncludeGen.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
ogDiagnosticPrinter.cpp
ultiplexConsumer.cpp
rintPreprocessedOutput.cpp
erializedDiagnosticPrinter.cpp
extDiagnostic.cpp
extDiagnosticBuffer.cpp
erifyDiagnosticConsumer.cpp
1fab7c3e3bd97a909a80b1bfea1909c6e7347fc0 12-Feb-2014 Stephen Hines <srhines@google.com> Merge remote-tracking branch 'upstream/release_34' into merge-20140211

Conflicts:
lib/Basic/Targets.cpp
lib/Sema/SemaDeclAttr.cpp

Change-Id: I17ca7161f32007272ee82036d237d051847dd02e
c78e5b33cb2dccfd7972eed2bc4a785cfa42bf94 28-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195888:
------------------------------------------------------------------------
r195888 | rsmith | 2013-11-27 14:58:16 -0800 (Wed, 27 Nov 2013) | 2 lines

Add support for C++'s SD6 feature test macros.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@195899 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
762e567ee54171662111534108aebf8f1c0b303c 18-Nov-2013 Sylvestre Ledru <sylvestre@debian.org> Using an invalid -O falls back on -O3 instead of an error

Summary:
Currently with clang:
$ clang -O20 foo.c
error: invalid value '20' in '-O20'

With the patch:
$ clang -O20 foo.c
warning: optimization level '-O20' is unsupported; using '-O3' instead.
1 warning generated.

This matches the gcc behavior (with a warning added)

Pass all tests:
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 94.14s
Expected Passes : 6721
Expected Failures : 20
Unsupported Tests : 17

(which was not the case of http://llvm-reviews.chandlerc.com/D2125)

Differential Revision: http://llvm-reviews.chandlerc.com/D2212

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195009 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ce5b5f13a6c90904040b29b9eb765bb7cd736f0b 17-Nov-2013 Hal Finkel <hfinkel@anl.gov> Add -freroll-loops to enable loop rerolling

This adds -freroll-loops (and -fno-reroll-loops in the usual way) to enable
loop rerolling as part of the optimization pass manager. This transformation
can enable vectorization, reduce code size (or both).

Briefly, loop rerolling can transform a loop like this:

for (int i = 0; i < 3200; i += 5) {
a[i] += alpha * b[i];
a[i + 1] += alpha * b[i + 1];
a[i + 2] += alpha * b[i + 2];
a[i + 3] += alpha * b[i + 3];
a[i + 4] += alpha * b[i + 4];
}

into this:

for (int i = 0; i < 3200; ++i) {
a[i] += alpha * b[i];
}

Loop rerolling is currently disabled by default at all optimization levels.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194967 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e22017e0b691ff02616e6a8e670b721d078d4bc9 15-Nov-2013 Alp Toker <alp@nuanti.com> Revert "Using an invalid -O falls back on -O3 instead of an error"

Trying to fix test failures since earlier today.

One of the tests added in this commit is outputting test/Driver/clang_f_opts.s
which the builders that build in-tree (eg. clang-native-arm-cortex-a9) are
trying to run as a test case, causing failures.

clang_f_opts.c:
If -### doesn't emit the warning then this test probably shouldn't be in
here in the first place. Frontend maybe?

invalid-o-level.c:
Running %clang_cc1 in the Driver tests doesn't make sense because -cc1
bypasses the driver. (I'm not reverting the commit that introduced this but
please fix instead of keeping it this way.)

Reverting to fix the build failures and also so that the tests can be thought
out more thoroughly.

This reverts commit r194817.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194845 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c3e16a2f1cbb4d08aec1b9b567afa97cd083bc4e 15-Nov-2013 Justin Bogner <mail@justinbogner.com> Darwin: Look for libc++ headers in include/, rather than lib/

Up until now we were expecting that when libc++ is installed alongside
clang the headers would be in lib/, which was true if the configure
build was used and false if the cmake build was.

We've now corrected the configure build to install in include/, and
with this change we'll be able to find the correct headers with both
build systems.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194834 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
eb4d7c3fceed6c6e4151489c0572cff36500db78 15-Nov-2013 Sylvestre Ledru <sylvestre@debian.org> Using an invalid -O falls back on -O3 instead of an error

Summary:
Currently with clang:
$ clang -O20 foo.c
error: invalid value '20' in '-O20'

With the patch:
$ clang -O20 foo.c
warning: optimization level '-O20' is unsupported; using '-O3' instead.
1 warning generated.

This matches the gcc behavior (with a warning added)

Pass all tests:
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 94.14s
Expected Passes : 6721
Expected Failures : 20
Unsupported Tests : 17

(which was not the case of http://llvm-reviews.chandlerc.com/D2125)

Reviewers: chandlerc, rafael, rengolin, hfinkel

Reviewed By: rengolin

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2152

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194817 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
26297f57634994b4ae47a0774c372d6944265bb2 15-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> When we hit a #include directive that maps to a module import, emit a token
representing the module import rather than making the module immediately
visible. This serves two goals:
* It avoids making declarations in the module visible prematurely, if we
walk past the #include during a tentative parse, for instance, and
* It gives a diagnostic (although, admittedly, not a very nice one) if
a header with a corresponding module is included anywhere other than
at the top level.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194782 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
2c050f6a68c4f871d26be63f8d598f1b64a8e16f 14-Nov-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [objcmt] Introduce "objcmt-white-list-dir-path=" option.

This options accepts a path to a directory, collects the filenames of the files
it contains, and the migrator will only modify files with the same filename.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194710 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
b85a9ec6df63f30bbdef9a3975b1d31a680b15c1 13-Nov-2013 Diego Novillo <dnovillo@google.com> Add -fprofile-sample-use to Clang's driver.

This adds a new option -fprofile-sample-use=filename to Clang. It
tells the driver to schedule the SampleProfileLoader pass and passes
on the name of the profile file to use.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194567 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
5d2a20671954f55f765b96375e8bcd38367cb3ba 13-Nov-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC migrator. Place use of NS_NONATOMIC_IOSONLY
on inferred property attribute under
-objcmt-ns-nonatomic-iosonly option.
// rdar://15442742


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194532 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
849f3ececee1293371bc0930fcb74b0a44f22c98 11-Nov-2013 Sylvestre Ledru <sylvestre@debian.org> Revert "Using an invalid -O falls back on -O3 instead of an error"

This reverts commit r194403.

Was breaking too many tests...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194420 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1cd76b1a44d74e9e2e8b8fcacc2d7ec290b54b76 11-Nov-2013 Sylvestre Ledru <sylvestre@debian.org> Using an invalid -O falls back on -O3 instead of an error

Summary:
Currently with clang:
$ clang -O20 foo.c
error: invalid value '20' in '-O20'

With the patch:
$ clang -O20 foo.c
warning: invalid value '20' in '-O20'. Fall back on value '3'

Reviewers: rengolin, hfinkel

Reviewed By: rengolin

CC: cfe-commits, hfinkel, rengolin

Differential Revision: http://llvm-reviews.chandlerc.com/D2125

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194403 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8442b6f8b8dccb334751a2836a8454229ebec1b0 08-Nov-2013 Douglas Gregor <dgregor@apple.com> Eliminate an unnecessary .c_str()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194228 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
195dd7c8448893e13a0cd8e776520f14cba65b08 06-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add a limit to the length of a sequence of 'operator->' functions we will
follow when building a class member access expression. Based on a patch by
Rahul Jain!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194161 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
cd569f2788ece55b9f790b6900164e2b2d5d966c 05-Nov-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC migrator. Please annotation of properties with
NS_RETURNS_INNER_POINTER under -objcmt-returns-innerpointer-property
flag (off by default), as older compilers do not support such annotations.
// rdar://15396636


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194100 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
3cebc73895daccea85984d8881b5b45c8f8df9c6 05-Nov-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y sized deallocation: if we have a use, but not a definition, of a sized
deallocation function (and the corresponding unsized deallocation function has
been declared), emit a weak discardable definition of the function that
forwards to the corresponding unsized deallocation.

This allows a C++ standard library implementation to provide both a sized and
an unsized deallocation function, where the unsized one does not just call the
sized one, for instance by putting both in the same object file within an
archive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194055 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d9553e35e1e3af6fc4ca817b169dc796a5b54bcd 01-Nov-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC. Define a new cc1 flag
-fobjc-subscripting-legacy-runtime which is off
by default and on only when using ObjectiveC
legacy runtime. Use this flag to allow
array and dictionary subscripting and disallow
objectiveC pointer arithmatic in ObjectiveC
legacy runtime. // rdar://15363492


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193889 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
5794b53ad5b38b53c9eaf3a172354e63081ceb2f 28-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Allow a new syntax in a module requires-declaration:

requires ! feature

The purpose of this is to allow (for instance) the module map for /usr/include
to exclude <tgmath.h> and <complex.h> when building in C++ (these headers are
instead provided by the C++ standard library in this case, and the glibc C
<tgmath.h> header would otherwise try to include <complex.h>, resulting in a
module cycle).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193549 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendActions.cpp
28ce23a550d386b32aa60abbbf308d164992eb1e 25-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> I am about to change llvm::MemoryBuffer::getFile take take a Twine. Change
clang first so that the build still works.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193428 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ee0cd37fe4a9f4e2ee73ae34cf93c410cb299a82 24-Oct-2013 Manuel Klimek <klimek@google.com> Use the same SourceManager for ModuleMaps and compilations.

This allows using virtual file mappings on the original SourceManager to
map in virtual module.map files. Without this patch, the ModuleMap
search will find a module.map file (as the FileEntry exists in the
FileManager), but will be unable to get the content from the
SourceManager (as ModuleMap previously created its own SourceManager).

Two problems needed to be fixed which this patch exposed:

1. Storing the inferred module map
When writing out a module, the ASTWriter stores the names of the files
in the main source manager; when loading the AST again, the ASTReader
errs out if such a file is found missing, unless it is overridden.
Previously CompilerInstance's compileModule method would store the
inferred module map to a temporary file; the problem with this approach
is that now that the module map is handled by the main source manager,
the ASTWriter stores the name of the temporary module map as source to
the compilation; later, when the module is loaded, the temporary file
has already been deleted, which leads to a compilation error. This patch
changes the inferred module map to instead inject a virtual file into
the source manager. This both saves some disk IO, and works with how the
ASTWriter/ASTReader handle overridden source files.

2. Changing test input in test/Modules/Inputs/*
Now that the module map file is handled by the main source manager, the
VerifyDiagnosticConsumer will not ignore diagnostics created while
parsing the module map file. The module test test/Modules/renamed.m uses
-I test/Modules/Inputs and triggers recursive loading of all module maps
in test/Modules/Inputs, some of which had conflicting names, thus
leading errors while parsing the module maps. Those diagnostics already
occur on trunk, but before this patch they would not break the test, as
they were ignored by the VerifyDiagnosticConsumer. This patch thus
changes the module maps that have been recently introduced which broke
the invariant of compatible modules maps in test/Modules/Inputs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193314 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
b934d248d001d1536e074e3e8da8f47db63d719f 19-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Fix crash if a submodule @imports another submodule from the same module. The
test also adds FIXMEs for a number of places where imports and includes of
submodules don't work very well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193005 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
5ff6c115456b13078ab49466c921f31f5a400f23 18-Oct-2013 Hans Wennborg <hans@hanshq.net> Add another MinGW header include path

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192982 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
e96a7b4d99e8737b1dc8a3bd07038f885bc4263b 15-Oct-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] For an unscoped enum include the enumerators in the top-level code-completion hash since they enter the top-level namespace.

rdar://14703327

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192720 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
96d6c4596587df59821da10270d2102da4a49b73 11-Oct-2013 Manman Ren <manman.ren@gmail.com> Turn struct-path aware TBAA on by default.

Use -no-struct-path-tbaa to turn it off.
This is the same as r191695, which was reverted because it depends on a
commit that has issues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192497 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ff05979144fc199e229aaeb1d248867d87d0d866 11-Oct-2013 Nick Lewycky <nicholas@mxc.ca> Add -fno-function-sections and -fno-data-sections. Since
-f{function,data}-sections had no tests at all, add some, and verify that the
-fno variants work as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192413 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
39ebb02cb0bd342ced56de6d19aa9992aa0371b8 09-Oct-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC migrator. Introduce a new objcmt-atomic-property option
and use it to infer all properties as 'atomic'.
// rdar://14988132


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192317 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
9a7e09fffbad657f775417252bc966098dfb1501 07-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Remove -ast-dump-xml.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192131 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ompilerInvocation.cpp
rontendActions.cpp
a00f8737e671b587e83280a53e85562c00a7a78d 02-Oct-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC migrator: Add more options one for each
kind of migration. // rdar://15003157



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191858 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
081099d302b79d1746c7a39da14e3265971eb718 02-Oct-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC migrator. Starting distiguising different
migrations under their own option.
wip and // rdar://15003157


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191855 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
72c26c0d47eb850db18b784403260bce0632c478 02-Oct-2013 Reid Kleckner <reid@kleckner.net> Accept #pragma warning(push, 0) without warning

This partially addresses PR17435, but it doesn't actually implement the
pragma. If we implement it, we should map levels 1-4 to something like
-Wall and level 0 to something like -w.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191833 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
1596e5b368ddbdc4b9c3ecab75115b179b6e5391 01-Oct-2013 Richard Smith <richard-llvm@metafoo.co.uk> Revert r191586 and r191695. They cause crashes when building with
-relaxed-aliasing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191725 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
03928403af872d3b04d1d5d5a5c4be2d4d366af4 30-Sep-2013 Manman Ren <manman.ren@gmail.com> Turn struct-path aware TBAA on by default.

Use -no-struct-path-tbaa to turn it off.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191695 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
5ada7a5e9747e03e8c3725b1b4d00e2a9f448e9e 29-Sep-2013 Ed Schouten <ed@80386.nl> Add character set related __STDC_* definitions.

Clang uses UTF-16 and UTF-32 for its char16_t's and char32_t's
exclusively. This means that we can define __STDC_UTF_16__ and
__STDC_UTF_32__ unconditionally.

While there, define __STDC_MB_MIGHT_NEQ_WC__ for FreeBSD. FreeBSD's
wchar_t's don't encode characters as ISO-10646; the encoding depends on
the locale used. Because the character set used might not be a superset
of ASCII, we must define __STDC_MB_MIGHT_NEQ_WC__.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191631 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
4cb295d3b32cb04215f87948fbf944ee4c31de1b 29-Sep-2013 Richard Smith <richard-llvm@metafoo.co.uk> Implement C++1y sized deallocation (n3778). This is not enabled by -std=c++1y;
instead, it's enabled by the -cc1 flag -fsized-deallocation, until we sort out
the backward-compatibility issues.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191629 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
14f9889b9b88f73a891688d7732bf01a127d9e7c 27-Sep-2013 Rafael Espindola <rafael.espindola@gmail.com> Replace -fobjc-default-synthesize-properties with disable-objc-default-synthesize-properties.

We want the modern behavior most of the time, so inverting the option simplifies
the driver and the tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191551 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1b8840ce0d7a3383915b29dc3779dfadec817458 24-Sep-2013 Daniel Jasper <djasper@google.com> Add -fmodule-map-file option.

With this option, arbitrarily named module map files can be specified
to be loaded as required for headers in the respective (sub)directories.

This, together with the extern module declaration allows for specifying
module maps in a modular fashion without the need for files called
"module.map".

Among other things, this allows a directory to contain two modules that
are completely independent of one another.

Review: http://llvm-reviews.chandlerc.com/D1697.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191284 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ddd2dfc1d3f4a36cbe8cd775c588623a17049f9f 24-Sep-2013 Daniel Jasper <djasper@google.com> Module use declarations (II)

Review: http://llvm-reviews.chandlerc.com/D1546.

I have picked up this patch form Lawrence
(http://llvm-reviews.chandlerc.com/D1063) and did a few changes.

From the original change description (updated as appropriate):
This patch adds a check that ensures that modules only use modules they
have so declared. To this end, it adds a statement on intended module
use to the module.map grammar:

use module-id

A module can then only use headers from other modules if it 'uses' them.
This enforcement is off by default, but may be turned on with the new
option -fmodules-decluse.

When enforcing the module semantics, we also need to consider a source
file part of a module. This is achieved with a compiler option

-fmodule-name=<module-id>.

The compiler at present only applies restrictions to the module directly
being built.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191283 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
89e32745123c02159fa1d1f19f96bdd4173029f0 24-Sep-2013 Hans Wennborg <hans@hanshq.net> clang-cl: print diagnostics as "error(clang): foo" in /fallback mode

This solves two problems:

1) MSBuild will not flag the build as unsuccessful just because we print
an error in the output, since "error(clang):" doesn't seem to match
the regex it's using.

2) It becomes more clear that the diagnostic is coming from clang as
supposed to cl.exe.

Differential Revision: http://llvm-reviews.chandlerc.com/D1735

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191250 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnostic.cpp
extDiagnosticPrinter.cpp
767b3d2000a00c56e1a3c19372810e2b7d66b76c 22-Sep-2013 Benjamin Kramer <benny.kra@googlemail.com> Fix array_pod_sort predicates after LLVM change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@191176 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
d2f9308220af22bfc1bcd3bc2cad118dbd8be013 19-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Make Preprocessor::Lex non-recursive.

Before this patch, Lex() would recurse whenever the current lexer changed (e.g.
upon entry into a macro). This patch turns the recursion into a loop: the
various lex routines now don't return a token when the current lexer changes,
and at the top level Preprocessor::Lex() now loops until it finds a token.
Normally, the recursion wouldn't end up being very deep, but the recursion depth
can explode in edge cases like a bunch of consecutive macros which expand to
nothing (like in the testcase test/Preprocessor/macro_expand_empty.c in this
patch).

<rdar://problem/14569770>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190980 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
0295c238f7b4329f86498055337f91f25465f836 17-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Fix potential race in module building code.

Let the module building code handle the case of overwriting an existing file
itself, so the existing locking infrastructure works correctly.

<rdar://problem/14403381>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190833 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
585c84c5afd91f57b84b0236aa28620438cfe636 16-Sep-2013 Benjamin Kramer <benny.kra@googlemail.com> Add a define for the ObjFW runtime ABI version.

This removes __has_feature(objc_msg_lookup_stret), as it is not required
anymore after this patch.

Patch by Jonathan Schleifer!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190791 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
2ee042dee9f7693665e28463955401905474a284 14-Sep-2013 Reid Kleckner <reid@kleckner.net> Lex and ignore Microsoft's #pragma warning(...)

Summary:
This fixes PR17145 and avoids unknown pragma warnings.

This change does not attempt to map MSVC warning numbers to clang
warning flags. Perhaps in the future we will implement a mapping for
some common subset of Microsoft warnings, but for now we don't.

Reviewers: rsmith

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D1652

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190726 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
0b5ca510fb00eeb19ab82ebfd3c2585404bc9aa8 13-Sep-2013 David Blaikie <dblaikie@gmail.com> Remove unnecessary inclusion of Sema.h

Let me tell you a tale...

Within some twisted maze of debug info I've ended up implementing an
insane man's Include What You Use device. When the debugger emits debug
info it really shouldn't, I find out why & then realize the code could
be improved too.

In this instance CIndexDiagnostics.cpp had a lot more debug info with
Clang than GCC. Upon inspection a major culprit was all the debug info
describing clang::Sema. This was emitted because clang::Sema is
befriended by DiagnosticEngine which was rightly required, but GCC
doesn't emit debug info for friends so it never emitted anything for
Clang. Clang does emit debug info for friends (will be fixed/changed to
reduce debug info size).

But why didn't Clang just emit a declaration of Sema if this entire TU
didn't require a definition?

1) Diagnostic.h did the right thing, only using a declaration of Sema
and not including Sema.h at all.
2) Some other dependency of CIndexDiagnostics.cpp didn't do the right
thing. ASTUnit.h, only needing a declaration, still included Sema.h
(hence this commit which removes that include and adds the necessary
includes to the cpp files that were relying on this)
3) -flimit-debug-info didn't save us because of
EnterExpressionEvaluationContext, defined inline in Sema.h which fires
the "requiresCompleteType" check/flag (since it uses nested types from
Sema and calls Sema member functions) and thus, if debug info is ever
emitted for the type, the whole type is emitted and not just a
declaration.

Improving -flimit-debug-info to account for this would be... hard.
Modifying the code so that's not 'required to be complete' might be
possible, but probably only by moving EnterExpressionEvaluationContext
either into Sema, or out of Sema.h. That might be a bit too much of a
contortion to be bothered with.

Also, this is only one of the cases where emitting debug info for
friends caused us to emit a lot more debug info (this change reduces
Clang's DWO size by 0.93%, dropping friends entirely reduces debug info
by 3.2%) - I haven't hunted down the other cases, but I assume they
might be similar (Sema or something like it). IWYU or a similar tool
might help us reduce build times a bit, but analyzing debug info to find
these differences isn't worthwhile. I'll take the 3.2% win, provide this
small improvement to the code itself, and move on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190715 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1eef85246b411b55c493098266746d0d83c241ea 13-Sep-2013 David Tweed <david.tweed@arm.com> Certain multi-platform languages, such as OpenCL, have the concept of
address spaces which is both (1) a "semantic" concept and
(2) possibly a hardware level restriction. It is desirable to
be able to discard/merge the LLVM-level address spaces on arguments for which
there is no difference to the current backend while keeping
track of the semantic address spaces in a funciton prototype. To do this
enable addition of the address space into the name-mangling process. Add
some tests to document this behaviour against inadvertent changes.

Patch by Michele Scandale!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190684 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
fc3389701ead32709ba84825e4c06651065da2c0 12-Sep-2013 Hans Wennborg <hans@hanshq.net> Move Compilation::PrintJob and PrintDiagnosticJob into Job::Print.

This moves the code to Job.cpp, which seems like a more natural fit,
and replaces the "is this a JobList? is this a Command?" logic with
a virtual function call.

It also removes the code duplication between PrintJob and
PrintDiagnosticJob and simplifies the code a little.

There's no functionality change here, except that the Executable is
now always printed within quotes, whereas it would previously not be
quoted in crash reports, which I think was a bug.

Differential Revision: http://llvm-reviews.chandlerc.com/D1653

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190620 91177308-0d34-0410-b5e6-96231b3b80d8
reateInvocationFromCommandLine.cpp
2956ef43da9c0e7bce8fae4a015255a2c19458bb 11-Sep-2013 Nico Rieck <nico.rieck@gmail.com> Add -fansi-escape-codes option

Some build systems use pipes for stdin/stderr. On nix-ish platforms colored
output can be forced by -fcolor-diagnostics. On Windows this option has
no effect in these cases because LLVM uses the console API (which only
operates on the console buffer) even if a console wrapper capable of
interpreting ANSI escape codes is used.

The -fansi-escape-codes option allows switching from the console API to
ANSI escape codes. It has no effect on other platforms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190464 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8bc56022db2d9b16aab25ce3b6fccda9dd8991fc 09-Sep-2013 David Tweed <david.tweed@arm.com> The OpenCL standard specifies the sizes and alignments of various types than other C-family
languages, as well as specifying errno is not set by the math functions. Make the
clang front-end set those appropriately when the OpenCL language option is set.

Patch by Erik Schnetter!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190296 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7b7bef1ec355fb46643349d77c266b913f36b656 05-Sep-2013 Stepan Dyatkovskiy <stpworld@narod.ru> Add new methods for TargetInfo:
getRealTypeByWidth and getIntTypeByWidth
for ASTContext names are almost same(invokes new methods from TargetInfo):
getIntTypeForBitwidth and getRealTypeForBitwidth.

As first commit for PR16752 fix: 'mode' attribute for unusual targets doesn't work properly
Description:
Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp).
For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only.
Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct.
Please consider the next solution:
1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth virtual methods. By default current behaviour could be implemented here.
2. Fix handleModeAttr according to new methods in TargetInfo.
This approach is implemented in the patch attached to this post.

Fixes:
1st Commit (Current): Add new methods for TargetInfo:
getRealTypeByWidth and getIntTypeByWidth
for ASTContext names are almost same(invokes new methods from TargetInfo):
getIntTypeForBitwidth and getRealTypeForBitwidth

2nd Commit (Next): Fix SemaDeclAttr, handleModeAttr function.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190044 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
86164e8f51fa89a3ec904607c3848dc4a21b12cf 05-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Note when a decl is used in AST files.

When an AST file is built based on another AST file, it can use a decl from
the fist file, and therefore mark the "isUsed" bit. We need to note this in
the AST file so that the bit is set correctly when the second AST file is
loaded.

This patch introduces the distinction between setIsUsed() and markUsed() so
that we don't call into the ASTMutationListener callback when it wouldn't
be appropriate.

Fixes PR16635.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190016 91177308-0d34-0410-b5e6-96231b3b80d8
ultiplexConsumer.cpp
617f4c5796b36017695b787a305bb42b93c5e4cf 03-Sep-2013 Eric Christopher <echristo@gmail.com> Attempt to migrate default dwarf version to 4 for linux.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189823 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
3432b7800d447267f4353e70a319f6f5a0bb4aab 29-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Properly escape filenames in line directives.

Fixes PR17018. Only partial test coverage because I don't want
to try to write a test which generates a file whose name contains a newline.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189557 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
5b98aba1d74184923da32016c3abbc20e9a7686d 29-Aug-2013 Fariborz Jahanian <fjahanian@apple.com> ObjectiveC migrator. This patch infers readonly properties for no-parameter
instance methods returning non-void. This will be quite noisy. So, it is
placed under a new migrator flag -objcmt-migrate-readonly-property.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189537 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
62c90e188931e01fc5b08eae8b25de43ed3a1a7c 28-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Handle -D arguments ending in a backslash.

We translate these into #define directives; to preserve gcc-compatible
semantics (where the expanded macro includes the backslash), we add
an extra "\\\n" to the end of the synthesized "#define".

<rdar://problem/14810220>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189511 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
809d254c1f1521c141c8807638c29d67b50ebf29 24-Aug-2013 Benjamin Kramer <benny.kra@googlemail.com> This wasn't headers, just missing namespaces.

/me bows head in shame.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189172 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a9bdbce589c28d8e89d816c82fae72a303600994 24-Aug-2013 Benjamin Kramer <benny.kra@googlemail.com> Replace compLocDecl with less_first.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189170 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
24146975f1af8c1b4b14e8545f218129d0e7dfeb 22-Aug-2013 Eli Friedman <eli.friedman@gmail.com> Split isFromMainFile into two functions.

Basically, isInMainFile considers line markers, and isWrittenInMainFile
doesn't. Distinguishing between the two is useful when dealing with
files which are preprocessed files or rewritten with -frewrite-includes
(so we don't, for example, print useless warnings).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188968 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
5389b84a780ac17b63c10ad97cd5e3aaa41595b7 21-Aug-2013 Rafael Espindola <rafael.espindola@gmail.com> Move -mfpmath handling to -cc1 and implement it for x86.

The original idea was to implement it all on the driver, but to do that the
driver needs to know the sse level and to do that it has to know the default
features of a cpu.

Benjamin Kramer pointed out that if one day we decide to implement support for
' __attribute__ ((__target__ ("arch=core2")))', then the frontend needs to
keep its knowledge of default features of a cpu.

To avoid duplicating which part of clang handles default cpu features,
it is probably better to handle -mfpmath in the frontend.

For ARM this patch is just a small improvement. Instead of a cpu list, we
check if neon is enabled, which allows us to reject things like

-mcpu=cortex-a9 -mfpu=vfp -mfpmath=neon

For X86, since LLVM doesn't support an independent ssefp feature, we just
make sure the selected -mfpmath matches the sse level.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188939 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
dcc520ebc7d8631e24781de62168f816dab6c65c 18-Aug-2013 NAKAMURA Takumi <geek4civic@gmail.com> InitHeaderSearch.cpp: [Cygwin] Add 4.7.3.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188638 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
5fba5a789a238c29ef811a39a39be722443ec1b1 16-Aug-2013 Jordan Rose <jordan_rose@apple.com> [analyzer] Merge TextPathDiagnostics and ClangDiagPathDiagConsumer.

This once again restores notes to following their associated warnings
in -analyzer-output=text mode. (This is still only intended for use as a
debugging aid.)

One twist is that the warning locations in "regular" analysis output modes
(plist, multi-file-plist, html, and plist-html) are reported at a different
location on the command line than in the output file, since the command
line has no path context. This commit makes -analyzer-output=text behave
like a normal output format, which means that the *command line output
will be different* in -analyzer-text mode. Again, since -analyzer-text is
a debugging aid and lo-fi stand-in for a regular output mode, this change
makes sense.

Along the way, remove a few pieces of stale code related to the path
diagnostic consumers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188514 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
a3bf897544692cf71e34f090f39b54f9adf5c8cc 12-Aug-2013 Benjamin Kramer <benny.kra@googlemail.com> SourceManager intialization tweaks.

- Open files before calling stat on them.
- Go through FileManager for getting the buffer of named pipes. It has the
necessary plumbing to deal with "volatile" files.
- Print the cause when stdin reading fails. The only case I can imagine where
this happens is when stdin is wired to a device file, so no test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188178 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
708002ede3938256a6223d153a0c040f7a40f5cc 09-Aug-2013 Hans Wennborg <hans@hanshq.net> clang-cl: Support /showIncludes

This option prints information about #included files to stderr. Clang could
already do it, this patch just teaches the existing code about the /showIncludes
style and adds the flag.

Differential Revision: http://llvm-reviews.chandlerc.com/D1333

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188037 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
eaderIncludeGen.cpp
b26404a7505dab7ec3a16f6e3b85f95cfd59ba93 08-Aug-2013 Chandler Carruth <chandlerc@gmail.com> The only useful loop unrolling flag to give realistically is
'-fno-unroll-loops'. The option to the backend is even called
'DisableUnrollLoops'. This is precisely the form that Clang *didn't*
support. We didn't recognize the flag, we didn't pass it to the CC1
layer, and even if we did we wouldn't use it. Clang only inspected the
positive form of the flag, and only did so to enable loop unrolling when
the optimization level wasn't high enough. This only occurs for an
optimization level that even has a chance of running the loop unroller
when optimizing for size.

This commit wires up the 'no' variant, and switches the code to actually
follow the standard flag pattern of using the last flag and allowing
a flag in either direction to override the default.

I think this is still wrong. I don't know why we disable the loop
unroller entirely *from Clang* when optimizing for size, as the loop
unrolling pass *already has special logic* for the case where the
function is attributed as optimized for size! We should really be
trusting that. Maybe in a follow-up patch, I don't really want to change
behavior here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187969 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
4ac73c7514f9e836b4d9781738f333c5cb91cb63 08-Aug-2013 Stephen Hines <srhines@google.com> Merge commit '51e75aecf4fb303b91c9e54fd88e3509e5acc7a6' into merge-20130807

Conflicts:
lib/Basic/Targets.cpp
lib/Sema/SemaDeclAttr.cpp

Change-Id: If457223ecbee9e43c73d15333bf10d36590d05c4
b3574796d7cc0113e54b6516fc16e17ca09459fb 08-Aug-2013 Hans Wennborg <hans@hanshq.net> clang-cl: Support the run-time selection options (/MD, /MT et al.)

These flags set some preprocessor macros and injects a dependency
on the runtime library into the object file, which later is picked up
by the linker.

This also adds a new CC1 flag for adding a dependent library.

Differential Revision: http://llvm-reviews.chandlerc.com/D1315

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187945 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
51e75aecf4fb303b91c9e54fd88e3509e5acc7a6 07-Aug-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] Fix a PCH serialization crash, with invalid code related to forward enum references.

The problem was that an enum without closing semicolon could be associated as a forward enum
in an erroneous declaration, leading to the identifier being associated with the enum decl but
without a declaration actually referencing it.
This resulted in not having it serialized before serializing the identifier that is associated with.

Also prevent the ASTUnit from querying the serialized DeclID for an invalid top-level decl; it may not
have been serialized.

rdar://14539667

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187914 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ef4579cda09b73e3d4d98af48201da25adc29326 06-Aug-2013 Larisse Voufo <lvoufo@google.com> Started implementing variable templates. Top level declarations should be fully supported, up to some limitations documented as FIXMEs or TODO. Static data member templates work very partially. Static data member templates of class templates need particular attention...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187762 91177308-0d34-0410-b5e6-96231b3b80d8
ultiplexConsumer.cpp
056ec12ca14ee5014ea49786f719ceaa299a7e19 05-Aug-2013 Daniel Jasper <djasper@google.com> Add option to disable module loading.

This patch was created by Lawrence Crowl and reviewed in:
http://llvm-reviews.chandlerc.com/D963

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187738 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
4ed47ccf892de9b725f64d6cfc309f0461105ba5 02-Aug-2013 Hans Wennborg <hans@hanshq.net> CC1: Only parse command-line options that have the CC1Option flag.

We already reject flags that don't have the CC1Option flag,
but we would previously do so after parsing the command-line
arguments.

Since the option parser now has a parameter for excluding options,
we should just use that instead.

Differential Revision: http://llvm-reviews.chandlerc.com/D1270

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187668 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
0fda0f75f053ad9afdb2bb8d4ea72c5e6a49d657 01-Aug-2013 Rafael Espindola <rafael.espindola@gmail.com> Use llvm::sys::fs::UniqueID for windows and unix.

This unifies the unix and windows versions of FileManager::UniqueDirContainer
and FileManager::UniqueFileContainer by using UniqueID.

We cannot just replace "struct stat" with llvm::sys::fs::file_status, since we
want to be able to construct fake ones, and file_status has different members
on unix and windows.

What the patch does is:

* Record only the information that clang is actually using.
* Use llvm::sys::fs::status instead of stat and fstat.
* Use llvm::sys::fs::UniqueID
* Delete the old windows versions of UniqueDirContainer and
UniqueFileContainer since the "unix" one now works on windows too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187619 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
extDiagnostic.cpp
4488835d1c78221553909447cf87d7e4ff7f99fb 29-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Update for llvm api change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187379 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
aefb1d3312a63ac8d289a2e84747fe61a7f61823 29-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Convert a use of stat with sys::fs::status.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187364 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
0046ce5aa0a0cae048ec8f277bc7098870294dd3 28-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Avoid crashing if a directory has no pch files.

Should fix some of the bots that have assertions disabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@187329 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
264d206244bde858471e4b6211aeba28fd8ce7cb 23-Jul-2013 Eli Bendersky <eliben@google.com> Add a -fno-math-builtin option to the Clang -cc1


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186899 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f0c06a3fa424a7bf858d95f6e83c392dbb31ea43 18-Jul-2013 Manuel Klimek <klimek@google.com> Fix crash in libclang if code completion is used with unknown flags.

Use CaptureDroppedDiagnostics to make sure that there is a diagnostic
client installed when warning flags are parsed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186582 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
b470d1a54877e7b3622e4cbdeae423c6d51be696 17-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Use the simpler is_directory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186487 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
d965f95daa97097c8ddc5e1165ceae585a888719 16-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Update for llvm API change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@186448 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
eaderIncludeGen.cpp
d412999a3da6387dbfaf00f7647132082e94310e 09-Jul-2013 Fariborz Jahanian <fjahanian@apple.com> ObjC migrator: Add -objcmt-migrate-property to do property
migration. Also, fixes an old bug where older migration
flags were not being checked for properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185948 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
70e7aeccbf5856a84f81366c6c1a0c0c01e70063 05-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Use llvm::sys::fs::createUniqueFile.

Include a test that clang now produces output files with permissions matching
the umask.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185727 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
1ec4a86a867fc04f35d13bc9e33b04cf2171fe41 05-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Use llvm::sys::fs::createTemporaryFile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185717 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
6b9240e058bf3451685df73fc8ce181b3046e92b 05-Jul-2013 Craig Topper <craig.topper@gmail.com> Use SmallVectorImpl& for function arguments instead of SmallVector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185715 91177308-0d34-0410-b5e6-96231b3b80d8
hainedIncludesSource.cpp
abab18373808f2a179a97b00d574e306970934d7 05-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> We don't need to check for windows' error codes in here.

The operator== calls equivalent which calls default_error_condition which
handles windows to posix conversion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185702 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ceb6dc8e5afbd8e4dad7aaa1948994965fd8ff2e 28-Jun-2013 Benjamin Kramer <benny.kra@googlemail.com> Use the multiple argument form of path::append.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185164 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8ffd0a4eb8875f452e407effe49d86d1620a4499 28-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Update for llvm::sys::fs::unique_file not creating directories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185127 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
375a4f519eb85d37e702c90498ef9816aeda4c3e 27-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Small improvements to createOutputFile.

* Use a single stat to find out if the file exists and if it is a regular file.
* Use early returns when possible.
* Add comments explaining why we have each check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@185091 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
3473c8de3cb8de1cedc25151909514af05a25450 26-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove PathV1.h from CompilerInvocation.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184918 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ac1db6b2bde50e9a0f3846243f654f6c13682725 26-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Use llvm::sys::fs::getMainExecutable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184915 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
48955f8119261c47cac564d1b6976c8f6441800a 26-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove PathV1.h from CompilerInstance.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184913 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
21b1824304076325a72239a4446e5f7e97370cfd 26-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't use PathV1.h in ASTUnit.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184912 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1cd7df45ac8909a92a80af4be7ec1bbdcb3a84e7 26-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove the last use of PathWithStatus.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184909 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
85d28486b781f4e69dbff2d0b0239edc5a31ae16 26-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Use llvm::sys::fs::unique_file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184908 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
b804cb315cfeebc4d1c4d2d023ffb08440f77254 26-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove some uses of llvm::sys::Path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184907 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
fdf137b9073aa52423183fe886d072bc3b7d3889 25-Jun-2013 Nick Lewycky <nicholas@mxc.ca> Make -vectorize-... proper cc1 flags instead of abusing -backend-option. Fixes
usage of clang as a library.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184812 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1f3ff6a709432e1131ff802d660def2fab2aea58 24-Jun-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang/codecompletion] Make sure the top-level decl hash takes into account ImportDecls.

The top-level hash is used to determine if we need to update the global code-completion results.
ImportDecls did not affect the hash so a newly introduced ImportDecl would not trigger an update of the global results.

rdar://14202797

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184782 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ab297ccbcc51d5197d4ddb4e99b7bc8868d38314 24-Jun-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add -ast-dump-lookups switch to -cc1 to dump DeclContext lookup maps. Test to
follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184678 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ompilerInvocation.cpp
rontendActions.cpp
a0a65ef433e2ec19c080a9073cc6b3ccc132c27b 22-Jun-2013 Benjamin Kramer <benny.kra@googlemail.com> Remove duplicated case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184640 91177308-0d34-0410-b5e6-96231b3b80d8
rontendOptions.cpp
73b8d4bdd68372bff9eddc5a02675ee345a8a94f 21-Jun-2013 Nick Lewycky <nicholas@mxc.ca> Fix a leak of TargetMachine in clang. We'll continue to leak it on purpose if
given -disable-free. (Reviewed by John McCall over IRC.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184595 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8f5d7d1d1f990f174c7f2682271a83acf64dd93d 21-Jun-2013 Douglas Gregor <dgregor@apple.com> [Modules] If a module map resides in a system header directory, treat it as a system module.

This prevents -pedantic from causing warnings in the system headers
used to create modules. Fixes <rdar://problem/14201171>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184560 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendActions.cpp
bc3f628815b3841dc99109e7f67f9afa7793bc94 20-Jun-2013 Lawrence Crowl <crowl@google.com> This patch adds new private headers to the module map. Private
headers may be included from within the module, but not from outside
the module.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184471 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
erifyDiagnosticConsumer.cpp
da4cb0cf401bb546574a7db46e50cda8b9d9c048 20-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Use the new name of getUniqueID.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184432 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
fc0f91cf0673775ce4b8b174dbb05ad2e4e6cd01 19-Jun-2013 Manman Ren <mren@apple.com> Debug Info: support for gdwarf-2 gdwarf-3 gdwarf-4

These options will add a module flag with name "Dwarf Version".
The behavior flag is currently set to Warning, so when two values disagree,
a warning will be emitted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184276 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
da1f9cb8ce0e89d2848390aef985bad9e32e1ddb 18-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Use llvm::sys::fs::can_write.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184234 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
105b207db81a4cce4f5e76d8da634d800ff5cb36 18-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Use llvm::sys::fs::GetUniqueID.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184218 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
b8b52972c72b2ba6fe171c522e5d3d7d69503021 18-Jun-2013 John McCall <rjmccall@apple.com> Add support for -fpcc-struct-return. Patch by Arthur O'Dwyer!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@184166 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
b1e25a1bc03292dc538d336573e0be1490223171 14-Jun-2013 Reid Kleckner <reid@kleckner.net> [Driver] Refactor clang driver to use LLVM's Option library

The big changes are:
- Deleting Driver/(Arg|Opt)*
- Rewriting includes to llvm/Option/ and re-sorting
- 'using namespace llvm::opt' in clang::driver
- Fixing the autoconf build by adding option everywhere

As discussed in the review, this change includes using directives in
header files. I'll make follow up changes to remove those in favor of
name specifiers.

Reviewers: espindola

Differential Revision: http://llvm-reviews.chandlerc.com/D975

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183989 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
aa12d8f06e641ee9f047b89efc28cecf9498ac05 13-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't depend on the transitive inclusion of PathV1.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183945 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
6f2e23b25d9be365266be43ffa1cf6f850b6027e 13-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Use the sys::RemoveFileOnSignal that takes a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183944 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
0b214905f7fff7fa21ecc54a17b97372ba0c9a07 13-Jun-2013 Benjamin Kramer <benny.kra@googlemail.com> Modernize some low-hanging PathV1 uses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183903 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
nitHeaderSearch.cpp
a603569515eea06e54e6e041b1c690d33086f375 12-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Use the global functions instead of the Program methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183861 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
2049840b0ffe8ee4bf39051cfa8ca08440c8f667 12-Jun-2013 Stephen Hines <srhines@google.com> Merge commit '1342a4ef62dd7b839c6f09348b246a4f00282f29' into merge_20130612
34392373fe25e943586de0fdbe37b806c3f7ff70 11-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Include PathV1.h in files that use it.

This is preparation for replacing Path.h with PathV2.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183781 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
ependencyFile.cpp
nitHeaderSearch.cpp
739f9e575cfa3ade546b3845eeea86eabd67357f 11-Jun-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Modify a comment to reflect changes of r183717.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183751 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
b62b8b9aa5ee5035ca1e02e1191a22a21d0228f4 11-Jun-2013 Benjamin Kramer <benny.kra@googlemail.com> ASTUnit: Invert the dependency of PrecompilePreambleAction on PrecompilePreambleConsumer.

Actions outlive consumers. PR16295. Found by AddressSanitizer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183741 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1f01f7c160c06f8290b4f1c203e36b242074c6b1 11-Jun-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Allow building a precompiled preamble with compiler errors

A while ago we allowed libclang to build a PCH that had compiler errors; this was to retain the performance
afforded by a PCH even if the user's code is in an intermediate state.

Extend this for the precompiled preamble as well.

rdar://14109828

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183717 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
rontendAction.cpp
1f13fbd0c5bac045aa7d6ae3e998758e9dfa3ce4 07-Jun-2013 Jordan Rose <jordan_rose@apple.com> Handle Unicode characters in fix-it replacement strings.

Patch by Sukolsak Sakshuwong!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183535 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
a7ff62f9443efa3b13a28a1e566d4625b15b8553 04-Jun-2013 Aaron Ballman <aaron@aaronballman.com> Adding support for MSVC #pragma detect_mismatch functionality by emitting a FAILIFMISMATCH linker command into the object file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@183178 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
3b7deda7137e62810a810ce25b062927a9fc7c71 24-May-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [modules] If we hit a failure while loading a PCH/module, abort parsing instead of trying to continue in an invalid state.

Also don't let libclang create a PCH with such an error.

Fixes rdar://13953768

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182629 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
cc8e22b4e940a6d74174343ec16547e3bb52e630 21-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Revert r182331, these checks should be based on the target not the host.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182333 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7efb8af368309b5a2e5f9fa4df6da136d1c5ac54 21-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> Move two Darwin-specific hacks into #ifdef __APPLE__. These were stat'ing
nonexistent Darwin-specific files on every module build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182331 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
9dadfab2faebe40e7dbbfd0801c15174b69bd726 11-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y deduced return types: when we deduce a return type for a function which
we loaded from PCH, if we're building another PCH, create an update record to
patch the return type of the earlier declaration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181659 91177308-0d34-0410-b5e6-96231b3b80d8
ultiplexConsumer.cpp
d8f681e135ebd536e25a60cdb23f4d531f1f993e 10-May-2013 Douglas Gregor <dgregor@apple.com> [Modules] Extend Darwin hack to include the modification time of SystemVersion.plist.

Fixes <rdar://problem/13856838>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181635 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7eca8d2262a26eedb2ff3cc0fd11be2494b17cc1 10-May-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] When parsing with CXTranslationUnit_ForSerialization, make sure to install the ASTWriter that we create as an ASTMutationListener.

Fixes rdar://13833268

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181575 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f9ba851c9b5db8ea30846215e737702a1cc2c194 09-May-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] Remove the ASTReaderListener::ReadHeaderFileInfo callback.

This made sense in pre-module era, before merging of HeaderFileInfos was introduced.

Final part of rdar://13840148.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181490 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
e7565635002ce0daaaf4b714cdb472507af462ee 08-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: Add a step limit to constexpr evaluation, to catch runaway loops.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181388 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7f0ffb3a9f4ce7428fd4f6eb3c3274c867c134f8 07-May-2013 Richard Smith <richard-llvm@metafoo.co.uk> C++1y: Update __cplusplus to temporary value 201305L to allow detection of provisional C++1y support.
Add __has_feature and __has_extension checks for C++1y features (based on the provisional names from
the C++ features study group), and update documentation to match.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181342 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
fe57db23431463e137c4aaf01d999165c84b0e9f 05-May-2013 Benjamin Kramer <benny.kra@googlemail.com> Use remove_if to erase parts of a vector. Avoids O(n^2) worst cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181150 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5543169296beeb183b9c9392debc774fcf493eeb 05-May-2013 Dmitri Gribenko <gribozavr@gmail.com> Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef constructor from None

Patch by Robert Wilhelm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181139 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
d99990df0b4aca43a0315b2928ff1b8baf704052 04-May-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r177218.

Per discussion in cfe-commits, asserting may be a better way than introducing a special test flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181073 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
arnings.cpp
cc2b653c319599f502425d2c3de29865d47bb9e4 04-May-2013 Douglas Gregor <dgregor@apple.com> Remove DiagnosticConsumer::clone(), a bad idea that is now unused.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181070 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ogDiagnosticPrinter.cpp
erializedDiagnosticPrinter.cpp
extDiagnosticBuffer.cpp
extDiagnosticPrinter.cpp
erifyDiagnosticConsumer.cpp
a4a90cabfa15c900016a7cfaea51a6d4e8ebf4db 04-May-2013 Douglas Gregor <dgregor@apple.com> When building a module, forward diagnostics to the outer diagnostic consumer.

Previously, we would clone the current diagnostic consumer to produce
a new diagnostic consumer to use when building a module. The problem
here is that we end up losing diagnostics for important diagnostic
consumers, such as serialized diagnostics (where we'd end up with two
diagnostic consumers writing the same output file). With forwarding,
the diagnostics from all of the different modules being built get
forwarded to the one serialized-diagnostic consumer and are emitted in
a sane way.

Fixes <rdar://problem/13663996>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181067 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
ompilerInstance.cpp
erifyDiagnosticConsumer.cpp
83eba02c2ea333015335e2f74c4d11c5315b655d 03-May-2013 Stephen Hines <srhines@google.com> Merge remote-tracking branch 'upstream/master' into merge-20130502
a7efaf99ac662af11890aae74d84da8d31ab2fe0 30-Apr-2013 Joerg Sonnenberger <joerg@bec.de> Add support for -stdlib=libc++ in the NetBSD toolchain.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180766 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
56f6e09562568437e852eba192c17869beba1d49 29-Apr-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> When emitting a preprocessed file with implicit module imports, make sure line directives are emitted in the next line.

rdar://13722737

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180718 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
cbdbbd1ba105e65c5c1afa30c6c64f44adf56ad4 26-Apr-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [frontend] Make -chain-include work when used with modules.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180633 91177308-0d34-0410-b5e6-96231b3b80d8
hainedIncludesSource.cpp
rontendAction.cpp
b82e117e4af1062b9f0d1aab89abf4aa804558f1 24-Apr-2013 Chad Rosier <mcrosier@apple.com> [driver] Improve the implementation of the -Ofast option.

Specifically, allow the flags that fall under this umbrella (i.e., -O3,
-ffast-math, and -fstrict-aliasing) to be overridden/disabled with the
individual -O[0|1|2|s|z]/-fno- flags.

This also fixes the handling of various floating point optimization
flags that are modified by -ffast-math (and thus -Ofast as well).
Part of rdar://13622687

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180204 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
dd3e2d90418de46b77a9dde3bb992390610e343a 23-Apr-2013 Benjamin Kramer <benny.kra@googlemail.com> Make compares unsigned. The expression can't become negative anyways.

Silences a sign compare warning on 32 bit archs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180110 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
f5ae4dd6bf2310fbf4b192137aecd21248a08449 19-Apr-2013 Andy Gibbs <andyg1001@hotmail.co.uk> Keep the parentheses in #pragma message (partial revert of r179771).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179862 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
688f2a1fc1ac38e8b7b602ab8afc69cdfa7492bf 18-Apr-2013 Andy Gibbs <andyg1001@hotmail.co.uk> Dropped the parentheses for #pragma message and its kin in the -E output generator.

This was a suggestion by Jordan Rose since the documented format for these pragmas is without the parentheses. At the same time, I've increased test coverage too for the preprocessed output.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179771 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
142b35e25b579e2a883d6ca37c3c1121f562f242 17-Apr-2013 Jordan Rose <jordan_rose@apple.com> Fix off-by-one error in #pragma clang system_header.

The system_header pragma (from GCC) is implemented using line notes in the
source manager. However, a line note's line number specifies the number
not for the current line, but for the next line. This was making all
line numbers appear off by one after the pragma.

Reported by Andy Gibbs, uncovered during r179677.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179709 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
076eea20b80024fc63bbd71fb019375983680ea6 17-Apr-2013 Andy Gibbs <andyg1001@hotmail.co.uk> Implemented #pragma GCC warning/error in the same mould as #pragma message.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179687 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
b42f200777a66b98989160bf3987ce431540a584 17-Apr-2013 Andy Gibbs <andyg1001@hotmail.co.uk> Extended VerifyDiagnosticConsumer to also verify source file for diagnostic.

VerifyDiagnosticConsumer previously would not check that the diagnostic and
its matching directive referenced the same source file. Common practice was
to create directives that referenced other files but only by line number,
and this led to problems such as when the file containing the directive
didn't have enough lines to match the location of the diagnostic in the
other file, leading to bizarre file formatting and other oddities.

This patch causes VerifyDiagnosticConsumer to match source files as well as
line numbers. Therefore, a new syntax is made available for directives, for
example:

// expected-error@file:line {{diagnostic message}}

This extends the @line feature where "file" is the file where the diagnostic
is generated. The @line syntax is still available and uses the current file
for the diagnostic. "file" can be specified either as a relative or absolute
path - although the latter has less usefulness, I think! The #include search
paths will be used to locate the file and if it is not found an error will be
generated.

The new check is not optional: if the directive is in a different file to the
diagnostic, the file must be specified. Therefore, a number of test-cases
have been updated with regard to this.

This closes out PR15613.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179677 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
6afcf8875d4e447645cd7bf3733dd8e2eb8455dc 16-Apr-2013 Tareq A. Siraj <tareq.a.sriaj@intel.com> Sema for Captured Statements

Add CapturedDecl to be the DeclContext for CapturedStmt, and perform semantic
analysis. Currently captures all variables by reference.

TODO: templates

Author: Ben Langmuir <ben.langmuir@intel.com>

Differential Revision: http://llvm-reviews.chandlerc.com/D433


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179618 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
85192c7fe187d5486e12dbc6960af28f16a558a0 16-Apr-2013 Tareq A. Siraj <tareq.a.sriaj@intel.com> Parser support for #pragma clang __debug captured

This patch implements parsing ‘#pragma clang __debug’ as a first step for
implementing captured statements. Captured statements are a mechanism for
doing outlining in the AST.
see http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-January/027540.html.

Currently returns StmtEmpty

Author: Andy Zhang <andy.zhang@intel.com>

Differential Revision: http://llvm-reviews.chandlerc.com/D369


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179614 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
f4910132078b4b8852fc46657f3150ed472f4654 16-Apr-2013 Daniel Dunbar <daniel@zuster.org> [Modules] Convert module specific -fno-modules-autolink into -fno-autolink.

- There is no reason to have a modules specific flag for disabling
autolinking. Instead, convert the existing flag into -fno-autolink (which
should cover other autolinking code generation paths like #pragmas if and
when we support them).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179612 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
31230e6fb3331192b5559cab539344235c715836 12-Apr-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13615607> Include SDK version information in the module hash.

This is a Darwin-SDK-specific hash criteria used to identify a
particular SDK without having to hash the contents of all of its
headers. If other platforms have such versioned files, we should add
those checks here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179346 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8cfb720c857e66b7fb64bf3cb80fd82fcd0c0ac3 12-Apr-2013 John McCall <rjmccall@apple.com> Fix the driver logic for recent versions of DragonFly.

Patch by John Marino.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179334 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
05422365baa8e603237f865e0de52f73f8b77235 10-Apr-2013 Chad Rosier <mcrosier@apple.com> Remove unused arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179217 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d4fc9de6f7d9a56bdc2ec51d9cbbfd7d3cb0cf0a 10-Apr-2013 Chad Rosier <mcrosier@apple.com> [driver] Add a -Ofast option, which enables -O3, -ffast-math, and
-fstrict-aliasing.
rdar://13622687


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179216 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
6fd7d3067dd06584ef3940e88e31fea1a0e83588 10-Apr-2013 Dmitri Gribenko <gribozavr@gmail.com> Add an option to parse all comments as documentation comments

Patch by Amin Shali.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179180 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
15aa81a4746697311f71f5802ce27c7dc98b2ff3 10-Apr-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [frontend] When preprocessing, turn implicit module imports into @imports.

part of rdar://13610250

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179144 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
3769f38264ba46a18059ad82a3a506f27bbf2537 08-Apr-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13559825> Further reduce template instantiation depth down to 256, since we're blowing the stack for a trivial "factorial" class template.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@179057 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
b37a73d5c6a0c8bb1f6e363d3b53980e4fa0cead 04-Apr-2013 Manman Ren <mren@apple.com> Initial support for struct-path aware TBAA.

Added TBAABaseType and TBAAOffset in LValue. These two fields are initialized to
the actual type and 0, and are updated in EmitLValueForField.
Path-aware TBAA tags are enabled for EmitLoadOfScalar and EmitStoreOfScalar.
Added command line option -struct-path-tbaa.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178797 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7cc0a110bcf3fe9c4d1269ea2ae7e72aa7f37531 04-Apr-2013 Manman Ren <mren@apple.com> revert r178784 since it does not have a commit message

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178796 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ab4ffe242935ae0dd66fbe0dcc792c1ad38b00c1 04-Apr-2013 Manman Ren <mren@apple.com> Index: include/clang/Driver/CC1Options.td
===================================================================
--- include/clang/Driver/CC1Options.td (revision 178718)
+++ include/clang/Driver/CC1Options.td (working copy)
@@ -161,6 +161,8 @@
HelpText<"Use register sized accesses to bit-fields, when possible.">;
def relaxed_aliasing : Flag<["-"], "relaxed-aliasing">,
HelpText<"Turn off Type Based Alias Analysis">;
+def struct_path_tbaa : Flag<["-"], "struct-path-tbaa">,
+ HelpText<"Turn on struct-path aware Type Based Alias Analysis">;
def masm_verbose : Flag<["-"], "masm-verbose">,
HelpText<"Generate verbose assembly output">;
def mcode_model : Separate<["-"], "mcode-model">,
Index: include/clang/Driver/Options.td
===================================================================
--- include/clang/Driver/Options.td (revision 178718)
+++ include/clang/Driver/Options.td (working copy)
@@ -587,6 +587,7 @@
Flags<[CC1Option]>, HelpText<"Disable spell-checking">;
def fno_stack_protector : Flag<["-"], "fno-stack-protector">, Group<f_Group>;
def fno_strict_aliasing : Flag<["-"], "fno-strict-aliasing">, Group<f_Group>;
+def fstruct_path_tbaa : Flag<["-"], "fstruct-path-tbaa">, Group<f_Group>;
def fno_strict_enums : Flag<["-"], "fno-strict-enums">, Group<f_Group>;
def fno_strict_overflow : Flag<["-"], "fno-strict-overflow">, Group<f_Group>;
def fno_threadsafe_statics : Flag<["-"], "fno-threadsafe-statics">, Group<f_Group>,
Index: include/clang/Frontend/CodeGenOptions.def
===================================================================
--- include/clang/Frontend/CodeGenOptions.def (revision 178718)
+++ include/clang/Frontend/CodeGenOptions.def (working copy)
@@ -85,6 +85,7 @@
VALUE_CODEGENOPT(OptimizeSize, 2, 0) ///< If -Os (==1) or -Oz (==2) is specified.
CODEGENOPT(RelaxAll , 1, 0) ///< Relax all machine code instructions.
CODEGENOPT(RelaxedAliasing , 1, 0) ///< Set when -fno-strict-aliasing is enabled.
+CODEGENOPT(StructPathTBAA , 1, 0) ///< Whether or not to use struct-path TBAA.
CODEGENOPT(SaveTempLabels , 1, 0) ///< Save temporary labels.
CODEGENOPT(SanitizeAddressZeroBaseShadow , 1, 0) ///< Map shadow memory at zero
///< offset in AddressSanitizer.
Index: lib/CodeGen/CGExpr.cpp
===================================================================
--- lib/CodeGen/CGExpr.cpp (revision 178718)
+++ lib/CodeGen/CGExpr.cpp (working copy)
@@ -1044,7 +1044,8 @@
llvm::Value *CodeGenFunction::EmitLoadOfScalar(LValue lvalue) {
return EmitLoadOfScalar(lvalue.getAddress(), lvalue.isVolatile(),
lvalue.getAlignment().getQuantity(),
- lvalue.getType(), lvalue.getTBAAInfo());
+ lvalue.getType(), lvalue.getTBAAInfo(),
+ lvalue.getTBAABaseType(), lvalue.getTBAAOffset());
}

static bool hasBooleanRepresentation(QualType Ty) {
@@ -1106,7 +1107,9 @@

llvm::Value *CodeGenFunction::EmitLoadOfScalar(llvm::Value *Addr, bool Volatile,
unsigned Alignment, QualType Ty,
- llvm::MDNode *TBAAInfo) {
+ llvm::MDNode *TBAAInfo,
+ QualType TBAABaseType,
+ uint64_t TBAAOffset) {
// For better performance, handle vector loads differently.
if (Ty->isVectorType()) {
llvm::Value *V;
@@ -1158,8 +1161,11 @@
Load->setVolatile(true);
if (Alignment)
Load->setAlignment(Alignment);
- if (TBAAInfo)
- CGM.DecorateInstruction(Load, TBAAInfo);
+ if (TBAAInfo) {
+ llvm::MDNode *TBAAPath = CGM.getTBAAStructTagInfo(TBAABaseType, TBAAInfo,
+ TBAAOffset);
+ CGM.DecorateInstruction(Load, TBAAPath);
+ }

if ((SanOpts->Bool && hasBooleanRepresentation(Ty)) ||
(SanOpts->Enum && Ty->getAs<EnumType>())) {
@@ -1217,7 +1223,8 @@
bool Volatile, unsigned Alignment,
QualType Ty,
llvm::MDNode *TBAAInfo,
- bool isInit) {
+ bool isInit, QualType TBAABaseType,
+ uint64_t TBAAOffset) {

// Handle vectors differently to get better performance.
if (Ty->isVectorType()) {
@@ -1268,15 +1275,19 @@
llvm::StoreInst *Store = Builder.CreateStore(Value, Addr, Volatile);
if (Alignment)
Store->setAlignment(Alignment);
- if (TBAAInfo)
- CGM.DecorateInstruction(Store, TBAAInfo);
+ if (TBAAInfo) {
+ llvm::MDNode *TBAAPath = CGM.getTBAAStructTagInfo(TBAABaseType, TBAAInfo,
+ TBAAOffset);
+ CGM.DecorateInstruction(Store, TBAAPath);
+ }
}

void CodeGenFunction::EmitStoreOfScalar(llvm::Value *value, LValue lvalue,
bool isInit) {
EmitStoreOfScalar(value, lvalue.getAddress(), lvalue.isVolatile(),
lvalue.getAlignment().getQuantity(), lvalue.getType(),
- lvalue.getTBAAInfo(), isInit);
+ lvalue.getTBAAInfo(), isInit, lvalue.getTBAABaseType(),
+ lvalue.getTBAAOffset());
}

/// EmitLoadOfLValue - Given an expression that represents a value lvalue, this
@@ -2494,9 +2505,12 @@

llvm::Value *addr = base.getAddress();
unsigned cvr = base.getVRQualifiers();
+ bool TBAAPath = CGM.getCodeGenOpts().StructPathTBAA;
if (rec->isUnion()) {
// For unions, there is no pointer adjustment.
assert(!type->isReferenceType() && "union has reference member");
+ // TODO: handle path-aware TBAA for union.
+ TBAAPath = false;
} else {
// For structs, we GEP to the field that the record layout suggests.
unsigned idx = CGM.getTypes().getCGRecordLayout(rec).getLLVMFieldNo(field);
@@ -2508,6 +2522,8 @@
if (cvr & Qualifiers::Volatile) load->setVolatile(true);
load->setAlignment(alignment.getQuantity());

+ // Loading the reference will disable path-aware TBAA.
+ TBAAPath = false;
if (CGM.shouldUseTBAA()) {
llvm::MDNode *tbaa;
if (mayAlias)
@@ -2541,6 +2557,16 @@

LValue LV = MakeAddrLValue(addr, type, alignment);
LV.getQuals().addCVRQualifiers(cvr);
+ if (TBAAPath) {
+ const ASTRecordLayout &Layout =
+ getContext().getASTRecordLayout(field->getParent());
+ // Set the base type to be the base type of the base LValue and
+ // update offset to be relative to the base type.
+ LV.setTBAABaseType(base.getTBAABaseType());
+ LV.setTBAAOffset(base.getTBAAOffset() +
+ Layout.getFieldOffset(field->getFieldIndex()) /
+ getContext().getCharWidth());
+ }

// __weak attribute on a field is ignored.
if (LV.getQuals().getObjCGCAttr() == Qualifiers::Weak)
Index: lib/CodeGen/CGValue.h
===================================================================
--- lib/CodeGen/CGValue.h (revision 178718)
+++ lib/CodeGen/CGValue.h (working copy)
@@ -157,6 +157,11 @@

Expr *BaseIvarExp;

+ /// Used by struct-path-aware TBAA.
+ QualType TBAABaseType;
+ /// Offset relative to the base type.
+ uint64_t TBAAOffset;
+
/// TBAAInfo - TBAA information to attach to dereferences of this LValue.
llvm::MDNode *TBAAInfo;

@@ -175,6 +180,10 @@
this->ImpreciseLifetime = false;
this->ThreadLocalRef = false;
this->BaseIvarExp = 0;
+
+ // Initialize fields for TBAA.
+ this->TBAABaseType = Type;
+ this->TBAAOffset = 0;
this->TBAAInfo = TBAAInfo;
}

@@ -232,6 +241,12 @@
Expr *getBaseIvarExp() const { return BaseIvarExp; }
void setBaseIvarExp(Expr *V) { BaseIvarExp = V; }

+ QualType getTBAABaseType() const { return TBAABaseType; }
+ void setTBAABaseType(QualType T) { TBAABaseType = T; }
+
+ uint64_t getTBAAOffset() const { return TBAAOffset; }
+ void setTBAAOffset(uint64_t O) { TBAAOffset = O; }
+
llvm::MDNode *getTBAAInfo() const { return TBAAInfo; }
void setTBAAInfo(llvm::MDNode *N) { TBAAInfo = N; }

Index: lib/CodeGen/CodeGenFunction.h
===================================================================
--- lib/CodeGen/CodeGenFunction.h (revision 178718)
+++ lib/CodeGen/CodeGenFunction.h (working copy)
@@ -2211,7 +2211,9 @@
/// the LLVM value representation.
llvm::Value *EmitLoadOfScalar(llvm::Value *Addr, bool Volatile,
unsigned Alignment, QualType Ty,
- llvm::MDNode *TBAAInfo = 0);
+ llvm::MDNode *TBAAInfo = 0,
+ QualType TBAABaseTy = QualType(),
+ uint64_t TBAAOffset = 0);

/// EmitLoadOfScalar - Load a scalar value from an address, taking
/// care to appropriately convert from the memory representation to
@@ -2224,7 +2226,9 @@
/// the LLVM value representation.
void EmitStoreOfScalar(llvm::Value *Value, llvm::Value *Addr,
bool Volatile, unsigned Alignment, QualType Ty,
- llvm::MDNode *TBAAInfo = 0, bool isInit=false);
+ llvm::MDNode *TBAAInfo = 0, bool isInit = false,
+ QualType TBAABaseTy = QualType(),
+ uint64_t TBAAOffset = 0);

/// EmitStoreOfScalar - Store a scalar value to an address, taking
/// care to appropriately convert from the memory representation to
Index: lib/CodeGen/CodeGenModule.cpp
===================================================================
--- lib/CodeGen/CodeGenModule.cpp (revision 178718)
+++ lib/CodeGen/CodeGenModule.cpp (working copy)
@@ -227,6 +227,20 @@
return TBAA->getTBAAStructInfo(QTy);
}

+llvm::MDNode *CodeGenModule::getTBAAStructTypeInfo(QualType QTy) {
+ if (!TBAA)
+ return 0;
+ return TBAA->getTBAAStructTypeInfo(QTy);
+}
+
+llvm::MDNode *CodeGenModule::getTBAAStructTagInfo(QualType BaseTy,
+ llvm::MDNode *AccessN,
+ uint64_t O) {
+ if (!TBAA)
+ return 0;
+ return TBAA->getTBAAStructTagInfo(BaseTy, AccessN, O);
+}
+
void CodeGenModule::DecorateInstruction(llvm::Instruction *Inst,
llvm::MDNode *TBAAInfo) {
Inst->setMetadata(llvm::LLVMContext::MD_tbaa, TBAAInfo);
Index: lib/CodeGen/CodeGenModule.h
===================================================================
--- lib/CodeGen/CodeGenModule.h (revision 178718)
+++ lib/CodeGen/CodeGenModule.h (working copy)
@@ -501,6 +501,11 @@
llvm::MDNode *getTBAAInfo(QualType QTy);
llvm::MDNode *getTBAAInfoForVTablePtr();
llvm::MDNode *getTBAAStructInfo(QualType QTy);
+ /// Return the MDNode in the type DAG for the given struct type.
+ llvm::MDNode *getTBAAStructTypeInfo(QualType QTy);
+ /// Return the path-aware tag for given base type, access node and offset.
+ llvm::MDNode *getTBAAStructTagInfo(QualType BaseTy, llvm::MDNode *AccessN,
+ uint64_t O);

bool isTypeConstant(QualType QTy, bool ExcludeCtorDtor);

Index: lib/CodeGen/CodeGenTBAA.cpp
===================================================================
--- lib/CodeGen/CodeGenTBAA.cpp (revision 178718)
+++ lib/CodeGen/CodeGenTBAA.cpp (working copy)
@@ -21,6 +21,7 @@
#include "clang/AST/Mangle.h"
#include "clang/AST/RecordLayout.h"
#include "clang/Frontend/CodeGenOptions.h"
+#include "llvm/ADT/SmallSet.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Metadata.h"
@@ -225,3 +226,87 @@
// For now, handle any other kind of type conservatively.
return StructMetadataCache[Ty] = NULL;
}
+
+/// Check if the given type can be handled by path-aware TBAA.
+static bool isTBAAPathStruct(QualType QTy) {
+ if (const RecordType *TTy = QTy->getAs<RecordType>()) {
+ const RecordDecl *RD = TTy->getDecl()->getDefinition();
+ // RD can be struct, union, class, interface or enum.
+ // For now, we only handle struct.
+ if (RD->isStruct() && !RD->hasFlexibleArrayMember())
+ return true;
+ }
+ return false;
+}
+
+llvm::MDNode *
+CodeGenTBAA::getTBAAStructTypeInfo(QualType QTy) {
+ const Type *Ty = Context.getCanonicalType(QTy).getTypePtr();
+ assert(isTBAAPathStruct(QTy));
+
+ if (llvm::MDNode *N = StructTypeMetadataCache[Ty])
+ return N;
+
+ if (const RecordType *TTy = QTy->getAs<RecordType>()) {
+ const RecordDecl *RD = TTy->getDecl()->getDefinition();
+
+ const ASTRecordLayout &Layout = Context.getASTRecordLayout(RD);
+ SmallVector <std::pair<uint64_t, llvm::MDNode*>, 4> Fields;
+ // To reduce the size of MDNode for a given struct type, we only output
+ // once for all the fields with the same scalar types.
+ // Offsets for scalar fields in the type DAG are not used.
+ llvm::SmallSet <llvm::MDNode*, 4> ScalarFieldTypes;
+ unsigned idx = 0;
+ for (RecordDecl::field_iterator i = RD->field_begin(),
+ e = RD->field_end(); i != e; ++i, ++idx) {
+ QualType FieldQTy = i->getType();
+ llvm::MDNode *FieldNode;
+ if (isTBAAPathStruct(FieldQTy))
+ FieldNode = getTBAAStructTypeInfo(FieldQTy);
+ else {
+ FieldNode = getTBAAInfo(FieldQTy);
+ // Ignore this field if the type already exists.
+ if (ScalarFieldTypes.count(FieldNode))
+ continue;
+ ScalarFieldTypes.insert(FieldNode);
+ }
+ if (!FieldNode)
+ return StructTypeMetadataCache[Ty] = NULL;
+ Fields.push_back(std::make_pair(
+ Layout.getFieldOffset(idx) / Context.getCharWidth(), FieldNode));
+ }
+
+ // TODO: This is using the RTTI name. Is there a better way to get
+ // a unique string for a type?
+ SmallString<256> OutName;
+ llvm::raw_svector_ostream Out(OutName);
+ MContext.mangleCXXRTTIName(QualType(Ty, 0), Out);
+ Out.flush();
+ // Create the struct type node with a vector of pairs (offset, type).
+ return StructTypeMetadataCache[Ty] =
+ MDHelper.createTBAAStructTypeNode(OutName, Fields);
+ }
+
+ return StructMetadataCache[Ty] = NULL;
+}
+
+llvm::MDNode *
+CodeGenTBAA::getTBAAStructTagInfo(QualType BaseQTy, llvm::MDNode *AccessNode,
+ uint64_t Offset) {
+ if (!CodeGenOpts.StructPathTBAA)
+ return AccessNode;
+
+ const Type *BTy = Context.getCanonicalType(BaseQTy).getTypePtr();
+ TBAAPathTag PathTag = TBAAPathTag(BTy, AccessNode, Offset);
+ if (llvm::MDNode *N = StructTagMetadataCache[PathTag])
+ return N;
+
+ llvm::MDNode *BNode = 0;
+ if (isTBAAPathStruct(BaseQTy))
+ BNode = getTBAAStructTypeInfo(BaseQTy);
+ if (!BNode)
+ return StructTagMetadataCache[PathTag] = AccessNode;
+
+ return StructTagMetadataCache[PathTag] =
+ MDHelper.createTBAAStructTagNode(BNode, AccessNode, Offset);
+}
Index: lib/CodeGen/CodeGenTBAA.h
===================================================================
--- lib/CodeGen/CodeGenTBAA.h (revision 178718)
+++ lib/CodeGen/CodeGenTBAA.h (working copy)
@@ -35,6 +35,14 @@
namespace CodeGen {
class CGRecordLayout;

+ struct TBAAPathTag {
+ TBAAPathTag(const Type *B, const llvm::MDNode *A, uint64_t O)
+ : BaseT(B), AccessN(A), Offset(O) {}
+ const Type *BaseT;
+ const llvm::MDNode *AccessN;
+ uint64_t Offset;
+ };
+
/// CodeGenTBAA - This class organizes the cross-module state that is used
/// while lowering AST types to LLVM types.
class CodeGenTBAA {
@@ -46,8 +54,13 @@
// MDHelper - Helper for creating metadata.
llvm::MDBuilder MDHelper;

- /// MetadataCache - This maps clang::Types to llvm::MDNodes describing them.
+ /// MetadataCache - This maps clang::Types to scalar llvm::MDNodes describing
+ /// them.
llvm::DenseMap<const Type *, llvm::MDNode *> MetadataCache;
+ /// This maps clang::Types to a struct node in the type DAG.
+ llvm::DenseMap<const Type *, llvm::MDNode *> StructTypeMetadataCache;
+ /// This maps TBAAPathTags to a tag node.
+ llvm::DenseMap<TBAAPathTag, llvm::MDNode *> StructTagMetadataCache;

/// StructMetadataCache - This maps clang::Types to llvm::MDNodes describing
/// them for struct assignments.
@@ -89,9 +102,49 @@
/// getTBAAStructInfo - Get the TBAAStruct MDNode to be used for a memcpy of
/// the given type.
llvm::MDNode *getTBAAStructInfo(QualType QTy);
+
+ /// Get the MDNode in the type DAG for given struct type QType.
+ llvm::MDNode *getTBAAStructTypeInfo(QualType QType);
+ /// Get the tag MDNode for a given base type, the actual sclar access MDNode
+ /// and offset into the base type.
+ llvm::MDNode *getTBAAStructTagInfo(QualType BaseQType,
+ llvm::MDNode *AccessNode, uint64_t Offset);
};

} // end namespace CodeGen
} // end namespace clang

+namespace llvm {
+
+template<> struct DenseMapInfo<clang::CodeGen::TBAAPathTag> {
+ static clang::CodeGen::TBAAPathTag getEmptyKey() {
+ return clang::CodeGen::TBAAPathTag(
+ DenseMapInfo<const clang::Type *>::getEmptyKey(),
+ DenseMapInfo<const MDNode *>::getEmptyKey(),
+ DenseMapInfo<uint64_t>::getEmptyKey());
+ }
+
+ static clang::CodeGen::TBAAPathTag getTombstoneKey() {
+ return clang::CodeGen::TBAAPathTag(
+ DenseMapInfo<const clang::Type *>::getTombstoneKey(),
+ DenseMapInfo<const MDNode *>::getTombstoneKey(),
+ DenseMapInfo<uint64_t>::getTombstoneKey());
+ }
+
+ static unsigned getHashValue(const clang::CodeGen::TBAAPathTag &Val) {
+ return DenseMapInfo<const clang::Type *>::getHashValue(Val.BaseT) ^
+ DenseMapInfo<const MDNode *>::getHashValue(Val.AccessN) ^
+ DenseMapInfo<uint64_t>::getHashValue(Val.Offset);
+ }
+
+ static bool isEqual(const clang::CodeGen::TBAAPathTag &LHS,
+ const clang::CodeGen::TBAAPathTag &RHS) {
+ return LHS.BaseT == RHS.BaseT &&
+ LHS.AccessN == RHS.AccessN &&
+ LHS.Offset == RHS.Offset;
+ }
+};
+
+} // end namespace llvm
+
#endif
Index: lib/Driver/Tools.cpp
===================================================================
--- lib/Driver/Tools.cpp (revision 178718)
+++ lib/Driver/Tools.cpp (working copy)
@@ -2105,6 +2105,8 @@
options::OPT_fno_strict_aliasing,
getToolChain().IsStrictAliasingDefault()))
CmdArgs.push_back("-relaxed-aliasing");
+ if (Args.hasArg(options::OPT_fstruct_path_tbaa))
+ CmdArgs.push_back("-struct-path-tbaa");
if (Args.hasFlag(options::OPT_fstrict_enums, options::OPT_fno_strict_enums,
false))
CmdArgs.push_back("-fstrict-enums");
Index: lib/Frontend/CompilerInvocation.cpp
===================================================================
--- lib/Frontend/CompilerInvocation.cpp (revision 178718)
+++ lib/Frontend/CompilerInvocation.cpp (working copy)
@@ -324,6 +324,7 @@
Opts.UseRegisterSizedBitfieldAccess = Args.hasArg(
OPT_fuse_register_sized_bitfield_access);
Opts.RelaxedAliasing = Args.hasArg(OPT_relaxed_aliasing);
+ Opts.StructPathTBAA = Args.hasArg(OPT_struct_path_tbaa);
Opts.DwarfDebugFlags = Args.getLastArgValue(OPT_dwarf_debug_flags);
Opts.MergeAllConstants = !Args.hasArg(OPT_fno_merge_all_constants);
Opts.NoCommon = Args.hasArg(OPT_fno_common);
Index: test/CodeGen/tbaa.cpp
===================================================================
--- test/CodeGen/tbaa.cpp (revision 0)
+++ test/CodeGen/tbaa.cpp (working copy)
@@ -0,0 +1,217 @@
+// RUN: %clang_cc1 -O1 -disable-llvm-optzns %s -emit-llvm -o - | FileCheck %s
+// RUN: %clang_cc1 -O1 -struct-path-tbaa -disable-llvm-optzns %s -emit-llvm -o - | FileCheck %s -check-prefix=PATH
+// Test TBAA metadata generated by front-end.
+
+#include <stdint.h>
+typedef struct
+{
+ uint16_t f16;
+ uint32_t f32;
+ uint16_t f16_2;
+ uint32_t f32_2;
+} StructA;
+typedef struct
+{
+ uint16_t f16;
+ StructA a;
+ uint32_t f32;
+} StructB;
+typedef struct
+{
+ uint16_t f16;
+ StructB b;
+ uint32_t f32;
+} StructC;
+typedef struct
+{
+ uint16_t f16;
+ StructB b;
+ uint32_t f32;
+ uint8_t f8;
+} StructD;
+
+typedef struct
+{
+ uint16_t f16;
+ uint32_t f32;
+} StructS;
+typedef struct
+{
+ uint16_t f16;
+ uint32_t f32;
+} StructS2;
+
+uint32_t g(uint32_t *s, StructA *A, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !5
+ *s = 1;
+ A->f32 = 4;
+ return *s;
+}
+
+uint32_t g2(uint32_t *s, StructA *A, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa !5
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: store i16 4, i16* %{{.*}}, align 2, !tbaa !8
+ *s = 1;
+ A->f16 = 4;
+ return *s;
+}
+
+uint32_t g3(StructA *A, StructB *B, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !5
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !9
+ A->f32 = 1;
+ B->a.f32 = 4;
+ return A->f32;
+}
+
+uint32_t g4(StructA *A, StructB *B, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa !5
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !5
+// PATH: store i16 4, i16* %{{.*}}, align 2, !tbaa !11
+ A->f32 = 1;
+ B->a.f16 = 4;
+ return A->f32;
+}
+
+uint32_t g5(StructA *A, StructB *B, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !5
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !12
+ A->f32 = 1;
+ B->f32 = 4;
+ return A->f32;
+}
+
+uint32_t g6(StructA *A, StructB *B, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !5
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !13
+ A->f32 = 1;
+ B->a.f32_2 = 4;
+ return A->f32;
+}
+
+uint32_t g7(StructA *A, StructS *S, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !5
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !14
+ A->f32 = 1;
+ S->f32 = 4;
+ return A->f32;
+}
+
+uint32_t g8(StructA *A, StructS *S, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa !5
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !5
+// PATH: store i16 4, i16* %{{.*}}, align 2, !tbaa !16
+ A->f32 = 1;
+ S->f16 = 4;
+ return A->f32;
+}
+
+uint32_t g9(StructS *S, StructS2 *S2, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !14
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !17
+ S->f32 = 1;
+ S2->f32 = 4;
+ return S->f32;
+}
+
+uint32_t g10(StructS *S, StructS2 *S2, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i16 4, i16* %{{.*}}, align 2, !tbaa !5
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !14
+// PATH: store i16 4, i16* %{{.*}}, align 2, !tbaa !19
+ S->f32 = 1;
+ S2->f16 = 4;
+ return S->f32;
+}
+
+uint32_t g11(StructC *C, StructD *D, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !20
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !22
+ C->b.a.f32 = 1;
+ D->b.a.f32 = 4;
+ return C->b.a.f32;
+}
+
+uint32_t g12(StructC *C, StructD *D, uint64_t count) {
+// CHECK: define i32 @{{.*}}(
+// CHECK: store i32 1, i32* %{{.*}}, align 4, !tbaa !4
+// CHECK: store i32 4, i32* %{{.*}}, align 4, !tbaa !4
+// TODO: differentiate the two accesses.
+// PATH: define i32 @{{.*}}(
+// PATH: store i32 1, i32* %{{.*}}, align 4, !tbaa !9
+// PATH: store i32 4, i32* %{{.*}}, align 4, !tbaa !9
+ StructB *b1 = &(C->b);
+ StructB *b2 = &(D->b);
+ // b1, b2 have different context.
+ b1->a.f32 = 1;
+ b2->a.f32 = 4;
+ return b1->a.f32;
+}
+
+// CHECK: !1 = metadata !{metadata !"omnipotent char", metadata !2}
+// CHECK: !2 = metadata !{metadata !"Simple C/C++ TBAA"}
+// CHECK: !4 = metadata !{metadata !"int", metadata !1}
+// CHECK: !5 = metadata !{metadata !"short", metadata !1}
+
+// PATH: !1 = metadata !{metadata !"omnipotent char", metadata !2}
+// PATH: !4 = metadata !{metadata !"int", metadata !1}
+// PATH: !5 = metadata !{metadata !6, metadata !4, i64 4}
+// PATH: !6 = metadata !{metadata !"_ZTS7StructA", i64 0, metadata !7, i64 4, metadata !4}
+// PATH: !7 = metadata !{metadata !"short", metadata !1}
+// PATH: !8 = metadata !{metadata !6, metadata !7, i64 0}
+// PATH: !9 = metadata !{metadata !10, metadata !4, i64 8}
+// PATH: !10 = metadata !{metadata !"_ZTS7StructB", i64 0, metadata !7, i64 4, metadata !6, i64 20, metadata !4}
+// PATH: !11 = metadata !{metadata !10, metadata !7, i64 4}
+// PATH: !12 = metadata !{metadata !10, metadata !4, i64 20}
+// PATH: !13 = metadata !{metadata !10, metadata !4, i64 16}
+// PATH: !14 = metadata !{metadata !15, metadata !4, i64 4}
+// PATH: !15 = metadata !{metadata !"_ZTS7StructS", i64 0, metadata !7, i64 4, metadata !4}
+// PATH: !16 = metadata !{metadata !15, metadata !7, i64 0}
+// PATH: !17 = metadata !{metadata !18, metadata !4, i64 4}
+// PATH: !18 = metadata !{metadata !"_ZTS8StructS2", i64 0, metadata !7, i64 4, metadata !4}
+// PATH: !19 = metadata !{metadata !18, metadata !7, i64 0}
+// PATH: !20 = metadata !{metadata !21, metadata !4, i64 12}
+// PATH: !21 = metadata !{metadata !"_ZTS7StructC", i64 0, metadata !7, i64 4, metadata !10, i64 28, metadata !4}
+// PATH: !22 = metadata !{metadata !23, metadata !4, i64 12}
+// PATH: !23 = metadata !{metadata !"_ZTS7StructD", i64 0, metadata !7, i64 4, metadata !10, i64 28, metadata !4, i64 32, metadata !1}


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178784 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ea65cb191c33e3da13c6c18f0eea442894389940 04-Apr-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the unused MemoryBuffers, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178780 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
3105627bd76d6a0cc5ee305c99f4c96519bac9ac 04-Apr-2013 Eric Christopher <echristo@gmail.com> Plumb through the -fsplit-stack option using the existing backend
support.

Caveat: Other than the existing segmented stacks support, no
claims are made of this working.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178744 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
bd25ff8632e18bb3af761369fd3b0f1b48fdf061 03-Apr-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [preprocessor] Allow comparing two macro definitions syntactically instead of only lexically.

Syntactically means the function macro parameter names do not need to use the same
identifiers in order for the definitions to be considered identical.

Syntactic equivalence is a microsoft extension for macro redefinitions and we'll also
use this kind of comparison to check for ambiguous macros coming from modules.

rdar://13562254

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178671 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
670b2e6e9e75ca5d816899f6c1ac97137ba6f206 03-Apr-2013 Douglas Gregor <dgregor@apple.com> Use getPredefinesFileID() appropriately.

Thanks to Argyrios for the pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178616 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
1b461b0ad072fd36c8c20e7bd29448f08050a3c3 02-Apr-2013 Richard Smith <richard-llvm@metafoo.co.uk> Remove dead store.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178561 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ddc15c40d22718d7b7060634b782d1a3ce9184a8 02-Apr-2013 Benjamin Kramer <benny.kra@googlemail.com> Escape # and $ in dependency files.

Fixes PR15642.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178540 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
93ce7d59f0ce9d85301cbad96a71694e4f345fcd 29-Mar-2013 Benjamin Kramer <benny.kra@googlemail.com> Remove sign-compare warning on systems that still use 32 bit time_ts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178351 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
edaf281379e0aa712caf984ee33388e5f414e18d 28-Mar-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> Define __SIZE_MAX__ preprocessor macro.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178226 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
c544ba09695e300f31355af342258bd57619e737 27-Mar-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13509689> Introduce -module-file-info option that provides information about a particular module file.

This option can be useful for end users who want to know why they
ended up with a ton of different variants of the "std" module in their
module cache. This problem should go away over time, as we reduce the
need for module variants, but it will never go away entirely.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178148 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendActions.cpp
rontendOptions.cpp
d560ce3b66325ff22cd3aca23c6de3143bd74d24 27-Mar-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [Preprocessor] Remove PPMutationListener.

It's not used anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178106 91177308-0d34-0410-b5e6-96231b3b80d8
hainedIncludesSource.cpp
ompilerInstance.cpp
rontendAction.cpp
c56fff7fd231aebf4b152f60f8f11ef91835c48a 26-Mar-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [Preprocessor/Modules] Separate the macro directives kinds into their own MacroDirective's subclasses.

For each macro directive (define, undefine, visibility) have a separate object that gets chained
to the macro directive history. This has several benefits:

-No need to mutate a MacroDirective when there is a undefine/visibility directive. Stuff like
PPMutationListener become unnecessary.
-No need to keep extra source locations for the undef/visibility locations for the define directive object
(which is the majority of the directives)
-Much easier to hide/unhide a section in the macro directive history.
-Easier to track the effects of the directives across different submodules.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@178037 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rintPreprocessedOutput.cpp
87ab066c70006d998a6d358d272e00c8345b0f26 25-Mar-2013 Douglas Gregor <dgregor@apple.com> Use <time.h> rather than <sys/time.h>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177924 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
d44d2872b2ebe58237de4dbc350b82cab944ccc5 25-Mar-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13434605> Periodically prune the module cache so that it does not grow forever.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177918 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
ed2fc2a311065ee5f6c20adb1655702aff86ae8a 22-Mar-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13479539> Only rebuild the global module cache when we're allowed to.

This eliminates excessive rebuilds of the global module cache.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177766 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
c640058aa7f224a71ce3b1d2601d84e1b57f82d3 22-Mar-2013 Alexey Bataev <a.bataev@hotmail.com> OpenMP threadprivate directive parsing and semantic analysis

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177705 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
906d66acc5cf2679453e10a4f0a67feedd765b21 20-Mar-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/12368093> Extend module maps with a 'conflict' declaration, and warn when a newly-imported module conflicts with an already-imported module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177577 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
83c546afef39d6b7be69f3f399804ebf037c4022 20-Mar-2013 Nick Lewycky <nicholas@mxc.ca> The flag "-coverage-function-names-in-data" is actually backwards -- we do
emit function names in .gcda files by default, and the flag turns that off!
Rename the flag to make it match what it actually does. This keeps the default
format compatible with gcc 4.2.

Also add a test for this flag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177475 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f2b5e0707229e1149828ebc8d01d9308a997d6df 20-Mar-2013 Nick Lewycky <nicholas@mxc.ca> Make clang emit linkage names in debug info for subprograms when coverage info
is enabled. Also add a new -test-coverage cc1 flag which makes testing coverage
possible and add our first clang-side coverage test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177470 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
63a726870b486e0470c3a4b11cf62bab8be00b73 20-Mar-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/10796651> Introduce configuration macros into module maps.

Configuration macros are macros that are intended to alter how a
module works, such that we need to build different module variants
for different values of these macros. A module can declare its
configuration macros, in which case we will complain if the definition
of a configation macro on the command line (or lack thereof) differs
from the current preprocessor state at the point where the module is
imported. This should eliminate some surprises when enabling modules,
because "#define CONFIG_MACRO ..." followed by "#include
<module/header.h>" would silently ignore the CONFIG_MACRO setting. At
least it will no longer be silent about it.

Configuration macros are eventually intended to help reduce the number
of module variants that need to be built. When the list of
configuration macros for a module is exhaustive, we only need to
consider the settings for those macros when building/finding the
module, which can help isolate modules for various project-specific -D
flags that should never affect how modules are build (but currently do).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177466 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
15d68882f5fa4afae8333e75b2bfd5e2834c8aaf 19-Mar-2013 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge_2013_03_18

Conflicts:
lib/Sema/SemaDeclAttr.cpp

Change-Id: I05e70941163ec5a461eba43ef78f6738cd5a1e69
677e15ffee2ecc9c1c8f46fd77cab4b5afb59640 19-Mar-2013 Douglas Gregor <dgregor@apple.com> <rdar://problem/13363214> Eliminate race condition between module rebuild and the global module index.

The global module index was querying the file manager for each of the
module files it knows about at load time, to prune out any out-of-date
information. The file manager would then cache the results of the
stat() falls used to find that module file.

Later, the same translation unit could end up trying to import one of the
module files that had previously been ignored by the module cache, but
after some other Clang instance rebuilt the module file to bring it
up-to-date. The stale stat() results in the file manager would
trigger a second rebuild of the already-up-to-date module, causing
failures down the line.

The global module index now lazily resolves its module file references
to actual AST reader module files only after the module file has been
loaded, eliminating the stat-caching race. Moreover, the AST reader
can communicate to its caller that a module file is missing (rather
than simply being out-of-date), allowing us to simplify the
module-loading logic and allowing the compiler to recover if a
dependent module file ends up getting deleted.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177367 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
62ba4ba4852b3dc3a8c1c77b34b58a06077387d8 18-Mar-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [frontend] Initialize the diagnostic client before loading an ast file.

Issue reported by Tom Honermann!
http://llvm.org/bugs/show_bug.cgi?id=15377

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177336 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
6aa240c03dd68ab413106d6af7a18af1c9b4e872 16-Mar-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove -Wspellcheck and replace it with a diagnostic option.

Thanks to Richard S. for pointing out that the warning would show up
with -Weverything.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177218 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
arnings.cpp
316dd5467bed9242088149fe92f3316ef4f235e9 16-Mar-2013 Ted Kremenek <kremenek@apple.com> Fix buffer underrun (invalid read) triggered during diagnostic rendering. The test would overflow when computing '0 - 1'.

I don't have a good testcase for this that does not depend on system headers.
It did not trigger with preprocessed output, and I had trouble reducing the example.

Fixes <rdar://problem/13324594>.

Thanks to Michael Greiner for reporting this issue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177201 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
c3ae583a9a2e0e5c862a94b678c7cdfaab46a981 14-Mar-2013 Nick Lewycky <nicholas@mxc.ca> Update GCOVProfiling pass creation for API change in r177002. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@177004 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c1d22393628a145e54396c0ac66e9625d13a7658 13-Mar-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [Modules] Resolve top-headers of modules lazily.

This allows resolving top-header filenames of modules to FileEntries when
we need them, not eagerly.

Note that that this breaks ABI for libclang functions
clang_Module_getTopLevelHeader / clang_Module_getNumTopLevelHeaders
but this is fine because they are experimental and not widely used yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176975 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
0f815f1f91e5cf0726fd8296445038fec3bed80b 07-Mar-2013 Nick Lewycky <nicholas@mxc.ca> Add flags for additional control over coverage generation. Pick the version
string to be emitted, and two properties about the files themselves.

Use $PWD to absolut-ify the path to the coverage file. Yes, this is what GCC
does. Reverts my own r175706.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176617 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
bd3aca04d304b9f31240b94af0aad818f6f932ab 06-Mar-2013 Stephen Hines <srhines@google.com> Update build rules for Clang merge to version 176138.

Change-Id: Ib028329a591e6175998d969f11b5404bf3f19e81
ndroid.mk
450b86c0c9ff8307f5145ced621914600196c500 06-Mar-2013 Stephen Hines <srhines@google.com> Merge commit 'b58f810669d9c17bcc025b7560de01d162856f34' into merge_20130226

Conflicts:
include/clang/Basic/LangOptions.def
lib/Sema/SemaDeclAttr.cpp

Change-Id: Ia10b4d3b2c949a72d328cb58b113f90237d4a5d5
360355db57d15ce3c90051b05cca993a4c5ee8db 06-Mar-2013 Weiming Zhao <weimingz@codeaurora.org> revert r176531 due to clan-native-arm fails



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176544 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
cf2c2e9588a12a716615850cc5bfacd9b20f68ef 06-Mar-2013 Jordan Rose <jordan_rose@apple.com> Preprocessor: don't keep comments under -traditional-cpp.

This patch is designed for minimal intrusion into normal preprocessing
and compilation; under -E -traditional-cpp, the lexer will still
generate tok::comment nodes since it is preserving all whitespace, but
the output printer will then throw it away.

<rdar://problem/13338680>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176534 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
46a2290c030597e26022fe2b535c8e4b0d30a765 06-Mar-2013 Weiming Zhao <weimingz@codeaurora.org> PR 11326: Lack diagnosic message when ABI conflicts on ARM

When both Triple and -mabi are used, it may result into conflicting ABI value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176531 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
44f65a587ee39c20e715c9df411c864d328c71b5 05-Mar-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] When logging a CXTranslationUnit that came from an AST file, print out the filename.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176511 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c515978bd3a703aa733f846a0094ffa84d149074 24-Feb-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [preprocessor] Use MacroDirective in the preprocessor callbacks to make available the
full information about the macro (e.g if it was imported and where).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175978 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
rintPreprocessedOutput.cpp
b063ef0222a99ee168631afa7b5a882d494b8fde 23-Feb-2013 Benjamin Kramer <benny.kra@googlemail.com> Add streamed versions of getQualifiedNameAsString.

Move the cold virtual method getNameForDiagnostic out of line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175966 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ff971d7973aaa00c286b788d30f6919c7b1f4de2 23-Feb-2013 Eric Christopher <echristo@gmail.com> Propagate the split dwarf file information through into the backend
and through to the debug info in the module. In order to make the
testcase a bit more efficient allow the filename to go through
compilation for compile and not assemble jobs and turn off the
extract for cases where we don't create an object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175935 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
6ebf09130479bc7605aa09a3e6c4dc2ba3513495 22-Feb-2013 Dmitri Gribenko <gribozavr@gmail.com> Comment parsing: add CommentOptions to allow specifying custom comment block commands

Add an ability to specify custom documentation block comment commands via a new
class CommentOptions. The intention is that this class will hold future
customizations for comment parsing, including defining documentation comments
with specific numbers of parameters, etc.

CommentOptions instance is a member of LangOptions.

CommentOptions is controlled by a new command-line parameter
-fcomment-block-commands=Foo,Bar,Baz.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175892 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
9e738cc9d4b4655c44dadeb22f3a314daf43b995 22-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,
to control the check for the C 5.2.4.1 / C++ [implimits] restriction on nesting
levels for parentheses, brackets and braces.

Some code with heavy macro use exceeds the default limit of 256, but we don't
want to increase it generally to avoid stack overflow on stack-constrained
systems.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175855 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
63631bd173df1decfff98ae6a7ed7f3d5f886b86 21-Feb-2013 Ted Kremenek <kremenek@apple.com> Teach serialized diagnostics about notes without locations.

Along the way, improve a diagnostic for "previous declaration here" for implicit parameters.

Fixes <rdar://problem/13211384>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175802 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
6aad4a31b35df07fe818f193fcfd3c0197aea467 21-Feb-2013 Jordan Rose <jordan_rose@apple.com> Preprocessor: preserve whitespace in -traditional-cpp mode.

Note that unlike GNU cpp we currently do not preserve whitespace in macros
(even in -traditional-cpp mode).

<rdar://problem/12897179>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175778 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
9818a1d443e97677dd3422305de9cc2b1fb2a8c1 20-Feb-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [preprocessor] Split the MacroInfo class into two separate concepts, MacroInfo class
for the data specific to a macro definition (e.g. what the tokens are), and
MacroDirective class which encapsulates the changes to the "macro namespace"
(e.g. the location where the macro name became active, the location where it was undefined, etc.)

(A MacroDirective always points to a MacroInfo object.)

Usually a macro definition (MacroInfo) is where a macro name becomes active (MacroDirective) but
splitting the concepts allows us to better model the effect of modules to the macro namespace
(also as a bonus it allows better modeling of push_macro/pop_macro #pragmas).
Modules can have their own macro history, separate from the local (current translation unit)
macro history; MacroDirectives will be used to model the macro history (changes to macro namespace).

For example, if "@import A;" imports macro FOO, there will be a new local MacroDirective created
to indicate that "FOO" became active at the import location. Module "A" itself will contain another
MacroDirective in its macro history (at the point of the definition of FOO) and both MacroDirectives
will point to the same MacroInfo object.

Introducing the separation of macro concepts is the first part towards better modeling of module macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175585 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
a880b19aa6ef1dc95936f5de052be7a7d6ee6814 19-Feb-2013 John McCall <rjmccall@apple.com> Add support for -fvisibility-ms-compat.

We treat this as an alternative to -fvisibility=<?>
which changes the default value visibility to "hidden"
and the default type visibility to "default".

Expose a -cc1 option for changing the default type
visibility, repurposing -fvisibility as the default
value visibility option (also setting type visibility
from it in the absence of a specific option).

rdar://13079314

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175480 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
3f6f51e28231f65de9c2dd150a2d757b2162cfa3 08-Feb-2013 Jordan Rose <jordan_rose@apple.com> Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.

Nearly all of these changes are one-to-one replacements; the few that
aren't have to do with custom identifier validation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174768 91177308-0d34-0410-b5e6-96231b3b80d8
ayoutOverrideSource.cpp
rintPreprocessedOutput.cpp
extDiagnostic.cpp
erifyDiagnosticConsumer.cpp
ea14a8799f2a6d139491483151cee4341ef1a73e 08-Feb-2013 Douglas Gregor <dgregor@apple.com> Never cache the result of a module file lookup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174744 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
953a61f26bf79932b9699b09add4c388764de170 07-Feb-2013 Douglas Gregor <dgregor@apple.com> Rename -fmodule-cache-path <blah> to -fmodules-cache-path=<blah> for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174645 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
3646c68676c3c46a026b23d52188ef6e0d856178 07-Feb-2013 Richard Smith <richard-llvm@metafoo.co.uk> Simplify FindExternalVisibleDeclsByName by making it return a bool indicating
if it found any decls, rather than returning a list of found decls. This
removes a returning-ArrayRef-to-deleted-storage bug from
MultiplexExternalSemaSource (in code not exercised by any of the clang
binaries), reduces the work required in the found-no-decls case with PCH, and
importantly removes the need for DeclContext::lookup to be reentrant.

No functionality change intended!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174576 91177308-0d34-0410-b5e6-96231b3b80d8
hainedIncludesSource.cpp
005d51bc4f16a7b330e13082d186b72953bde581 07-Feb-2013 Douglas Gregor <dgregor@apple.com> Be a little more permissive with -fmodules-ignore-macro= by removing everything after the second '=' if it is there.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174567 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
2a06085281d1b6aee628f85e8676eec04542cbc9 07-Feb-2013 Douglas Gregor <dgregor@apple.com> Introduce -fmodules-ignore-macro=NNN to ignore a macro when building/loading modules.

The use of this flag enables a modules optimization where a given set
of macros can be labeled as "ignored" by the modules
system. Definitions of those macros will be completely ignored when
building the module hash and will be stripped when actually building
modules. The overall effect is that this flag can be used to
drastically reduce the number of

Eventually, we'll want modules to tell us what set of macros they
respond to (the "configuration macros"), and anything not in that set
will be excluded. However, that requires a lot of per-module
information that must be accurate, whereas this option can be used
more readily.

Fixes the rest of <rdar://problem/13165109>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174560 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
8bf778eb9c0afb0a4c63a97ce504f50759c08d5f 06-Feb-2013 Douglas Gregor <dgregor@apple.com> Detect when we end up trying to load conflicting module files.

This can happen when one abuses precompiled headers by passing more -D
options when using a precompiled hedaer than when it was built. This
is intentionally permitted by precompiled headers (and is exploited by
some build environments), but causes problems for modules.

First part of <rdar://problem/13165109>, detecting when something when
horribly wrong.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174554 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
3ad86fd2effccf1b9337e8cb9a317e4353cec275 05-Feb-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [frontend] Don't put a PCH/PTH filename into the set of includes in the preprocessor options;
since only one of them is allowed in command-line, process them separately.

Otherwise, if more than one is specified in the command-line, one is processed normally
and the others are going to be treated and included as header files.

Related to radar://13140508

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174385 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendAction.cpp
nitPreprocessor.cpp
77163bc392be75795d58b1f6177a0a4626a57dcb 05-Feb-2013 NAKAMURA Takumi <geek4civic@gmail.com> TextDiagnostic.cpp: Suppress a warning to use ptrdiff_t on i686-clang. [-Wsign-compare]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174353 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
5ebcb20b0331a6e64c213f0bb5f4bed9a9e8eb34 01-Feb-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> For ModuleLoader::makeModuleVisible() also pass the source location where the
module import occurred.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174191 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
91165e74c8b480c1da3a719d764f4fa0e7b1b921 30-Jan-2013 Jordan Rose <jordan_rose@apple.com> Diagnostics: Clarify name of line-length-limiting constant in r173976.

Thanks, Sean.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173981 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
f6e74a35e0c0e53b2e65fc9fe86f8e4cadcca473 30-Jan-2013 Jordan Rose <jordan_rose@apple.com> Diagnostics: if a line is longer than 4096 characters, don't print it.

Specifically, don't print snippets, caret diagnostics, or ranges for
lines over 4096 characters. We copy the line around a few times in our
diagnostics machinery, and we have to print a caret line that's just as
long. This uses a lot of memory just to create a poor user experience as
we print out a line much too long for anyone to read...or spend extra
energy trying to fit it to -fmessage-length.

<rdar://problem/13106850>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173976 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
ac3a3e7a402cd349dd2b7d70cd92c5fe702ae831 30-Jan-2013 Anna Zaks <ganna@apple.com> [analyzer] Make shallow mode more shallow.

Redefine the shallow mode to inline all functions for which we have a
definite definition (ipa=inlining). However, only inline functions that
are up to 4 basic blocks large and cut the max exploded nodes generated
per top level function in half.

This makes shallow faster and allows us to keep inlining small
functions. For example, we would keep inlining wrapper functions and
constructors/destructors.

With the new shallow, it takes 104s to analyze sqlite3, whereas
the deep mode is 658s and previous shallow is 209s.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173958 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
6bbe1442a5f3f5f761582a9005e9edf1d49c4da2 30-Jan-2013 Anna Zaks <ganna@apple.com> [analyzer] Use analyzer config for max-inlinable-size option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173957 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
cb5620c9b213f4bd323912159fdddda35e258a14 30-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Move UTF conversion routines from clang/lib/Basic to llvm/lib/Support

This is required to use them in TableGen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173924 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
74c2498bb9e339345ee32bdd095e76157cec3b86 30-Jan-2013 Jordan Rose <jordan_rose@apple.com> Don't warn about Unicode characters in -E mode.

People use the C preprocessor for things other than C files. Some of them
have Unicode characters. We shouldn't warn about Unicode characters
appearing outside of identifiers in this case.

There's not currently a way for the preprocessor to tell if it's in -E mode,
so I added a new flag, derived from the PreprocessorOutputOptions. This is
only used by the Unicode warnings for now, but could conceivably be used by
other warnings or even behavioral differences later.

<rdar://problem/13107323>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173881 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
9cd90a23f75d213a37740555626f18d3bb9e540b 30-Jan-2013 Daniel Dunbar <daniel@zuster.org> [Frontend] Factor AddUnmappedPath() out of AddPath() and simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173871 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
59fd63581d6d572f23e82e81a50e0b940c8d1089 30-Jan-2013 Daniel Dunbar <daniel@zuster.org> [Frontend] Remove HeaderSearchOptions::Entry::IsInternal, which is unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173866 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ef84554239d77cc52a14b42f2bff8c2d02e7630e 30-Jan-2013 Daniel Dunbar <daniel@zuster.org> [Frontend] Add an ExternCSystem include entry group.

- The only group where it makes sense for the "ExternC" bit is System, so this
simplifies having to have the extra isCXXAware (or ImplicitExternC, depending
on what code you talk to) bit caried around.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173859 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
c33c9f7a9a955463b3418afd461774c726913800 30-Jan-2013 Daniel Dunbar <daniel@zuster.org> [Frontend] Make the include dir group independent from the "use sysroot" bit.

- This slightly decouples the path handling, since before the group sometimes
dominated the "use sysroot" bit, but it was still passed in via the API.

- No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173855 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
f85541c812af87e54b6738d22611721692ccdcb0 30-Jan-2013 Daniel Dunbar <daniel@zuster.org> [Frontend] Rename a member variable to clarify its intent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173854 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
49ffaeff757daa79dc5bf73d4c1ad7dd856aa77f 30-Jan-2013 Daniel Dunbar <daniel@zuster.org> [Frontend] Factor out helper function, for clarity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173853 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
78d85b1c5830a881c0a20a1b3fea99ee73149590 30-Jan-2013 Chad Rosier <mcrosier@apple.com> [ubsan] Implement the -fcatch-undefined-behavior flag using a trapping
implementation; this is much more inline with the original implementation
(i.e., pre-ubsan) and does not require run-time library support.

The trapping implementation can be invoked using either '-fcatch-undefined-behavior'
or '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error', with the latter
being preferred. Eventually, the -fcatch-undefined-behavior' flag will be removed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173848 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
20c6f2eae500242d3aef5daaa55d440a0786a1fd 28-Jan-2013 Douglas Gregor <dgregor@apple.com> Enable the global module index by default. Introduce the
-fno-modules-global-index -cc1 option to allow one to disable the
index for performance testing purposes, but with a 10% win in
-fsyntax-only time, there is no reason a user would do this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173707 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
43bb45d152b14e186689e159ac9be2e27787d5ac 28-Jan-2013 Hal Finkel <hfinkel@anl.gov> Fix the indentation of the first line of preprocessor output

The -E output from clang did not produce the correct indentation on the first line.
This is because MoveToLine returned false, and when this happens,
the regular process for producing initial indentation is skipped.

Thanks to Eli for suggesting a way to simplify this to a one-line change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173657 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
eab6652b7e417c8e46b21c7d340f3a7d41492d6e 25-Jan-2013 Daniel Dunbar <daniel@zuster.org> [Frontend] Remove another IsUserSpecified member variable that is now unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173412 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
5c4e34c16782927ecfeb5f005d65b68e77f5435a 25-Jan-2013 Daniel Dunbar <daniel@zuster.org> [Frontend] Drop the isUserSupplied argument to InitHeaderSearch, it is unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173411 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f3fc21f7277921677244b2c4b14f3a67e0cde8d1 25-Jan-2013 Daniel Dunbar <daniel@zuster.org> [Frontend] The -iwithprefix option belongs in the After category, according to
GCC docs.
- Found by inspection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173410 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1ea6bc0fd9c1ff9fa03e8a829a79c4167445d503 25-Jan-2013 Daniel Dunbar <daniel@zuster.org> [Lex] Remove DirectoryLookup.UserSpecified, which is unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173409 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
1a49d97d762570027863e9209af81d445e4f1502 25-Jan-2013 Douglas Gregor <dgregor@apple.com> Implement the reader of the global module index and wire it into the
AST reader.

The global module index tracks all of the identifiers known to a set
of module files. Lookup of those identifiers looks first in the global
module index, which returns the set of module files in which that
identifier can be found. The AST reader only needs to look into those
module files and any module files not known to the global index (e.g.,
because they were (re)built after the global index), reducing the
number of on-disk hash tables to visit. For an example source I'm
looking at, we go from 237844 total identifier lookups into on-disk
hash tables down to 126817.

Unfortunately, this does not translate into a performance advantage.
At best, it's a wash once the global module index has been built, but
that's ignore the cost of building the global module index (which
is itself fairly large). Profiles show that the global module index
code is far less efficient than it should be; optimizing it might give
enough of an advantage to justify its continued inclusion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173405 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
f575d6e7c3b887ea4c5394d2c7e322c7a929a57e 25-Jan-2013 Douglas Gregor <dgregor@apple.com> Rename the -cc1 option "-generate-module-index" to
"-fmodules-global-index" and expand its behavior to include both the
use and generation of the global module index.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173404 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
rontendAction.cpp
bfa9ab8183e2fdc74f8633d758cb0c6201314320 25-Jan-2013 Anna Zaks <ganna@apple.com> [analyzer] Replace "-analyzer-ipa" with "-analyzer-config ipa".

The idea is to eventually place all analyzer options under
"analyzer-config". In addition, this lays the ground for introduction of
a high-level analyzer mode option, which will influence the
default setting for IPAMode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173385 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
a6b00fc97669aa25d89ae9f202b05dfadfd0e324 23-Jan-2013 Douglas Gregor <dgregor@apple.com> Implement the writer side of the global module index.

The global module index is a "global" index for all of the module
files within a particular subdirectory in the module cache, which
keeps track of all of the "interesting" identifiers and selectors
known in each of the module files. One can perform a fast lookup in
the index to determine which module files will have more information
about entities with a particular name/selector. This information can
help eliminate redundant lookups into module files (a serious
performance problem) and help with creating auto-import/auto-include
Fix-Its.

The global module index is created or updated at the end of a
translation unit that has triggered a (re)build of a module by
scraping all of the .pcm files out of the module cache subdirectory,
so it catches everything. As with module rebuilds, we use the file
system's atomicity to synchronize.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173301 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
rontendAction.cpp
89cf425f1136f8d24a64ed94450e488b6794dfa4 23-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Use 'const Decl *' throughout code completion in Sema


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173277 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
19dbb20ac4371fae3190379a7e7bd467af3c00aa 23-Jan-2013 Joey Gouly <joey.gouly@arm.com> Add a new LangOpt NativeHalfType. This option allows for native half/fp16
operations (as opposed to storage only half/fp16).

Also add some semantic checks for OpenCL half types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173254 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
18f43a62134eca1cd830a5b289f4bee4e6ee42fe 23-Jan-2013 James Dennett <jdennett@google.com> Documentation cleanup: fixing documentation for FrontendAction.
* Fix a typo, s/BeginSourceAction/BeginSourceFile/, so that the documentation
for FrontendAction::BeginSourceFileAction links correctly to BeginSourceFile;
* Add some basic \file documentation for FrontendAction.h;
* More use of "\brief" instead of repeating the name of the entity being
documented;
* Stop using Doxygen-style "///" comments in FrontendAction.cpp, as they were
polluting the documentation for BeginSourceFile;
* Drop incorrect "\see" markup that broke Doxygen's formatting;
* Other minor documentation fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173213 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
b2e2157f905b0b6e27f1d3f5e1f38778c6731813 22-Jan-2013 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Remove the -fenable-experimental-ms-inline-asm flag. MS-style
inline assembly can be enable with -fasm-blocks or -fms-extensions alone.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173186 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
15bb58edc9d053aa49c28167deb41ff0409ddabc 21-Jan-2013 Stephen Hines <srhines@google.com> Merge commit 'd130fd2e141f1fef412c2d58e7385370801bd718' into merge-llvm

Conflicts:
lib/Basic/Targets.cpp

Change-Id: I90a669a33ffe4de8b32c8459016fd0b2a55da0ad
eb8fc58241e1781a77c958764e16a4c402e4d707 21-Jan-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [ASTUnit] Unlike LoadFromCommandLine, LoadFromCompilerInvocation causes a crash if Precompilepreamble
is set to true because there is no FileManager at that point.

Patch by Hurcan Solter!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173071 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
4bdc60434c79126b75aee2bb391275f3bb746364 20-Jan-2013 Alexey Samsonov <samsonov@google.com> Add top-level Clang flag -f(no-)sanitize-address-zero-base-shadow that makes AddressSanitizer use bottom of the address space for the shadow memory. On Linux it can be used with -fPIE/-pie to improve performance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172974 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d47afb96a3f988e6d21a92fe4dfe875ab227c7c0 20-Jan-2013 Sean Silva <silvas@purdue.edu> Nuke SetUpBuildDumpLog.

Also, it was the only reason that `argc` and `argv` were being passed
into createDiagnostics, so remove those parameters and clean up callers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172945 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
d2ff76b84c2f018f438eac2c2dd8b82bde441468 20-Jan-2013 Sean Silva <silvas@purdue.edu> Fix what appears to be a copy-paste error.

This looks like it was copied from SetUpBuildDumpLog, which dumps to the
file `DiagOpts->DumpBuildInformation`. There is another member
`DiagOpts->DiagnosticLogFile` which appears to be unused. The fact that
this feature doesn't even print to the output file specified on the
command line makes me think that it should be ripped out.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172944 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
4f45bc099f2665bc6e4bcbb169aa452390dbf3fe 18-Jan-2013 Will Dietz <wdietz2@illinois.edu> [ubsan] Add support for -fsanitize-blacklist

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172808 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f43b7214e812ddca74a6213608c69c960e067956 16-Jan-2013 Douglas Gregor <dgregor@apple.com> Add -fmodules-autolink/-fno-modules-autolink (defaults to on) so that
users can explicitly enable/disable modules autolinking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172592 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
50a70cd11801fd9a700d06e447095249c34c261f 15-Jan-2013 Douglas Gregor <dgregor@apple.com> Add -fopenmp -cc1 option and wire it up to define _OPENMP, from Alexey Bataev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172509 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
08e79d2f075d1326ff7a849fd1bc88dadf99d574 15-Jan-2013 Chad Rosier <mcrosier@apple.com> [driver] Warnings for warning options are handled by the frontend. The driver needs to process the
warning options to setup diagnostic state, but should not be emitting warnings as these would be
rudndant with what the frontend emits.
rdar://13001556

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172497 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
b3958476b21702a15f64f09d2862506d03dffe7b 14-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Constify argument of Preprocessor::getMacroInfoHistory and propagate to
callers, removing unneeded const_cast


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172372 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
cfa88f893915ceb8ae4ce2f17c46c24a4d67502f 12-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Remove useless 'llvm::' qualifier from names like StringRef and others that are
brought into 'clang' namespace by clang/Basic/LLVM.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172323 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
ependencyGraph.cpp
iagnosticRenderer.cpp
ayoutOverrideSource.cpp
erializedDiagnosticPrinter.cpp
arnings.cpp
ca2ab45341c448284cf93770018c717810575f86 12-Jan-2013 Douglas Gregor <dgregor@apple.com> Provide Decl::getOwningModule(), which determines the (sub)module in
which a particular declaration resides. Use this information to
customize the "definition of 'blah' must be imported from another
module" diagnostic with the module the user actually has to
import. Additionally, recover by importing that module, so we don't
complain about other names in that module.

Still TODO: coming up with decent Fix-Its for these cases, and expand
this recovery approach for other name lookup failures.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172290 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
814b51a3d572d4e4107e67d549c8a82484ce8160 11-Jan-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] In ASTUnit::getMainFileName() Invocation may be null because the ASTUnit
came from loading a PCH/module.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172259 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
b8a8be10038edd1454156d4c25cc86d4e93b6623 10-Jan-2013 Douglas Gregor <dgregor@apple.com> Be more careful about updating the failed-modules set

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172035 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
086cc83a84bfab60685b69e3afa3e4500daebb4d 09-Jan-2013 Eli Friedman <eli.friedman@gmail.com> Make sure clang puts tokens from different files on separate lines in "-E -P" mode. <rdar://problem/12774044>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171944 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
86ebd03380dd5d1b5744fe48405445ea27faf1d6 04-Jan-2013 Douglas Gregor <dgregor@apple.com> Remove -Wmodule-build; it was a dumb idea anyway. <rdar://problem/12957525>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171478 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
3b844ba7d5be205a9b4f5f0b0d1b7978977f4b8c 02-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate to
reflect the migration in r171366.

Re-sort the #include lines to reflect the new paths.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171369 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
80ad52f327b532bded5c5b0ee38779d841c6cd35 02-Jan-2013 Richard Smith <richard-llvm@metafoo.co.uk> s/CPlusPlus0x/CPlusPlus11/g


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171367 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
nitPreprocessor.cpp
2d382d149b442b928fd3fb8edcc8d82ea9325872 30-Dec-2012 Will Dietz <wdietz2@illinois.edu> [ubsan] Recover by default, use -fno-sanitize-recover to disable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171264 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
34ef11be9d09ebf916ab02a521e37be6e9e102d3 24-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> Support -fsanitize-memory-track-origins.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171020 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
14f9b5d62861d7c672f5aa7d7fc20cfa38bc92a8 24-Dec-2012 NAKAMURA Takumi <geek4civic@gmail.com> DiagnosticRenderer.cpp: Prune one description in DiagnosticRenderer::emitMacroExpansions(). [-Wdocumentation]

/// \param MacroSkipEnd The depth to stop skipping macro expansions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171012 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
ac504561cd888455a48bf85d21ada20a932ebd94 22-Dec-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Don't try to translate diagnostics from the precompiled preamble to the
code-completion results, the SourceManager state may be slightly
different when code-completing.

And we don't even care for diagnostics when code-completing, anyway.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170979 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
95f38f614c8005b5cc398021e1f9e28ed233d533 21-Dec-2012 Roman Divacky <rdivacky@freebsd.org> Sort the includes according to the coding standard.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170905 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
87aa2fbc75a897e7c4a4082374aaba3f50db6f0f 21-Dec-2012 Roman Divacky <rdivacky@freebsd.org> Remove duplicate includes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170903 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
6ee225c8d4381e728c73252ed589f13e9f546def 19-Dec-2012 Ted Kremenek <kremenek@apple.com> Simplify logic to use SourceManager::getFileLoc(), per Argyrios's feedback.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170487 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
813bc7faa74bda8162db3dede57e07bfe764e86e 19-Dec-2012 Douglas Gregor <dgregor@apple.com> Be defensive when printing module import locations; the diagnostic printer needs to be robust

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170466 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
adff43ad96defb28bad20d8335ab30beadd72ee8 18-Dec-2012 Eli Friedman <eli.friedman@gmail.com> More conservative fix for <rdar://problem/12847524> (a crash printing diagnostic ranges).
I'm not really happy with this fix, but I'm confident it's correct.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170397 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
5bdbc114da925304a774b726b0abb87d75bc3008 13-Dec-2012 Nadav Rotem <nrotem@apple.com> Revert 170049 because it fails with an assertion on one of the spec2000 workloads.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170143 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
0fdcd1e81db7b8f5b3fd05154d966b215b20a2eb 13-Dec-2012 Eli Friedman <eli.friedman@gmail.com> More hacking on mapDiagnosticRanges to make it handle more cases.
This still isn't quite right, but it fixes a crash.

I factored out findCommonParent because we need it on the result of
getImmediateExpansionRange: for a function macro, the beginning
and end of an expansion range can come out of different
macros/macro arguments, which means the resulting range is a complete
mess to handle consistently.

I also made some changes to how findCommonParent works; it works somewhat
better in some cases, and somewhat worse in others, but I think overall
it's a better balance. I'm coming to the conclusion that mapDiagnosticRanges
isn't using the right algorithm, though: chasing the caret is fundamentally
more complicated than any algorithm which only considers one FileID for the
caret can handle because each SourceLocation doesn't really have a single parent.
We need to follow the same path of choosing expansion locations and spelling
locations which the caret used to come up with the correct range
in the general case.

Fixes <rdar://problem/12847524>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170049 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
e5d30e3b403539b10aaa52f03875a2243bf88904 11-Dec-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Extend stat query APIs to explicitly specify if the query is for
a file or directory, allowing just a stat call if a file descriptor
is not needed.

Doing just 'stat' is faster than 'open/fstat/close'.
This has the effect of cutting down system time for validating the input files of a PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169831 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
0f584640dce8f9d10e802b1e323a594f7850a465 08-Dec-2012 Benjamin Kramer <benny.kra@googlemail.com> Escape % in the TextDiagnosticBuffer so they aren't interpreted twice when fed into the diagnostic formatting machinery again.

Fixes PR14543.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169677 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticBuffer.cpp
4fb10d1c67fd9596998cf05016fa3a4ed6fd0fb3 06-Dec-2012 Chad Rosier <mcrosier@apple.com> [driver, ms-inline asm] -fms-compatibility enables -fms-extensions, so this should enable
the AsmBlocks language extension as well.
rdar://12808010

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169448 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e23fbf1fca9be5653ca706ccefc31d5e5a3a334d 06-Dec-2012 Chad Rosier <mcrosier@apple.com> [driver, ms-inline asm] Have -fms-extensions enable the AsmBlocks language
option. MS-style inline asm can now be enabled by either -fasm-blocks or
-fms-extensions.
rdar://12808010

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169445 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
15490fd42d7d8dca2f9b5b3a9dc074892ca1acd7 05-Dec-2012 Chad Rosier <mcrosier@apple.com> [driver, ms-inline asm] MS-Style inline assembly is controlled by the
-fasm-blocks flag, not the -fms-extensions flag.
rdar://12808010

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169422 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
5b10af7aa9e254a38d0a9f4d86caaccd61972124 05-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> PR14049: Don't say "expanded from macro 'foo'" when 'foo' just happens to be
the LHS of a token paste. Use "expanded from here" instead when we're not sure
it's actually a macro.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169373 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
98cffc6b30dacd71434530fee368b1f7d03bd565 05-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Minor reorganization. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169367 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
ac31c8346f1ce3628b5a7fb862fefab5b94f8e82 05-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Simplify slightly by seperating out the responsibility for emission of a caret
diagnostic from the emission of macro backtraces. Incidentally, we now get the
displayed source location for a diagnostic and the location for the caret from
the same place, rather than computing them separately. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169357 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
678839297204002df215e0be12bcd10b20a9a4a4 05-Dec-2012 Richard Smith <richard-llvm@metafoo.co.uk> Simplify diagnostic emission. No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169351 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
55fc873017f10f6f566b182b70f6fc22aefa3464 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort all of Clang's files under 'lib', and fix up the broken headers
uncovered.

This required manually correcting all of the incorrect main-module
headers I could find, and running the new llvm/utils/sort_includes.py
script over the files.

I also manually added quite a few missing headers that were uncovered by
shuffling the order or moving headers up to be main-module-headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
STMerge.cpp
STUnit.cpp
acheTokens.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
ependencyGraph.cpp
iagnosticRenderer.cpp
rontendAction.cpp
rontendActions.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
ogDiagnosticPrinter.cpp
ultiplexConsumer.cpp
rintPreprocessedOutput.cpp
erializedDiagnosticPrinter.cpp
extDiagnostic.cpp
extDiagnosticPrinter.cpp
erifyDiagnosticConsumer.cpp
arnings.cpp
37ed12720a35b7bfa1c4de73ad6f1c6c1c88ee17 04-Dec-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactor recording the preprocessor conditional directive regions out of
PreprocessingRecord and into its own class, PPConditionalDirectiveRecord.

Decoupling allows a client to use the functionality of PPConditionalDirectiveRecord
without needing a PreprocessingRecord.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169229 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
91ecfa6af51836d3ccc90beddab1193b0c060739 03-Dec-2012 Alexey Samsonov <samsonov@google.com> Add Clang flags -fsanitize-blacklist and -fno-sanitize-blacklist. Make this flag usable for ASan. Blacklisting can be used to disable sanitizer checks for particular file/function/object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169144 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ad95481b2769ad61f23afc5e2c31f11c66090657 02-Dec-2012 Will Dietz <wdietz2@illinois.edu> [ubsan] Add flag to enable recovery from checks when possible.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169114 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c2b914fb6fed213a7e7d9847e543f1e7f94d852d 01-Dec-2012 Benjamin Kramer <benny.kra@googlemail.com> Make helper classes anonymous. Make helper functions static instead of private members so the anonymous class doesn't leak out.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169099 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
14afab36c73c32a831838ba80f36136a80d9e6db 01-Dec-2012 Douglas Gregor <dgregor@apple.com> Teach the serialized diagnostic writer to clone() itself, sharing
state so that all of the various clones end up rendering their
diagnostics into the same serialized-diagnostics file. This is
important when we actually want failures during module build to be
reported back to the translation unit that tried to import the
not-yet-built or out-of-date module. <rdar://problem/12565727>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169057 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
4565e487531c7bf6d348dbe9f5529784966fc7ae 30-Nov-2012 Douglas Gregor <dgregor@apple.com> Rename ModuleBuildPath -> ModuleBuildStack. Thanks, Dmitri!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169045 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
iagnosticRenderer.cpp
6c3254316de2d0d554b19702f4b10117ae46b77b 30-Nov-2012 Douglas Gregor <dgregor@apple.com> When we're emitting a diagnostic with a source location in an imported
module, provide a module import stack similar to what we would get for
an include stack, e.g.,

In module 'DependsOnModule' imported from build-fail-notes.m:4:
In module 'Module' imported from DependsOnModule.framework/Headers/DependsOnModule.h:1:
Inputs/Module.framework/Headers/Module.h:15:12: note: previous definition is here
@interface Module

<rdar://problem/12696425>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169042 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
extDiagnostic.cpp
830ea5b7c75413526c19531f0180fa6e45b98919 30-Nov-2012 Douglas Gregor <dgregor@apple.com> When an error occurs while building a module on demand, provide "While
building module 'Foo' imported from..." notes (the same we we provide
"In file included from..." notes) in the diagnostic, so that we know
how this module got included in the first place. This is part of
<rdar://problem/12696425>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169021 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
iagnosticRenderer.cpp
extDiagnostic.cpp
ecdc8d3e0fc65610746a4e074491ca0807fca7b2 30-Nov-2012 Eli Friedman <eli.friedman@gmail.com> Fix the computation of highlight ranges so we produce something sane when
the beginning and end of the range are in different macro arguments.
PR14399.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168984 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
463d90986ec54c62bf8fe31193ef5db701db48a5 30-Nov-2012 Douglas Gregor <dgregor@apple.com> Keep track of modules that have failed to build. If we encounter an
import of that module elsewhere, don't try to build the module again:
it won't work, and the experience is quite dreadful. We track this
information somewhat globally, shared among all of the related
CompilerInvocations used to build modules on-the-fly, so that a
particular Clang instance will only try to build a given module once.

Fixes <rdar://problem/12552849>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168961 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
84268904947ada7e251932a6f5b0f4364df7a2c7 29-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Reject uses of __int128 on platforms that don't support it. Also move the ugly
'getPointerWidth(0) >= 64' test to be a method on TargetInfo, ready to be
properly cleaned up.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168856 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
17c874a944090a74aa890d7b5ef361be6e4a0184 27-Nov-2012 Rafael Espindola <rafael.espindola@gmail.com> Remove some dead code. CLANG_IS_PRODUCTION is now just a build flag and
is not used in any #ifdef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168703 91177308-0d34-0410-b5e6-96231b3b80d8
reateInvocationFromCommandLine.cpp
acf36129fa7ff2abef80d38ab6901a50b044c7d1 27-Nov-2012 Daniel Dunbar <daniel@zuster.org> Frontend: Create a virtual file for named pipe inputs.
- This ensures we see the right buffer size for the file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168636 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
85489080807b47b70d26611ba543801e16bec4cd 23-Nov-2012 Joey Gouly <joey.gouly@arm.com> PR14306: Move -fbounds-checking to -fsanitize=bounds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168510 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
0061fe4094a088863fd47d2509a40cbfcb019f07 21-Nov-2012 Dmitri Gribenko <gribozavr@gmail.com> Use color for -ast-dump-filter only when it is supported

Patch by Philip Craig.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168420 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
49a87549f4dc95ecb3d8a593b71df7c167a51f85 16-Nov-2012 Douglas Gregor <dgregor@apple.com> Since CreateTargetInfo is taking ownership of the target options, pass
it as a pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168136 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
7fdc8fdbfe0d2b4bc0f1a22b2560ca6d86a72c94 16-Nov-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] When caching code-completion results, pass the CachedCompletionAllocator
to the CodeCompletionTUInfo that is going to be used to get the results.

Previously we would use ASTUnit's CodeCompletionTUInfo which has its own allocator
that will go away when we reparse. That could result in a use-after-free bug when
getting the parent context name from a CodeCompletionString.

Addresses rdar://12568377.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168133 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
2a9be3e5b0c390f9189bb3dec2b2b6ba884f60cc 16-Nov-2012 Daniel Dunbar <daniel@zuster.org> CPP Output: Do not emit an enter file marker for the main file.

- This diverges from gcc, and confuses tools (like dtrace) which track # line
markers as a way to determine which content is in the context of the main
file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168128 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
3d145f660a23d5bdabdd1ead83c51f3df1489b09 15-Nov-2012 Fariborz Jahanian <fjahanian@apple.com> block extended signatur option. Change previous option
to a cc1 -fencode-extended-block-signature and pass it
to cc1 and recognize this option to produce extended block
type signature. // rdar://12109031


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168063 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
992d91742129c1f77563df0b3d0a40b36fd13e3e 15-Nov-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [modules] Use a memory buffer directly as input for the module includes,
instead of messing with virtual files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168062 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
958bcaf3d4e0c1ae46de3e84e7c2a7638c3c5286 15-Nov-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [modules] Setup the import location of a module file and use it
as the include location of the main file of an imported module.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168061 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
c4a77906c259cba58c147d8468c406a430ecdcbb 15-Nov-2012 Dmitri Gribenko <gribozavr@gmail.com> Use empty parens for empty function parameter list instead of '(void)'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168041 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
931c0833811c030884fa50b2ccbd3c34f0f4c4ee 15-Nov-2012 Lang Hames <lhames@gmail.com> Make -ffp-contract a codegen option, rather than a laguage option. This makes
more sense anyway - it determines how expressions are codegen'd. It also ensures
that -ffp-contract=fast has the intended effect when compiling LLVM IR.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168027 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
62221b17c90457df9ca0ff20bb54d634e8951def 15-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add -cc1 option -fno-diagnostics-use-presumed-location, a handy mode for
working with preprocessed testcases. This causes source locations in
diagnostics to point at the spelling location instead of the presumed location,
while still keeping the semantic effects of the line directives (entering and
leaving system-header mode, primarily).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168004 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
iagnosticRenderer.cpp
06cffc0511ba76d979fad9ef6944e685936b62f0 15-Nov-2012 Fariborz Jahanian <fjahanian@apple.com> objective-C blocks: under cc1 flag -encode-extended-block-signature,
generate expanded signature encoding to include types as we
already do this for protocol method lists.
// rdar://12109031


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167997 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
bb23628148f555a4cf71f98c27096a7a804c085c 11-Nov-2012 Nico Weber <nicolasweber@gmx.de> s/BCPLComment/LineComment/

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167690 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
75e8efef960a5e8b94a7e289088e5e7cabe728bd 10-Nov-2012 Eli Friedman <eli.friedman@gmail.com> Make __LDBL_MAX__ etc. have the correct type on targets where long double/double/etc. have the same format. PR14285.

Based on patch by Jeroen Dobbelaere.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167649 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
ecd27bf256c92f56c7c7ede6f40ec5d31a40b35e 09-Nov-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add a FileCharacteristic parameter to SourceManager::createFileIDForMemBuffer
for completeness and use it in CompilerInstance::InitializeSourceManager if
the input is a memory buffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167628 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
8616f9af65b9a3662f2c9dfed38eeabc509f8446 09-Nov-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Turn FrontendInputFile into an immutable class and have it also accept
a memory buffer instead of only a filename.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167627 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
rontendAction.cpp
8e1fbbc492bc1f4833136d9b55e1aaf478565d32 09-Nov-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make CompilerInstance::InitializeSourceManager accept a FrontendInputFile,
no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167626 91177308-0d34-0410-b5e6-96231b3b80d8
hainedIncludesSource.cpp
ompilerInstance.cpp
rontendAction.cpp
485577dcac0b0877cfb5395b365490a0189c66f5 09-Nov-2012 Chad Rosier <mcrosier@apple.com> Implement -mstrict-align using '-backend-option -arm-strict-align' as this saves
us from having to make any backend changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167623 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7e293276281bd5bf8526c064d298082b08f0bd8b 09-Nov-2012 Chad Rosier <mcrosier@apple.com> [driver] Add a -mstrict-align compiler option for ARM targets.
rdar://12340498

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167619 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
64c4f29ff3b98d412e0235504364096e997b04bb 08-Nov-2012 Bob Wilson <bob.wilson@apple.com> Remove code to fall back to llvm-gcc for i386 kexts.

More cleanups to follow in separate commits....

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167566 91177308-0d34-0410-b5e6-96231b3b80d8
reateInvocationFromCommandLine.cpp
7cdd28162dc7ade4b14bf237e87b4bbc17b2f023 07-Nov-2012 Douglas Gregor <dgregor@apple.com> When loading a module fails because it is out of date, rebuild that
module in place. <rdar://problem/10138913>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167539 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
3043175274899e086c8664fe64c8fb4b9eacb733 06-Nov-2012 Douglas Gregor <dgregor@apple.com> Split the instrinsic header wmmintrin.h into AES and PCLMUL parts, so
that we can model them as separate submodules.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167420 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ce36ecd5a509af8fc5924d21694df36e8bc94a95 05-Nov-2012 Daniel Dunbar <daniel@zuster.org> Frontend: Add support for reading named pipes as the main file.

- The whole {File,Source}Manager is built around wanting to pre-determine the
size of files, so we can't fit this in naturally. Instead, we handle it like
we do STDIN, where we just replace the main file contents upfront.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167419 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
d6396a681c9acbe56bc41bbc2bed2db45755bcd7 05-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Use the individual -fsanitize=<...> arguments to control which of the UBSan
checks to enable. Remove frontend support for -fcatch-undefined-behavior,
-faddress-sanitizer and -fthread-sanitizer now that they don't do anything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167413 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c4dabadb51475e76b606024f144e7cf93b0bad00 05-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add -fsanitize=<sanitizers> argument to driver and frontend, and add
-fno-sanitize=<sanitizers> argument to driver. These allow ASan, TSan, and the
various UBSan checks to be enabled and disabled separately. Right now, the
different modes can't be combined, but the intention is that combining UBSan
and the other sanitizers will be permitted in the near future.

Currently, the UBSan checks will all be enabled if any of them is; that will be
fixed by the next patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167411 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ca1b62a33cacee20d3bd756210d3211dd663209e 05-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Rename LangOptions members for address sanitizer and thread sanitizer from
*Sanitizer to Sanitize* in preparation for later patches.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167405 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
984e2eb52ce97eae001a28e54f36e624e98c12a7 05-Nov-2012 Douglas Gregor <dgregor@apple.com> Hash the various compiler version, target, preprocessor, and
header-search options into the module hash. We're just using
ADT/Hashing.hpp for this, which isn't as cryptographically strong as
I'd like, but it'll do. If someone contributes (say) and MD4
implementation, we'd happily switch to that.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167397 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
191db6dc0d6290b5f2993691e409ff2dc8b4345e 04-Nov-2012 Seth Cantrell <seth.cantrell@gmail.com> only truncate source lines in text diagnostics when
the ellipsis is shorter than the text it replaces

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167364 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
9cffb4a9ae548245ede15850cb96dfedf56255fe 03-Nov-2012 Seth Cantrell <seth.cantrell@gmail.com> don't step into the middle of multibyte sequences

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167361 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
eaa5a2b5e099bf29856bc88b03cd7c9d473f671d 03-Nov-2012 Seth Cantrell <seth.cantrell@gmail.com> fix bug in SourceColumnMap::startOfPreviousColumn

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167360 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
9cb1c3de9df7d944f0c5cccaf03fa414036487eb 03-Nov-2012 Eli Friedman <eli.friedman@gmail.com> Add a proper algorithm to compute accurate source ranges for diagnostics with
caret locations and source ranges in macros. Makes ranges more accurate
in some cases, and fixes an assertion failure.

Fixes <rdar://problem/12472249>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167353 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
extDiagnostic.cpp
e50904f83b1b09bff487185dd823dfc8415cb300 02-Nov-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> When code-completing don't disable the preprocessing record if modules are enabled.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167325 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1d489cf4a04ad0ad8ac2696e4eed0995f3a67288 01-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove first argument from Arg::getValue; it's been unused since r105760.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167211 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7c3f8b3dafebc87b4b1492276f63b6cabbc7c59b 01-Nov-2012 Richard Smith <richard-llvm@metafoo.co.uk> Remove CompilerInvocation::toArgs and clang -cc1test mode. These were untested
and apparently unused (and since they are untested, they're presumably also
broken).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167210 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
4182ed686283b72736b287cbe28583cb641f8934 31-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] Remove the stat cache from the PCH file.

The stat cache became essentially useless ever since we started
validating all file entries in the PCH.
But the motivating reason for removing it now is that it also affected
correctness in this situation:

-You have a header without include guards (using "#pragma once" or #import)
-When creating the PCH:
-The same header is referenced in an #include with different filename cases.
-In the PCH, of course, we record only one file entry for the header file
-But we cache in the PCH file the stat info for both filename cases

-Then the source files are updated and the header file is updated in a way that
its size and modification time are the same but its inode changes

-When using the PCH:
-We validate the headers, we check that header file and we create a file entry with its current inode
-There's another #include with a filename with different case than the previously created file entry
-In order to get its stat info we go through the cached stat info of the PCH and we receive the old inode
-because of the different inodes, we think they are different files so we go ahead and include its contents.

Removing the stat cache will potentially break clients that are attempting to use the stat cache
as a way of avoiding having the actual input files available. If that use case is important, patches are welcome
to bring it back in a way that will actually work correctly (i.e., emit a PCH that is self-contained, coping with
literal strings, line/column computations, etc.).

This fixes rdar://5502805

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167172 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendAction.cpp
30280389d108a5a781e45b8cfd1aa14bed3920d4 31-Oct-2012 Alexander Kornienko <alexfh@google.com> Fix for -ast-dump-filter

Summary:
-ast-dump-filter implementation used to stop AST traversal after traversing a NULL Decl node.

Added test and fixed.

Reviewers: djasper, klimek, rsmith

Reviewed By: djasper

CC: cfe-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D93

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167155 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
25893e0930c1241c3fdafc6f1b8661443bb19692 31-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Decouple code-completion for the SkipFunctionBodies frontend option and
add a test to make sure code-completion skips bodies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167141 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
0d1e645bbfd3727b0dd758bdb685c6e5c7592fec 30-Oct-2012 Seth Cantrell <seth.cantrell@gmail.com> remove duplicate data array

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167007 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
c6a2f6e2dd16368f4a60178b5e20b63fcafb5481 30-Oct-2012 Seth Cantrell <seth.cantrell@gmail.com> fix calculation of end pointer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167006 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
badb3f6971bec4a7341ed152d367f27d572682e0 30-Oct-2012 Rafael Espindola <rafael.espindola@gmail.com> Move getOriginalSourceFileName inline. Patch by Laszlo Nagy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166981 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
b201e93f018fc9e5b964053a85685d38cec6f841 29-Oct-2012 Nick Lewycky <nicholas@mxc.ca> Remove spurious mode marker from .cpp file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166915 91177308-0d34-0410-b5e6-96231b3b80d8
hainedDiagnosticConsumer.cpp
286d6236850ed3710822e659afdfdf08a315716b 27-Oct-2012 Mahesha S <mahesha.llvm@gmail.com> Reverted back the changes made in 166868 and in 166869

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166871 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f3b52315e2ee52bdff9cba31b037c7e6b3adfadc 27-Oct-2012 Mahesha S <mahesha.llvm@gmail.com> -------------------------------------------------
Feature:
OpenMP support in CLANG:

Sub-Feature:
Support for option -fopenmp

Files Changed/Added:
* include/clang/Driver/Options.td (C)
* include/clang/Basic/LangOptions.def (C)
* lib/Driver/Tools.cpp (C)
* lib/Frontend/CompilerInvocation.cpp (C)

Test Cases Changed/Added:
* test/Driver/clang_fopenmp_opt.c (A)
-------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166868 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
4399890d385171eff39927a26823426046d33456 25-Oct-2012 Douglas Gregor <dgregor@apple.com> ASTUnit doesn't actually care about the predefines; don't record them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166650 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
4c0c7e86645dfa1719d17d70e009ab49347aba62 25-Oct-2012 Douglas Gregor <dgregor@apple.com> Teach the PCH validator to check the preprocessor options, especially
the macros that are #define'd or #undef'd on the command line. This
checking happens much earlier than the current macro-definition
checking and is far cleaner, because it does a direct comparison
rather than a diff of the predefines buffers. Moreover, it allows us
to use the result of this check to skip over PCH files within a
directory that have non-matching -D's or -U's on the command
line. Finally, it improves the diagnostics a bit for mismatches,
fixing <rdar://problem/8612222>.

The old predefines-buffer diff'ing will go away in a subsequent commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166641 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
36a16498ff911a218f26c7955376bbe99ddb16df 24-Oct-2012 Douglas Gregor <dgregor@apple.com> Teach the preprocessor to hold onto the preprocessor options.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166599 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
14e71f04136de056c08ffb9ccd44b4ca391cc8a5 24-Oct-2012 Douglas Gregor <dgregor@apple.com> Move PreprocessorOptions into the Lex library, and make it intrusively
reference-counted.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166587 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
c042edd54face617a3b9d0b4b9d5a3ff229d0f48 24-Oct-2012 Douglas Gregor <dgregor@apple.com> Move HeaderSearchOptions into the Lex library, make it intrusively
reference-counted, and hold a reference to it in HeaderSearch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166583 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
nitHeaderSearch.cpp
4d9e497a2b1eab3b1214848216050c64fc3acfd6 24-Oct-2012 Jordan Rose <jordan_rose@apple.com> [analyzer] Replace -analyzer-no-eagerly-trim-egraph with graph-trim-interval.

After every 1000 CFGElements processed, the ExplodedGraph trims out nodes
that satisfy a number of criteria for being "boring" (single predecessor,
single successor, and more). Rather than controlling this with a cc1 option,
which can only disable this behavior, we now have an analyzer-config option,
'graph-trim-interval', which can change this interval from 1000 to something
else. Setting the value to 0 disables reclamation.

The next commit relies on this behavior to actually test anything.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166528 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
dc7b641574a733624489bd87fc7061771edf2113 24-Oct-2012 Douglas Gregor <dgregor@apple.com> Use a .def file for most of the diagnostic options.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166520 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnostic.cpp
arnings.cpp
02c23ebf41ae2f70da0ba7337e05c51fbfe35f7f 24-Oct-2012 Douglas Gregor <dgregor@apple.com> Make DiagnosticOptions intrusively reference-counted, and make sure
the various stakeholders bump up the reference count. In particular,
the diagnostics engine now keeps the DiagnosticOptions object alive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166508 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
iagnosticRenderer.cpp
ogDiagnosticPrinter.cpp
erializedDiagnosticPrinter.cpp
extDiagnostic.cpp
extDiagnosticPrinter.cpp
arnings.cpp
4cdad3151bfb2075c6bdbfe89fbb08f31a90a45b 23-Oct-2012 Douglas Gregor <dgregor@apple.com> Switch CodeGenOptions over to a .def file, like we do with LangOptions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166497 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
27ffa6caf965ef20fdef5ae23b81cdc3d05e7afb 23-Oct-2012 Douglas Gregor <dgregor@apple.com> If the precompiled header named by "-include" is actually a directory,
check each of the files within that directory to determine if any of
them is an AST file that matches the language and target options. If
so, the first matching AST file is loaded. This fixes a longstanding
discrepency with GCC's precompiled header implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166469 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
rontendAction.cpp
4ec429d1be4ede3d02712714f20470b2c87f748c 23-Oct-2012 Douglas Gregor <dgregor@apple.com> Handle implicitly-included PCH files the same way as
implicitly-included PTH files during initialization, delaying the
mapping down to the "original source file" until after later in the
initialization process.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166452 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
38295beb73db5f90bfcf31625fb81dbc3b96290a 23-Oct-2012 Douglas Gregor <dgregor@apple.com> Allow clients of the AST reader to specify what kinds of AST load
failures they know how to tolerate, e.g., out-of-date input files or
configuration/version mismatches. Suppress the corresponding
diagnostics if the client can handle it.

No clients actually use this functionality, yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166449 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
4825fd7fbb3fe87cdf8da9bccc1361fac45bdf2d 23-Oct-2012 Douglas Gregor <dgregor@apple.com> Distinguish the various kinds of AST file loading failures:
file corruption, compiler version mismatch, target/language
configuration mismatch, out-of-date AST file. No functionality change
yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166446 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
c635710bcbb9598acd5a14647ba7ca28bee89a68 23-Oct-2012 Michael J. Spencer <bigcheesegs@gmail.com> [Options] Add prefixes to options.

Each option has a set of prefixes. When matching an argument such as
-funroll-loops. First the leading - is removed as it is a prefix. Then
a lower_bound search for "funroll-loops" is done against the option table by
option name. From there each option prefix + option name combination is tested
against the argument.

This allows us to support Microsoft style options where both / and - are valid
prefixes. It also simplifies the cases we already have where options come in
both - and -- forms. Almost every option for gnu-ld happens to have this form.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166444 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
91e06dab9335ed6b4474a74353549c708cf3d936 20-Oct-2012 Michael J. Spencer <bigcheesegs@gmail.com> [Options] Make Option non clang specific.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166348 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
266dba3661928d26f043560b169bea87578aa917 19-Oct-2012 Andy Gibbs <andyg1001@hotmail.co.uk> Change VerifyDiagnosticConsumer so that it *must* contain at least one "expected-*" directive. As a result, for test-cases that are not expected to generate any diagnostics, an additional directive "expected-no-diagnostics" has been implemented which can then be included in such test-cases. This new directive may not be used in conjunction with any other "expected-*" directive.

This change was initially proposed as a solution to the problem highlighted by check-in r164677, i.e. that -verify will not cause a test-case failure where the compile command does not actually reference the file.

Patch reviewed by David Blaikie.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166281 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
4a529d26d6ccfc9b3d11031f1256f4f87055c562 19-Oct-2012 Andy Gibbs <andyg1001@hotmail.co.uk> Fix directive parsing in VerifyDiagnosticConsumer so that it ensures that "expected" is at the start of the word and will no longer accept typos such as "junkexpected-*" as a valid "expected-*" directive. A very few test-cases had to be amended to adhere to the new rule.

Patch reviewed by David Blaikie.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166279 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
f38523388174760dcbad810ef60d8504d7df6b4c 19-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r166223 and the subsequent commits that depend on it, r166230 & r166235.

This seems to have introduced assertion hit when building compiler-rt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166245 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
da3301eec823fe770bfa49a1cb19649506caa698 18-Oct-2012 Eric Christopher <echristo@gmail.com> Add a new option for and disable column number information as there
are no known current users of column info. Robustify and fix up
a few tests in the process. Reduces the size of debug information
by a small amount.

Part of PR14106

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166236 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d2deb91b02ae1d810719e4a5a63dc404f362575a 18-Oct-2012 Michael J. Spencer <bigcheesegs@gmail.com> [Options] Make Option non clang specific.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166230 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
4ca3abd3680afec6207d25d0bb80838bf59ecbfe 18-Oct-2012 Benjamin Kramer <benny.kra@googlemail.com> Emit diagnostics in chunks even when we're trying to print colored template diffs.

char-by-char is really slow on an unbuffered stream.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166218 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
5ba49c0177bd594a9760956f51293b5731b03d6d 18-Oct-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add -std=c++1y argument, for *highly* experimental C++14 support.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166139 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
57016dda61498294120b1a881d9e6606337b29d9 17-Oct-2012 Douglas Gregor <dgregor@apple.com> Serialize TargetOptions into an AST file, and make sure that we keep
target options around so they can be accessed at any point (rather
than keeping them transient).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166072 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
9a022bb007a3e77e1ac1330f955a239cfb1dd0fb 15-Oct-2012 Douglas Gregor <dgregor@apple.com> Teach TargetInfo to hold on to the TargetOptions with which it was
created.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165943 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a2e94892e273423e2f772f989921cda6442a66c4 14-Oct-2012 Benjamin Kramer <benny.kra@googlemail.com> Make sure temporary files are deleted when recovering from a crash when compiling modules.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165911 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ac447fce02d119fb70f0aab885d836dea43e7f26 14-Oct-2012 Benjamin Kramer <benny.kra@googlemail.com> Delete temporary output files when an error occurs during PCH reading.

This reduces the spam make test leaves behind in /tmp. The assert isn't
particularly useful because it's not run with -disable-free (the default when
using the clang driver) but should cover all -cc1 tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165910 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendAction.cpp
900ab95e12bb7483971640a91075699eec391804 11-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Improve AST serialization done by ASTUnit::Save().

The ASTUnit needs to initialize an ASTWriter at the beginning of
parsing to fully handle serialization of a translation unit that
imports modules. Do this by introducing an option to enable it, which
corresponds to CXTranslationUnit_ForSerialization on the C API side.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165717 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
62288edde26ff4af9fc079c979a0e1bdc577ce9d 10-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> When indexing a module file, for the ppIncludedFile callback give
an invalid location if the location points to the synthetic buffer
for the module input.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165592 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
2a857180050fb78b356c17931e311eef7f2daf3e 10-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [modules] Consistently construct a buffer as input to build the module.
This means the main file for modules will always be a virtual one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165591 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
a8235d6c4093cd38dcf742909651f867de62e55b 10-Oct-2012 Douglas Gregor <dgregor@apple.com> Rework the (de-)serialization of macros, as stored in
MacroInfo*. Instead of simply dumping an offset into the current file,
give each macro definition a proper ID with all of the standard
modules-remapping facilities. Additionally, when a macro is modified
in a subsequent AST file (e.g., #undef'ing a macro loaded from another
module or from a precompiled header), provide a macro update record
rather than rewriting the entire macro definition. This gives us
greater consistency with the way we handle declarations, and ties
together macro definitions much more cleanly.

Note that we're still not actually deserializing macro history (we
never were), but it's far easy to do properly now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165560 91177308-0d34-0410-b5e6-96231b3b80d8
hainedIncludesSource.cpp
ompilerInstance.cpp
rontendAction.cpp
d7ee194e7c7649cad542a36cd1d26c23432807aa 08-Oct-2012 Benjamin Kramer <benny.kra@googlemail.com> Don't emit double parentheses in __clang_version__.

PR14040.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165415 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
c7782d96c657eeb767bfea5117db49dc40e6356c 05-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [Modules] Introduce Module::TopHeaders which is a set of top-level headers
that are associated with a (sub)module.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165279 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
3da76bfbd24b2747ceb72d1918bbbe3123dac841 03-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] When indexing, invoke the importedASTFile for PCH files as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165161 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
d3d981627c375b187f33cc92a034a77ac329ec47 03-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ASTConsumer::HandleImplicitImportDecl() callback that is invoked
when an ImportDecl that was implicitly created due to an inclusion directive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165084 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
95c579cae01118eadd311d445ff7f491d0011fb0 03-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Some renames to use the 'visitor' nomenclature, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165083 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
2093e0bc4e436b1b2791d5423fb3274dd37231b8 02-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] When indexing an AST file, only deserialize the file level
declarations of the current primary module.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165046 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
632dcc92f60ab7f806a89c5bca3a0951763a9219 02-Oct-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] When indexing an AST file, only deserialize the preprocessing record
entities of the current primary module.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165023 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f8afcffe6a0213760b64c211812b1750e1e1e967 29-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> For PPCallbacks::InclusionDirective() add a parameter for the module, whenever
an inclusion directive was automatically turned into a module import, and
PPCallbacks::moduleImport() for an explicit module import.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164874 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
ependencyGraph.cpp
e2ac16b09ea66ad955752381b82fb8719d003e5e 29-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> In the Module class, add a reference to the corresponding AST file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164873 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
f3477c13eeaf11b32a41f181398fb5deffd0dd73 27-Sep-2012 Sylvestre Ledru <sylvestre@debian.org> Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164766

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164769 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
94ff8e1f57c6382d91d0de981a4f311509d83e37 27-Sep-2012 Sylvestre Ledru <sylvestre@debian.org> Fix a typo 'iff' => 'if'

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164766 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
da313592441db36cf4b06be97c4bcc238ee6fa9c 27-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Per discussion in http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120917/064551.html
have PPCallbacks::InclusionDirective pass the character range for the filename quotes or brackets.

rdar://11113134 & http://llvm.org/PR13880

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164743 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
ependencyGraph.cpp
c04bb926ef693c94560da254e87926e93bb9c92f 27-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Always report a CXCursor_MacroDefinition for code-completion
results for a macro name, not CXCursor_NotImplemented.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164740 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
e6d22027bc22d3767a2acdc80299c76b91159867 26-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Have ASTUnit::Save() return a bool to indicate save error.

Removes a dependency of ASTUnit to clang-c/Index.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164704 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
98e95bf1c84560684356088af7f4878bdacb5856 15-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow disabling PCH validation when loading an AST file by checking
an environment variable for debugging purposes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163958 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
7f1863326488813e7648845f3cec5225770b1a0b 14-Sep-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] When loading an AST file, make sure to apply the language options
to the target info.

Related to rdar://12069503.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163931 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c7bb384d608aeae23a6c95114569da0c3eae10fe 13-Sep-2012 Richard Smith <richard-llvm@metafoo.co.uk> Make TextDiagnostic more robust against SourceLocations which point into the
middle of UTF-8 characters, and avoid walking to such positions when adjusting
column ranges for display. Fixes a couple of hangs when rendering diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163820 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
127ff2ea6440c3da4b47f9c8b3b190254a97e7b5 13-Sep-2012 Ted Kremenek <kremenek@apple.com> Conditionally parse documentation comments in system headers by
passing -fretain-comments-from-system-headers. By default, the
compiler no longer parses such documentation comments, as they
can result in a noticeable compile time/PCH slowdown.

Fixes <rdar://problem/11860820>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163778 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1696bc28f4460c187ab80f3b20b1507f58a4ef2f 13-Sep-2012 NAKAMURA Takumi <geek4civic@gmail.com> InitHeaderSearch.cpp: [mingw] Handle DOSish paths only on Win32 hosts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163776 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
9f0b1324a5352713337c75ef4a5acffd96609c6c 11-Sep-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge-2012_09_10
5a1ffe98b04120846a15f7105905b5f363b08635 06-Sep-2012 Jordan Rose <jordan_rose@apple.com> [analyzer] Always include destructors in the analysis CFG.

While destructors will continue to not be inlined (unless the analyzer
config option 'c++-inlining' is set to 'destructors'), leaving them out
of the CFG is an incomplete model of the behavior of an object, and
can cause false positive warnings (like PR13751, now working).

Destructors for temporaries are still not on by default, since
(a) we haven't actually checked this code to be sure it's fully correct
(in particular, we probably need to be very careful with regard to
lifetime-extension when a temporary is bound to a reference,
C++11 [class.temporary]p5), and
(b) ExprEngine doesn't actually do anything when it sees a temporary
destructor in the CFG -- not even invalidate the object region.

To enable temporary destructors, set the 'cfg-temporary-dtors' analyzer
config option to '1'. The old -cfg-add-implicit-dtors cc1 option, which
controlled all implicit destructors, has been removed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163264 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
5b86ffd219bdee7720217d5755b772726668b242 05-Sep-2012 Abramo Bagnara <abramo.bagnara@gmail.com> Allow disabling of wchar_t type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163221 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
45796b10d11869e86c6b85e24df165410536b313 31-Aug-2012 Ted Kremenek <kremenek@apple.com> Make AnalyzerOptions a shared object between CompilerInvocation and
AnalysisManager, allowing the StringMap of configuration values to
be propagated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162978 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
987695a5ddd78beca784d4e503ffbc2dc879181a 31-Aug-2012 Ted Kremenek <kremenek@apple.com> Move AnalyzerOptions.h into 'Core' StaticAnalyzer sub-library.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162977 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
3f2a55d81983577c85c03f6b9844f51c566c785b 31-Aug-2012 Anna Zaks <ganna@apple.com> [analyzer] Make analyzer-ipa=dynamic-bifurcate the default.

There are two tests regressions that come from the fact that the Retain
Count checker does not cancel out inlining of ObjC methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162950 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
2fa9d72d4d23ccdcd4137946e5ebafac7a04f04c 30-Aug-2012 Ted Kremenek <kremenek@apple.com> Rename 'MaxLoop' to 'maxBlockVisitOnPath' to reflect reality. We
should consider renaming the command line option as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162932 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
3b8a04004afa46057a9af4afbd086be71d619793 30-Aug-2012 Ted Kremenek <kremenek@apple.com> Rename 'VisualizeEGUbi' and 'VisualizeEGDot' to 'visualizeExplodedGraphWithUbigGraph'
and 'visualizeExplodedGraphWithGraphViz' respectively.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162931 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
0caa2d47b84337e942b3f6652adfafe4ae506cfe 30-Aug-2012 Ted Kremenek <kremenek@apple.com> Rename AnalyzerOptions 'EagerlyAssume' to 'eagerlyAssumeBinOpBifurcation'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162930 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
255d4d4226b24036ceb11228fbb74286e58620f7 30-Aug-2012 Ted Kremenek <kremenek@apple.com> Store const& to AnalyzerOptions in AnalysisManager instead of copying
individual flags.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162929 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
82f5aceed89b85e79373086b7e0e7986e2c59179 30-Aug-2012 Ted Kremenek <kremenek@apple.com> Move Analyses.def to include/clang/StaticAnalyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162927 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
318cc3c07eaca04d319be841e9e3bac35d1ff9f5 30-Aug-2012 Ted Kremenek <kremenek@apple.com> Change -analyzer-config to use '=' as the key-value separator, and only
support the '-analyzer-config key=val' variant.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162891 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7b73e0832b20af1f43601a3d19e76d02d9f4dce5 29-Aug-2012 Ted Kremenek <kremenek@apple.com> Add new -cc1 driver option -analyzer-config, which allows one to specify
a comma separated collection of key:value pairs (which are strings). This
allows a general way to provide analyzer configuration data from the command line.

No clients yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162827 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8a64bb58c3b24d7d97895e435bbc0965c99bd3be 29-Aug-2012 Alexander Kornienko <alexfh@google.com> Keep history of macro definitions and #undefs

Summary:
Summary: Keep history of macro definitions and #undefs with corresponding source locations, so that we can later find out all macros active in a specified source location. We don't save the history in PCH (no need currently). Memory overhead is about sizeof(void*)*3*<number of macro definitions and #undefs>+<in-memory size of all #undef'd macros>

I've run a test on a file composed of 109 .h files from boost 1.49 on x86-64 linux.
Stats before this patch:
*** Preprocessor Stats:
73222 directives found:
19171 #define.
4345 #undef.
#include/#include_next/#import:
5233 source files entered.
27 max include stack depth
19210 #if/#ifndef/#ifdef.
2384 #else/#elif.
6891 #endif.
408 #pragma.
14466 #if/#ifndef#ifdef regions skipped
80023/451669/1270 obj/fn/builtin macros expanded, 85724 on the fast path.
127145 token paste (##) operations performed, 11008 on the fast path.

Preprocessor Memory: 5874615B total
BumpPtr: 4399104
Macro Expanded Tokens: 417768
Predefines Buffer: 8135
Macros: 1048576
#pragma push_macro Info: 0
Poison Reasons: 1024
Comment Handlers: 8

Stats with this patch:
...
Preprocessor Memory: 7541687B total
BumpPtr: 6066176
Macro Expanded Tokens: 417768
Predefines Buffer: 8135
Macros: 1048576
#pragma push_macro Info: 0
Poison Reasons: 1024
Comment Handlers: 8

In my test increase in memory usage is about 1.7Mb, which is ~28% of initial preprocessor's memory usage and about 0.8% of clang's total VMM allocation.

As for CPU overhead, it should only be noticeable when iterating over all macros, and should mostly consist of couple extra dereferences and one comparison per macro + skipping of #undef'd macros. It's less trivial to measure, though, as the preprocessor consumes a very small fraction of compilation time.


Reviewers: doug.gregor, klimek, rsmith, djasper

Reviewed By: doug.gregor

CC: cfe-commits, chandlerc

Differential Revision: http://llvm-reviews.chandlerc.com/D28

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162810 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
6c4590f3470df97deb6150652d40155b20466ef7 25-Aug-2012 Francois Pichet <pichet2000@gmail.com> _HAS_CHAR16_T_LANGUAGE_SUPPORT is not predefined MSVC macro.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162641 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
56d7f2348a182002563700db2158da0c6fc115a5 24-Aug-2012 Chad Rosier <mcrosier@apple.com> [ms-inline asm] Change the -fenable-experimental-ms-inline-asm option from a
CodeGen option to a LangOpt option. In turn, hoist the guard into the parser
so that we avoid the new (and fairly unstable) Sema/AST/CodeGen logic. This
should restore the behavior of clang to that prior to r158325.
<rdar://problem/12163681>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162602 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
80ea4bc944eb01c220eeaa004b21ad709ba928e1 24-Aug-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge_2

Conflicts:
lib/Sema/SemaDeclAttr.cpp

Change-Id: If47d0d39459760017258502b4d9e859ac36a273b
c568e2f801a62e442cbbd823b71f70175715661f 21-Aug-2012 Jordan Rose <jordan_rose@apple.com> [analyzer] Set the default IPA mode to 'basic-inlining', which excludes C++.

Under -analyzer-ipa=basic-inlining, only C functions, blocks, and C++ static
member functions are inlined -- essentially, the calls that behave like simple
C function calls. This is essentially the behavior in Xcode 4.4.

C++ support still has some rough edges, and we don't want users to be worried
about them if they download and run their own checker. (In particular, the
massive number of false positives for analyzing LLVM comes from inlining
defensively-written code in contexts where more aggressive assumptions are
implicitly made. This problem is not unique to C++, but it is exacerbated by
the higher proportion of code that lives in header files in C++.)

The eventual goal is to be comfortable enough with C++ support (and simple
Objective-C support) to advance to -analyzer-ipa=inlining as the default
behavior. See the IPA design notes for more details.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162318 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
a7afeb040416c0eaac19b92db914913a788044f5 21-Aug-2012 Chad Rosier <mcrosier@apple.com> [driver] Add support for the --param ssp-buffer-size= driver option.
PR9673


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162285 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
db309ae1bfa7c30ed3b2b9e59a316b8fef2e56b6 21-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Avoid binding a reference to a dereferenced pointer in diagnostic serialization
if a diagnostic is emitted outside of any source file. The fix mirrors the
corresponding code in TextDiagnosticPrinter. This required moving the
functional parts of SDiagRenderer into SDiagWriter so they can be reused in the
non-rendering codepath.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162253 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
0a7dd788dbef975f35f273c7ab913f480f7edd60 21-Aug-2012 John McCall <rjmccall@apple.com> Screw around with ObjCRuntime some more, changing the
diagnostics for bad deployment targets and adding a few
more predicates. Includes a patch by Jonathan Schleifer
to enable ARC for ObjFW.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162252 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
7eaaa186d1e9797f424136f565403f7a8b6672fa 18-Aug-2012 Jordan Rose <jordan_rose@apple.com> Allow -verify to be used with files that don't have an associated FileEntry.

In Debug builds, VerifyDiagnosticConsumer checks any files with diagnostics
to make sure we got the chance to parse them for directives (expected-warning
and friends). This check previously relied on every parsed file having a
FileEntry, which broke the cling interpreter's test suite.

This commit changes the extra debug checking to mark a file as unparsed
as soon as we see a diagnostic from that file. At the very end, any files
that are still marked as unparsed are checked for directives, and a fatal
error is emitted (as before) if we find out that there were directives we
missed. -verify directives should always live in actual parsed files, not
in PCH or AST files.

Patch by Andy Gibbs, with slight modifications by me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162171 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
a7612aec79bf7f7c7791941aa0a5c59b1dc82463 17-Aug-2012 Alexander Kornienko <alexfh@google.com> Fixed crash and added a test and a minor output problem

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162110 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
c141b51d78b40c7b0b04f27adfa70ec5bbddc49c 17-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Switch PTH format from a 7 byte magic number to an 8 byte one, to avoid
misaligned reads throughout the file. Bump PTH format version to 10.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162076 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
317d6ef9d55c3577606bc64eb1a89a51a325f66e 15-Aug-2012 Michael Han <Michael.Han@autodesk.com> Fix base type of ASTDeclNodeLister.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161963 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
026b3588b9916f3fcb20ad2f02ca5472cbbdc5d7 14-Aug-2012 Richard Smith <richard-llvm@metafoo.co.uk> Fix undefined behavior in code completion, caught by
-fcatch-undefined-behavior. Don't try to fit 34 different flags
into 32 bits. Also, don't use 32-bit signed left shifts for this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161830 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
6bd3291605a3034b858c8aeecc6990fa4f979f6c 10-Aug-2012 Dylan Noblesmith <nobled@dreamwidth.org> Frontend: define _LP64 in a target-independent way

Instead of adding it to each individual subclass in
Targets.cpp, simply check the appropriate target
values.

Where before it was only on x86_64 and ppc64, it's now
also defined on mips64 and nvptx64.

Also add a bunch of negative tests to ensure it is *not*
defined on any other architectures while we're here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161685 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
7094dee95f8c915d27097ac18b47d1ef31fd72ed 10-Aug-2012 Joerg Sonnenberger <joerg@bec.de> Add missing cctype includes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161660 91177308-0d34-0410-b5e6-96231b3b80d8
ayoutOverrideSource.cpp
rintPreprocessedOutput.cpp
extDiagnostic.cpp
erifyDiagnosticConsumer.cpp
7c304f56eecbd03db7d222a05dfcd593750d50d3 10-Aug-2012 Jordan Rose <jordan_rose@apple.com> Update VerifyDiagnosticConsumer to only get directives during parsing.

The old behavior was to re-scan any files (like modules) where we may have
directives but won't actually be parsing during the -verify invocation.
Now, we keep the old behavior in Debug builds as a sanity check (though
modules are a known entity), and expect all legitimate directives to come
from comments seen by the preprocessor.

This also affects the ARC migration tool, which captures diagnostics in
order to filter some out. This change adds an explicit cleanup to
CaptureDiagnosticsConsumer in order to let its sub-consumer handle the
real end of diagnostics.

This was originally split into four patches, but the tests do not run
cleanly without all four, so I've combined them into one commit.

Patches by Andy Gibbs, with slight modifications from me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161650 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
af6cf431ead1658e13338c6ac0e571755047f7c7 10-Aug-2012 Jordan Rose <jordan_rose@apple.com> Make sure to call EndSourceFile even if we can't continue compiling.

Patch by Andy Gibbs!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161649 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
42f74f21ece01dc8573d5377859d327fbb23b26c 09-Aug-2012 Eli Friedman <eli.friedman@gmail.com> clang support for Bitrig (an OpenBSD fork); patch by David Hill.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161546 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f23e8d2b928b0baa361dbf34df10862a5bcd01c4 08-Aug-2012 Dylan Noblesmith <nobled@dreamwidth.org> Preprocessor: fix __OPTIMIZE_SIZE__ and -Oz

Add some tests for __OPTIMIZE_SIZE__ and __NO_INLINE__,
removing the superfluous copies in the target-specific
tests, since it's target-independent.

This uncovered a bug in the handling of -Oz: it would
attempt to store the value 2 in the 1-bit bitfield OptimizeSize,
leaving a value of 0 and never defining __OPTIMIZE_SIZE__.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161495 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
5aeda88995fd98d55f3c565a108196e2b0df16ed 08-Aug-2012 Dylan Noblesmith <nobled@dreamwidth.org> Frontend: further document __BYTE_ORDER__

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161494 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
fbffb5f91e34c4c455cdeb9d4331b128f9511a48 08-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove unused variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161483 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
ee959355b93c0648fea88dc986d196e3705407dc 03-Aug-2012 Shih-wei Liao <sliao@google.com> Apply changes to migrate to CLANG-160673-20120724.

Change-Id: I00d23ac9b893c62dca281ec771eeb5f911854bae
ndroid.mk
08fc8eb5a1cc9c01af67e016ab21c9b905711eb1 03-Aug-2012 Shih-wei Liao <sliao@google.com> Merge with Clang upstream r160673 (Jul 24th 2012)

Conflicts:
lib/Sema/SemaDeclAttr.cpp

Change-Id: I37f02f20642a037b9da8d35fefa01986cd250b14
9d82a038f04945739c4960d9fe683d4ab66722eb 02-Aug-2012 Hans Wennborg <hans@hanshq.net> Correct AddDefaultCIncludePaths for OpenBSD to not include /usr/local/include
in the default search path. Compilers on *BSD OS's only include /usr/include by
default.

Contributed by Brad Smith <brad@comstyle.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161173 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
e1ce783708b65eaa832ffad03d239264046dd0eb 31-Jul-2012 Jordan Rose <jordan_rose@apple.com> [analyzer] Turn -cfg-add-initializers on by default, and remove the flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161060 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
171af64ef10ae816ed2a4f15f5d17aca1d71769f 31-Jul-2012 Alexander Kornienko <alexfh@google.com> Added -ast-list option to dump filterable AST decl node names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161040 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ompilerInvocation.cpp
rontendActions.cpp
3b198a97d2aceb1620483586c8c3cabf9e5e8078 27-Jul-2012 Dylan Noblesmith <nobled@dreamwidth.org> Preprocessor: add __BYTE_ORDER__ predefined macro

The __BYTE_ORDER__ predefined macro was added in GCC 4.6:
http://gcc.gnu.org/onlinedocs/gcc-4.6.0/cpp/Common-Predefined-Macros.html

It's used like the following:

#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
...
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
...
#else
#error insane architecture like the pdp-11
#endif

There's a similar macro, __FLOAT_WORD_ORDER__, but it looks like it
mainly exist to accommodate fairly obscure architectures and ARM's
old FPA instructions, so it doesn't seem nearly as useful.

The tests are updated to check for the correct(at least, based on
clang's current output) value of the macro on each target. So now the
suite will catch bugs like the one fixed in r157626.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160879 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
11abf2ad01f64ede7c0555167f41a1c5852f80c6 27-Jul-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/lib: [CMake] Update tblgen'd dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160851 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
866abce3b93ab01bac00e0383a753819893b868a 27-Jul-2012 NAKAMURA Takumi <geek4civic@gmail.com> clang/lib: [CMake] Reformat, alphabetize lists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160850 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
e34a052d642ba7830174b1a51787251d7f704f80 26-Jul-2012 Alexander Kornienko <alexfh@google.com> Added -ast-dump-filter option to clang -cc1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160784 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ompilerInvocation.cpp
rontendActions.cpp
bed28ac1d1463adca3ecf24fca5c30646fa9dbb2 23-Jul-2012 Sylvestre Ledru <sylvestre@debian.org> Fix a typo (the the => the)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160622 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
extDiagnosticPrinter.cpp
d256f8673bf2499f57e0f40aab30ff243d576c17 21-Jul-2012 Chad Rosier <mcrosier@apple.com> Rename -fms-inline-asm to -fenable-experimental-ms-inline-asm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160590 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
89770e5640dd5039569ecdc64c61acd9aa22cff9 20-Jul-2012 Chad Rosier <mcrosier@apple.com> Add the mechanics for -fms-inline-asm. No easy way to test at this time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160580 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
bbe0175255d4da42cd99d93ca1e60c8eabcb4b9a 20-Jul-2012 Jordan Rose <jordan_rose@apple.com> Re-apply r160319 "Don't crash when emitting fixits following Unicode chars"

This time, make sure we don't try to print fixits with newline characters,
since they don't have a valid column width, and they don't look good anyway.

PR13417 (and originally <rdar://problem/11877454>)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160561 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
43972898614d91c00982f10cdf7f2bfb4a9f6275 20-Jul-2012 Nico Weber <nicolasweber@gmx.de> Revert r160319, it caused PR13417. Add a test for PR13417.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160542 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
455e72e7625a8f87c2c302d8d82baee5c111e094 19-Jul-2012 Bob Wilson <bob.wilson@apple.com> Define __FINITE_MATH_ONLY__ based on -ffast-math and -ffinite-math-only.

This macro was being unconditionally set to zero, preceded by a FIXME comment.
This fixes <rdar://problem/11845441>. Patch by Michael Gottesman!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160491 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
6f977c3e7918f9a668164f3ce27f1baa9557eb82 16-Jul-2012 Jordan Rose <jordan_rose@apple.com> Don't crash when emitting fixits following Unicode characters.

This code is very sensitive to the difference between "columns" as printed
and "bytes" (SourceManager columns). All variables are now named explicitly
and our assumptions are (hopefully) documented as both comment and assertion.

Whether parseable fixits should use byte offsets or Unicode character counts
is pending discussion on the mailing list; currently the implementation uses
bytes (and has no problems on lines containing multibyte characters).
This has been added to the user manual.

<rdar://problem/11877454>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160319 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
af082c3b163397c040c3a98c7a5f09ee2a0badef 12-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> PR13312: Don't crash when printing a fixit that ends in a unicode character.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160112 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
198871cc90375246d8692680467ff6e810edac36 12-Jul-2012 Tanya Lattner <tonic@nondot.org> Add OpenCL metadata for kernel arg names. This output is controlled via a flag as noted in the OpenCL Spec.
Includes a test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160092 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ff398965a5abfaf5bc47bc022876f56a28e5b9a7 11-Jul-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce a flag in SourceManager to treat non-system source files
as "volatile", meaning there's a high enough chance that they may
change while we are trying to use them.

This flag is only enabled by libclang.
Currently "volatile" source files will be stat'ed immediately
before opening them, because the file size stat info
may not be accurate since when we got it (e.g. from the PCH).
This avoids crashes when trying to reference mmap'ed memory
from a file whose size is not what we expect.

Note that there's still a window for a racing issue to occur
but the window for it should be way smaller than before.
We can consider later on to avoid mmap completely on such files.

rdar://11612916

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160074 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
78541c433049322b27b4f437973076ba29cff709 11-Jul-2012 Jordan Rose <jordan_rose@apple.com> Allow -verify directives to be filtered by preprocessing.

This is accomplished by making VerifyDiagnosticsConsumer a CommentHandler,
which then only reads the -verify directives that are actually in live
blocks of code. It also makes it simpler to handle -verify directives that
appear in header files, though we still have to manually reparse some files
depending on how they are generated.

This requires some test changes. In particular, all PCH tests now have their
-verify directives outside the "header" portion of the file, using the @line
syntax added in r159978. Other tests have been modified mostly to make it
clear what is being tested, and to prevent polluting the expected output with
the directives themselves.

Patch by Andy Gibbs! (with slight modifications)

The new Frontend/verify-* tests exercise the functionality of this commit,
as well as r159978, r159979, and r160053 (Andy's other -verify enhancements).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160068 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
c6d64a26c28bbeee50e06c94c4f4c08e610327b7 11-Jul-2012 Jordan Rose <jordan_rose@apple.com> Emit -verify diagnostics even when we have a fatal error.

Previously we'd halt at the fatal error as expected, but not actually emit
any -verify-related diagnostics. This lets us catch cases that emit a
/different/ fatal error from the one we expected.

This is implemented by adding a "force emit" mode to DiagnosticBuilder, which
will cause diagnostics to immediately be emitted regardless of current
suppression. Needless to say this should probably be used /very/ sparingly.

Patch by Andy Gibbs! Tests for all of Andy's -verify patches coming soon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160053 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
e445e5d6377827f222f0d15e18fbd1f86114d2cc 10-Jul-2012 Axel Naumann <Axel.Naumann@cern.ch> Clear diagnostic counts after processing the diagnostics.
The consumer might see multiple input files (e.g. for cling) and since r159977 the count is maintained across input files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159995 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
3b81b7d604e851498243ee732dee3babc1cf20d4 10-Jul-2012 Jordan Rose <jordan_rose@apple.com> Allow -verify directives to specify a min and max count, not just "+".

void f(); // expected-note 0+ {{previous declaration is here}}
void g(); // expected-note 0-1 {{previous declaration is here}}

The old "+" syntax is still an alias for "1+", and single numbers still work.

Patch by Andy Gibbs!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159979 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
aa48fe80a1b2000809900a437f0819d929793002 10-Jul-2012 Jordan Rose <jordan_rose@apple.com> Allow line numbers on -verify directives.

// expected-warning@10 {{some text}}

The line number may be absolute (as above), or relative to the current
line by prefixing the number with either '+' or '-'.

Patch by Andy Gibbs!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159978 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
4313c013c658f6c97e6460e7780c26faa6b78d9a 10-Jul-2012 Jordan Rose <jordan_rose@apple.com> Clean up VerifyDiagnosticsConsumer in preparation for upcoming enhancements.

Patch by Andy Gibbs!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159977 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
e8cf7d143446c45568bb7c9a6fbd8f32ca6ae93e 07-Jul-2012 Ted Kremenek <kremenek@apple.com> Re-apply r159875 with fixes.

- Split pedantic driver flag test into separate test file, and XFAIL on cygwin,mingw32
- Fix bug in tablegen logic where a missing '{' caused errors to be included in -Wpedantic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159892 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
3b4c53259603ba389373362f476648b2b1ab9eca 07-Jul-2012 NAKAMURA Takumi <geek4civic@gmail.com> Revert rr159875, "Implement -Wpedantic and --no-pedantic to complement -Weverything." It broke several builds.

I suspect FileCheck might match assertion failure, even if clang/test/Misc/warning-flags.c passed the test.

> 0. Program arguments: bin/./clang -### -pedantic -Wpedantic clang/test/Driver/warning-options.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159886 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
25570a94ca6b706d19812b0f8df25a63ec3445c8 07-Jul-2012 Ted Kremenek <kremenek@apple.com> Implement -Wpedantic and --no-pedantic to complement -Weverything.

This patch introduces some magic in tablegen to create a "Pedantic" diagnostic
group which automagically includes all warnings that are extensions. This
allows a user to suppress specific warnings traditionally under -pedantic used
an ordinary warning flag. This also allows users to use #pragma to silence
specific -pedantic warnings, or promote them to errors, within blocks of text
(just like any other warning).

-Wpedantic is NOT an alias for -pedantic. Instead, it provides another way
to (a) activate -pedantic warnings and (b) disable them. Where they differ
is that -pedantic changes the behavior of the preprocessor slightly, whereas
-Wpedantic does not (it just turns on the warnings).

The magic in the tablegen diagnostic emitter has to do with computing the minimal
set of diagnostic groups and diagnostics that should go into -Wpedantic, as those
diagnostics that already members of groups that themselves are (transitively) members
of -Wpedantic do not need to be included in the Pedantic group directly. I went
back and forth on whether or not to magically generate this group, and the invariant
was that we always wanted extension warnings to be included in -Wpedantic "some how",
but the bookkeeping would be very onerous to manage by hand.

-no-pedantic (and --no-pedantic) is included for completeness, and matches many of the
same kind of flags the compiler already supports. It does what it says: cancels out
-pedantic. One discrepancy is that if one specifies --no-pedantic and -Weverything or
-Wpedantic the pedantic warnings are still enabled (essentially the -W flags win). We
can debate the correct behavior here.

Along the way, this patch nukes some code in TextDiagnosticPrinter.cpp and CXStoredDiagnostic.cpp
that determine whether to include the "-pedantic" flag in the warning output. This is
no longer needed, as all extensions now have a -W flag.

This patch also significantly reduces the number of warnings not under flags from 229
to 158 (all extension warnings). That's a 31% reduction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159875 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
c9686716d2ceb5518178dca98670ec34c472a1be 06-Jul-2012 Lang Hames <lhames@gmail.com> Add -ffp-contract = { fast | on | off } command line option support.

This flag sets the 'fp-contract' mode, which controls the formation of fused
floating point operations. Available modes are:

- Fast: Form fused operations anywhere.
- On: Form fused operations where allowed by FP_CONTRACT. This is the default
mode.
- Off: Don't form fused operations (in future this may be relaxed to forming
fused operations where it can be proved that the result won't be
affected).

Currently clang doesn't support the FP_CONTRACT pragma, so the 'On' and 'Off'
modes are equivalent.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159794 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8d3ba23f2d9e6c87794d059412a0808c9cbacb25 06-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Implement AST classes for comments, a real parser for Doxygen comments and a
very simple semantic analysis that just builds the AST; minor changes for lexer
to pick up source locations I didn't think about before.

Comments AST is modelled along the ideas of HTML AST: block and inline content.

* Block content is a paragraph or a command that has a paragraph as an argument
or verbatim command.
* Inline content is placed within some block. Inline content includes plain
text, inline commands and HTML as tag soup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159790 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
817881376e3a40ca54376547dd1cb9ca5def7190 03-Jul-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Protect against a race condition where a thread
may be destroying an ASTUnit while cleanupOnDiskMapAtExit is
getting called.

rdar://11781241

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159664 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
8f4783c6a5ae1e95aeb58b41da9707310e60ab5b 02-Jul-2012 Douglas Gregor <dgregor@apple.com> Reduce default template instantiation depth to 512; we're blowing out
the stack too often with 1024. Fixes <rdar://problem/11678534>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159573 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d99ef536b241071b6f4c01db6525dc03242ac30b 02-Jul-2012 Dmitri Gribenko <gribozavr@gmail.com> Add a new libclang completion API to get brief documentation comment that is
attached to a declaration in the completion string.

Since extracting comments isn't free, a new code completion option is
introduced.

A new code completion option that enables including brief comments
into CodeCompletionString should be a, err, code completion option.
But because ASTUnit caches global declarations during parsing before
even completion consumer is created, the option is duplicated as a
translation unit option (in both libclang and ASTUnit, like the option
to cache code completion results).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159539 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
b956e5a2439bce94ba2e1da264471859632eb11f 29-Jun-2012 Richard Trieu <rtrieu@google.com> When applying a template diff highlighting to a diagnostic message, remember
to reapply the bold formatting when needed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159386 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
50badd523b9b90c0731423d002b13a00bf754036 28-Jun-2012 David Blaikie <dblaikie@gmail.com> Fix template type diffing coloring (r159216) when forcing color output to a file (not a terminal)

Reviewed (over the shoulder) by Richard Trieu.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159381 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
de981f3ff163bc9ec69e4c5e7316e94276412993 28-Jun-2012 Hans Wennborg <hans@hanshq.net> Add -ftls-model command-line flag.

This allows for setting the default TLS model. (PR9788)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159336 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
246b6aa6763de8c617d564ef33123a8f3293a80e 26-Jun-2012 Richard Trieu <rtrieu@google.com> Add template type diffing to Clang. This feature will provide a better
comparison between two templated types when they both appear in a diagnostic.
Type elision will remove indentical template arguments, which can be disabled
with -fno-elide-type. Cyan highlighting is applied to the differing types.

For more formatting, -fdiagnostic-show-template-tree will output the template
type as an indented text tree, with differences appearing inline. Template
tree works with or without type elision.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159216 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnostic.cpp
arnings.cpp
6b4f50662a1857d5203254fb2c52975e6f30fc90 22-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup: escape \ characters in Doxygen comments as needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158968 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
b0d8671f95fe08a220118bca29063ba4d11a9dac 21-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Remove a goofy CMake hack and use the standard CMake facilities to
express library-level dependencies within Clang.

This is no more verbose really, and plays nicer with the rest of the
CMake facilities. It should also have no change in functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158888 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
260611a32535c851237926bfcf78869b13c07d5b 20-Jun-2012 John McCall <rjmccall@apple.com> Restructure how the driver communicates information about the
target Objective-C runtime down to the frontend: break this
down into a single target runtime kind and version, and compute
all the relevant information from that. This makes it
relatively painless to add support for new runtimes to the
compiler. Make the new -cc1 flag, -fobjc-runtime=blah-x.y.z,
available at the driver level as a better and more general
alternative to -fgnu-runtime and -fnext-runtime. This new
concept of an Objective-C runtime also encompasses what we
were previously separating out as the "Objective-C ABI", so
fragile vs. non-fragile runtimes are now really modelled as
different kinds of runtime, paving the way for better overall
differentiation.

As a sort of special case, continue to accept the -cc1 flag
-fobjc-runtime-has-weak, as a sop to PLCompatibilityWeak.

I won't go so far as to say "no functionality change", even
ignoring the new driver flag, but subtle changes in driver
semantics are almost certainly not intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158793 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
5e94d6fa2e1d5ca606e060406adee13b96849f2a 20-Jun-2012 Tanya Lattner <tonic@nondot.org> Extend the support for cl-std to include 1.2.
Add error checking for the static qualifier which is now allowed in certain situations for OpenCL 1.2. Use the CL version to turn on this feature.
Added test case for 1.2 static storage class feature.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158759 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8af669f2f1d92436fe6dc43144bb084a620e7516 19-Jun-2012 Rafael Espindola <rafael.espindola@gmail.com> Add a -fuse-init-array option to cc1 and map to the UseInitArray target
option. On the driver, check if we are using libraries from gcc 4.7 or newer
and if so pass -fuse-init-array to the frontend.
The crtbegin*.o files in gcc 4.7 no longer call the constructors listed in
.ctors, so we have to use .init_array.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158694 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
3065cf9ecc883715edbd3bf875acb2cab531138e 19-Jun-2012 Ted Kremenek <kremenek@apple.com> Sink definition of IBOutlet, IBOutletCollection, and IBAction into
the compiler predefines buffer. These are essentially part of
the Objective-C language.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158690 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
f4205e12cede5db17f47b31471852bb4a1f27533 19-Jun-2012 Tanya Lattner <tonic@nondot.org> Add language std for OpenCL 1.1 and 1.2.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158686 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
29271fbcef645117df05d5b60e593acb6562422c 18-Jun-2012 Matt Beaumont-Gay <matthewbg@google.com> Move a few static functions from DiagnosticRenderer.cpp into SourceManager.

This simplifies the code a little bit, since these functions all took a
SourceManager parameter and called a bunch of methods on it, and makes
the functions available to other users.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158676 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
c5613b26a24a33d7450e3d0bf315c6ccc920ce7b 16-Jun-2012 Meador Inge <meadori@codesourcery.com> Explicitly build __builtin_va_list.

The target specific __builtin_va_list types are now explicitly built instead
of injecting strings into the preprocessor input.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158592 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
0cdd1fe3ec29b5cbff9a728966ace5c5b5d614f7 16-Jun-2012 Jordan Rose <jordan_rose@apple.com> [-E] Emit a rewritten _Pragma on its own line.

1. Teach Lexer that pragma lexers are like macro expansions at EOF.
2. Treat pragmas like #define/#undef when printing.
3. If we just printed a directive, add a newline before any more tokens.
(4. Miscellaneous cleanup in PrintPreprocessedOutput.cpp)

PR10594 and <rdar://problem/11562490> (two separate related problems)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158571 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
5e9dda6f9b3f98e31ef94e84c019fb2d1e54c092 15-Jun-2012 James Dennett <jdennett@google.com> Documentation cleanup: escape # in a Doxygen comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158554 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
f1492f970c7c6eb85dc18f13fb864b185bed1d23 14-Jun-2012 David Blaikie <dblaikie@gmail.com> Support -frewrite-includes as an option while preprocessing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158460 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
60ad16b7e24cdb88c577c107b69da85458000858 14-Jun-2012 David Blaikie <dblaikie@gmail.com> Rename -rewrite-includes to -frewrite-includes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158458 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
809d1be9820039b4cf6efa48246a0d70ffa13394 14-Jun-2012 James Dennett <jdennett@google.com> More doxygen/documentation cleanups.

This reduces the number of warnings generated by Doxygen by about 100
(roughly 10%). Issues addressed:
(1) Primarily, backslash-escaped "@foo" and "#bah" in Doxygen comments
when they're not supposed to be Doxygen commands or links, and
similarly for "<baz>" when it's not intended as as HTML tag;
(2) Changed some \t commands (which don't exist) to \c ("to refer to a
word of code", as the Doxygen manual says);
(3) \precondition becomes \pre;
(4) When touching comments, deleted a couple of spurious spaces in them;
(5) Changed some \n and \r to \\n and \\r;
(6) Fixed one tiny typo: #pragms -> #pragma.

This patch touches documentation/comments only.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158422 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
f122a138e39dbb29162abfa9a3d44091d8efa7af 13-Jun-2012 Richard Smith <richard-llvm@metafoo.co.uk> Add -isystem-prefix and -ino-system-prefix arguments, which can be used to
override whether headers are system headers by checking for prefixes of the
header name specified in the #include directive.

This allows warnings to be disabled for third-party code which is found in
specific subdirectories of include paths.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158418 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
7ed25df166c68a3d67f0f05b0b7dd802c57adfb8 11-Jun-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Const'ify CompilerInvocation::toArgs().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158298 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
3772c9abf9651da1f77c83ec937c96e10a353c6a 08-Jun-2012 Jordan Rose <jordan_rose@apple.com> If fixits appear to overlap, move the second one over in the output.

This occurs when you have two insertions and the first one is so long that the
second fixit's column is before the first fixit ends. The edits themselves
don't actually overlap, but our command-line preview does.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158229 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
374a00bcc6e26b4fc3cd1d378a5d056c4c7d618e 08-Jun-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Don't crash when saving a PCH from a prefix header
that does not exist.

rdar://11607033

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158193 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
rontendAction.cpp
581deb3da481053c4993c7600f97acf7768caac5 06-Jun-2012 David Blaikie <dblaikie@gmail.com> Revert Decl's iterators back to pointer value_type rather than reference value_type

In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.

This rolls back r155808 and r155869.

Review by Doug Gregor incorporating feedback from Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158104 91177308-0d34-0410-b5e6-96231b3b80d8
ayoutOverrideSource.cpp
8c0b3787e7ccc7978b42dfbb84da2b802c743a5d 06-Jun-2012 David Blaikie <dblaikie@gmail.com> Add a -rewrite-includes option, which is similar to -rewrite-macros, but only expands #include directives.

Patch contributed by Lubos Lunak (l.lunax@suse.cz).
Review by Matt Beaumont-Gay (matthewbg@google.com).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158093 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
a08e7bc74b5635995fc50009f240dd3feb1999e2 06-Jun-2012 Francois Pichet <pichet2000@gmail.com> Zap the /Za compiler switch from MSVC projects, the option is considered harmful even by Microsoft people and clang won't build using the MSVC 2012 RC if not removed.

Only 1 minor code change was necessary: can't use cdecl as variable name anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158063 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
e3f341152af5589f2586b6b5cfbad284afa731f2 29-May-2012 David Blaikie <dblaikie@gmail.com> Fix indenting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157628 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
4031a376275ccf9f76eae2efeb26ee64c4c5780a 25-May-2012 Seth Cantrell <seth.cantrell@gmail.com> ensure value passed to is space is representable as unsigned char

if the value isn't an unsigned char or EOF behavior is undefined
(and on Windows there's an assertion)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157445 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
c5493d7d60005fc8aa9b0e06d326026a9f9a688d 24-May-2012 Seth Cantrell <seth.cantrell@gmail.com> fix Bug 12924

http://llvm.org/bugs/show_bug.cgi?id=12924

This issue was that the source location was pointing to a
non-printable character and so CaretEnd was pointing one
_column_ past the caret but not one _character_ past the
caret. So the conversion between column and byte locations
wasn't working (because the conversion is only valid from
the first column or byte of a character).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157372 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
def18494b97f554ea0d95db75627c3e77b74307f 22-May-2012 Nuno Lopes <nunoplopes@sapo.pt> wire -fbounds-checking to the new LLVM bounds checking pass

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157262 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d6277fb9e0353edffc0d6c8655a65542c08cf6f1 21-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [driver] When creating the compiler invocation out of command-line
arguments, force use of clang frontend for the driver.

Fixes rdar://11356765.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157205 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
reateInvocationFromCommandLine.cpp
832a2aac5766dd78f113e0f03a0c62fd0eacbc97 16-May-2012 Manuel Klimek <klimek@google.com> Pulls diagnostics for temp file handling into the common diagnostic kinds.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156947 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
6a1fd4a078c96fef37609208661d6cd9309365c4 16-May-2012 Chad Rosier <mcrosier@apple.com> Tweek r156937 a bit so that the suggestions are correct.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156938 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
ff1affef282d7146e14c8aa894eb5466a659398c 16-May-2012 Chad Rosier <mcrosier@apple.com> Warn about -Wno-foo where foo is an unknown warning option. This is helpful
for subtle misspellings such as -Wno-unused-command-line-arguments instead of
-Wno-unused-command-line-argument.

Also fix the diagnostic messages to properly handle -Wno- options. Previously,
the positive version was always emitted (i.e., -Wfoo was emitted for -Wno-foo).
rdar://11461500

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156937 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
7d9ae25d93554bdb238da83f9bb3e0b05475c16c 11-May-2012 Eric Christopher <echristo@apple.com> For final output files create them with mode 0664 to match other
compilers and expected defaults.

Part of rdar://11325849

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156592 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
16afdf76b6f12e41ff6f6e6828bfb1d4732523ba 10-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix an assertion hit when the serialized diagnostics writer receive a diagnostic
from the frontend when the location is invalid and the SourceManager null.

Instead of keeping the SourceManager object in DiagnosticRenderer, propagate it
to the calls accordingly (as reference when it is expected to not be null, or pointer
when it may be null).
This effectively makes DiagnosticRenderer not tied to a specific SourceManager,
removing a hack from TextDiagnosticPrinter.

rdar://11386874

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156536 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
erializedDiagnosticPrinter.cpp
extDiagnostic.cpp
extDiagnosticPrinter.cpp
b3198a841e7f356f171f1e11faff014b2deb1eb8 09-May-2012 Nuno Lopes <nunoplopes@sapo.pt> add -fbounds-checking option.
When enabled, clang generates bounds checks for array and pointers dereferences. Work to follow in LLVM's backend.

OK'ed by Chad; thanks for the review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156431 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
a30d8600b9b52922a92a90b30993564ba257537a 04-May-2012 James Molloy <james.molloy@arm.com> Add a predefine __WINT_UNSIGNED__, similar to __WCHAR_UNSIGNED__, and test them both for ARM and X86.

Use this to fully fix Sema/format-strings.c for non-x86 platforms.

Reviewed by Chandler on IRC.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156169 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
fd00eecad6fa5400cf37269d84361a0551d0e6d3 04-May-2012 Alexey Samsonov <samsonov@google.com> This patch adds a new Clang compiler flag "-gline-tables-only".
It reduces the amount of emitted debug information:
1) DIEs in .debug_info have types DW_TAG_compile_unit, DW_TAG_subprogram,
DW_TAG_inlined_subroutine (for opt builds) and DW_TAG_lexical_block only.
2) .debug_str contains only function names.
3) No debug data for types/namespaces/variables is emitted.
4) The data in .debug_line is enough to produce valid stack traces with
function names and line numbers.

Reviewed by Eric Christopher.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156160 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
0513448ae71478fd08d7e925bab46db1ddac3dfa 04-May-2012 Richard Smith <richard-llvm@metafoo.co.uk> Use the standard values for the __cplusplus macro, even when in GNU mode. GCC
dropped its prior behavior of always defining __cplusplus to 1 in GNU mode in
version 4.7.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156113 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
6d89b4bcb2c0c4c67931f138ed04f47111e418f7 02-May-2012 Andrew Trick <atrick@apple.com> Fix cmake. Remaining two ClangCC1Options deps.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155977 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
f720a2bd5ac2130852a67b4ec1d79ed8f4d7f43e 01-May-2012 David Blaikie <dblaikie@gmail.com> Remove variables made dead by r155923

This makes Clang's build warning free again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155928 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
1b9a688fbaae610398676186dcd1f3a596a46571 01-May-2012 Ted Kremenek <kremenek@apple.com> Remove dead code found by static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155923 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
bfd7a525bcf372004787cb641b8c1566b9e8aba5 01-May-2012 James Molloy <james.molloy@arm.com> Unify Options.td and CC1Options.td, in a first step towards unifying the serialization logic in Frontend and Driver.

Reviewed by Eric, Doug and Chandler, and here: http://llvm.org/reviews/r/7/



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155916 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d1fda0393b50c9c1ea25925725916da3ce13c1e2 01-May-2012 Benjamin Kramer <benny.kra@googlemail.com> Make some helper functions static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155914 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
262bc18e32500558af7cb0afa205b34bd37bafed 30-Apr-2012 David Blaikie <dblaikie@gmail.com> Remove the ref/value inconsistency in filter_decl_iterator.

filter_decl_iterator had a weird mismatch where both op* and op-> returned T*
making it difficult to generalize this filtering behavior into a reusable
library of any kind.

This change errs on the side of value, making op-> return T* and op* return
T&.

(reviewed by Richard Smith)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155808 91177308-0d34-0410-b5e6-96231b3b80d8
ayoutOverrideSource.cpp
3a70cd6e1cc414856e41ce5509aa61c89bf472dc 27-Apr-2012 Alexey Samsonov <samsonov@google.com> Use enum to set debug info size generated by Clang

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155697 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
40d8e971a32a23856ce1ab0106ae75cf4b92ca9d 26-Apr-2012 Nico Weber <nicolasweber@gmx.de> Revert r154981, because it caused PR12674.

Add a test for PR12674.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155666 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
fa784da5b9039ead42323bfe9ae6d33ab3c5c6b3 24-Apr-2012 Shih-wei Liao <sliao@google.com> Merge with CLANG upstream r155088.

Conflicts:
lib/Basic/Targets.cpp

Change-Id: Id80f069ae25e623967b705e9fa11cfd94dd2461c
0ddb097bb02ddee8f1924ee4fcca384cb18ad8c5 18-Apr-2012 Matt Beaumont-Gay <matthewbg@google.com> Suppress -Wunused-variable warning in -Asserts build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155011 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
3acf764931e0f3e3ce75db0f4c4d400ee588d6b0 18-Apr-2012 Seth Cantrell <seth.cantrell@gmail.com> fix display of source lines with null characters

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154981 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
6749dd50869281f9b49ad5960e25288c15a71cac 18-Apr-2012 Seth Cantrell <seth.cantrell@gmail.com> Nicer display of unprintable source, and fix caret display for non-ascii text

Unprintable source in diagnostics is transformed to a printable form and then
displayed with reversed colors if possible. Unprintable characters are
displayed as <U+NNNN> while bytes that do not represent valid characters are
shown as <XX>.

Column adjustments to diagnostic carets, highlighted ranges, and fixups are
made both for characters escaped as above and for characters which are
printable but take up more than a single column.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154980 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
9591697707c69af99bb196d70895f4e7e28be333 17-Apr-2012 Seth Cantrell <seth.cantrell@gmail.com> Revert "Nicer display of unprintable source, and fix caret display for non-ascii text"

This reverts commit e9a3b76ba589a8a884e978273beaed0d97cf9861.

Revert "fix display of source lines with null characters"

This reverts commit 70712b276e40bbe11e5063dfc7e82ce3209929cd.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154950 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
70712b276e40bbe11e5063dfc7e82ce3209929cd 17-Apr-2012 Seth Cantrell <seth.cantrell@gmail.com> fix display of source lines with null characters

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154947 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
e9a3b76ba589a8a884e978273beaed0d97cf9861 17-Apr-2012 Seth Cantrell <seth.cantrell@gmail.com> Nicer display of unprintable source, and fix caret display for non-ascii text

Unprintable source in diagnostics is transformed to a printable form and then
displayed with reversed colors if possible. Unprintable characters are
displayed as <U+NNNN> while bytes that do not represent valid characters are
shown as <XX>.

Column adjustments to diagnostic carets, highlighted ranges, and fixups are
made both for characters escaped as above and for characters which are
printable but take up more than a single column.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154946 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
93a49944e0e68e32bc22d45d44ee136b34beffb3 16-Apr-2012 Fariborz Jahanian <fjahanian@apple.com> objective-c modern translator: buildit objc bool
type for rewriter project will be BoolTy.
// rdar://11231426.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154861 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
bcadf96a75942f528fc0683d953d66589d341909 14-Apr-2012 Benjamin Kramer <benny.kra@googlemail.com> ASTUnit: Don't clone the new DiagnosticConsumer, causing it to get leaked.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154739 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
105047124ca8ccc27e4fa48ae8af8bb472c57648 13-Apr-2012 Douglas Gregor <dgregor@apple.com> Remove the -cc1-level option "-pubnames-dump". Such things should stay
out of the tree and use the tooling infrastructure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154668 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendActions.cpp
2c39d71bb7cefdfe6116fa52454f3b3dc5abd517 13-Apr-2012 Richard Smith <richard-llvm@metafoo.co.uk> Implement the missing pieces needed to support libstdc++4.7's <atomic>:
__atomic_test_and_set, __atomic_clear, plus a pile of undocumented __GCC_*
predefined macros.

Implement library fallback for __atomic_is_lock_free and
__c11_atomic_is_lock_free, and implement __atomic_always_lock_free.

Contrary to their documentation, GCC's __atomic_fetch_add family don't
multiply the operand by sizeof(T) when operating on a pointer type.
libstdc++ relies on this quirk. Remove this handling for all but the
__c11_atomic_fetch_add and __c11_atomic_fetch_sub builtins.

Contrary to their documentation, __atomic_test_and_set and __atomic_clear
take a first argument of type 'volatile void *', not 'void *' or 'bool *',
and __atomic_is_lock_free and __atomic_always_lock_free have an argument
of type 'const volatile void *', not 'void *'.

With this change, libstdc++4.7's <atomic> passes libc++'s atomic test suite,
except for a couple of libstdc++ bugs and some cases where libc++'s test
suite tests for properties which implementations have latitude to vary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154640 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
9bc0c290a79a6aca46367626e3463077147e7e76 12-Apr-2012 Erik Verbruggen <erikjv@me.com> Changed all direct calls to CompletionConsumer.reset(..) to go call
CompilerInstance::setCodeCompletionConsumer instead, in order to change
the SkipFunctionBodies flag accordingly. Also fixed
setCodeCompletionConsumer to take a reset() to null into account.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154585 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
6a91d385618ea4d28236c496f540a26877c95525 12-Apr-2012 Erik Verbruggen <erikjv@me.com> Added a flag to the parser to skip method bodies.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154584 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendAction.cpp
e722ed6f5464232e23be52f4976312ef526fae99 11-Apr-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] If displayDiagnostics is set (when calling clang_createIndex), make sure to
output the errors that occurred even if we did not get an AST (e.g. because the
PCH failed to load).

Also honor displayDiagnostics in clang_indexSourceFile().

rdar://11203489

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154472 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
28a83f57003469fb615ad27dd34bcf5b0a10da8c 10-Apr-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [code-complete] Introduce CodeCompletionTUInfo which will be used for caching
code-completion related strings specific to a translation unit (ASTContext and related data)

CodeCompletionAllocator does such limited caching, by caching the name assigned
to a DeclContext*, but that is not the appropriate place since that object has
a lifetime that can extend beyond that of an ASTContext.

Introduce CodeCompletionTUInfo which will be always tied to a translation unit
to do this kind of caching and move the caching of CodeCompletionAllocator into this
object, and propagate it to all the places where it will be needed.

The plan is to extend the caching where appropriate, using CodeCompletionTUInfo,
to avoid re-calculating code-completion strings.

Part of rdar://10796159.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154408 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
561d62280aecff3168097086425a7da0442d0de4 09-Apr-2012 David Chisnall <csdavec@swan.ac.uk> Revert r154321, pending more discussion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154327 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
649ee3fec12dcf7167630ff88087ad116e9eefa6 09-Apr-2012 David Chisnall <csdavec@swan.ac.uk> Add -fobjc-trace to emit a call before and after each Objective-C message send
for hooking in code flow visualisation applications.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154321 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
5e219cf7f896873c1c1e64b9e87a7dade99debba 08-Apr-2012 Chandler Carruth <chandlerc@gmail.com> Teach Clang about PIE compilations. This is the first step of PR12380.

First, this patch cleans up the parsing of the PIC and PIE family of
options in the driver. The existing logic failed to claim arguments all
over the place resulting in kludges that marked the options as unused.
Instead actually walk all of the arguments and claim them properly.

We now treat -f{,no-}{pic,PIC,pie,PIE} as a single set, accepting the
last one on the commandline. Previously there were lots of ordering bugs
that could creep in due to the nature of the parsing. Let me know if
folks would like weird things such as "-fPIE -fno-pic" to turn on PIE,
but disable full PIC. This doesn't make any sense to me, but we could in
theory support it.

Options that seem to have intentional "trump" status (-static, -mkernel,
etc) continue to do so and are commented as such.

Next, a -pie-level flag is threaded into the frontend, rigged to
a language option, and handled preprocessor, setting up the appropriate
defines. We'll now have the correct defines when compiling with -fpie.

The one place outside of the preprocessor that was inspecting the PIC
level (as opposed to the relocation model, which is set and handled
separately, yay!) is in the GNU ObjC runtime. I changed it to exactly
preserve existing behavior. If folks want to change its behavior in the
face of PIE, they can do that in a separate patch.

Essentially the only functionality changed here is the preprocessor
defines and bug-fixes to the argument management.

Tests have been updated and extended to test all of this a bit more
thoroughly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154291 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
b47dbcbc12430fdf3e5a5b9f59cdec5480e89e75 28-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Enable retry exhausted without inlining by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153591 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
82fe6aea407a5a09a6131452ce622087ba83880d 28-Mar-2012 Chandler Carruth <chandlerc@gmail.com> Move the emission of strict enum range metadata behind a flag (the same
flag as GCC uses: -fstrict-enums). There is a *lot* of code making
unwarranted assumptions about the underlying type of enums, and it
doesn't seem entirely reasonable to eagerly break all of it.

Much more importantly, the current state of affairs is *very* good at
optimizing based upon this information, which causes failures that are
very distant from the actual enum. Before we push for enabling this by
default, I think we need to implement -fcatch-undefined-behavior support
for instrumenting and trapping whenever we store or load a value outside
of the range. That way we can track down the misbehaving code very
quickly.

I discussed this with Rafael, and currently the only important cases he
is aware of are the bool range-based optimizations which are staying
hard enabled. We've not seen any issue with those either, and they are
much more important for performance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153550 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
5903a373db3d27794c90b25687e0dd6adb0e497d 27-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Add an option to re-analyze a dead-end path without inlining.

The analyzer gives up path exploration under certain conditions. For
example, when the same basic block has been visited more than 4 times.
With inlining turned on, this could lead to decrease in code coverage.
Specifically, if we give up inside the inlined function, the rest of
parent's basic blocks will not get analyzed.

This commit introduces an option to enable re-run along the failed path,
in which we do not inline the last inlined call site. This is done by
enqueueing the node before the processing of the inlined call site
with a special policy encoded in the state. The policy tells us not to
inline the call site along the path.

This lead to ~10% increase in the number of paths analyzed. Even though
we expected a much greater coverage improvement.

The option is turned off by default for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153534 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
978fc9c485d21ee89b4f0bc77ce1ea55c65c7f12 27-Mar-2012 Douglas Gregor <dgregor@apple.com> Introduce a -cc1-level option -pubnames-dump, which simply dumps the
list of identifiers that that 'public' names at the end of the
translation unit, e.g., defined macros or identifiers with top-level
names, in sorted order. Meant to support <rdar://problem/10921596>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153522 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendActions.cpp
dccb9bb102adf6ad89ede2f4930fb570c77243b9 26-Mar-2012 Benjamin Kramer <benny.kra@googlemail.com> Driver: Factor string vector push_back into a helper class and optimize it.

Due to lack of move semantics we would create a temporary std::string from the
string literal, copy it into the vector and discard the temporary. This leads
to massive code bloat, optimizing it saves 50k on i386-linux-Release+Asserts.

While there add a two-element overload for push_back, simplifying code a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153441 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
b3dcbbda59a24a5c72483d00f16c5e3f2b328495 26-Mar-2012 Aaron Ballman <aaron@aaronballman.com> Since this change is generating a considerable amount of discussion (and possibly even a regression for known bad versions), I'm reverting it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153420 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
b3656d312d856b15f42b889c3c390845f6867c33 25-Mar-2012 Aaron Ballman <aaron@aaronballman.com> No longer hard coding paths to the MinGW include directories; using a regular expression instead.

Patch thanks to Nikola Smiljanic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153413 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
560ad31c413724fafd13d6fd723e403f28daa132 22-Mar-2012 Shih-wei Liao <sliao@google.com> Migrate external/clang to CLANG-153220-20120321.

Change-Id: I3b469a42a5048f05f06d14aba34419119047e1a9
ndroid.mk
d316862f4fb281ec08a2e45cd3e5580574adb889 24-Mar-2012 Shih-wei Liao <sliao@google.com> Merge branch 'upstream' into sliao_d
fc055f943d154c9b7463f43a3b59e093723362c9 15-Mar-2012 Chad Rosier <mcrosier@apple.com> [frontend] Fix how the frontend handles -fno-inline. AFAIK clang now matches
the behavior of gcc with respect to the -fno-inline and -fno-inline-functions
flags.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152861 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e87e851fcebaf27341858b55fa3f46b9ce23a207 15-Mar-2012 Aaron Ballman <aaron@aaronballman.com> Adding in newer MinGW header paths.

Patch thanks to Nikola Smiljanic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152801 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
8fbe3855db0c341964bb550e13659505efe06c43 15-Mar-2012 Chad Rosier <mcrosier@apple.com> [frontend] Add support for disabling the "inline" keyword using
-fno-inline-functions.

This behaves much like -fno-inline in gcc, but based on a discussion with
Daniel it was decided that -fno-inline-functions should subsume -fno-inline.
Please speak up if you object. The -fno-inline flag remains ignored.
Final part of rdar://10972766



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152754 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
2dec85b21822f950bf6035640c496ad835e11728 13-Mar-2012 Chad Rosier <mcrosier@apple.com> [driver] Parse diagnostic args in the driver.

Previously, only diagnostics thrown by the cc1 process were
actually honoring the diagnostic options given on the command line,
like -Werror.

Reuse the existing code in Frontend currently used for cc1,
adjusting it to not interpret -Wl, linker flags as warnings.

Also fix a faulty test exposed by this change.
It wasn't actually testing anything, and was giving this warning:

clang-3: warning: argument unused during compilation: '-verify'

Which -Werror didn't turn into an error because it was output
by the driver, not the cc1 process, and diagnostic options
weren't parsed by the driver. And you couldn't see the warning
when running the test suite.

Fixes PR12181.
Patch by Dylan Noblesmith <nobled@dreamwidth.org>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152660 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
4bd265468cb115efd5c87c59d5a5b6af5d24d48c 13-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] When there's a file error when saving the PCH, make sure to
clear the error from raw_fd_ostream, otherwise we will crash.

rdar://10976410

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152605 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
4e4d08403ca5cfd4d558fa2936215d3a4e5a528d 11-Mar-2012 David Blaikie <dblaikie@gmail.com> Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).

The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
acheTokens.cpp
hainedIncludesSource.cpp
rontendAction.cpp
rontendActions.cpp
nitPreprocessor.cpp
rintPreprocessedOutput.cpp
erifyDiagnosticConsumer.cpp
5b31d55ab3a72c026a0781b6dcf9bc1dd462e8b9 10-Mar-2012 Aaron Ballman <aaron@aaronballman.com> No longer defining GNUC mode when compiling for Microsoft compatibility. This allows people's cross-platform compiler-specific macros to work properly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152512 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
3fd5f370a28552976c52e76c3035d79012d78dda 09-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Add support for NoRedundancy inlining mode.

We do not reanalyze a function, which has already been analyzed as an
inlined callee. As per PRELIMINARY testing, this gives over
50% run time reduction on some benchmarks without decreasing of the
number of bugs found.

Turning the mode on by default.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152440 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7b14026640d76145c4a9a9ac3b2e647bb49651f8 09-Mar-2012 Daniel Dunbar <daniel@zuster.org> [Basic] Rename LangOptions::NoInline to NoInlineDefine, to make things a bit
more obvious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152408 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
66253352131e3e7a22b3bfd0e180607aa2bfb988 09-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Rework inlining related command line options.
- Remove -analyzer-inline-call.
- Add -analyzer-ipa=[none|inlining]
- Add -analyzer-inlining-mode to allow experimentation for
different performance tuning methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152351 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
025039377d7247620750205dbd61ca1ba336f7e0 08-Mar-2012 Rafael Espindola <rafael.espindola@gmail.com> Replace MarkVarRequired with a more generic
HandleCXXStaticMemberVarInstantiation. Suggested by Argyrios.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152320 91177308-0d34-0410-b5e6-96231b3b80d8
ultiplexConsumer.cpp
e286d9b8b19b24da5158ffeb17a7de03644f1009 08-Mar-2012 Bob Wilson <bob.wilson@apple.com> Workaround module test failures by removing the version info from module hashes.

PR12196: The module hash strings are not actually hashing the compiler version
string; the entire version string is being included in the hash. Depending on
the module cache directory name, that can lead to failures where the path
names become too long. As a temporary workaround, just remove the version
string from the hash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152266 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
bef35c91b594f66216f4aab303b71a6c5ab7abcf 07-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] Mark a PCH file with a flag to indicate if the serialized AST had
compiler errors or not.

-Control whether ASTReader should reject such a PCH by a boolean flag at ASTReader's creation time.
By default, such a PCH file will be rejected with an error when trying to load it.

[libclang] Allow clang_saveTranslationUnit to create a PCH file even if compiler errors
occurred.
-Have libclang API calls accept a PCH that had compiler errors.

The general idea is that we want libclang to stay functional even if a PCH had a compiler error.
rdar://10976363.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152192 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendAction.cpp
00fd5ddc26843c26fde0f146fe4791361123692c 06-Mar-2012 NAKAMURA Takumi <geek4civic@gmail.com> CMake: Fix build to add clangEdit to USED_LIBS.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152154 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
634a4b1b045b13e7ddfa57934cf2b85d4348f77f 06-Mar-2012 Chad Rosier <mcrosier@apple.com> [driver] What was implemented in r152130 was actually -fno-inline-functions, not
-fno-inline.
Part of rdar://10972766


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152145 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
30660a898545416f0fea2d717f16f75640001e38 06-Mar-2012 Ted Kremenek <kremenek@apple.com> Add new code migrator support for migrating existing Objective-C code to use
the new Objective-C NSArray/NSDictionary/NSNumber literal syntax.

This introduces a new library, libEdit, which provides a new way to support
migration of code that improves on the original ARC migrator. We now believe
that most of its functionality can be refactored into the existing libraries,
and thus this new library may shortly disappear.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152141 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
iagnosticRenderer.cpp
250008b4678b19ef80866702e300bb4e53d9ff2d 06-Mar-2012 Chad Rosier <mcrosier@apple.com> [driver] Add support for -fno-inline.
rdar://10972766


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152130 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
361035524dc26094825134f30c07311f38f4f8b1 06-Mar-2012 Stephen Hines <srhines@google.com> Merge with upstream Clang @152062.

Added include/clang/Config/config.h
(note the ANDROID_CONFIG_H header guard because CONFIG_H is already taken)

Added support for AttrTemplateInstantiate TableGen rules.

Added libLLVMVectorize dependency.

Build
-HostInfo.cpp
-CallGraph.cpp
+GlobalCallGraph.cpp
-MultiInitializer.cpp
+PPCallbacks.cpp
+SemaConsumer.cpp
+ChainedDiagnosticConsumer.cpp
+DependencyGraph.cpp
+DiagnosticRenderer.cpp
+LayoutOverrideSource.cpp
+WindowsToolChain.cpp
+SemaLambda.cpp
+BoolAssignmentChecker.cpp
+LambdaMangleContext.cpp
+CStringSyntaxChecker.cpp
+ObjCContainersASTChecker.cpp
+ObjCContainersChecker.cpp
+VirtualCallChecker.cpp
+Dominators.cpp
+SubEngine.cpp
+RewriteModernObjC.cpp

Change-Id: Ifda805ce87ae132f055131f4f83692b5c3d63d17
ndroid.mk
91932089c31e1233f0c478b03412e90a65e07ad2 05-Mar-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge-20120305

Conflicts:
lib/Basic/Targets.cpp

Change-Id: Ib76c138030a701355ce39a6eda1a89a79f401667
234fe654a3dd2888be42ae5db34db96c5c2c4ba3 05-Mar-2012 Rafael Espindola <rafael.espindola@gmail.com> Fix a small difference in sema and codegen views of what needs to be output.

In the included testcase, soma thinks that we already have a definition after we
see the out of line decl. Codegen puts it in a deferred list, to be output if
a use is seen. This would break when we saw an explicit template instantiation
definition, since codegen would not be notified.

This patch adds a method to the consumer interface so that soma can notify
codegen that this decl is now required.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152024 91177308-0d34-0410-b5e6-96231b3b80d8
ultiplexConsumer.cpp
c6c54521f95760a5eaf29b668d4bf41fe2af49d7 05-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [preprocessor] Enhance PreprocessingRecord to keep track of locations of conditional directives.

Introduce PreprocessingRecord::rangeIntersectsConditionalDirective() which returns
true if a given range intersects with a conditional directive block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152018 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
e21dd284d8209a89137a03a0d63f2bd57be9e660 03-Mar-2012 Daniel Dunbar <daniel@zuster.org> Frontend: Default to creating output files using temporary files + rename.
- This is a more reliable default, as it behaves better on failure and also
ensures that we create *new* files (instead of reusing existing inodes). This
is useful for other applications (like lldb) which want to cache inode's to
know when a file has been rewritten.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151961 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
12f28ab8a53d7743081d607617309891fa8156f3 03-Mar-2012 Daniel Dunbar <daniel@zuster.org> Frontend: Don't automatically create missing directories when using temporary files with createOutputFile()
- This would otherwise happen as a side effect of llvm::sys::fs::unique_file creating parent directories.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151960 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendActions.cpp
8235f9c9c8b3d1737d1c6bd57f7ba3f616b92392 02-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Bound the size of the functions being inlined + provide
command line options for inlining tuning.

This adds the option for stack depth bound as well as function size
bound.

+ minor doxygenification

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151930 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
b4f0bd6864f33bc2fd8246f1f841d87e60c4ffc8 02-Mar-2012 David Chisnall <csdavec@swan.ac.uk> Add the Solaris support directory to the header search when using libc++.

Unconditionally define __C99FEATURES__ when using C++ on Solaris. This is a
(hopefully temporary) work around for libc++ exposing C99-but-not-C++98
features in C++98 mode.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151889 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
278f1f8d9557babb22b966379dd89039f3f8a440 01-Mar-2012 Anna Zaks <ganna@apple.com> [analyzer] Turn inlining on by default for better testing exposure.

Fix a test, which was most likely an unintended recursive call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151848 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
3c93122d31924d6d4a6265f36a0c98a164002da6 01-Mar-2012 Kostya Serebryany <kcc@google.com> Add a flag -fthread-sanitizer.
This flag enables ThreadSanitizer instrumentation committed to llvm as r150423.
The patch includes one test for -fthread-sanitizer and one similar test for -faddress-sanitizer.
This patch does not modify the linker flags (as we do it for -faddress-sanitizer) because the run-time library is not yet
committed and it's structure in compiler-rt is not 100% clear.
The users manual wil be changed in a separate commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151846 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8d6ff02cb78c67c615125782967b44d1b37e5815 29-Feb-2012 Daniel Dunbar <daniel@zuster.org> Serialization: Switch over to using the native SmallVector based BitstreamWriter
ctor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151752 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
erializedDiagnosticPrinter.cpp
165329c1d134d000904d6e08b1d166bf34e05517 28-Feb-2012 David Chisnall <csdavec@swan.ac.uk> Some more Solaris fixes. Now successfully building libc++ on Solaris with clang (and linking clang against it).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151632 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
81fb169f42769e02c7425b23885a261c025fd5e6 27-Feb-2012 Anna Zaks <ganna@apple.com> [analyzer] Add -analyzer-stats, which hooks up LLVM stats tracking.

As in http://llvm.org/docs/ProgrammersManual.html#Statistic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151570 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e1d4330adaaa7faf093e725c9c993207eb2d778a 25-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't record nested macro expansions in the preprocessing record,
it can only bring pain when dealing with preprocessor abuse (see: boost).

rdar://10898986

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151427 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
c93dc7889644293e318e19d82830ea2acc45b678 20-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> Basic: import IntrusiveRefCntPtr<> into clang namespace

The class name is long enough without the llvm:: added.
Also bring in RefCountedBase and RefCountedBaseVPTR.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150958 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
rontendAction.cpp
arnings.cpp
5f3c163b7b19a0c7e02509a0984ee1256bca890d 18-Feb-2012 David Chisnall <csdavec@swan.ac.uk> Implement #pragma redefine_extname.

This fixes PR5172 and allows clang to compile C++ programs on Solaris using the system headers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150881 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
ceb15656fbab9ee1da319afa4934b8f6a5964758 15-Feb-2012 David Blaikie <dblaikie@gmail.com> Remove the unuseful -fdiagnostics-show-name

This option was added in r129614 and doesn't have any use case that I'm aware
of. It's possible that external tools are using these names - and if that's
the case we can certainly reassess the functionality, but for now it lets us
shave out a few unneeded bits from clang.

Move the "StaticDiagNameIndex" table into the only remaining consumer, diagtool.
This removes the actual diagnostic name strings from clang entirely.

Reviewed by Chris Lattner & Ted Kremenek.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150612 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnosticPrinter.cpp
b622959527c07cc6b68739eac1412f75f0ca77fa 15-Feb-2012 David Chisnall <csdavec@swan.ac.uk> Add some Solaris include paths and fix a -lgcc_eh that apparently should be -lgcc_s.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150602 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
cc8a94565ec2ff459dcee9ef34237fdcdfc69b3f 14-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> include clang's config.h unconditionally (v2)

And remove HAVE_CLANG_CONFIG_H, now that the header is generated
in the autoconf build, too.

Reverts r149571/restores r149504, now that config.h is generated
correctly by LLVM's configure in all build configurations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150487 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
8be51eab5ad34515d2a40dcdc8558128ca1800ad 14-Feb-2012 Ted Kremenek <kremenek@apple.com> Refactor DiagnosticRenderer and SDiagsRenderer to have some functionality
pulled into DiagnosticNoteRenderer, and common DiagnosticRenderer that
assumes that all custom diagnostic messages are notes. Also extend
DiagnosticRenderer to work with StoredDiagnostics in preparation for
subsequent changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150455 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
erializedDiagnosticPrinter.cpp
extDiagnostic.cpp
6d968363877388f0a0268711d59367907b465ae1 10-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Indexing API: Fully index implict template instantiations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150267 91177308-0d34-0410-b5e6-96231b3b80d8
ultiplexConsumer.cpp
409e2456b70588eff1ef5477843fcd56454d8855 10-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add ArrayRef goodness in MultiplexASTMutationListener.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150266 91177308-0d34-0410-b5e6-96231b3b80d8
ultiplexConsumer.cpp
1da95dbf2a341faec43439802b23a4f847baa6ad 10-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Update MultiplexASTMutationListener with the missing methods from ASTMutationListener.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150265 91177308-0d34-0410-b5e6-96231b3b80d8
ultiplexConsumer.cpp
d7a3e2c5f61cd4893f95b69a424fe4def3aa0f69 07-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Revert my patches which removed Diagnostic.h includes by moving some operator overloads out of line.

This seems to negatively affect compile time onsome ObjC tests
(which use a lot of partial diagnostics I assume). I have to come
up with a way to keep them inline without including Diagnostic.h
everywhere. Now adding a new diagnostic requires a full rebuild
of e.g. the static analyzer which doesn't even use those diagnostics.

This reverts commit 6496bd10dc3a6d5e3266348f08b6e35f8184bc99.
This reverts commit 7af19b817ba964ac560b50c1ed6183235f699789.
This reverts commit fdd15602a42bbe26185978ef1e17019f6d969aa7.
This reverts commit 00bd44d5677783527d7517c1ffe45e4d75a0f56f.
This reverts commit ef9b60ffed980864a8db26ad30344be429e58ff5.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150006 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
a59d20b135bfde058a5a69045bab5ec4e2553f74 07-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Print NamedDecls directly to a raw_ostream where possible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149982 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
5bbc385ad2d8e487edfbc2756eaf4fb0b920cfe4 06-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Move instantiateTemplateAttribute into the sema namespace, make helpers static.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149864 91177308-0d34-0410-b5e6-96231b3b80d8
ayoutOverrideSource.cpp
e6cc51d9d7100d2d3e3ba48b476ab86fa1feca82 06-Feb-2012 Aaron Ballman <aaron@aaronballman.com> Invalid O levels on the command line no longer have a confusing error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149852 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f7ccbad5d9949e7ddd1cbef43d482553b811e026 05-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> Basic: import SmallString<> into clang namespace

(I was going to fix the TODO about DenseMap too, but
that would break self-host right now. See PR11922.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149799 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
acheTokens.cpp
ompilerInstance.cpp
reateInvocationFromCommandLine.cpp
iagnosticRenderer.cpp
rontendActions.cpp
eaderIncludeGen.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
ogDiagnosticPrinter.cpp
rintPreprocessedOutput.cpp
erializedDiagnosticPrinter.cpp
extDiagnostic.cpp
extDiagnosticBuffer.cpp
extDiagnosticPrinter.cpp
erifyDiagnosticConsumer.cpp
6f42b62b6194f53bcbc349f5d17388e1936535d7 05-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> Basic: import OwningPtr<> into clang namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149798 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
rontendAction.cpp
erializedDiagnosticPrinter.cpp
8fe83e1df954d72c0f4ffc15d20a5222ec151c21 04-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Move a method from IdentifierTable.h out of line and remove the SmallString include.

Fix all the transitive include users.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149783 91177308-0d34-0410-b5e6-96231b3b80d8
eaderIncludeGen.cpp
fdd15602a42bbe26185978ef1e17019f6d969aa7 04-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Remove Diagnostic.h include from Preprocessor.h.

- Move the offending methods out of line and fix transitive includers.
- This required changing an enum in the PPCallback API into an unsigned.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149782 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
9ec9ce17652819f6d291606fcf295abde2725894 04-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> ArrayRef goodness in MultiplexConsumer, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149764 91177308-0d34-0410-b5e6-96231b3b80d8
ultiplexConsumer.cpp
b3ca2637a9a3aeac5c7103eb4d612528680e7e20 04-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use variable in place of multiple CI.getFrontendOpts() calls and use a bit
of ArrayRef goodness. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149739 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
50a9a12d4f7387bcff3213d4b56e74bab9f4f5d2 04-Feb-2012 Sean Callanan <scallanan@apple.com> Clang has existing support for debuggers that
want to provide "po"-like functionality which
treats the result of an expression implicitly as
"id" (if it is not otherwise known) and prints
it as an Objective-C object.

This has in the past been gated by the
"DebuggerSupport" language option, but that is
too general. Debuggers also provide other commands
like "print" that do not make any assumptions
about whether the object is an Objective-C object.

This patch makes the assumption conditional on a
new language option: DebuggerCastResultToId. I
have also made corresponding modifications to the
testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149735 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
285c6070cba54ab9bb1d3bacdc2028498a83baef 03-Feb-2012 Douglas Gregor <dgregor@apple.com> Make sure that the layout-override parser grabs the size, not the data
size. Otherwise, we can end up with bogus layouts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149703 91177308-0d34-0410-b5e6-96231b3b80d8
ayoutOverrideSource.cpp
71fd6cc843719cab528a5df0899ad3d15cb9297f 03-Feb-2012 Bob Wilson <bob.wilson@apple.com> Fix -ftrap-function fallout from llvm r145714. <rdar://problem/10799325>

That llvm change removed the -trap-func backend option, so that using
-ftrap-function with clang would cause the backend to complain. Fix it
by adding the trap function name to the CodeGenOptions and passing it through
to the TargetOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149679 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
353300c4af020ce5d8368d1c336cbf7583c33a7d 03-Feb-2012 Rafael Espindola <rafael.espindola@gmail.com> Replace the old --with-cxx-* configure options with a single --with-gcc-toolchain
that just uses the new toolchain probing logic. This fixes linking with -m32 on
64 bit systems (the /32 dir was not being added to the search).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149652 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
773303a505c23d73da624f1e6abcf41a393dad2b 03-Feb-2012 Douglas Gregor <dgregor@apple.com> Rename -dependency-graphviz to -dependencncy-dot

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149645 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
ependencyGraph.cpp
2f04f1843ca0ffca13b8b0d4dadd1f50dffb38b8 02-Feb-2012 Douglas Gregor <dgregor@apple.com> Back out my heinous hack that tricked the module generation mechanism
into using non-absolute system includes (<foo>)...

... and introduce another hack that is simultaneously more heineous
and more effective. We whitelist Clang-supplied headers that augment
or override system headers (such as float.h, stdarg.h, and
tgmath.h). For these headers, Clang does not provide a module
mapping. Instead, a system-supplied module map can refer to these
headers in a system module, and Clang will look both in its own
include directory and wherever the system-supplied module map
suggests, then adds either or both headers. The end result is that
Clang-supplied headers get merged into the system-supplied module for
the C standard library.

As a drive-by, fix up a few dependencies in the _Builtin_instrinsics
module.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149611 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
nitHeaderSearch.cpp
c69a181049ab52da29f8f69316a34c90c3ea3b8e 02-Feb-2012 Douglas Gregor <dgregor@apple.com> Introduce a -cc1 option "-dependency-graphviz" that determines header
dependencies and outputs them in GraphViz format.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149575 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInstance.cpp
ompilerInvocation.cpp
ependencyGraph.cpp
f2462be34a49e2108c9b4151f8e6d3fe1b916179 02-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> back out r149504

Too many weird build failures.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149571 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
7f3a458cd46f19a854fb710fa9d27c411ddd5101 01-Feb-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Make sure we don't ever leave a StoredDiagnostic associated with
a SourceManager that has already been deleted, rdar://10768346.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149532 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
69d3b4f7c9fa818d2536b4f1b220b942ae392128 01-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> include clang's config.h unconditionally

And remove HAVE_CLANG_CONFIG_H, now that the header is generated
in the autoconf build, too. (clang r149497 / llvm r149498)

Also include the config.h header after all other headers, per
the LLVM coding standards.

It also turns out WindowsToolChain.cpp wasn't using the config
header at all, so that include's just deleted now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149504 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
eb7b9eb18b59c28d41d4dcddd55a3ec98c23d437 31-Jan-2012 Douglas Gregor <dgregor@apple.com> Split compiler builtin module into "stdlib" builtins and "intrinsic"
builds, and bring mm_alloc.h into the fold. Start playing some tricks
with these builtin modules to mirror the include_next tricks that the
headers already perform.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149434 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
588e83bf3e998d79d3acc7c7179ca466787f72cc 31-Jan-2012 Chad Rosier <mcrosier@apple.com> Fix 80-column violation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149405 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
dc58aa71026cce539ca9b5c2c52cc4efc7bd77fe 30-Jan-2012 Douglas Gregor <dgregor@apple.com> Thread a TargetInfo through to the module map; we'll need it for
target-specific module requirements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149224 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendActions.cpp
52f127297c9dca0f8fbb3a28144de4db1d1db9e2 29-Jan-2012 Douglas Gregor <dgregor@apple.com> Switch over to LLVM's file-level locking facility

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149204 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
85ae12db3bbc60b920c086f1cb23cc94ad4802ae 29-Jan-2012 Douglas Gregor <dgregor@apple.com> Ensure that we clean up after a failed module build and cope with the
results in libclang.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149200 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
c5b2e58840748145d1706c1d1481369d1863fabf 29-Jan-2012 Douglas Gregor <dgregor@apple.com> Implement code completion support for module import declarations, e.g.,

@import <complete with module names here>

or

@import std.<complete with submodule names here>

Addresses <rdar://problem/10710117>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149199 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
e434ec71fccfe078906403affd641f709702d598 29-Jan-2012 Douglas Gregor <dgregor@apple.com> Rework HeaderSearch's interface for getting a module from a name and
for getting the name of the module file, unifying the code for
searching for a module with a given name (into lookupModule()) and
separating out the mapping to a module file (into
getModuleFileName()). No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149197 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendActions.cpp
4188760f6bb20f91c6883dffd89204419f852dee 29-Jan-2012 John McCall <rjmccall@apple.com> Complain about attempts to use 'protected' visibility on targets
like Darwin that don't support it. We should also complain about
invalid -fvisibility=protected, but that information doesn't seem
to exist at the most appropriate time, so I've left a FIXME behind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149186 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
a1f1fad8b60e1cb9d21a40a37f2e03150bcbeb6f 27-Jan-2012 Douglas Gregor <dgregor@apple.com> Introduce module attributes into the module map grammar, along with a
single attribute ("system") that allows us to mark a module as being a
"system" module. Each of the headers that makes up a system module is
considered to be a system header, so that we (for example) suppress
warnings there.

If a module is being inferred for a framework, and that framework
directory is within a system frameworks directory, infer it as a
system framework.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149143 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendAction.cpp
rontendActions.cpp
11583c757bac6ce5c342f2eb572055dd2619a657 27-Jan-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Due to a bug, -Wno-everything works like -Weverything. Fix the bug by having
-Wno-everything remap all warnings to ignored.

We can now use "-Wno-everything -W<warning>" to ignore all warnings except
specific ones.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149121 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
bbdfad581fa300fa0d162d968ec14de3c95fc760 26-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> objc-arc: introduce -no-finalize-removal which in gc mode,
leaves "finalize' behind and in arc mode, does not
include it. This allows the migrated source to be compiled
in both gc and arc mode. // rdar://10532441


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149079 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
453dbcbe30093fbf947a0bec2fbd46e9694eafe9 26-Jan-2012 Douglas Gregor <dgregor@apple.com> Extend the ExternalASTSource interface to allow the AST source to
provide the layout of records, rather than letting Clang compute
the layout itself. LLDB provides the motivation for this feature:
because various layout-altering attributes (packed, aligned, etc.)
don't get reliably get placed into DWARF, the record layouts computed
by LLDB from the reconstructed records differ from the actual layouts,
and badness occurs. This interface lets the DWARF data drive layout,
so we don't need the attributes preserved to get the answer write.

The testing methodology for this change is fun. I've introduced a
variant of -fdump-record-layouts called -fdump-record-layouts-simple
that always has the simple C format and provides size/alignment/field
offsets. There is also a -cc1 option -foverride-record-layout=<file>
to take the output of -fdump-record-layouts-simple and parse it to
produce a set of overridden layouts, which is introduced into the AST
via a testing-only ExternalASTSource (called
LayoutOverrideSource). Each test contains a number of records to lay
out, which use various layout-changing attributes, and then dumps the
layouts. We then run the test again, using the preprocessor to
eliminate the layout-changing attributes entirely (which would give us
different layouts for the records), but supplying the
previously-computed record layouts. Finally, we diff the layouts
produced from the two runs to be sure that they are identical.

Note that this code makes the assumption that we don't *have* to
provide the offsets of bases or virtual bases to get the layout right,
because the alignment attributes don't affect it. I believe this
assumption holds, but if it does not, we can extend
LayoutOverrideSource to also provide base offset information.

Fixes the Clang side of <rdar://problem/10169539>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149055 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInvocation.cpp
rontendAction.cpp
ayoutOverrideSource.cpp
61d679ab2831b161c857cf3f974312fbd4ef1efd 26-Jan-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce 3 new fixit options:

-fixit-recompile
applies fixits and recompiles the result
-fixit-to-temporary
applies fixits to temporary files
-fix-only-warnings">,
applies fixits for warnings only, not errors

Combining "-fixit-recompile -fixit-to-temporary" allows testing the result of fixits
without touching the original sources.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149027 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
cf2362b76b624b90e2649497ab8019bcce959bf4 25-Jan-2012 Ted Kremenek <kremenek@apple.com> Fix -fmacro-backtrace-limit=0 to show the entire macro backtrace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148930 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
5ac4b6917aa34fae6da64036539023a6155a3d48 25-Jan-2012 Douglas Gregor <dgregor@apple.com> Rework the external Sema source's ReadMethodPool() so that it doesn't
return pre-built lists. Instead, it feeds the methods it deserializes
to Sema so that Sema can unique them, which keeps the chains shorter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148889 91177308-0d34-0410-b5e6-96231b3b80d8
hainedIncludesSource.cpp
b5c6babd3d8e0233b8ea5a4eb1e2700e30c0d396 25-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> arc migrator: Provide infrastructure to add options
specific to migrator. Use its first option to
warn migrating from GC to arc when
NSAllocateCollectable/NSReallocateCollectable is used.
// rdar://10532541


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148887 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7f6cf9764b33381e03fcf7c44f7985a333212b06 23-Jan-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> Improve Lexer::getImmediateMacroName to take into account inner macros
of macro arguments.

For "MAC1( MAC2(foo) )" and location of 'foo' token it would return
"MAC1" instead of "MAC2".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148704 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
1db772bd68502e0dabbd8efeb7f7c64a4ab2e37a 23-Jan-2012 Nick Lewycky <nicholas@mxc.ca> Add support for -fno-optimize-sibling-calls. Currently only implemented in the
X86 backend in LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148689 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f3c1ca6bced3f79ec6d76f1bcb05c5ae6944ce0b 21-Jan-2012 NAKAMURA Takumi <geek4civic@gmail.com> lib/Frontend/InitHeaderSearch.cpp: [Cygwin] Add 4.5.3.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148637 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
b4f90c28fabd167d59c63b445757b744dcb42971 21-Jan-2012 NAKAMURA Takumi <geek4civic@gmail.com> [Cygwin] Abandon Cygwin-1.5 and g++-3. Use g++-4.3 and higher on Cygwin-1.7.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148636 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
3026348bd4c13a0f83b59839f64065e0fcbea253 20-Jan-2012 David Blaikie <dblaikie@gmail.com> More dead code removal (using -Wunreachable-code)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148577 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1f6b2b5c82b2d2d3935b0db76352a04e9877b73f 20-Jan-2012 Douglas Gregor <dgregor@apple.com> Extract the (InputKind, std::string) pair used to describe inputs to
the front end into its own class, FrontendInputFile, to make it easier
to introduce new per-input data. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148546 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
hainedIncludesSource.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
rontendAction.cpp
rontendActions.cpp
erifyDiagnosticConsumer.cpp
c2a8d6cee01fc4845f5409bf5c021a64616ac8c3 18-Jan-2012 Anna Zaks <ganna@apple.com> Refactor: Pull getImmediateMacroName() out of DiagnosticRenderer and
into Lexer and Preprocessor; making it widely available.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148410 91177308-0d34-0410-b5e6-96231b3b80d8
iagnosticRenderer.cpp
7fe90f3bfa6bd7f779ecfd4ba201a296a3a1c8cb 17-Jan-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Make sure Preprocessor is set in ASTUnit during indexing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148319 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c8769460f1c03bc321b00f5611f9965e8385e64d 17-Jan-2012 Hans Wennborg <hans@hanshq.net> Treat -Wformat=0 as an alias for -Wformat.

Fixes PR9195.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148300 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
561d3abc881033776ece385a01a510e1cbc1fa92 17-Jan-2012 David Blaikie <dblaikie@gmail.com> Remove unnecessary default cases in switches over enums.

This allows -Wswitch-enum to find switches that need updating when these enums are modified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148281 91177308-0d34-0410-b5e6-96231b3b80d8
angStandards.cpp
ogDiagnosticPrinter.cpp
rintPreprocessedOutput.cpp
7a7ee3033e44b45630981355460ef89efa0bdcc4 16-Jan-2012 David Chisnall <csdavec@swan.ac.uk> Some improvements to the handling of C11 atomic types:

- Add atomic-to/from-nonatomic cast types
- Emit atomic operations for arithmetic on atomic types
- Emit non-atomic stores for initialisation of atomic types, but atomic stores and loads for every other store / load
- Add a __atomic_init() intrinsic which does a non-atomic store to an _Atomic() type. This is needed for the corresponding C11 stdatomic.h function.
- Enables the relevant __has_feature() checks. The feature isn't 100% complete yet, but it's done enough that we want people testing it.

Still to do:

- Make the arithmetic operations on atomic types (e.g. Atomic(int) foo = 1; foo++;) use the correct LLVM intrinsic if one exists, not a loop with a cmpxchg.
- Add a signal fence builtin
- Properly set the fenv state in atomic operations on floating point values
- Correctly handle things like _Atomic(_Complex double) which are too large for an atomic cmpxchg on some platforms (this requires working out what 'correctly' means in this context)
- Fix the many remaining corner cases



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148242 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
b8c879a5363f36bdae8831112b563333e3c05acb 05-Jan-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> When loading an AST file, set SourceManager::MainFileID to the main file of the AST file,
as suggested by Tom Honermann.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147612 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
752769f080e217747f7756d3db2b4ee405bf3767 05-Jan-2012 Douglas Gregor <dgregor@apple.com> When generating includes for all of the headers we found in an
umbrella directory, skip includes for any headers that are part of an
unavailable module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147572 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
b7a7819473709c01ea024a2dc15e99d38f0f8760 05-Jan-2012 Douglas Gregor <dgregor@apple.com> Store the submodules of a module in source order, as they are stored
in the module map. This provides a bit more predictability for the
user, as well as eliminating the need to sort the submodules when
serializing them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147564 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendActions.cpp
752c74d99b647710a495c2ff5f815c30a30c3264 03-Jan-2012 Douglas Gregor <dgregor@apple.com> Add a "Modules" language option, which subsumes the previous
"AutoModuleImport" preprocessor option and is tied to -fmodules.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147448 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
c514a8a0eaa575cf46b038cc27fa1e4e8c22f89a 03-Jan-2012 Douglas Gregor <dgregor@apple.com> Rename the command-line option for mapping #include/#import over to
module imports from -fauto-module-import to -fmodules. The new name
will eventually be used to enable modules, and the #include/#import
mapping is a crucial part of the feature.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147447 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ba9186c6fca2b8dd7885c909e7b1fd76c537c4ed 03-Jan-2012 Chandler Carruth <chandlerc@gmail.com> Teach the frontend to provide the builtin preprocessor defines for
-ffast-math.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147440 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
abf07a7fb669dcb74040eef948d61dfe3c59ff17 02-Jan-2012 Chandler Carruth <chandlerc@gmail.com> Fix PR11685 by implementing -ffast-math and its various friends in the
Clang driver. This involves a bunch of silly option parsing code to try
to carefully emulate GCC's options. Currently, this takes a conservative
approach, and unless all of the unsafe optimizations are enabled, none
of them are. The fine grained control doesn't seem particularly useful.
If it ever becomes useful, we can add that to LLVM first, and then
expose it here.

This also fixes a few tiny bugs in the flag management around
-fhonor-infinities and -fhonor-nans; the flags now form proper sets both
for enabling and disabling, with the last flag winning.

I've also implemented a moderately terrifying GCC feature where
a language change is also provided by the '-ffast-math' flag by defining
the __FAST_MATH__ preprocessor macro. This feature is tracked and
serialized in the frontend but it isn't used yet. A subsequent patch
will add the preprocessor macro and tests for it.

I've manually tested that codegen appears to respect this, but I've not
dug in enough to see if there is an easy way to test codegen options w/o
relying on the particulars of LLVM's optimizations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147434 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
bd9482d859a74bf2c45ef8b8aedec61c0e1c8374 01-Jan-2012 Douglas Gregor <dgregor@apple.com> Eliminate ObjCForwardProtocolDecl, which is redundant now that
ObjCProtocolDecl modules forward declarations properly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147415 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
51f564f80d9f71e175635b452ffeeeff899e9bf1 31-Dec-2011 Douglas Gregor <dgregor@apple.com> Implement support for module requirements, which indicate the language
features needed for a particular module to be available. This allows
mixed-language modules, where certain headers only work under some
language variants (e.g., in C++, std.tuple might only be available in
C++11 mode).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147387 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendActions.cpp
b406669fea7c8db83a377f368f1689c848296974 28-Dec-2011 Benjamin Kramer <benny.kra@googlemail.com> Add a target hook for FLT_EVAL_METHOD and use it to set the value on x86 with sse disabled.

x87 math evaluates everything with 80 bits precision, so we have to set FLT_EVAL_METHOD
to "2".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147311 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
375bb1413c041055262c8a416f20d10474a5eda9 27-Dec-2011 Douglas Gregor <dgregor@apple.com> Eliminate ObjCClassDecl, which is redundant now that ObjCInterfaceDecl
covers both declarations (@class) and definitions (@interface) of an
Objective-C class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147299 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
8d2a701734f6e0aa778f6be4e6b6d561d8ba6fdb 25-Dec-2011 Rafael Espindola <rafael.espindola@gmail.com> Remove unused variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147260 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
430cf51d4a4744fdcc9286098c659f9c82e3bd9a 23-Dec-2011 Benjamin Kramer <benny.kra@googlemail.com> Give C11's __STDC_VERSION__ the final value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147222 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
ffbe9b9c64ab2e94b9d48ec56e511f75826fc80a 23-Dec-2011 Benjamin Kramer <benny.kra@googlemail.com> Mass rename C1x references to C11. The name hasn't proliferated like "C++0x" so this patch is surprisingly small.

Also drop -Wc1x-extensions in favor of -Wc11-extensions. I don't think we need to keep this around for compatibility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147221 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
8fdb6dee2da0dee97d64fe12eda46fb318414de9 23-Dec-2011 Dylan Noblesmith <nobled@dreamwidth.org> Let CompilerInvocation initialization indicate failure

This fixes the FIXMEs in ParseAnalyzeArgs. (Also a
precursor to moving the analyzer into an AST plugin.)

For consistency, do the same with AssemblerInvocation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147218 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
1770e0dadcab966990cca4d7516253c886fd907c 22-Dec-2011 Dylan Noblesmith <nobled@dreamwidth.org> remove unneeded config.h includes



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147195 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
3ff53b3587862439a1a84a7b0bc9a7dbee0cf4eb 20-Dec-2011 Chandler Carruth <chandlerc@gmail.com> Update the CMake build for r146959's new files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146967 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
99ba9e3bd70671f3441fb974895f226a83ce0e66 20-Dec-2011 David Blaikie <dblaikie@gmail.com> Unweaken vtables as per http://llvm.org/docs/CodingStandards.html#ll_virtual_anch

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146959 91177308-0d34-0410-b5e6-96231b3b80d8
hainedDiagnosticConsumer.cpp
rontendAction.cpp
305dc3ebaa0bea5f3b789e4b54afc79c25907615 20-Dec-2011 Douglas Gregor <dgregor@apple.com> Detect when mapping a #include/#import over to a submodule ends up
hitting a submodule that was never actually created, e.g., because
that header wasn't parsed. In such cases, complain (because the
module's umbrella headers don't cover everything) and fall back to
including the header.

Later, we'll add a warning at module-build time to catch all such
cases. However, this fallback is important to eliminate assertions in
the ASTWriter when this happens.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146933 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ad646846f7033d3ee813998bb0bc028aee51e65e 17-Dec-2011 NAKAMURA Takumi <geek4civic@gmail.com> Frontend/VerifyDiagnosticConsumer.cpp: Fix an expression that had side-effect.

It had been causing test "Misc/diag-verify.cpp" failure on ms cl.exe. The emission was ordered unexpectedly as below;

First) error: 'error' diagnostics seen but not expected:
Second) error: 'error' diagnostics expected but not seen:

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146830 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
2a76410c0a23a6feb98d0f13e9c8bfa0638d3adf 17-Dec-2011 Ted Kremenek <kremenek@apple.com> Refactor SerializeDiagnosticsPrinter to using DiagnosticRenderer. This gives us comparative diagnostics
to TextDiagnosticPrinter.

This certainly can be cleaned up a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146820 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
erializedDiagnosticPrinter.cpp
2898d4f7648e6ed5e9047068f1e8ee2f3c2bcd75 17-Dec-2011 Ted Kremenek <kremenek@apple.com> Refactor 'TextDiagnostic' to have a parent class 'DiagnosticRenderer' which handles
the policy of how diagnostics are lowered/rendered, while TextDiagnostic handles
the actual pretty-printing.

This is a first part of reworking SerializedDiagnosticPrinter to use the same
inclusion-stack/macro-expansion logic as TextDiagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146819 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
iagnosticRenderer.cpp
extDiagnostic.cpp
08d6e032a2a0a8656d12b3b7b93942987bb12eb7 16-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> C++11 constexpr: Add note stacks containing backtraces if constant evaluation
fails within a call to a constexpr function. Add -fconstexpr-backtrace-limit
argument to driver and frontend, to control the maximum number of notes so
produced (default 10). Fix APValue printing to be able to pretty-print all
APValue types, and move the testing for this functionality from a unittest to
a -verify test now that it's visible in clang's output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146749 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
arnings.cpp
0e818a412f337baa35d1d7677c64259610df0c2e 16-Dec-2011 Anna Zaks <ganna@apple.com> Fixup to the relaxed diagnostic verification option r146633.

We should exit when matching the '+' even if nothing was found to
prevent searching for all UNIT_MAX items.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146747 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
9b879db75be6b8db4a7c804e9bba4c07c4cfa81c 16-Dec-2011 Logan Chien <loganchien@google.com> Apply changes to migrate to clang upstream r146715.

Change-Id: I7a40ad93f4cc76a6e748ba314ac06a1bef473bbf
ndroid.mk
298aaf2c97ab7c4d5bd3a8e8d8112e3bc77b29b6 16-Dec-2011 Logan Chien <loganchien@google.com> Merge with clang upstream r146715 (Dec 16th 2011)

Change-Id: I66024a7b6eb0ee37d7b3ff7ce41c0bfb4b514bee
53ba95612c023ecbcf142b9aaa90e4082fc1b480 15-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r146646 that was a mistake, and make the intended change in the right file.

Log:
[libclang] Try to unbreak mingw build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146647 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
f5a684d7742df5b57e70bb4dac327f2ef0333f71 15-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Try to unbreak mingw build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146646 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
4bf34d19b80bbcd26519b6ab32d17d876c8b8dcc 15-Dec-2011 Eli Friedman <eli.friedman@gmail.com> <climits> has UINT_MAX, not <limits>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146638 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
676bb5ad76947fbd81245100cebfbfc3d547d545 15-Dec-2011 Anna Zaks <ganna@apple.com> Another fixit for r146633 (to make debian-fnt bot happy), try including limits instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146637 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
c035e09b6f4ed51a21e7983e504fe5380d5f2723 15-Dec-2011 Anna Zaks <ganna@apple.com> Fixit for r146633. Make sure UINT_MAX is defined on all platforms.

(Attempt to turn debian-fnt buildbot back to green.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146635 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
2135ebb83179ee87910afdebc1bc091e17a7d1eb 15-Dec-2011 Anna Zaks <ganna@apple.com> Add support for matching one or more (aka regex +) diagnostic messages with -verify.

Ex:
// expected-warning + {{tainted}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146633 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
2fe9b7fb07dff15dd15dd8755a9a9e6de0fe46fc 15-Dec-2011 Richard Trieu <rtrieu@google.com> Modify how the -verify flag works. Currently, the verification string and
diagnostic message are compared. If either is a substring of the other, then
no error is given. This gives rise to an unexpected case:

// expect-error{{candidate function has different number of parameters}}

will match the following error messages from Clang:

candidate function has different number of parameters (expected 1 but has 2)
candidate function has different number of parameters

It will also match these other error messages:

candidate function
function has different number of parameters
number of parameters

This patch will change so that the verification string must be a substring of
the diagnostic message before accepting. Also, all the failing tests from this
change have been corrected. Some stats from this cleanup:

87 - removed extra spaces around verification strings
70 - wording updates to diagnostics
40 - extra leading or trailing characters (typos, unmatched parens or quotes)
35 - diagnostic level was included (error:, warning:, or note:)
18 - flag name put in the warning (-Wprotocol)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146619 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticConsumer.cpp
9f6d068b29ea2f6276f1105c71d9e768201f2b88 14-Dec-2011 Chad Rosier <mcrosier@apple.com> Per discussion on the list, remove BitcodeVerify pass to reimplement as a free function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146530 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ff7892758f1e46221b552486c1e329db92147ebc 13-Dec-2011 Chad Rosier <mcrosier@apple.com> Add frontend flags to enable bitcode verifier pass.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146441 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
9631939f82c0eaa6fb3936a0ce58a41adfbc9011 12-Dec-2011 Tony Linthicum <tlinth@codeaurora.org> Hexagon backend support

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146413 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
3b29bb99948f9e8b4a4e829445c753f6858f607e 12-Dec-2011 Douglas Gregor <dgregor@apple.com> When we have an umbrella directory in a module map, recursively walk
the subdirectories to find headers in submodules.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146398 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
001f628a693960380e37c2b58a1009da77d7e425 10-Dec-2011 Daniel Dunbar <daniel@zuster.org> Driver: Handle -f{no-}honor-infinities, -f{no-}honor-nans, and
-ffinite-math-only.
- No test case yet, I don't know how to construct a situation where this
matters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146297 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
71088d1af241ad114294ec3fe03cd9baea39ee08 09-Dec-2011 Chandler Carruth <chandlerc@gmail.com> Move ChainedIncludesSource into the Frontend library. This never really
belonged in the Serialization library, it's setting up a compilation,
not just deserializing.

This should fix PR11512, making Serialization actually be layered below
Frontend, a long standing layering violation in Clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146233 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
hainedIncludesSource.cpp
rontendAction.cpp
cb381eac84e5a14a8c7e7654eadbe1d3d54d795c 09-Dec-2011 Chandler Carruth <chandlerc@gmail.com> Move a free function from the Frontend library into the Lex library as
part of HeaderSearch. This function just normalizes filenames for use
inside of a synthetic include directive, but it is used in both the
Frontend and Serialization libraries so it needs a common home.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146227 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
77d029f6a24dbf70d97e61757945df53fb250ea0 08-Dec-2011 Douglas Gregor <dgregor@apple.com> Implement umbrella directories for modules, which are similar to
umbrella headers in the sense that all of the headers within that
directory (and eventually its subdirectories) are considered to be
part of the module with that umbrella directory. However, unlike
umbrella headers, which are expected to include all of the headers
within their subdirectories, Clang will automatically include all of
the headers it finds in the named subdirectory.

The intent here is to allow a module map to trivially turn a
subdirectory into a module, where the module's structure can mimic the
directory structure.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146165 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
10694cee2588442bee1e717f5042c58ffee25279 08-Dec-2011 Douglas Gregor <dgregor@apple.com> Within the module representation, generalize the notion of an umbrella
header to also support umbrella directories. The umbrella directory
for an umbrella header is the directory in which the umbrella header
resides.

No functionality change yet, but it's coming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146158 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
5e3f9223db88227d6d21679c613b139d8160186d 08-Dec-2011 Douglas Gregor <dgregor@apple.com> Keep track of import dependencies between submodules within the module
that's currently being built. This is important for supporting
transitive dependencies ("export *" in the module map) completely.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146156 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
29f2787b6da552018a7716f18f5bd8f67bd6edb5 07-Dec-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make changes to SDiagsWriter to make it work in combination with the ARC migrator:

-Allow it to be used with multiple BeginSourceFile/EndSourceFile calls; for this introduce
a "finish" callback method in the DiagnosticConsumer. SDiagsWriter finishes up the serialization
file inside this method.
-Make it independent of any particular DiagnosticsEngine; make it use the SourceManager of the
Diagnostic object.
-Ignore null source ranges.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146020 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
erializedDiagnosticPrinter.cpp
f64114b2aa611a66fc97e6bd8f35b0b039a4500a 07-Dec-2011 Douglas Gregor <dgregor@apple.com> If we can't write the temporary module map file when compiling a
module, at least have the decency to complain about it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146002 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
e912029b914f263ec22cba6f1fb41ebebcdd844f 07-Dec-2011 Douglas Gregor <dgregor@apple.com> Add a FIXME to provide a sensible error message here

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145983 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
1e821e9eba7c48f375c7cb5c9e19c489e17ec58a 06-Dec-2011 Douglas Gregor <dgregor@apple.com> Use absolute paths for temporary module map files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145973 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
8075ce62f7860224d7f3f9ddba38201ad89e2cbc 06-Dec-2011 Douglas Gregor <dgregor@apple.com> When building the main file to parse given a module map, don't skip
explicit submodules or umbrella headers from submodules. Instead,
build the entire module at once, and let the name-hiding mechanisms
hide the contents of explicit submodules at load time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145940 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
4e785c908ae01519d3592eae2828e2cc94fb02eb 06-Dec-2011 Nick Lewycky <nicholas@mxc.ca> Stack realignment is a tristate. Add -mno-stackrealign to turn off all stack
realignment, even with locals with alignment exceeding the ABI guarantee.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145909 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e9d11dbfe1f3286c5f8a2f2fc8ac759f63890655 06-Dec-2011 Joerg Sonnenberger <joerg@bec.de> Add -mstack-alignment=X and fix -mstackrealign handling now that the
backend options are gone.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145868 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
93ebfa6139bbca4d446c7343e3afc8e5ec777484 03-Dec-2011 Douglas Gregor <dgregor@apple.com> When we treat an #include or #import as a module import, create an
implicit ImportDecl in the translation unit to record the presence of
the import.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145727 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
5e35693721364673f8196e4f5a370f56b92e6053 01-Dec-2011 Douglas Gregor <dgregor@apple.com> Introduce the notion of name visibility into modules. For a given
(sub)module, all of the names may be hidden, just the macro names may
be exposed (for example, after the preprocessor has seen the import of
the module but the parser has not), or all of the names may be
exposed. Importing a module makes its names, and the names in any of
its non-explicit submodules, visible to name lookup (transitively).

This commit only introduces the notion of name visible and marks
modules and submodules as visible when they are imported. The actual
name-hiding logic in the AST reader will follow (along with test cases).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145586 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
1a4761edca58c6b559de825b9abfb66f7f1ba94a 01-Dec-2011 Douglas Gregor <dgregor@apple.com> Promote ModuleMap::Module to a namespace-scope class in the Basic
library, since modules cut across all of the libraries. Rename
serialization::Module to serialization::ModuleFile to side-step the
annoying naming conflict. Prune a bunch of ModuleMap.h includes that
are no longer needed (most files only needed the Module type).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145538 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendActions.cpp
e25633f777cfcaa564b4ed36cec37d6e6e1ecb04 30-Nov-2011 Matt Beaumont-Gay <matthewbg@google.com> Don't collide loop variable names (to appease GCC)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145515 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
392ed2b717d86ebdd202cb9bb58d18d8b3b4cd87 30-Nov-2011 Douglas Gregor <dgregor@apple.com> Implement (de-)serialization of the description of a module and its
submodules. This information will eventually be used for name hiding
when dealing with submodules. For now, we only use it to ensure that
the module "key" returned when loading a module will always be a
module (rather than occasionally being a FileEntry).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145497 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
a8cc6ce36e70e2afa22ab6b4340035cb3941c2eb 30-Nov-2011 Douglas Gregor <dgregor@apple.com> When writing a module file, pass the module through to the AST
writer. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145479 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
rontendActions.cpp
b514c792821a8f053027d88444e13bfaa8efef76 30-Nov-2011 Douglas Gregor <dgregor@apple.com> Teach the preprocessor how to handle module import declarations that
involve submodules (e.g., importing std.vector), rather than always
importing the top-level module.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145478 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
49009ec701feb3009450e57e40c656e2ad7c1f41 30-Nov-2011 Douglas Gregor <dgregor@apple.com> When loading a module that involves submodules (e.g., std.vector),
check whether the named submodules themselves are actually
valid, and drill down to the named submodule (although we don't do
anything with it yet). Perform typo correction on the submodule names
when possible.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145477 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
3d3589db579f7695667b913c5043dd264ebe546f 30-Nov-2011 Douglas Gregor <dgregor@apple.com> Switch the module-loading interfaces and parser from a simple
top-level module name to a module path (e.g., std.vector). We're still
missing a number of pieces for this actually to do something.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145462 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
6649014b792f8a4b1bc1e8be8f844a72220af508 29-Nov-2011 Douglas Gregor <dgregor@apple.com> Eliminate the -emit-module option, which emitted a module by parsing a
source file (e.g., a header). Immediately steal this useful option
name for building modules from a module map file.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145444 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendActions.cpp
18ee547b6926cacefa15eed8ca60ff73d22e279b 29-Nov-2011 Douglas Gregor <dgregor@apple.com> Switch on-demand module building over to use module maps, always. When
we infer the module map, we'll just print the module map to a
temporary file and generate the module using that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145436 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
f9e357d8a66c606a86a6e1aef678898b8843bd30 29-Nov-2011 Douglas Gregor <dgregor@apple.com> Teach the module import mechanism how to rebuild modules expressed via
module map, rather than assuming that there is an umbrella
header. This allows us to automatically build umbrella-less modules.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145415 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
933e7a61da12400d8971890719cb03d68c1b02eb 29-Nov-2011 Douglas Gregor <dgregor@apple.com> Start refactoring to use module maps when rebuilding a module
on-the-fly. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145414 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
9870401105660efb1c393829e08eae44e0583b3d 29-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Initialize NumWarningsInPreamble in ASTUnit's constructor, for safety.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145412 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
85224ae68ab9c9df5dd8410a1b7188b4d64f889e 29-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> Silence GCC warnings, RefCountedBase is meant to be default-initialized here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145396 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
a74ec5c314178a7e73bbaa7d406eb5079ef8ef26 29-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Add a couple more GCC versions to C++ search paths for MinGW. Patch by Ruben Van Boxem.

(We should probably start doing some sort of autodetection like we do on Linux at some point.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145326 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
a4d36a6dd00c1495cfe3b64f949d70ba9f778391 29-Nov-2011 Douglas Gregor <dgregor@apple.com> When attempting to load a module that is not in the module cache,
return the module itself (in the module map) rather than returning the
umbrella header used to build the module. While doing this, make sure
that we're inferring modules for frameworks to build that module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145310 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
4e969445d3ae80f8c6283bd94323223bf26701dc 28-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> Add missing equals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145290 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
6f3ce979a7748fd117e6473d6272b16d643b6262 28-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Indexing API: If the client requested to get a CXTranslationUnit after
indexing, honor all the TU options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145229 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ultiplexConsumer.cpp
991bf49f68e8caeb900dd9738712b861073363d9 28-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Indexing API: Capture diagnostics during indexing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145228 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
4c7ce36a761b65a659aa6c4728a318e5d06f5f95 26-Nov-2011 Rafael Espindola <rafael.espindola@gmail.com> Set __OPTIMIZE_SIZE__ on -Os and -Oz. This matches gcc's behaviour on both OS X
and linux.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145142 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
2a710c84db1ebf0c16cba0ff121ca8e15f045a07 25-Nov-2011 Logan Chien <loganchien@google.com> Merge with clang upstream r145117 (Nov 25th 2011)

Change-Id: Id4fde985342e3c81f13887e8728bd94b82523642
c14a03dffff69b5e1c55cc118fc52d8fd9f3a28d 23-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Fix operations (token annotation, getting cursor, etc.) with a file region
inside an objc container that "contains" other file-level declarations.

When getting the array of file-level declarations that overlap with a file region,
we failed to report that the region overlaps with an objc container, if
the container had other file-level declarations declared lexically inside it.

Fix this by marking such declarations as "isTopLevelDeclInObjCContainer" in the AST
and handling them appropriately.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145109 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
b61968857fd2c6579b4dcd7bad65736e89d21185 22-Nov-2011 Kostya Serebryany <kcc@google.com> implement __has_feature(address_sanitizer); also use LangOpts.AddressSanitizer instead of CodeGenOpts.AddressSanitizer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145054 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c18c42345636e2866fed75c7e434fb659d747672 21-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Add driver arguments -ftemplate-depth=N and -fconstexpr-depth=N, with the same
semantics and defaults as the corresponding g++ arguments. The historical g++
argument -ftemplate-depth-N is kept for compatibility, but modern g++ versions
no longer document that option.

Add -cc1 argument -fconstexpr-depth N to implement the corresponding
functionality.

The -ftemplate-depth=N part of this fixes PR9890.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145045 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1b91ab467cffd44c222f1c5bed76910cce059a9e 21-Nov-2011 Peter Collingbourne <peter@pcc.me.uk> Delete the depfile if we could not open a header file. We cannot
generate any reasonable depfile if a header is missing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145019 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
8a0c5c2ec5c5496cfb01d2c86bd50991866a7356 18-Nov-2011 Ted Kremenek <kremenek@apple.com> Refine placement of LangOptions object in CompilerInvocation by adding a new baseclass CompilerInvocationBase with a custom copy constructor. This ensures that whenever the CompilerInvocation object's copy constructor is used we always clone the LangOptions object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144973 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
88c2596edc8eb475e20f6033de1ea01669695a0c 18-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change ASTConsumer::HandleTopLevelDecl to return true for the parser to continue
parsing or false to abort parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144943 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
STUnit.cpp
ultiplexConsumer.cpp
d3b74d9ca4f239a7a90ad193378c494306c57352 18-Nov-2011 Ted Kremenek <kremenek@apple.com> Make 'LangOptions' in CompilerInvocation a heap-allocated, reference counted object. I discovered that llvm::RefCountedBase<T> has
a bug where the reference count is copied in the copy constructor, which means that there were cases when the CompilerInvocation
objects created by ASTUnit were actually leaked. When I fixed that bug locally, it showed that a whole bunch of code assumed
that the LangOptions object that was part of CompilerInvocation was still alive. By making it heap-allocated and reference counted,
we can keep it around after the CompilerInvocation object goes away.

As part of this change, change CompilerInvocation:getLangOptions() to return a pointer, acting as another clue that this
object may outlive the CompilerInvocation object.

This commit doesn't fix the CompilerInvocation leak itself. That will come when I commit the fix to llvm::RefCountedBase<T> to
mainline LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144930 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
d04a982d3472d98e58f58dfc327ca11e236980f5 18-Nov-2011 Ted Kremenek <kremenek@apple.com> Simplify crash cleanup logic in ASTUnit::LoadFromCommandLine() by zeroing out two IntrusiveRefCnt pointers after we have assigned their respective values into fields of ASTUnit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144929 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1b4eca67e073f0beefb9924cbe6c65427869f1fa 16-Nov-2011 Kostya Serebryany <kcc@google.com> Add -f[no-]address-sanitizer flag

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144800 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
261e75bd10198c336aded42f0398a13f7bf88889 16-Nov-2011 Douglas Gregor <dgregor@apple.com> When building a module from a module map that isn't simply an umbrella
header, create our own in-memory buffer to parse all of the
appropriate headers, and use that to build the module. This isn't
end-to-end testable yet; that's coming next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144797 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
35593a9add85353532519f8eba5ec513a611aac5 16-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Fix crash on invalid code. Fixes rdar://10451854

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144766 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1432569f88c6da4da902df7571621f3ea3f76596 16-Nov-2011 Douglas Gregor <dgregor@apple.com> Switch some more of the modules tests over to "-emit-module-from-map",
and remove stray fprintf.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144742 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
db1cde7dc7bb3aaf48118bd9605192ab94a93635 16-Nov-2011 Douglas Gregor <dgregor@apple.com> Add support for building a module from a module map to the -cc1
interface. This is currently limited to modules with umbrella
headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144736 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendActions.cpp
d2536a604f59a3cca491f175bf1e49eeca49163b 15-Nov-2011 Douglas Gregor <dgregor@apple.com> Revert r144703. It was a dumb idea anyway; will add the new bits more
incrementally with a new frontend action.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144723 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendActions.cpp
b8691df825c99b0fc989fcd92a008d2500ff2e37 15-Nov-2011 Douglas Gregor <dgregor@apple.com> Split GenerateModuleAction into its own action, which will start
differing from GeneratePCHAction fairly soon.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144703 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendActions.cpp
b86b8dc7ef89405205f94635c1073cdb1a7093eb 15-Nov-2011 Douglas Gregor <dgregor@apple.com> Add a -cc1-level option -fmodule-name=<name>, which will be used when
building modules.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144680 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
99643d951e56359c1bead5ce70be3883a06b520a 15-Nov-2011 Chad Rosier <mcrosier@apple.com> Typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144672 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
496cc8eae2c69b8fd36a2b3e815dd0e8207ec493 15-Nov-2011 Chad Rosier <mcrosier@apple.com> Fix a regression from 143657. The second pass of the warning options should only be emitting
warnings/errors for unknown warning options. getDiagnosticsInGroup returns false if the
diagnostics is found and true otherwise. Thus, if we're reporting and we have a valid
diagnostic, we were actually setting the flag and causing mayhem.
rdar://10444207

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144670 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
dce6327160a6e333137b34cce77e2dfc2cd5aab6 15-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> Warning option typo correction: When two options have the same edit_distance don't display either.

Also add a maximum edit distance threshold, so we don't correct "-Wx" to "-W#pragma-messages".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144644 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
71d9a71d19099a6673750b47b32e9786803fa81d 15-Nov-2011 Logan Chien <loganchien@google.com> Merge with clang upstream r144605 (Nov 15th 2011)

Conflicts:
include/clang-c/Index.h
include/clang/AST/APValue.h
include/clang/AST/DeclBase.h
include/clang/AST/DeclObjC.h
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Serialization/ASTWriter.h
lib/AST/APValue.cpp
lib/AST/ASTImporter.cpp
lib/AST/DeclObjC.cpp
lib/AST/ExprConstant.cpp
lib/Driver/ToolChains.cpp
lib/Frontend/SerializedDiagnosticPrinter.cpp
lib/Frontend/Warnings.cpp
lib/Lex/HeaderSearch.cpp
lib/Lex/LiteralSupport.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaInit.cpp
lib/Sema/SemaPseudoObject.cpp
test/Analysis/misc-ps.c
test/Analysis/retain-release-path-notes.m
test/CodeGen/string-literal-unicode-conversion.c
test/CodeGenCXX/blocks.cpp
test/Driver/crash-cleanup.c
test/Misc/serialized-diags.c
test/Misc/warning-flags.c
tools/c-index-test/c-index-test.c
tools/libclang/CXLoadedDiagnostic.cpp
tools/libclang/IndexDecl.cpp
tools/libclang/IndexTypeSourceInfo.cpp
tools/libclang/Indexing.cpp
tools/libclang/IndexingContext.cpp
tools/libclang/IndexingContext.h
tools/libclang/libclang.exports

Change-Id: I6621e7d5d9a9d1e4cdec7b7b62ffa6dffaff375d
02ae32ae110eeb1ef785bf5ad9cdce1c001a5fa1 15-Nov-2011 Devang Patel <dpatel@apple.com> Remove extra ';'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144604 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
a70cb9db9dd79ca9fc1febbb2f331004297664e0 15-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> Print a typo correction hint for unknown warning flags.

$ clang -Wololo t.c
warning: unknown warning option '-Wololo'; did you mean '-Wall'? [-Wunknown-warning-option]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144591 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
48a60c042162fa57933e96907fd869b04b26f3be 11-Nov-2011 Stephen Hines <srhines@google.com> Update Clang to svn 144355.

Change-Id: I36bd8b4479f887ed75abb84021996aff77b33bd9
ndroid.mk
77692f01900b322b8c6f409c785f171877e44be3 11-Nov-2011 Douglas Gregor <dgregor@apple.com> I predict that HeaderSearch will need the ability to generate
diagnostics in the future. Make it so.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144347 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
c5ee7dea893904f3491087d0f7fd0d2e6cb9aae0 10-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> serialized diagnostics: simplify code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144277 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
b1c06eebf90e14208d16fc4434013a4b423775d9 10-Nov-2011 Ted Kremenek <kremenek@apple.com> serialized diagnostics: implement full deserialization of clang diagnostics via the libclang API.

I've tested it on simple cases and it works. Test cases to follow as well as a few tweaks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144269 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
72ff3231af5e0fa1c24e2279dd4b6430f6bb935e 08-Nov-2011 Ted Kremenek <kremenek@apple.com> serialized diagnostics: serialize the version info in a separate meta block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144115 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
8fd620d53fe8a186526447004de9626053fc16c1 07-Nov-2011 Douglas Gregor <dgregor@apple.com> ASTConsumer::handleTopLevelDecl will end up getting called for
function template instantiations. Fixes <rdar://problem/10398005> / PR11312.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143984 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5b077a99629d0394531745da14afa871e0fb41c4 07-Nov-2011 Chandler Carruth <chandlerc@gmail.com> Rip out one of the features I added for the driver-include-management.
We don't actually need a separate flag for non-sysrooted paths as the
driver has to manage the sysroot anyways. The driver is not infrequently
adding paths to the header search based on their existence on the
filesystem. For that, it has to add the sysroot anyways, we should pass
it on down to CC1 already joined. More importantly, the driver cannot in
all cases distinguish between sysrooted paths and paths that are
relative to the Clang binary's installation directory. Essentially, we
always need to ignore the system root for these internal header search
options. It turns out in most of the places we were already providing
the system root in the driver, and then another one in CC1 so this fixes
several bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143917 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c9b8daa1fb95f10d4d5c151697bbeefa17c93f70 05-Nov-2011 Chandler Carruth <chandlerc@gmail.com> Move the Linux header searching from the Frontend to the Driver. This is
the first (and diff-noisiest) step to making Linux header searching
tremendously more principled and less brittle. Note that this step
should have essentially no functional impact. We still search the exact
same set of paths in the exact same order. The only change here is where
the code implementing such a search lives.

This has one obvious negative impact -- we now pass a ludicrous number
of flags to the CC1 layer. That should go away as I re-base this logic
on the logic to detect a GCC installation. I want to do this in two
phases so the bots can tell me if this step alone breaks something, and
so that the diffs of the refactoring make more sense.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143822 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
09476d9498be9acd22508d99451f7c90af24447b 05-Nov-2011 Chandler Carruth <chandlerc@gmail.com> Fix a significant oversight in my move of MSVC includes to the driver:
actually manage the builtin header file includes as well as the system
ones.

This one is actually debatable whether it belongs in the driver or not,
as the builtin includes are really an internal bit of implementation
goop for Clang. However, they must be included at *exactly* the right
point in the sequence of header files, which makes it essentially
impossible to have this be managed by the Frontend and the rest by the
Driver. I have terrible ideas that would "work", but I think they're
worse than putting this in the driver and making the Frontend library
even more ignorant of the environment and system on which it is being
run.

Also fix the fact that we weren't properly respecting the flags which
suppress standard system include directories.

Note that this still leaves all of the Clang tests which run CC1
directly and include builtin header files broken on Windows. I'm working
on a followup patch to address that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143801 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
47ae192fe624c6a684140311fd2f6a70ccfce563 05-Nov-2011 Chandler Carruth <chandlerc@gmail.com> Add two flags to the CC1 layer that I was hoping to avoid. We need to
encode the *exact* semantics which the header search paths internally
built by the Frontend layer have had, which is both non-user-provided,
and at times adding the implicit extern "C" bit to the directory entry.

There are lots of CC1 options that are very close, but none do quite
this, and they are all already overloaded for other purposes. In some
senses this makes the command lines more clean as it clearly indicates
which flags are exclusively used to implement internal detection of
"standard" header search paths.

Lots of the implementation of this is really crufty, due to the
surrounding cruft. It doesn't seem worth investing lots of time cleaning
this up as it isn't new, and hopefully *lots* of this code will melt
away as header search inside of the frontend becomes increasingly
trivial.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143798 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
91471b7a9ca8532175ef87549d53c9a626011aad 05-Nov-2011 Ted Kremenek <kremenek@apple.com> serialized diagnostics: include FixIt information in serialized diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143776 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
8477fe9629d5c703323fcc2a4d8da249542ff166 05-Nov-2011 Ted Kremenek <kremenek@apple.com> serialized diagnostics: pull emission of filenames into diagnostic block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143765 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
feba931a500c0febd04f115f2b253a86112260fe 05-Nov-2011 Ted Kremenek <kremenek@apple.com> serialized diagnostics: pull emission of diagnostic flag string into diagnostics block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143764 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
ea124120425b4e75e7484708d133eb47f732fe48 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Serialized diagnostics: pull category name serialization into diagnostic blocks. The goal is to remove BLOCK_STRINGS so that the bitcode file can potentially be streamed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143763 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
020566e7490bdf83486a9817b3020b5f5144c165 05-Nov-2011 Ted Kremenek <kremenek@apple.com> serialized diagnostics: emit source ranges.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143762 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
a2c05e4ecdd9b6ff336d2326ddcaf2487a1fabd9 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Move definition of record/block IDs for serialized diagnostics to public header.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143761 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
b05d6c0ee5d2e4e7a75eabafa2b8e84cc7e1ab8c 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Serialized diagnostics: encode a 24 bit version number as part of the "magic number" of serialized diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143760 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
36d315e2b024ecf303bd8a4d7f9c605c83e571d2 05-Nov-2011 Ted Kremenek <kremenek@apple.com> serialized diagnostics: unique warning strings when emitting serialized diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143759 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
cd3bef922c165af760ac570f9ac126ccff4f6a95 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Serialized diagnostics: serialize "notes" as sub diagnostics of warnings and errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143758 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
124a25e285e180d2e5ade5bc52e78132a646982c 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Also include file modification time and size in output of SerializedDiagnosticPrinter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143757 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
b2cf89f50c2072d94c51a1128c2d6dbe9db6bdd1 05-Nov-2011 Chandler Carruth <chandlerc@gmail.com> Begin the migration of header search logic to the driver, starting with
Windows. There are still FIXMEs and lots of problems with this code.
Some of them will be addressed shortly by my follow-up patches, but most
are going to wait until we isolate this code and can fix it properly.
This version should be no worse than what we had before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143752 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f28958906e8e9d556e87c7dec2eac23452e16e21 04-Nov-2011 Devang Patel <dpatel@apple.com> Enable -flimit-debug-info by default. Now, clang lazily emits debug info for structs. Original behavior can be restored using -fno-limit-debug-info.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143733 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d35c03e77055bf74a4218354e8449636891fd6ac 03-Nov-2011 Chad Rosier <mcrosier@apple.com> Parse the warning options twice. The first pass sets diagnostic state, while
the second pass reports warnings/errors. This has the effect that we follow
the more canonical "last option wins" paradigm when there are conflicting
options.
rdar://10383776

Previously, we parsed the warning options in order. This caused non-intuitive
behavior:

1) clang test.c -Wnosuchwarning -Wno-unknown-warning-option
Before:
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
1 warning generated.
After:
[0 warning generated.]

2) clang test.c -Wnosuchwarning -Werror=unknown-warning-option
Before:
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
1 warning generated.
After:
error: unknown warning option '-Wnosuchwarning' [-Werror,-Wunknown-warning-option]

3) clang test.c -Werror=unknown-warning-option -Wnosuchwarning -Wno-error=unknown-warning-option -Wnosuchwarning
Before:
error: unknown warning option '-Wnosuchwarning' [-Werror,-Wunknown-warning-option]
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
After:
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
2 warnings generated.

4) clang test.c -Werror=unknown-warning-option -Wnosuchwarning -Wno-error=unknown-warning-option -Wno-unknown-warning-option -Wnosuchwarning
Before:
error: unknown warning option '-Wnosuchwarning' [-Werror,-Wunknown-warning-option]

After:
[0 warning generated.]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143657 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
fefddd361b1a618bf06372ae5093b0eccf003609 03-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> After resetting the diagnostic state, set the number of warning occurring in the preamble.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143647 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
e3263b91d1d99135d7efeec2398a1ae36ba5b2ad 03-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Fix crash when a #pragma diagnostic is included in the preamble.

A PCH file keeps track of #pragma diagnostics state; when loading the preamble, they conflicted
with the #pragma diagnostic state already present in the DiagnosticsEngine object due to
parsing the preamble.

Fix this by clearing the state of the DiagnosticsEngine object.
Fixes rdar://10363572 && http://llvm.org/PR11254.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143644 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1102af7beef0c9efa95ec325a1bf8ee03557c554 03-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Add infrastructure to be able to only deserialize decls in a file region and
use it for clang_getCursor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143605 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a95cba91ab8df9ebc1507e649e808968a9a16821 02-Nov-2011 Douglas Gregor <dgregor@apple.com> Fix various minor issues find via unreachable code warnings, from
Ahmed Charles!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143569 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
cef45adc46a295842783dec44fa2a8aa85fb2ae8 02-Nov-2011 Chandler Carruth <chandlerc@gmail.com> Add the newest Gentoo GCC version based on the reported installed
version in PR11298.

I hear-by apologize for adding yet more code to this monstrosity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143567 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
0e13ea6a2981316357824ff4265e7b8664d470b1 02-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Add an option to emulate the strange Apple gcc behavior of #pragma pack.

<rdar://problem/10374763>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143527 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
826ed07bdc9e58c689c5eb047efa4a7223c85e96 01-Nov-2011 Sebastian Pop <spop@codeaurora.org> rename getHostTriple into getDefaultTargetTriple in clang



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143503 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
1cbd4441f5b323d1a3d85d4b816ebd088ca330ab 01-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Put a reference of the ASTReader in the ASTUnit.

This is intended for direct access of the ASTReader for uses that make
little sense to try to shoehorn in the ExternalASTSource interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143465 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
4582249f476437e5f326f8f57eb8426fbc929419 31-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r143342. Caching of code-completion results was intentionally placed in "reparse"
because we don't want to take this performance hit when doing code completion

Log of r143342:
Move caching of code-completion results from ASTUnit::Reparse to ASTUnit::CodeComplete,
so that it will happen when we are doing code-completion, not reparsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143367 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
26d513ab52d19eaa7b236ec4b0ef0a12663d8946 31-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Add "just one more" include path to the monstrosity that is our header
search logic. The Debian multiarch seems to have completely changed from
when these were originally added, and I'd like to remove a bunch of
them, but I'll be lazy and delay that until this logic is hoisted into
the driver where it belongs.

This should resolve PR11223.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143345 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f93c619bc0b7bcd598cea5f46c91b223e4716556 31-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move caching of code-completion results from ASTUnit::Reparse to ASTUnit::CodeComplete,
so that it will happen when we are doing code-completion, not reparsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143342 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
bd463dc18423af5b0a3095c0bccb47243df375ea 31-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Have the ASTUnit associate the local declarations that get parsed with the file
that contains them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143338 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
7e770a0a4b685e1bb6b8d3847fa56ee67e952e31 30-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> Add support for lazily linking bitcode files (using a new
-mlink-bitcode-file flag), and more generally llvm::Modules, before
running optimisations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143314 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c820f183cd92d4a18de81b660a34f76e2cfdc463 29-Oct-2011 Ted Kremenek <kremenek@apple.com> Start work on SerializedDiagnosticPrinter, a new DiagnosticConsumer that serializes out the diagnostics for a given translation unit to a bit code file. This is a WIP.

The motivation for this new DiagnosticConsumer is to provide a way for tools invoking the compiler
to get its diagnostics via a libclang interface, rather than textually parsing the compiler output.
This gives us flexibility to change the compiler's textual output, but have a structured data format
for clients to use to get the diagnostics via a stable API.

I have no tests for this, but llvm-bcanalyzer so far shows that the emitted file is well-formed.

More work to follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143259 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInstance.cpp
ompilerInvocation.cpp
erializedDiagnosticPrinter.cpp
6fa4bf36a57af69d17b93c9135051f63ce2fff67 29-Oct-2011 Douglas Gregor <dgregor@apple.com> Give __STDC_VERSION__ the value 201001L when we're in C1x mode. The
committee hasn't set a value for __STDC_VERSION__ yet, so this is a
placeholder. But at least it's > 199901L.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143245 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
5bf27ab741084eb379b40bc5e08a71ba7c26fb49 29-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make -error-on-deserialized-decl work correctly by correctly delegating to
the previous ASTDeserializationListener.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143241 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
46ab5f5b9fdfd746a81d99ffc6672e7ee64d1eb0 27-Oct-2011 Ted Kremenek <kremenek@apple.com> Add mutex for accessing ASTUnit's global OnDisk data. This may be an issue as libclang could be processing multiple ASTUnit's at once.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143138 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
821f8a1741e3bb62456971ba17601a678bc82e0f 27-Oct-2011 Ted Kremenek <kremenek@apple.com> Move ASTUnit's handling of temporary files and the preamble file into a lazily-created static DenseMap. This DenseMap is cleared (and the files erased) via an atexit routine in the case an ASTUnit is not destroyed. Fixes <rdar://problem/10293367>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143115 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a34fc036dbab7528e7f351e3bd244663ca24448d 25-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] When visiting preprocessed entities, make it possible to avoid deserializing
preprocessed entities that are #included in the range that we are interested.

This is useful when we are interested in preprocessed entities of a specific file, e.g
when we are annotating tokens. There is also an optimization where we cache the last
result of PreprocessingRecord::getPreprocessedEntitiesInRange and we re-use it if
there is a call with the same range as before.

rdar://10313365

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142887 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
fd40ad41764a319d488fe30d86a9cb88c953b9a9 24-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Switch to a more natural formatting of the macro name printing.
Suggested by John McCall.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142836 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
60a4a2506cea321d5509b9dcfb332d084c06ec9c 24-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Make sure we don't try to erase past the StoredDiagnostics vector.

Ted came upon the bug but I couldn't make a test out of it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142805 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
3ead475e566acdebe2208b0e75cbdb97f6976bff 24-Oct-2011 Douglas Gregor <dgregor@apple.com> Make -fms-compatibility imply -fms-extensions. Fixes PR11204.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142797 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c8f2c405e2c57d11f4315f3f0cfc71d75ba6cfd5 21-Oct-2011 Nick Lewycky <nicholas@mxc.ca> Take DW_AT_comp_dir from $PWD when it's present and starts with a '/'. This is
closer to what GCC does, except that GCC also checks that the inodes for $PWD
and '.' match.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142633 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
022474a99ca65618379df4dbedd5bbbbb1d464be 20-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Define __STDC__ in -fms-extensions mode; defining it is consistent with gcc, and not defining it causes the system headers on multiple platforms to break with -fms-extensions because they assume the lack of a definition of __STDC__ implies a traditional (pre-ANSI) preprocessor. PR10324 and <rdar://problem/10313809> .



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142554 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
8e23806863721495f9e1f84aed614f7afba774a3 11-Nov-2011 Douglas Gregor <dgregor@apple.com> I predict that HeaderSearch will need the ability to generate
diagnostics in the future. Make it so.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144347 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
6eb29d25282e8683a8e8d369e8dddbb903dad69a 10-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> serialized diagnostics: simplify code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144277 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
153221717e39ce41323d5bc6b8b8bf130923c1bd 10-Nov-2011 Ted Kremenek <kremenek@apple.com> serialized diagnostics: implement full deserialization of clang diagnostics via the libclang API.

I've tested it on simple cases and it works. Test cases to follow as well as a few tweaks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144269 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
0b69aa856308f6b35f8b96ef269a482558f2966b 08-Nov-2011 Ted Kremenek <kremenek@apple.com> serialized diagnostics: serialize the version info in a separate meta block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144115 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
66e870029fdc1a36e79e62fd64430b527a318868 07-Nov-2011 Douglas Gregor <dgregor@apple.com> ASTConsumer::handleTopLevelDecl will end up getting called for
function template instantiations. Fixes <rdar://problem/10398005> / PR11312.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143984 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
07643086c6460095855573902d66aae1b08a6182 07-Nov-2011 Chandler Carruth <chandlerc@gmail.com> Rip out one of the features I added for the driver-include-management.
We don't actually need a separate flag for non-sysrooted paths as the
driver has to manage the sysroot anyways. The driver is not infrequently
adding paths to the header search based on their existence on the
filesystem. For that, it has to add the sysroot anyways, we should pass
it on down to CC1 already joined. More importantly, the driver cannot in
all cases distinguish between sysrooted paths and paths that are
relative to the Clang binary's installation directory. Essentially, we
always need to ignore the system root for these internal header search
options. It turns out in most of the places we were already providing
the system root in the driver, and then another one in CC1 so this fixes
several bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143917 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7d7e9f963a4977e36efb90fd9c369f33ced1a95a 05-Nov-2011 Chandler Carruth <chandlerc@gmail.com> Move the Linux header searching from the Frontend to the Driver. This is
the first (and diff-noisiest) step to making Linux header searching
tremendously more principled and less brittle. Note that this step
should have essentially no functional impact. We still search the exact
same set of paths in the exact same order. The only change here is where
the code implementing such a search lives.

This has one obvious negative impact -- we now pass a ludicrous number
of flags to the CC1 layer. That should go away as I re-base this logic
on the logic to detect a GCC installation. I want to do this in two
phases so the bots can tell me if this step alone breaks something, and
so that the diffs of the refactoring make more sense.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143822 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
103accc00cf1c9a09790ef487a9fb89ec0750fd7 05-Nov-2011 Chandler Carruth <chandlerc@gmail.com> Fix a significant oversight in my move of MSVC includes to the driver:
actually manage the builtin header file includes as well as the system
ones.

This one is actually debatable whether it belongs in the driver or not,
as the builtin includes are really an internal bit of implementation
goop for Clang. However, they must be included at *exactly* the right
point in the sequence of header files, which makes it essentially
impossible to have this be managed by the Frontend and the rest by the
Driver. I have terrible ideas that would "work", but I think they're
worse than putting this in the driver and making the Frontend library
even more ignorant of the environment and system on which it is being
run.

Also fix the fact that we weren't properly respecting the flags which
suppress standard system include directories.

Note that this still leaves all of the Clang tests which run CC1
directly and include builtin header files broken on Windows. I'm working
on a followup patch to address that.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143801 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ac2bc4d220a6263be96b943e9162f4a11149e26d 05-Nov-2011 Chandler Carruth <chandlerc@gmail.com> Add two flags to the CC1 layer that I was hoping to avoid. We need to
encode the *exact* semantics which the header search paths internally
built by the Frontend layer have had, which is both non-user-provided,
and at times adding the implicit extern "C" bit to the directory entry.

There are lots of CC1 options that are very close, but none do quite
this, and they are all already overloaded for other purposes. In some
senses this makes the command lines more clean as it clearly indicates
which flags are exclusively used to implement internal detection of
"standard" header search paths.

Lots of the implementation of this is really crufty, due to the
surrounding cruft. It doesn't seem worth investing lots of time cleaning
this up as it isn't new, and hopefully *lots* of this code will melt
away as header search inside of the frontend becomes increasingly
trivial.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143798 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
96dcadec26244e028d59287ea1b249802c8fc2bc 05-Nov-2011 Ted Kremenek <kremenek@apple.com> serialized diagnostics: include FixIt information in serialized diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143776 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
0d34e6ebd9d8b6e97106e12c13c6057f9829b946 05-Nov-2011 Ted Kremenek <kremenek@apple.com> serialized diagnostics: pull emission of filenames into diagnostic block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143765 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
3baf63d37d0b6267885b584db1106232fc036cb9 05-Nov-2011 Ted Kremenek <kremenek@apple.com> serialized diagnostics: pull emission of diagnostic flag string into diagnostics block.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143764 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
0dbadc4a8e54df02aab05d5fe45f2048a2e84c6d 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Serialized diagnostics: pull category name serialization into diagnostic blocks. The goal is to remove BLOCK_STRINGS so that the bitcode file can potentially be streamed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143763 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
2a20b4fac5d06e2afc4980e7ef1b659c39c27c7b 05-Nov-2011 Ted Kremenek <kremenek@apple.com> serialized diagnostics: emit source ranges.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143762 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
fdd0ced001babd4e65fb909cc2f847df53faf764 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Move definition of record/block IDs for serialized diagnostics to public header.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143761 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
069f9c29802f650a793877fa4c9a34853de9ed98 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Serialized diagnostics: encode a 24 bit version number as part of the "magic number" of serialized diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143760 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
45d92757f84bbf0fe2d996f482821628fd9cb016 05-Nov-2011 Ted Kremenek <kremenek@apple.com> serialized diagnostics: unique warning strings when emitting serialized diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143759 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
59b61613ed3b835f869b0f6fa1db52b8c963c5e5 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Serialized diagnostics: serialize "notes" as sub diagnostics of warnings and errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143758 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
28eac520cf4f95e81cb8d85ff34b96d96046d50d 05-Nov-2011 Ted Kremenek <kremenek@apple.com> Also include file modification time and size in output of SerializedDiagnosticPrinter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143757 91177308-0d34-0410-b5e6-96231b3b80d8
erializedDiagnosticPrinter.cpp
ca23419b8214654d185d595956e9ddf24984750a 05-Nov-2011 Chandler Carruth <chandlerc@gmail.com> Begin the migration of header search logic to the driver, starting with
Windows. There are still FIXMEs and lots of problems with this code.
Some of them will be addressed shortly by my follow-up patches, but most
are going to wait until we isolate this code and can fix it properly.
This version should be no worse than what we had before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143752 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
033be8bd33e0f84db8158771e13528e071563b73 04-Nov-2011 Devang Patel <dpatel@apple.com> Enable -flimit-debug-info by default. Now, clang lazily emits debug info for structs. Original behavior can be restored using -fno-limit-debug-info.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143733 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
05272a659437fc6ec7fa5a7c3f3fc6eb220a6fa2 03-Nov-2011 Chad Rosier <mcrosier@apple.com> Parse the warning options twice. The first pass sets diagnostic state, while
the second pass reports warnings/errors. This has the effect that we follow
the more canonical "last option wins" paradigm when there are conflicting
options.
rdar://10383776

Previously, we parsed the warning options in order. This caused non-intuitive
behavior:

1) clang test.c -Wnosuchwarning -Wno-unknown-warning-option
Before:
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
1 warning generated.
After:
[0 warning generated.]

2) clang test.c -Wnosuchwarning -Werror=unknown-warning-option
Before:
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
1 warning generated.
After:
error: unknown warning option '-Wnosuchwarning' [-Werror,-Wunknown-warning-option]

3) clang test.c -Werror=unknown-warning-option -Wnosuchwarning -Wno-error=unknown-warning-option -Wnosuchwarning
Before:
error: unknown warning option '-Wnosuchwarning' [-Werror,-Wunknown-warning-option]
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
After:
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
warning: unknown warning option '-Wnosuchwarning' [-Wunknown-warning-option]
2 warnings generated.

4) clang test.c -Werror=unknown-warning-option -Wnosuchwarning -Wno-error=unknown-warning-option -Wno-unknown-warning-option -Wnosuchwarning
Before:
error: unknown warning option '-Wnosuchwarning' [-Werror,-Wunknown-warning-option]

After:
[0 warning generated.]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143657 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
27368f9f1942a42b668cd1d9426859566c4f8540 03-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> After resetting the diagnostic state, set the number of warning occurring in the preamble.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143647 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
e6825d39e89362105171c013f4018c4d1134ad6f 03-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Fix crash when a #pragma diagnostic is included in the preamble.

A PCH file keeps track of #pragma diagnostics state; when loading the preamble, they conflicted
with the #pragma diagnostic state already present in the DiagnosticsEngine object due to
parsing the preamble.

Fix this by clearing the state of the DiagnosticsEngine object.
Fixes rdar://10363572 && http://llvm.org/PR11254.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143644 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
dfb332d0081c6641d1dbae6a2aeff757c99cc740 03-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Add infrastructure to be able to only deserialize decls in a file region and
use it for clang_getCursor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143605 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
21a25167b8279df3d8f889d041a4fd98733d3c27 02-Nov-2011 Douglas Gregor <dgregor@apple.com> Fix various minor issues find via unreachable code warnings, from
Ahmed Charles!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143569 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
27e66ad42e04294a9322c85bbc14c5d263b2650d 02-Nov-2011 Chandler Carruth <chandlerc@gmail.com> Add the newest Gentoo GCC version based on the reported installed
version in PR11298.

I hear-by apologize for adding yet more code to this monstrosity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143567 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
19bda3ad8b5d37e505214e82fab1d0a0bf00f0fd 02-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Add an option to emulate the strange Apple gcc behavior of #pragma pack.

<rdar://problem/10374763>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143527 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
5d8b9548420e67f1bf45b7bbc1cf9fb86e9e4505 01-Nov-2011 Sebastian Pop <spop@codeaurora.org> rename getHostTriple into getDefaultTargetTriple in clang



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143503 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
62ba9f61af6177992d8cd2e3306257e1213b1bd3 01-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Put a reference of the ASTReader in the ASTUnit.

This is intended for direct access of the ASTReader for uses that make
little sense to try to shoehorn in the ExternalASTSource interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143465 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
2fe17fc5ead5e42ef195618228bca53c79e0e50d 31-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r143342. Caching of code-completion results was intentionally placed in "reparse"
because we don't want to take this performance hit when doing code completion

Log of r143342:
Move caching of code-completion results from ASTUnit::Reparse to ASTUnit::CodeComplete,
so that it will happen when we are doing code-completion, not reparsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143367 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ef0faeadecf3f539d47616de2b7363412fb3ac50 31-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Add "just one more" include path to the monstrosity that is our header
search logic. The Debian multiarch seems to have completely changed from
when these were originally added, and I'd like to remove a bunch of
them, but I'll be lazy and delay that until this logic is hoisted into
the driver where it belongs.

This should resolve PR11223.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143345 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
092294918b5649cac05d6442aae75f7904ef772e 31-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move caching of code-completion results from ASTUnit::Reparse to ASTUnit::CodeComplete,
so that it will happen when we are doing code-completion, not reparsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143342 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
332cb9be88fd2d1b294a2fbc299c354e93be673c 31-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Have the ASTUnit associate the local declarations that get parsed with the file
that contains them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143338 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
22a7dfea585703d6755db69b83e29a0e6ee10369 30-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> Add support for lazily linking bitcode files (using a new
-mlink-bitcode-file flag), and more generally llvm::Modules, before
running optimisations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143314 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7800212ef29be314d55814e8dcc568ff8beed106 29-Oct-2011 Ted Kremenek <kremenek@apple.com> Start work on SerializedDiagnosticPrinter, a new DiagnosticConsumer that serializes out the diagnostics for a given translation unit to a bit code file. This is a WIP.

The motivation for this new DiagnosticConsumer is to provide a way for tools invoking the compiler
to get its diagnostics via a libclang interface, rather than textually parsing the compiler output.
This gives us flexibility to change the compiler's textual output, but have a structured data format
for clients to use to get the diagnostics via a stable API.

I have no tests for this, but llvm-bcanalyzer so far shows that the emitted file is well-formed.

More work to follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143259 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInstance.cpp
ompilerInvocation.cpp
erializedDiagnosticPrinter.cpp
5aa6dea4efe19f4c2e6600364123fb8899ec4af7 29-Oct-2011 Douglas Gregor <dgregor@apple.com> Give __STDC_VERSION__ the value 201001L when we're in C1x mode. The
committee hasn't set a value for __STDC_VERSION__ yet, so this is a
placeholder. But at least it's > 199901L.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143245 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
407ef9a9286a05bd286174471889295f6615c1b2 29-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make -error-on-deserialized-decl work correctly by correctly delegating to
the previous ASTDeserializationListener.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143241 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
e055f8a1d8a33511394302d38af7ab0fbd2c35fa 27-Oct-2011 Ted Kremenek <kremenek@apple.com> Add mutex for accessing ASTUnit's global OnDisk data. This may be an issue as libclang could be processing multiple ASTUnit's at once.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143138 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1872b3153a388b3a548c9f699cbc348128059be9 27-Oct-2011 Ted Kremenek <kremenek@apple.com> Move ASTUnit's handling of temporary files and the preamble file into a lazily-created static DenseMap. This DenseMap is cleared (and the files erased) via an atexit routine in the case an ASTUnit is not destroyed. Fixes <rdar://problem/10293367>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143115 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f226ff9fe8c8db6c5b74a61ce649eda1491c3502 25-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] When visiting preprocessed entities, make it possible to avoid deserializing
preprocessed entities that are #included in the range that we are interested.

This is useful when we are interested in preprocessed entities of a specific file, e.g
when we are annotating tokens. There is also an optimization where we cache the last
result of PreprocessingRecord::getPreprocessedEntitiesInRange and we re-use it if
there is a call with the same range as before.

rdar://10313365

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142887 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
9875c6020f6f2832e48c0d41910ba9fc99181670 24-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Switch to a more natural formatting of the macro name printing.
Suggested by John McCall.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142836 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
3e9d32656a8a3a787f64f9beeef66d2d700eb85d 24-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Make sure we don't try to erase past the StoredDiagnostics vector.

Ted came upon the bug but I couldn't make a test out of it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142805 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
0bb935c5e75250f9cab8efa7a95ebdd534c11602 24-Oct-2011 Douglas Gregor <dgregor@apple.com> Make -fms-compatibility imply -fms-extensions. Fixes PR11204.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142797 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
fe6bd6dc51777802a0118521b9039981a0e6a806 21-Oct-2011 Logan Chien <loganchien@google.com> Apply changes to migrate to upstream Oct 20th 2011 (r142531)

Change-Id: I32cdb5da2c07c84e01f42b4e87161196f468806a
ndroid.mk
00a92abaf907802bfa4d6f38bdd242c6bfc34c09 21-Oct-2011 Logan Chien <loganchien@google.com> Merge with clang upstream Oct 20th 2011 (r142531)

Change-Id: I42181113f38ce445f2a48694d6f654438562b71e
7c4fd9121f5885096fd3258d20a984e3f08f8603 21-Oct-2011 Nick Lewycky <nicholas@mxc.ca> Take DW_AT_comp_dir from $PWD when it's present and starts with a '/'. This is
closer to what GCC does, except that GCC also checks that the inodes for $PWD
and '.' match.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142633 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
85037d987a68b8bc9db22e4e1c18cac80b74ea1c 20-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Define __STDC__ in -fms-extensions mode; defining it is consistent with gcc, and not defining it causes the system headers on multiple platforms to break with -fms-extensions because they assume the lack of a definition of __STDC__ implies a traditional (pre-ANSI) preprocessor. PR10324 and <rdar://problem/10313809> .



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142554 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
024f4be866d13dd2b0ec062e694a62ca84c37191 18-Oct-2011 Daniel Dunbar <daniel@zuster.org> Frontend: Support -iframework.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142418 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ea523d73a6de06f828952a02f5ff86e4cc631695 18-Oct-2011 Nick Lewycky <nicholas@mxc.ca> Wire up support for the controlling the extended dwarf .file directive. With
r142300 but not this patch, clang -S may emit .s files that assemblers other
than llvm-mc can't parse.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142301 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
05edf668f0984bfa2994ddc8bb7b78d9fb24cf11 17-Oct-2011 Douglas Gregor <dgregor@apple.com> When building a module, use the macro definitions on the command line
as part of the hash rather than ignoring them. This means we'll end up
building more module variants (overall), but it allows configuration
macros such as NDEBUG to work so long as they're specified via command
line. More to come in this space.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142187 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
fe627b0e16e9a735891505325b670d0d3c51d2b9 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Hoist the logic I added to compute the macro name into a helper
function. No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142128 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
a47129e97be2379961046fac4f94f12ac15cb540 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Now that macro expansion notes are real notes and go through the same
formatting as any other diagnostic, they will be properly line wrapped and
otherwise pretty printed. Let's take advantage of that and the new factoring to
add some helpful information to them (much like template backtrace notes and
other notes): the name of the macro whose expansion is being noted. This makes
a world of difference if caret diagnostics are disabled, making the expansion
notes actually useful in this case. It also helps ensure that in edge cases the
information the user needs is present. Consider:

% nl -ba t5.cc
1 #define M(x, y, z) \
2 y
3
4 M(
5 1,
6 2,
7 3);

We now produce:
% ./bin/clang -fsyntax-only t5.cc
t5.cc:6:3: error: expected unqualified-id
2,
^
t5.cc:2:3: note: expanded from macro: M
y
^
1 error generated.

Without the added information in the note, the name of the macro being expanded
would never be shown.

This also deletes a FIXME to use the diagnostic formatting. It's not yet clear
to me that we *can* do this reasonably, and the production of this message was
my primary goal here anyways.

I'd love any comments or suggestions on improving these notes, their wording,
etc. Currently, I need to make them provide more helpful information in the
presence of a token-pasting buffer, and I'm pondering adding something along
the lines of "expanded from argument N of macro: ...".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142127 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
938ef249e9e5b5e3b7065c7f92b2578aa2dd971b 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Fix the original bug in our diagnostic printing that got me started on
this long quest: actually use the note printing machinery for each macro
expansion note rather than a hacky version of it. This will colorize and
format the notes the same as any other. There is still some stuff to fix
here, but it's one step closer.

No test case changes because currently we don't do anything differently
that I can FileCheck for -- I don't really want to try matching the
color escape codes... Suggestions for how to test this are welcome. =]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142121 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
4ba55659982bf45eedc9d32851815e5c4b6d8460 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Now that the structure of this is more reasonably laid out, fix a long
standing deficiency: we were providing no macro backtrace information
whenever caret diagnostics were turned off. This sinks the logic for
suppressing the code snippet and caret to the code that actually prints
tho code snippet and caret. Along the way, clean up the naming of
functions, remove some now fixed FIXMEs, and generally improve the
wording and logic of this process.

Add a test case exerecising this functionality. It is notable that the
resulting messages are extremely low quality. I'm working on a follow-up
patch that should address this and have left a FIXME in the test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142120 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
2ed3495278c13802a3d85578ab20560dcb0ef270 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Add proper doxyments to the entry point routine, and remove a dead parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142109 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
21a869aace45586125238fde88c477b330618a0b 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Persist the TextDiagnostic object across multiple diagnostics as long as
the SourceManager doesn't change, and the source files don't change.
This greatly simplifies the interfaces and interactions. The lifetime of
the TextDiagnostic object forms the 'session' over which we attempt to
condense and deduplicate information in diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142104 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
extDiagnosticPrinter.cpp
7531f571808201d44002fa38b67ee0a81e5ae936 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Clean up the names of all the TextDiagnostic methods (and even a static
function) to agree with the coding conventions, and in one case have
a bit more information in it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142088 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
extDiagnosticPrinter.cpp
6ddd8871c07ab161742e8ed37d3ef121ac79fa59 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Move two functions out of the public interface that shouldn't have ever
been there. Also delete their redundant doxyments in favor of those in
the source file. I'm putting the doxyments for private and static
helpers into the implementation file, and only the public interface
doxyments into the header. If folks have strong opinions about this type
of split, feel free to chime in, I'm happy to re-organize.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142087 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnostic.cpp
db463bb2e4a9751f4cbe53996db751e1985ee966 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Graduate the TextDiagnostic interface to its own header and source file,
making it accessible to anyone from the Frontend library. Still a good
bit of cleanup to do here, but its a good milestone. This ensures that
*all* of the functionality needed to implement the DiagnosticConsumer is
exposed via the generic interface in some form. No sneaky re-use of
static functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142086 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
extDiagnostic.cpp
extDiagnosticPrinter.cpp
1f3839e2574292ced2e629f758d8d697aa50719a 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Move the message printing to a class-static function so that it can be
part of the TextDiagnostic interface without requiring a full instance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142085 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
7eb84dc2504c8b2d1bb9e1247fd445cb16297360 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Move the diagnostic level printing into a class static helper. This will
allow the TextDiagnosticPrinter to continue using it even if
TextDiagnostic is implemented in a separate file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142084 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
03efd2efeeafc97db9a956df8c6ab88fbb6160da 16-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Rationalize the last bit of "arbitrary" state that is carried between
diagnostics to control suppression of redundant information. It now
follows the same model as all the other state, and has a bit more clear
semantics.

This is making the duality of the state a bit annoying, and I've added
a FIXME to resolve it. The problem is that I need to lift the
TextDiagnostic up into an externally visible layer before that can
happen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142083 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
d614040a678c994b0171234e7f5f9cf61e9f86fe 15-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Neither 'Warning' nor 'NonNote' was a good name for this location...
It's the last include-stack-root we tried to walk up. Use a better name
and better doxyments for it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142071 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
67e2d51a86b14a61e3c0e9c41224c7a8f020b4a6 15-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Nuke a bunch of FIXMEs that are now fixed. =] Also, remove the now-dead
TextDiagnosticPrinter argument to the TextDiagnostic helper class. This
cements the proper ordering of things: TextDiagnostic is now a viable
stand-alone class for emitting pretty-printed textual diagnostics to
a terminal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142070 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
cae9ab1a8af46643f8cf89399c9ccfb28fba0c36 15-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Sink the include stack printing into the generic text diagnostic
utility. This is a particularly nice win because it removes a pile of
parameters from these routines. Also name them a bit better. I'm trying
to follow the pattern of 'emit' routines writing directly to what is
expected to be the final output, while 'print' routines take a output
stream argument and can be used to build up intermediate buffers, etc.

Also, fix a bug I spotted by inspection from my last commit where
'LastLoc' and 'LastNonNoteLoc' were reversed. It's really scary that
this didn't trigger a single test failure. Will be working on tests for
more of this functionality now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142069 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
f54a61454e548fff63d6ce5700ecc2958297207e 15-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Rationalize some of how the locations of prior diagnostics are tracked
across emissions.

1) The include stack printing is conditioned on non-note diagnostics,
not just on warning diagnostics.
2) Those should be full source locations as they're tied to a source
manager.
3) We should pass in the prior state to the TextDiagnostic constructor,
allow it to mutate as diagnostics are emitted, and then cache the
final state before tearing it down.

Some of this remains incomplete, specifically #3 isn't finished for the
non-note location. That'll come when the include stack printing sinks
down a level.

This also highlights how *completely* bug-ridden this code is. For
example, we currently do all these comparisons of a FullSourceLoc and
a SourceLocation... which silently does a SourceLocation to
SourceLocation comparison, completely disregarding the source manager
from whence one of the arguments came. Oops! Good thing in practice this
wasn't important, but it could in theory be suppressing caret
diagnostics in a second TU on a single clang invocation. I'm hoping to
hammer these bugs out as the refactorings occur, although for so many of
them it's really unlikely I can dream up a test case that would show the
potentially buggy behavior.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142067 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
9ed3066cfe4545acec30aff63581d1a7b5c88128 15-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Sink the EmitDiagnosticLoc method down to the generic TextDiagnostic
interface now that its only caller is there.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142065 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
60e4a2a5e9bf534e106b0c2553d06e06c3d07794 15-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Sink the non-caret diagnostic logic down and out of the diagnostic
consumer. The TextDiagnostic interface now has a generic entry point for
emitting a diagnostic which uses a minimal interface that should be
compatible with StoredDiagnostics such as are available in libclang etc.

Some unfortunate shuffling of static functions as things get relocated.
Also some unfortunate public interface points added to
TextDiagnosticPrinter, but those are the next bits to get moved so they
won't last long.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142064 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
55c611021e771a816e6e3679928439f667f12eb9 15-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Simplify the interface of a helper method in the TextDiagnosticPrinter
to operate directly on the source location and ranges associated with
a diagnostic rather than digging them out of the diagnostic. This had
a side benefit of cleaning up its code a tiny bit by using the ArrayRef
interface.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142063 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
d79e4628da88b58e9913008ff32f2e1ca785a4e7 15-Oct-2011 Chandler Carruth <chandlerc@gmail.com> Change 'Emit' to 'EmitCaret' which sums up what it *should* be doing.
Also note that it is actually doing much more than it should. This paves
the way for building a more generic 'Emit' routine that is the real
entry point here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142035 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
abb5afadd11b19568359880faa5d966a4e33551c 14-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow calling ASTUnit::LoadFromCompilerInvocationAction with a previously created ASTUnit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142004 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
b8989f27f116ff2400e92a52c067a69846119eb5 14-Oct-2011 Benjamin Kramer <benny.kra@googlemail.com> Change operator<< for raw_ostream and NamedDecl to take a reference instead of a pointer.

Passing a pointer was a bad idea as it collides with the overload for void*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141971 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
a268fc0f2229eb132ebc8501b140093aeb5516bf 11-Oct-2011 Daniel Dunbar <daniel@zuster.org> Frontend: Replace -nostdinc by -nostdsysteminc (which is just system include
paths). The -nostdinc behavior is now -nostdsysteminc + -nobuiltininc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141691 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
c892c5fa92db137ff68d95afb13fe969d17f4fb2 11-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> For the FileChanged Preprocessor callback, when exiting a file, pass its FileID.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141681 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
eaderIncludeGen.cpp
rintPreprocessedOutput.cpp
a696ece1ac449a2b77e7c0a693b55cb10e9e2068 10-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] Implement ConcurrencyCheck using a recursive mutex to allow re-entrancy in the same thread.
The checks are performed only in DEBUG, it becomes no-op in release mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141582 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c91562ce427a88f4aa4d6c2b374f6f0937f5b6fc 10-Oct-2011 Francois Pichet <pichet2000@gmail.com> Revert r140009, about disabling clang's builtin in -fms-compatibility mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141577 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e305e81f65d13e6953f623a6b31176ad7041ba20 10-Oct-2011 Chad Rosier <mcrosier@apple.com> When an included non-system directory duplicates a system directory the clang
frontend removes the non-system directory to maintain gcc compatibility. When
this happens NumAngled needs to be updated.
PR11097

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141565 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ae57eadbc1a923efb72924765445db915cc23a9b 10-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> OpenCL: add driver/frontend support for precompiled headers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141516 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
0caed281f7f47713ae8be61ed75bac03596e1add 08-Oct-2011 NAKAMURA Takumi <geek4civic@gmail.com> lib/Frontend/CompilerInstance.cpp: Suppress a "Comparision of unsigned and signed" warning on Cygwin gcc-4.3.4.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141488 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
a789ca9b967abe47b84df83bcf4afb150856a8d9 08-Oct-2011 NAKAMURA Takumi <geek4civic@gmail.com> Whitespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141486 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
5e1cdac63c3d9c9b32fa41fa0b2d242a58a20d49 07-Oct-2011 John McCall <rjmccall@apple.com> Rename TagDecl::isDefinition -> isCompleteDefinition
for better self-documenting code, since the semantics
are subtly different from getDefinition().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141355 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
d51e43af0b3a6897b971f316c4de2035ec82d1f2 06-Oct-2011 Peter Collingbourne <peter@pcc.me.uk> CUDA: add -fcuda-is-device flag

This frontend-only flag is used by the IR generator to determine
whether to filter CUDA declarations for the host or for the device.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141301 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
88934e85f81abdc4fb5202325252be3bcab5ebf0 05-Oct-2011 Daniel Dunbar <daniel@zuster.org> Driver & AST: Implement support for -fpack-struct and -fpack-struct= command
line options.
- <rdar://problem/10120602>, PR9631

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141211 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
2572849d5ee3e5729a89ca934e1b04199eec5a5b 05-Oct-2011 Douglas Gregor <dgregor@apple.com> Seriously ugly hack, part 2

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141181 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
1872e7916ce14a0a0b697eed534e27cb4d2b9ec2 05-Oct-2011 Douglas Gregor <dgregor@apple.com> Seriously ugly hack to try to get the Windows builders back online

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141180 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
2bc750700487163e31e4f67cd0e0886868209e3c 05-Oct-2011 Douglas Gregor <dgregor@apple.com> Introduce a simple file-based locking protocol for on-demand module
creation, so that only a single Clang instance will rebuild a given
module at once (and the others will wait).

We still don't clean up the lock files when we crash, which is a
rather unfortunate problem. I'll handle that next, and there is
certainly a *lot* of room for further improvements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141179 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ef48e053f98391d3df2818307160de16988227a5 04-Oct-2011 Justin Holewinski <justin.holewinski@gmail.com> Fix include path detection on Fedora 15 with GCC 4.6.1. Patch by Arthur Haas.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141086 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
10a82cde7c317c5dd41dc3faf17f503c52ce2a3d 04-Oct-2011 Bob Wilson <bob.wilson@apple.com> Rip out flags for controlling C++ "production mode" separately.

This is old leftover cruft from the days when C++ was not yet ready
for prime time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141063 91177308-0d34-0410-b5e6-96231b3b80d8
reateInvocationFromCommandLine.cpp
0ced799878d1beb8f0fa1cc31fa6d2e4229c217c 04-Oct-2011 Douglas Gregor <dgregor@apple.com> When build a module on demand, run the module-building job on a
separate thread with the "suitably large" stack, so we don't blow the
stack when building modules recursively.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141051 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
d1e40d5389a4382cbebc97d54792f41ee0414af4 02-Oct-2011 John McCall <rjmccall@apple.com> Make -fobjc-nonfragile-abi the -cc1 default, since it's the
increasingly prevailing case to the point that new features
like ARC don't even support the fragile ABI anymore.

This required a little bit of reshuffling with exceptions
because a check was assuming that ObjCNonFragileABI was
only being set in ObjC mode, and that's actually a bit
obnoxious to do.

Most, though, it involved a perl script to translate a ton
of test cases.

Mostly no functionality change for driver users, although
there are corner cases with disabling language-specific
exceptions that we should handle more correctly now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140957 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d30952838421ddfb9f7e346b2ba8213889a5f789 30-Sep-2011 Anna Zaks <ganna@apple.com> [analyzer] Add -analyzer-purge option which can take on multiple values, remove -analyzer-purge=none. (Small refactor as well: move the work of constructing AnalysisManager from the callers to the class itself.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140838 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
76101cfe52d1b56974bf0e316247b3201f87c463 29-Sep-2011 Daniel Dunbar <daniel@zuster.org> Basic/Diagnostics: Add an isDefaultMappingAsError method, and switch TextDiagnosticPrinter to use that instead of extracting the current mapping via getDiagnosticLevel, which fixes one class of corner cases w.r.t. printing the "-Werror" diagnostic option marker.
- The TextDiagnosticPrinter code is still fragile as it is just "reverse engineering" what the diagnostic engine is doing. Not my current priority to fix though.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140752 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
4aa8f2bce0f498152d624f748712a991adc23fdd 29-Sep-2011 Daniel Dunbar <daniel@zuster.org> Basic/Diagnostic: Factor out
DiagnosticsEngine::setDiagnosticGroup{ErrorAsFatal,WarningAsError} methods which
more accurately model the correct API -- no internal change to the diagnostics
engine yet though.
- Also, stop honoring -Werror=everything (etc.) as a valid (but oddly behaved) option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140747 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
08d6acf6e5efa6df57345922d412476127f856fc 29-Sep-2011 Douglas Gregor <dgregor@apple.com> Introduce an opt-in warning when a module is being implicitly built
from sources.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140746 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
aee526e77657afd1600276450e9c346953ad51d7 29-Sep-2011 Douglas Gregor <dgregor@apple.com> Introduce a pure virtual clone() method to DiagnosticConsumer, so that
we have the ability to create a new, distict diagnostic consumer when
we go off and build a module. This avoids the currently horribleness
where the same diagnostic consumer sees diagnostics for multiple
translation units (and multiple SourceManagers!) causing all sorts of havok.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140743 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ogDiagnosticPrinter.cpp
extDiagnosticBuffer.cpp
extDiagnosticPrinter.cpp
erifyDiagnosticConsumer.cpp
cc78c6c6152b6c30b069769b45716e0ae6519211 29-Sep-2011 Chad Rosier <mcrosier@apple.com> [driver] Add basic support for escaping XML characters in CC_LOG_DIAGNOSTICS
strings.
rdar://9696709

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140732 91177308-0d34-0410-b5e6-96231b3b80d8
ogDiagnosticPrinter.cpp
ed73b1046d1f30d64b47baaaeaaeffa6ef0dde91 28-Sep-2011 Douglas Gregor <dgregor@apple.com> Remove the egregious hack that made Objective-C++ ARC work with older
versions of libc++. Newer versions of libc++ know how to deal with ARC
properly. Fixes <rdar://problem/10062179>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140651 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
30c42404202d2e2512e51efc6066bd614cfdb5a4 28-Sep-2011 Douglas Gregor <dgregor@apple.com> When 'bool' is not a built-in type but is defined as a macro, print
'bool' rather than '_Bool' within types, to make things a bit more
readable. Fixes <rdar://problem/10063263>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140650 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
64b0cee15206d55913240dca676ed3f340c60926 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Add back support for a manually formatted section of the diagnostic
message. Specifically, we now only line-wrap the first line of te
diagnostic message and assume the remainder is manually formatted. While
adding it back, simplify the logic for doing this.

Finally, add a test that ensures we actually preserve this feature. =D
*Now* its not dead code. Thanks to Doug for the test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140538 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
e6d1dff47d17154e99a98c499ee399df70a4bcf1 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Hoist and beef up the asserts about the level of infrastructure expected
when working with a diagnostic attached to a source location. Also
comment more thoroughly why its important to handle non-location
diagnostic messages separately.

Finally, hoist the creation of the TextDiagnostic object up to the
beginning of the location-based diagnostics. This paves the way for
sinking more and more of the logic into this class. When everything
below this constructor is sunk into the TextDiagnostic class it should
be sufficiently "feature complete" to accomplish my two goals:
1) Have the printing of a macro expansion note use the exact same code
as any other note.
2) Be able to implement clang_formatDiagnostic in terms of this class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140526 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
0ef898865aaec8c99addee23d01e03c7abdbd2b3 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Switch the emission of diagnostics without a source location to
a dedicated path. The logic for such diagnostics is much simpler than
for others.

This begins to make an important separation in this routine. We expect
most (and most interesting) textual diagnostics to be made in the
presence of at least *some* source locations and a source manager.
However the DiagnosticConsumer must be prepared to diagnose errors even
when the source manager doesn't (yet) exist or when there is no location
information at all. In order to sink more and more logic into the
TextDiagnostic class while minimizing its complexity, my plan is to
force the DiagnosticConsumer to special case diagnosing any locationless
messages and then hand the rest to the TextDiagnostic class. I'd
appreciate any comments on this design. It requires a bit of code
duplication in order to keep interfaces simple. Alternatively, if we
really need TextDiagnostic to be capable of handling diagnostics even in
the absence of a viable SourceManager, then this split isn't necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140525 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
75c1befb4592387ef1bec3bff5f0f5c0c931ea84 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Extract the actual printing of the message string into a helper
function. Doing this conveniently requires moving the word wrapping to
use a StringRef which seems generally an improvement. There is a lot
that could be simplified in the word wrapping by using StringRef that
I haven't looked at yet...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140524 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
8dcdde12e6c98b92e0210cbacf48f801c7c87303 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Group the helpers for word wrapping with the primary routine. No
functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140523 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
ee0f84fc84ed7de7975e102668d8e53a778f7a8c 26-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't map a file:line:col triplet that is inside the preamble range to
a "loaded" location of the precompiled preamble.

Instead, handle specially locations of preprocessed entities:
-When looking up for preprocessed entities, map main file locations inside the
preamble range to a preamble loaded location.
-When getting the source range of a preprocessing cursor, map preamble loaded
locations back to main file locations.

Fixes rdar://10175093 & http://llvm.org/PR10999

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140519 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a65cb0ced55c8a382e8d42881983f84793b4d5b6 26-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Don't print a stray ] at the end of diagnostics.

Also remove an obsolete utostr call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140511 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
3a2180910a2e6008c2c282f885708d822d2f12c2 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Remove support for splitting word-wrapped diagnostic messages on newline
characters. I could find no newline character in a diagnostic message,
and adding an assert to this code never fires in the testsuite.

I think this code is essentially dead, and was previously used for
a different purpose. If I just don't understand how it is we can end up
with a newline here please let me know (with a test case?) and I'll
revert.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140497 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
45b19dea3633737cabdd9a86477f7f2e07024595 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Move the word wrapped printing routine down to all the other helper
printing routines, clean up its doxyments and switch it to a camelCase
name as well. No functionality changed here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140496 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
a3ba6bbac30a3bec488ee7071d203df9d8bcd05d 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Switch some of my recently added helper functions to use the proper
style, and add doxyments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140495 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
253d41d74cd449742fd8642753c3076514fb99c5 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Rewrite the printing of diagnostic options, categories, etc to actually
use the ostream interface and avoid lots of temporary strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140494 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
40847cfb58acc3cac7d68727df9455ac45f2e118 26-Sep-2011 David Blaikie <dblaikie@gmail.com> Rename DiagnosticInfo to Diagnostic as per issue 5397


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140493 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ogDiagnosticPrinter.cpp
extDiagnosticBuffer.cpp
extDiagnosticPrinter.cpp
erifyDiagnosticConsumer.cpp
c3516afb24f62e974e3e8db51437e72deab28b7e 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Delete an extraneous line I missed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140491 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
53a529ee614d6a854814273ac49587a03b71a46b 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> A direct extraction of the rest of the option printing into a helper.
This needs to be cleaned up to better use the ostream object, WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140490 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
621bc69624599da62abd9bc9e5edd8a63ac99fe6 26-Sep-2011 David Blaikie <dblaikie@gmail.com> Rename VerifyDiagnosticsClient to VerifyDiagnosticConsumer as per issue 5397


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140489 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInstance.cpp
erifyDiagnosticConsumer.cpp
erifyDiagnosticsClient.cpp
761457827001290ca96bd2d5b05f182d21f28296 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Start a more correct pattern for factoring out the name printing. Slowly
I'm planning to switch a bunch of these over to use a raw_ostream
instead of += on a string object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140488 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
a629004ec698daec414b00d773f6a73d8465ef8d 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Revert r140484. That was *not* ready to be committed! Only halfway done,
and completely broken at that.

Sorry, must remember to stash rather than commit. =]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140487 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
534ed20bd2956b912da911f02b39be6b15cb68ec 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Fix a formatting goof.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140486 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
4e85b8ae413fa00fa42aa3e625c2db3b1932f8d3 26-Sep-2011 David Blaikie <dblaikie@gmail.com> Rename ChainedDiagnosticClient to ChainedDiagnosticConsumer as per issue 5397


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140485 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
89645bab0bd889b03339e69ea949f5edaa2f1081 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Extract the diagnostic message formatting into a helper routine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140484 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
26e7a90c7c74b0ecd8d3f19e216c72a8849017ae 26-Sep-2011 David Blaikie <dblaikie@gmail.com> Rename StoredDiagnosticClient to StoredDiagnosticConsumer as per issue 5397


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140483 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
99c4e5bcb93ec0b053bdba48b56939479562f11d 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Extract the logic for printing a colorful level name into a helper
function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140481 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
78ad0b98848c17a0a11847fa1d456e2dfec8aa2f 26-Sep-2011 David Blaikie <dblaikie@gmail.com> Rename DiagnosticClient to DiagnosticConsumer as per issue 5397


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140479 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ogDiagnosticPrinter.cpp
extDiagnosticBuffer.cpp
extDiagnosticPrinter.cpp
erifyDiagnosticsClient.cpp
d6471f7c1921c7802804ce3ff6fe9768310f72b9 26-Sep-2011 David Blaikie <dblaikie@gmail.com> Rename Diagnostic to DiagnosticsEngine as per issue 5397


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140478 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
rontendAction.cpp
nitPreprocessor.cpp
ogDiagnosticPrinter.cpp
extDiagnosticBuffer.cpp
extDiagnosticPrinter.cpp
erifyDiagnosticsClient.cpp
arnings.cpp
026cb7604c8ef0bc7032e4c067500907d03b67a3 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Inline this method now that its completely trivial, and prepare for
hoisting parts of the text diagnostic.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140477 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
18fc0025b01472e3961e35a817aaf49fffb333df 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Shuffle some names around. 'CaretDiagnostic' is inaccurate as this needs
to handle non-caret diagnostics as well in order to be fully useful in
libclang etc. Also sketch out some more of my plans on this refactoring.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140476 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
8be5c159df96c88880a50086a41efc86b89a46a4 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Actually remove the members of CaretDiagnostic no longer in use for
tracking the start and stop of macro expansion suppression. Also remove
the Columns variable which was just a convenience variable based on
DiagOpts. Instead we materialize it in the one piece of code that cared.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140475 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
b9c398b25b9c24769fb30b90c3805a500806e06f 26-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Sink the logic for suppressing some macro expansion notes from the
TextDiagnosticPrinter into the CaretDiagnostic class. Several
interesting results from this:

- This removes a significant per-diagnostic bit of state from the
CaretDiagnostic class, which should eventually allow us to re-use the
object.
- It removes a redundant recursive walk of the macro expansion stack
just to compute the depth. We don't need the depth until we're
unwinding anyways, so we can just mark when we reach it.
- It also paves the way for several simplifications we can do to how we
implement the suppression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140474 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
a02a8a984f338076c87fd5aa61dca46ab90f27f4 25-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Split the recursive macro expansion walk out from the routine which
emits a source snippet and caret line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140467 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
10efbaf8632e61e7d329a98c71641d1e839dfa4c 24-Sep-2011 Douglas Gregor <dgregor@apple.com> Don't translate CRLF files into LF files. Fixes PR6870, from Aaron Ballman!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140435 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
548f6c8e8010b181cb151df92f0a989363cb993e 23-Sep-2011 David Blaikie <dblaikie@gmail.com> More missing header inclusions from llvm_unreachable migration.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140369 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticBuffer.cpp
extDiagnosticPrinter.cpp
b219cfc4d75f0a03630b7c4509ef791b7e97b2c8 23-Sep-2011 David Blaikie <dblaikie@gmail.com> Switch assert(0/false) llvm_unreachable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140367 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ompilerInvocation.cpp
extDiagnosticBuffer.cpp
extDiagnosticPrinter.cpp
c535d9730e11ca335790359bfbd4600be71c5410 23-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Reenable -cxx-isystem for Objective C++, until I come up with a better solution

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140365 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
47adebef0df6dce752fe9a45e9190e8005b5d07c 22-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Add support for CPATH and friends.

This moves the existing code for CPATH into the driver and adds the environment lookup and path splitting there.
The paths are then passed down to cc1 with -I options (CPATH), added after the normal user-specified include dirs.
Language specific paths are passed via -LANG-isystem and the actual filtering is performed in the frontend.

I tried to match GCC's behavior as close as possible

Fixes PR8971.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140341 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
37c31c2e050856f87efd652958352181e72e5dea 21-Sep-2011 Tobias Grosser <grosser@fim.uni-passau.de> In the OpenCL mode, the AltiVec mode must be off and checks must be strict

OpenCL is different from AltiVec in the way it supports vector literals. OpenCL
is strict with regards to semantic checks. For example, implicit conversions
and explicit casts between vectors of different types are disallowed.

Fixes PR10975. Submitted by: Anton Lokhmotov <Anton.lokhmotov@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140270 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
47fcd293a526e898437b8fe1696310ccf92dd8e5 20-Sep-2011 Eric Christopher <echristo@apple.com> Remove __WCHAR_UNSIGNED__ and anything that used it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140155 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
92ddef1bf843e1e18c040d69f48a6bf0bc7c776a 19-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> In libclang, when visiting preprocessed entities in a source range, use
PreprocessingRecord's getPreprocessedEntitiesInRange.

Also remove all the stuff that were added in ASTUnit that are unnecessary now
that we do a binary search for preprocessed entities and deserialize only
what is necessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140063 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
b6441ef9b7285bd1aa77b05b10f473f7a3f413e7 19-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce local_begin()/local_end() methods in PreprocessingRecord which
return iterators for local, non-loaded, preprocessed entities.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140062 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
507097ec40105ed927cb5a744fad98f5875aacac 19-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] When getting a source location from a file:line:col triplet
check whether the requested location points inside the precompiled preamble,
in which case the returned source location will be a "loaded" one.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140060 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
a64ccefdf0ea4e03ec88805d71b0af74950c7472 19-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.

It already works (and is useful with) macro locs as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140057 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticsClient.cpp
9850ae1decf10021475bd5d15a6dad949ddd67c0 19-Sep-2011 Francois Pichet <pichet2000@gmail.com> Do not use builtin includes if -fms-compatibility is specified. Some MSVC header files have the same name as clang's builtins, this creates clash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140009 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
62ec1f2fd7368542bb926c04797fb07023547694 17-Sep-2011 Francois Pichet <pichet2000@gmail.com> Rename LangOptions::Microsoft to LangOptions::MicrosoftExt to make it clear that this flag must be used only for Microsoft extensions and not emulation; to avoid confusion with the new LangOptions::MicrosoftMode flag.

Many of the code now under LangOptions::MicrosoftExt will eventually be moved under the LangOptions::MicrosoftMode flag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139987 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
rintPreprocessedOutput.cpp
ae55608a29d61737b7c5390e2d1bb30ab8d5febb 17-Sep-2011 Francois Pichet <pichet2000@gmail.com> As per discussion with Doug Gregor on the IRC channel, introduce a new compiler switch: -fms-compatility.

Microsoft specific tweaking will now fall into 2 categories:

- fms-extension: Microsoft specific extensions that should never change the meaning of an otherwise well formed code. Currently map to LangOptions::Microsoft. (To be clearer, I am planning to change the name to LangOptions::MicrosoftExt).

- fms-compatibility: Really a MSVC emulation mode. Map to LangOptions::MicrosoftMode. Can change the meaning of an otherwise standard conformant program.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139978 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
fba18aa8f2cd1994dc65e8cb9f4be201c560dc0b 16-Sep-2011 Douglas Gregor <dgregor@apple.com> Add an experimental flag -fauto-module-import that automatically turns
#include or #import direcctives of framework headers into module
imports of the corresponding framework module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139860 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
nitPreprocessor.cpp
b2d39c217b2cfe87cbe69f25df83869940d8adcd 15-Sep-2011 Douglas Gregor <dgregor@apple.com> Comment what's going on when we compile a module

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139837 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
4ebd45f4279d84416568ada6adf56044bdf391b7 15-Sep-2011 Douglas Gregor <dgregor@apple.com> Detect cyclic module dependencies in a manner that is rather more
graceful than running out of stack space.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139833 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
7489889dd4e0fb5cd4b4176c59283da3b217f14e 15-Sep-2011 Douglas Gregor <dgregor@apple.com> Eliminate the list of modules from the preprocessor options. This was
used back when we had an -import-module command-line option, but it's
no longer used (or useful).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139829 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
531dcce3e5f5d5234520df7593e285d7dd007456 15-Sep-2011 Douglas Gregor <dgregor@apple.com> Eliminate the unused -create-module cc1-level option

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139827 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1a995ddaa53a20dcd063ea47eb1f533ecb0d243a 15-Sep-2011 Douglas Gregor <dgregor@apple.com> When we load the first module, make sure that we wire up the ASTConsumer to the newly-created ASTReader. This makes sure that CodeGen sees the declarations it is interested in

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139824 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
e24692b30adbe8144597678a0e3354912e99c747 15-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [PCH] Overhaul how preprocessed entities are [de]serialized.

-Use an array of offsets for all preprocessed entities
-Get rid of the separate array of offsets for just macro definitions;
for references to macro definitions use an index inside the preprocessed
entities array.
-Deserialize each preprocessed entity lazily, at first request; not in bulk.

Paves the way for binary searching of preprocessed entities that will offer
efficiency and will simplify things on the libclang side a lot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139809 91177308-0d34-0410-b5e6-96231b3b80d8
ultiplexConsumer.cpp
de8a9050d79d66325a18168a0994fed125a7790d 15-Sep-2011 Douglas Gregor <dgregor@apple.com> Make -E work with module imports

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139750 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
815759cb08d5b91e2585b200bcf20822e0d422ad 14-Sep-2011 Douglas Gregor <dgregor@apple.com> Encode the module hash in base-36, to reduce the length of the strings a bit

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139696 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
76d991ec6c5cd247ee18fe65c35d43c2d47cf094 14-Sep-2011 Douglas Gregor <dgregor@apple.com> Assert that the module hash produced after stripping away non-modular options is the same as the module hash before stripping those options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139663 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
6e975c4517958bcc11c834336d340797356058db 14-Sep-2011 Douglas Gregor <dgregor@apple.com> For modules, use a hash of the compiler version, language options, and
target triple to separate modules built under different
conditions. The hash is used to create a subdirectory in the module
cache path where other invocations of the compiler (with the same
version, language options, etc.) can find the precompiled modules.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139662 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
nitHeaderSearch.cpp
1c7e0472f5683a8ade62285f366637050cf113e5 13-Sep-2011 Douglas Gregor <dgregor@apple.com> When building a module on-demand, clear out the "non-modular" language
and preprocessor options (such as macro definitions) first.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139638 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
e289d81369914678db386f6aa86faf8f178e245d 13-Sep-2011 Douglas Gregor <dgregor@apple.com> Switch LangOptions over to a .def file that describes header of the
language options. Use that .def file to declare the LangOptions class
and initialize all of its members, eliminating a source of annoying
initialization bugs.

AST serialization changes are next up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139605 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
78243658c533168d51fd076fba328437932ba6f1 13-Sep-2011 Douglas Gregor <dgregor@apple.com> When compiling a module on-demand, re-use the diagnostics client
already provided. This required a little bit of clean-up in the way
that VerifyDiagnosticsClient managed ownership of its underlying
"primary" client, because now it will no longer always take ownership.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139570 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
erifyDiagnosticsClient.cpp
21cae2059a06f7d89eee169409c9266def1b1aca 13-Sep-2011 Douglas Gregor <dgregor@apple.com> When an import statement fails to find a module in the module cache,
but there is a corresponding umbrella header in a framework, build the
module on-the-fly so it can be immediately loaded at the import
statement. This is very much proof-of-concept code, with details to be
fleshed out over time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139558 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
9a6da6930644b4f2dbe4885b0eb4fc1274ff56a4 12-Sep-2011 Douglas Gregor <dgregor@apple.com> Introduce a cc1-level option to provide the path to the module cache,
where the compiler will look for module files. Eliminates the
egregious hack where we looked into the header search paths for
modules.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139538 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
nitHeaderSearch.cpp
26d43cd3a088d4f1f1645328db3b73afbc7eaa61 12-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [libclang] In ASTUnit::Parse copy the CompilerInvocation object instead of
modifying directly for the preamble.

This avoids an awful, hard to find, bug where "PreprocessorOpts.DisablePCHValidation = true"
would be persistent for subsequent reparses of the translation unit which would result
in defines, present in command-line but not in the PCH, being ignored.

Fixes rdar://9615399.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139512 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
eced60c185c92a34953090b98d8458fb2df9dc81 12-Sep-2011 Douglas Gregor <dgregor@apple.com> Only predefine the __EXCEPTIONS macro if C++ exceptions are turned on.
Only predefine the OBJC_ZEROCOST_EXCEPTIONS macro if Objective-C
exceptions are turned on. Fixes PR10910.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139496 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
08e0bc16b3312c27e87d33be7dcf3d4fe5bdd2e2 10-Sep-2011 Douglas Gregor <dgregor@apple.com> Kill of the Decl::PCHLevel field entirely. We now only need to know
whether a Decl was deserialized from an AST file (any AST file).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139438 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
13db5cfc4e5f03eb70efe0d227b53b8280f16161 09-Sep-2011 John McCall <rjmccall@apple.com> Treat the weak export of block runtime symbols as a deployment-target
feature akin to the ARC runtime checks. Removes a terrible hack where
IR gen needed to find the declarations of those symbols in the translation
unit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139404 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
5770bb707db9169c258859a9e7c935f99a32d64c 07-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Extract the emission of the diagnostic's location into a separate
function. This is really the beginning of the second phase of
refactorings here. The end goal is to have (roughly) three interfaces:

1) Base class to format a single diagnostic suitable for display on the
console.
2) Extension of the base class which also displays a caret diagnostic
suitable for display on the console.
3) An adaptor that implements the DiagnosticClient by delegating to #1
and/or #2 as appropriate.

Once we have these, things like libclang's formatDiagnostic can use #1
and #2 to provide really well formatted (and consistently formatted!)
textual formatting of diagnostics.

Getting there is going to be quite a bit of shuffling. I'm basically
sketching out where the interface boundaries can be drawn for #1 and #2
within the existing classes. That lets me shuffle with a minimum of fuss
and delta. Once that's done, and any of the related interfaces that need
to change are updated, I'll hoist these into separate headers and
re-implement libclang in terms of their interfaces. Long WIP, but
comments at each step welcome. =D

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139228 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
6c57ccec994f09d732a381bb4bb16c79d181e5ac 07-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Move the HilightRange method from TextDiagnosticPrinter down to
CaretDiagnostic. It's completely generic, with nothing to do with the
diagnostic client or info APIs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139227 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
d2156fcd15c9ad3e0d538f0fe372d7a9e2be965a 07-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Hoist the tab expansion into a helper function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139226 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
0580e7dccecadc8edee3ed47fe22283addf92e2b 07-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Don't compute the same line number in two places, once inside a loop.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139225 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
5182a1858f4483c7289997d365ba3e103cd7d1b7 07-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Switch the CharSourceRange array to a small vector. The array was
a stack array of a magical size with an assert() that we never
overflowed it. That seems incredibly risky. We also have a very nice API
for bundling up a vector we expect to usually have a small size without
loss of functionality or security if the size is excessive.

The fallout is to remove the last pointer+size parameter pair that are
traced through the recursive caret diagnostic emission.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139217 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
c79a0d22f84e86ad1f9dcb23ec1081aaf5ae4f20 07-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Remove the doxyment for this now defunct parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139197 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
f15651a3afab339cfe9ea1462230d823629bbc61 07-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Don't recompute the presumed loc twice in 5 lines of code... Spotted by
inspection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139196 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
8a7b3f73d06a7181f2228d1605235b1b5484255f 07-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Use ArrayRef for the fixit hint array rather than a pointer and a size.
Clean up loops over the hints to use the more idiomatic iterator form in
LLVM and Clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139195 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
682630ccaae4306d7cfe142006b923905ca2d90e 07-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Hoist the construction of the FixItHint line into a member function with
a defined interface. This isn't as nice as the previous one, but should
get better as I push through better data types in all these functions.

Also, I'm hoping to pull some aspects of this out into a common routine
(such as tab expansion).

Again, WIP, comments welcome as I'm going through.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139190 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
335a13f069b25b0228d1e9e7cb55a83e6f8058fa 06-Sep-2011 Peter Collingbourne <peter@pcc.me.uk> Add missing dependency

Spotted by Ninja.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139129 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
c8c97a03eb0fdeb4f5fc9c4dea308ebbf46c2c93 04-Sep-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix Lexer::ComputePreamble when MaxLines parameter is non-zero.

The function was only counting lines that included tokens and not empty lines,
but MaxLines (mainly initiated to the line where the code-completion point resides)
is a count of overall lines (even empty ones).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139085 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
cca61589cada607478fbf05cdc70a7983c5e58d1 02-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Hoist the emission of parseable fixits into a helper method, simplifying
and reducing indentation through the clever use of early exits. ;]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139001 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
f8a1e51c48761ee1d7803c3fa35ac94f42ebb55e 02-Sep-2011 Douglas Gregor <dgregor@apple.com> Always construct an ASTReader with a non-NULL ASTContext and
Preprocessor, eliminating the constructor that was used by ASTUnit
(which didn't provide an ASTContext or Prepreprocessor). Ensuring that
both objects are non-NULL will simplify module loading (but none of
that is done yet).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138986 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
bcfd1f55bfbb3e5944cd5e03d07b343e280838c4 02-Sep-2011 Douglas Gregor <dgregor@apple.com> Extend the ASTContext constructor to delay the initialization of
builtin types (When requested). This is another step toward making
ASTUnit build the ASTContext as needed when loading an AST file,
rather than doing so after the fact. No actual functionality change (yet).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138985 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
998b3d3e8528ebd9d2c5d78d3a82edd90a8953a4 02-Sep-2011 Douglas Gregor <dgregor@apple.com> Allow the preprocessor to be constructed without performing target-
and language-specific initialization. Use this to allow ASTUnit to
create a preprocessor object *before* loading the AST file. No actual
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138983 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
3e3cd93b2fd9644e970c389e715c13883faf68b6 01-Sep-2011 Douglas Gregor <dgregor@apple.com> Teach ASTContext and Preprocessor to hold on to references to the same
LangOptions, rather than making distinct copies of
LangOptions. Granted, LangOptions doesn't actually get modified, but
this will eventually make it easier to construct ASTContext and
Preprocessor before we know all of the LangOptions.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138959 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
7143aab97c6e849a5a5005b7853b8c7d5af008ed 01-Sep-2011 Douglas Gregor <dgregor@apple.com> Modules hide macro definitions by default, so that silly things like
include guards don't show up as macro definitions in every translation
unit that imports a module. Macro definitions can, however, be
exported with the intentionally-ugly #__export_macro__
directive. Implement this feature by not even bothering to serialize
non-exported macros to a module, because clients of that module need
not (should not) know that these macros even exist.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138943 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
rontendActions.cpp
50c909bd837f00265034d876736e2db47686be38 01-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Create a CaretDiagnostic class to hold the logic for emitting
(unsurprisingly) caret diagnostics. This is designed to bring some
organization to the monstrous EmitCaretDiagnostic function, and allow
factoring it more easily and with less mindless parameter passing.

Currently this just lifts the existing function into a method, and
splits off the obviously invariant arguments to be class members. No
functionality is changed, and there are still lots of warts to let
existing code continue functioning as-is. Definitely WIP, more cleanups
to follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138921 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
0d6b893c0d66813fad5d9b9193e7af1058e4742e 01-Sep-2011 Chandler Carruth <chandlerc@gmail.com> Sink all of the include stack printing logic into its member function.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138920 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
e082af17d4b425a49f7f8bccc2a99810f0072828 31-Aug-2011 Douglas Gregor <dgregor@apple.com> Switch the "no module found" default-fatal warning to a default-fatal error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138909 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
f84139a1331c63c998e8b7d54148c75ac0b48ccd 31-Aug-2011 Eli Friedman <eli.friedman@gmail.com> Change err_pp_file_not_found back to an Error; when it's a Warning, we suppress it in system headers. And it is not a good idea to suppress it in system headers. (This was originally changed in r134996 to implement -MG.)

Fixes <rdar://10041960>. And also brings down the number of warnings without a flag by one :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138842 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
b1f2f4782097ed5e0a760598cbb853864cf9d7ce 29-Aug-2011 Eli Friedman <eli.friedman@gmail.com> Some minor updates to the Linux search path handling for Slackware. Patch by Will Dietz. PR10692.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138753 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
95ed7784a335aca53b0c6e952cf31a4cfb633360 27-Aug-2011 Fariborz Jahanian <fjahanian@apple.com> objective-c: Treat top-level objective-c declarations
, such as list of forward @class decls, in a DeclGroup
node. Deal with its consequence throught clang. This
is in preparation for more Sema work ahead. // rdar://8843851.
Feel free to reverse if it breaks something important
and I am unavailable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138709 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
831c6313dfa36f297094cd593a9dd3cb60649362 27-Aug-2011 Douglas Gregor <dgregor@apple.com> Remove the -import-module option. It's no longer useful

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138681 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
6aa52ec6b969faabf3764baf79d89810b8249a7e 27-Aug-2011 Douglas Gregor <dgregor@apple.com> Introduce support for a simple module import declaration, which
loads the named module. The syntax itself is intentionally hideous and
will be replaced at some later point with something more
palatable. For now, we're focusing on the semantics:
- Module imports are handled first by the preprocessor (to get macro
definitions) and then the same tokens are also handled by the parser
(to get declarations). If both happen (as in normal compilation),
the second one is redundant, because we currently have no way to
hide macros or declarations when loading a module. Chris gets credit
for this mad-but-workable scheme.
- The Preprocessor now holds on to a reference to a module loader,
which is responsible for loading named modules. CompilerInstance is
the only important module loader: it now knows how to create and
wire up an AST reader on demand to actually perform the module load.
- We search for modules in the include path, using the module name
with the suffix ".pcm" (precompiled module) for the file name. This
is a temporary hack; we hope to improve the situation in the
future.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138679 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
1b9060553221720152e12981109549e0a1d8e3a1 26-Aug-2011 Chad Rosier <mcrosier@apple.com> [driver] Add -mglobal-merge/-mno-global-merge machine options to enable/disable merging of
globals during codegen.
Fixes <rdar://problem/10017909>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138612 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
b5af843a20e237ad1a13ad66a867e200695b8c8e 26-Aug-2011 Douglas Gregor <dgregor@apple.com> Eliminate the -chained-pch flag and all of the frontend and libclang options associated with it. Chained PCH is the only way to build a PCH file that includes another PCH file

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138597 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
9293ba8e26fcba18505b273ecc9b66645133fcce 26-Aug-2011 Douglas Gregor <dgregor@apple.com> Remove the Chaining argument from the PCH/module generator. It's no longer used

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138596 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
rontendActions.cpp
467dc88512b4ba4bb16e274ea3771dc1415d31da 26-Aug-2011 Douglas Gregor <dgregor@apple.com> Introduce a -cc1 option "-emit-module", that creates a binary module
from the given source. -emit-module behaves similarly to -emit-pch,
except that Sema is somewhat more strict about the contents of
-emit-module. In the future, there are likely to be more interesting
differences.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138595 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
rontendAction.cpp
rontendActions.cpp
03c107a42fae79e89d0016999a1a04c07d65591a 25-Aug-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make Lexer::ComputePreamble accept a LangOptions parameter, otherwise it may be
out-of-sync how a file is compiled. Patch by Matthias Kleine!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138580 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
rontendActions.cpp
84c05e3b873a95c8c8d64fa8083407bcf395383f 24-Aug-2011 Axel Naumann <Axel.Naumann@cern.ch> Reset FirstID (first diagnostic's file ID) to allow for invocations of the VerifyDiagnosticsClient on several input files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138434 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticsClient.cpp
1e473ccb0e0f6fd1954bef330f7193c1a3fb3ba1 18-Aug-2011 Ted Kremenek <kremenek@apple.com> Implement '-Weverything', which enables all warnings except those explicitly mapped to be ignored.

Currently this includes -pedantic warnings as well; we'll need to consider whether these should
be included.

This works as expected with -Werror.

Test cases were added to Sema/warn-unused-parameters.c, but they should probably be broken off into
their own test file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137910 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
e95b9198b8b70ce0219cfb89483b41102e02dbf5 17-Aug-2011 Douglas Gregor <dgregor@apple.com> In the AST file format, eliminate the CHAINED_METADATA record. Instead,
all AST files have a normal METADATA record that has the same form
regardless of whether we refer to a chained PCH or any other kind of
AST file.

Introduce the IMPORTS record, which describes all of the AST files
that are imported by this AST file, and how (as a module, a PCH file,
etc.). Currently, we emit at most one entry to this record, to support
chained PCH.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137869 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
236a537eacbb347b5aa19a8aa2c82cdb7da8a62b 17-Aug-2011 Nico Weber <nicolasweber@gmx.de> Add Gentoo gcc 4.3.4 include paths

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137834 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
01a429a1029dd650ed11cc35160451664f664df3 17-Aug-2011 NAKAMURA Takumi <geek4civic@gmail.com> [MSVC] Fix a warning C4334 "'operator' : result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137803 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1f7957d63ccbb9c14f852eb127144d27c40f7e8f 13-Aug-2011 Nico Weber <nicolasweber@gmx.de> Accept -x objc++-cpp-output as an alias for -x objective-c++-cpp-output

This is the ObjC++ version of r129201. It's for example needed to use
ccache with clang.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137560 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e735e2deb9e57d9b62c1258ee236ccfeba8e84b2 06-Aug-2011 Jonathan D. Turner <jonathan.d.turner@gmail.com> Wire up -import-module to run ReadAST for each module loaded.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136987 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendAction.cpp
8fa0a80b4482ad94e82c4a19e23de17fd69140b5 04-Aug-2011 Douglas Gregor <dgregor@apple.com> Add a new libclang API to return a CXCompletionString for an arbitrary
cursor, from Connor Wakamo! Addresses <rdar://problem/9087798>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136911 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
0f91c8ccb398be2bd40dc402309bd79737542396 30-Jul-2011 Douglas Gregor <dgregor@apple.com> When performing code completion after at @interface, allow both
already-defined and forward-declared results. Already-defined results
are fine because they could be the start of a category. Fixes
<rdar://problem/9811691>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136559 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
baf41f16421a10c8ecd015baa686aa1b965ae5e3 29-Jul-2011 Douglas Gregor <dgregor@apple.com> On Darwin, libc++ may be installed alongside the compiler in
lib/c++/v1. Look there first, before falling back to the normal
/usr/include/c++/v1. <rdar://problem/9866149>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136507 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
a4c7a4314ffbe402091695874e93d9b0a79c8099 29-Jul-2011 Ted Kremenek <kremenek@apple.com> Really remove FlatStoreManager and BasicStoreManager, this time from the driver. Also remove associated tests. Sorry for the messy commits; this is the result of a botched Git merge.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136422 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
65e02fa80e1c185f18e5f81cefc30d75383a7301 28-Jul-2011 Douglas Gregor <dgregor@apple.com> Introduce the "-index-header-map" option, to give special semantics
for quoted header lookup when dealing with not-yet-installed
frameworks. Fixes <rdar://problem/9824020>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136331 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
7e90985df09855dc309ed888a5b16a0ae684f8e3 28-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Cut down the number of open/close system calls for output files.

For PCH files, have only one open/close for temporary + rename to be safe from race conditions.
For all other output files open/close the output file directly.

Depends on llvm r136310. rdar://9082880 & http://llvm.org/PR9374.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136315 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendActions.cpp
5cb3d699f0e37de1767eb23d26d03953a46cf1ff 28-Jul-2011 Richard Trieu <rtrieu@google.com> Add template instantiations to the output of -ast-dump.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136306 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
48d2c3f7c3ca48da05436afdc8426a245294ee65 26-Jul-2011 Jonathan D. Turner <jonathan.d.turner@gmail.com> This patch extends the previous patch by starting to incorporate more functionality, like lookup-by-name and exporting lookup tables, into the module manager. Methods now have documentation. A few more functions have been switched over to the new iterator style and away from manual/explicit iteration. Ultimately we want to move away from name lookup here, as symlinks make filenames not a safe unique value, but we use it here as a stopgap before better measures are in place (namely instead using FileEntry* from a global FileManager).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136107 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
96d3589e523a04f4ff2058a7919226ce60696ae8 26-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Rename SourceManager (and InstantiationInfo) isMacroArgInstantiation API
to isMacroArgExpansion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136053 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
642116259e8df6286063a17361c20e95b5017a0a 25-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Rename getInstantiationLineNumber to getExpansionLineNumber in both
SourceManager and FullSourceLoc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135969 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
a77c031cb66f75d22672070052cc6e0205289ff8 25-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Rename getInstantiationColumnNumber to getExpansionColumnNumber in both
SourceManager and FullSourceLoc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135965 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
extDiagnosticPrinter.cpp
e7b2b6e87dbe5b1207f77b6ff9c210a02f95bb39 25-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Rename getDecomposedInstantiationLoc to getDecomposedExpansionLoc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135962 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
999f739404edf2078cf9f9c28b4dc45c19765842 25-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Rename SourceManager::getImmediateInstantiationRange to
getImmediateExpansionRange.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135960 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
01231610bc89a8d3ae1bdfee0063af9386fd82a4 25-Jul-2011 Axel Naumann <Axel.Naumann@cern.ch> Pick up expected diagnostics not only in the main file but also in the file where the first diagnostic occurred.
Useful if the main file is not relevant (like with cling).
By Vassil Vassilev.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135936 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticsClient.cpp
edc3dccece244a584f8ebdb81da6c962c08e79be 25-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Rename SourceManager::getInstantiationRange to getExpansionRange.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135915 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
402785357ab053dd53f4fdd858b9630a5e0f8bad 25-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Mechanically rename SourceManager::getInstantiationLoc and
FullSourceLoc::getInstantiationLoc to ...::getExpansionLoc. This is part
of the API and documentation update from 'instantiation' as the term for
macros to 'expansion'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135914 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
extDiagnosticPrinter.cpp
2d3ba4f5a923a90c3fc290ddfba5e36c2d0a9b46 23-Jul-2011 Chris Lattner <sabre@nondot.org> Move ArrayRef to LLVM.h and eliminate now-redundant qualifiers, patch by Jon Mulder!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135855 91177308-0d34-0410-b5e6-96231b3b80d8
reateInvocationFromCommandLine.cpp
5f9e272e632e951b1efe824cd16acb4d96077930 23-Jul-2011 Chris Lattner <sabre@nondot.org> remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
STMerge.cpp
STUnit.cpp
acheTokens.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
reateInvocationFromCommandLine.cpp
ependencyFile.cpp
rontendAction.cpp
rontendActions.cpp
rontendOptions.cpp
eaderIncludeGen.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
angStandards.cpp
ogDiagnosticPrinter.cpp
rintPreprocessedOutput.cpp
extDiagnosticPrinter.cpp
erifyDiagnosticsClient.cpp
arnings.cpp
9461fccd05bde8458710ba367be10b6e4efe2ec7 22-Jul-2011 Jonathan D. Turner <jonathan.d.turner@gmail.com> Remove prepending of '$' to module names.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135775 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
832d620b4ae0fc5fe28561b885b4cfc65cf5c9ab 22-Jul-2011 Douglas Gregor <dgregor@apple.com> Switch all of the "isysroot" const char*'s throughout the AST reader
and writer to StringRef or std::string, as appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135769 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendActions.cpp
72a9ae18553bf8b6bdad84d2c54f73741a47e275 22-Jul-2011 Douglas Gregor <dgregor@apple.com> Rename ASTReader::PerFileData to serialization::Module, pulling it out
of ASTReader so it can become its own full-fledged class
(eventually). No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135767 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
9cca68dbfc42f7778f8db0bcfe8b3e575599ac0f 21-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> For ASTUnit::Save, write the AST to a temporary and then rename it to the actual filename.
Should avoid race conditions. Addresses rdar://9788943.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135691 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
bc9d5a3ace7cb75e4bff3dd4a3999a3fc04f4d45 21-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Cut down one open/close pair of system calls by using Path's makeUnique instead of createTemporaryFileOnDisk.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135690 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
4c30bb148b53c8063e940ca3e049ba4d270dc9d5 21-Jul-2011 Douglas Gregor <dgregor@apple.com> Rework the detailed preprocessing record to separate preprocessing
entities generated directly by the preprocessor from those loaded from
the external source (e.g., the ASTReader). By separating these two
sets of entities into different vectors, we allow both to grow
independently, and eliminate the need for preallocating all of the
loaded preprocessing entities. This is similar to the way the recent
SourceManager refactoring treats FileIDs and the source location
address space.

As part of this, switch over to building a continuous range map to
track preprocessing entities.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135646 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
9d102547dc44d064b40473a5a5166a8bb0dec99a 20-Jul-2011 Logan Chien <loganchien@google.com> Merge with clang upstream r135574 (Jul 20th 2011)

Change-Id: Ib6cc2ba08a63e4cf8febc05fb6e3f2ca58f1d71d
7ee2049278b98d42709380054eb83f4952af1200 19-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Add some additional driver flags to optionally emit or save the pre-migration ARC errors.

-arcmt-migrate-emit-errors : Emits the pre-migration ARC errors but it doesn't affect anything else
-arcmt-migrate-report-output : Writes out the pre-migration ARC errors to the provided plist file

rdar://9791454

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135491 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f62d43d2afe1960755a1b5813cae1e5983bcac1b 19-Jul-2011 Douglas Gregor <dgregor@apple.com> Revamp the SourceManager to separate the representation of parsed
source locations from source locations loaded from an AST/PCH file.

Previously, loading an AST/PCH file involved carefully pre-allocating
space at the beginning of the source manager for the source locations
and FileIDs that correspond to the prefix, and then appending the
source locations/FileIDs used for parsing the remaining translation
unit. This design forced us into loading PCH files early, as a prefix,
whic has become a rather significant limitation.

This patch splits the SourceManager space into two parts: for source
location "addresses", the lower values (growing upward) are used to
describe parsed code, while upper values (growing downward) are used
for source locations loaded from AST/PCH files. Similarly, positive
FileIDs are used to describe parsed code while negative FileIDs are
used to file/macro locations loaded from AST/PCH files. As a result,
we can load PCH/AST files even during parsing, making various
improvemnts in the future possible, e.g., teaching #include <foo.h> to
look for and load <foo.h.gch> if it happens to be already available.

This patch was originally written by Sebastian Redl, then brought
forward to the modern age by Jonathan Turner, and finally
polished/finished by me to be committed.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135484 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendAction.cpp
2f5127e6e0dbd9fcead5d61576d4c40237a28927 19-Jul-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement a __WCHAR_UNSIGNED__ macro and use it to include WCHAR_MIN and
WCHAR_MAX in limits.h, thus solving the problem where the system header
thinks it knows better.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135455 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
e9c0265d6e6b5bf865f4a0c2c00d00ac251e6437 18-Jul-2011 Frits van Bommel <fvbommel@gmail.com> Migrate LLVM and Clang to use the new makeArrayRef(...) functions where previously explicit non-default constructors were used.
Mostly mechanical with some manual reformatting.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135390 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
99d3594a56fb8e6900611ede7330aae61e924ec4 17-Jul-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r135359 at Sun. 17th July 2011.
a6c2b3a648913d47703625acb17671dd2d926bbc 16-Jul-2011 Francois Pichet <pichet2000@gmail.com> Do not modify string returned by getenv on Windows.
Fixes PR9875, patch by Nikola Smiljanic!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135356 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
0a9399c6726563f480537649e6f28da5186c4b78 16-Jul-2011 Nowar Gu <nowar100@gmail.com> Fix Android.mk.
ndroid.mk
174cba922331b896949d02d8b1a05f1998ed98e1 16-Jul-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r135344 at Sat. 16th July 2011.
9f79a1f89695a79d5e29a72c28ffb59823b31cef 14-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Update the remaining comments in Frontend to 'expansion'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135150 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
ba7537febdf1bc1cc617e1f1746f2644feba6274 14-Jul-2011 Chandler Carruth <chandlerc@gmail.com> NestedMacroInstantiations -> NestedMacroExpansions

This is switches all the interfaces points (and most of the commenst
/ local variables I saw on my way through) regarding the
NestedMacroInstantiations bit.

The libclang enums corresponding to this state were renamed, but
a legacy enum was added with the old name, and the same value to keep
existing clients working. I've added a documentation blurb for it, but
let me know if there is a canonical way to document legacy elemenst of
the libclang interface.

No functionality changed here, even in tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135141 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
7e7736aa826b4f8b29e1eae6584393f97243ab5a 14-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Switch all local code and comments from '[Ii]nstantiat(ion|ed)' to
'[Ee]xpan(sion|ded)' in the TextDiagnosticPrinter.

No functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135136 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
4e805467121700c31f5a37aaac681524a9b9deef 14-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Switch the diagnostic messages about macros to use the terms 'expanded'
and 'expansions' rather than 'instantiated' and 'contexts'.

This is the first of several patches migrating Clang's terminology
surrounding macros from 'instantiation' to 'expansion'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135135 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
48218c60d6b53b7880917d1366ee716dec2145ca 13-Jul-2011 John McCall <rjmccall@apple.com> In debugger mode, make ObjC message sends to unknown selectors return
__unknown_anytype, and rewrite such message sends correctly.

I had to bite the bullet and actually add a debugger support mode for this
one, which is a bit unfortunate, but there really isn't anything else
I could imagine doing; this is clearly just debugger-specific behavior.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135051 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
bb52786da8d055568eef6e5694288c1258bc8c2a 12-Jul-2011 Peter Collingbourne <peter@pcc.me.uk> Implement -MG. Fixes PR9613

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134996 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ependencyFile.cpp
69325d5b7cfecf1b3128745efc33612aedf1b8b4 09-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Introduce new '-ccc-arcmt-migrate <path>' ARC migration driver option.

This is a new mode of migration, where we avoid modifying the original files but
we emit temporary files instead.

<path> will be used to keep migration process metadata. Currently the temporary files
that are produced are put in the system's temp directory but we can put them
in the <path> if is necessary.

Also introduce new ARC migration functions in libclang whose only purpose,
currently, is to accept <path> and provide pairs of original file/transformed file
to map from the originals to the files after transformations are applied.

Finally introduce the c-arcmt-test utility that exercises the new libclang functions,
update arcmt-test, and add tests for the whole process.

rdar://9735086.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134844 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
a6e023c4491a8a8116c11783f4e81c7bd172f88d 08-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Fix up dependency file name printing to more closely match that of gcc, including fixing a nasty recent regression that could make us print "/foo.h" with a command-line including "-I ./".

rdar://problem/9734352



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134728 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
c8d1ecca1cd3fadbd331d15c420755aa6184554b 08-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Keep track of which source locations are part of a macro argument
instantiation and improve diagnostics which are stem from macro
arguments to trace the argument itself back through the layers of macro
expansion.

This requires some tricky handling of the source locations, as the
argument appears to be expanded in the opposite direction from the
surrounding macro. This patch provides helper routines that encapsulate
the logic and explain the reasoning behind how we step through macros
during diagnostic printing.

This fixes the rest of the test cases originially in PR9279, and later
split out into PR10214 and PR10215.

There is still some more work we can do here to improve the macro
backtrace, but those will follow as separate patches.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134660 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
3bd21383f0d788e49af71c5d25255197ddb8a59b 08-Jul-2011 Jonathan D. Turner <jonathan.d.turner@gmail.com> Remove BoostCon-specific code from Clang. FWIW, I'm a fan of things like this living in a separate branch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134649 91177308-0d34-0410-b5e6-96231b3b80d8
oostConAction.cpp
MakeLists.txt
ompilerInvocation.cpp
3da626b4f38eb0350de960d71271ca77af7a9cc8 07-Jul-2011 Douglas Gregor <dgregor@apple.com> Introduce a new libclang aPI function,
clang_codeCompleteGetContexts(), that provides the client with
information about the context in which code completion has occurred
and what kinds of entities make sense as completions at that
point. Patch by Connor Wakamo!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134615 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
85bea9777d444ccbcc086d98f075fe666c2e865d 06-Jul-2011 Douglas Gregor <dgregor@apple.com> Keep track of when "unrecoverable" errors occur, then allow
clang_saveTranslationUnit() to save a PCH file if the only errors it
contains are recoverable errors. Fixes <rdar://problem/9727804>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134503 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
39c411fa229b2a6747b92f945d1702ee674d3470 06-Jul-2011 Douglas Gregor <dgregor@apple.com> libclang: Allow callers of clang_saveTranslationUnit() to distinguish
between different classes of errors. Addresses most of
<rdar://problem/9660328>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134495 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
256a76e0b0e0c9e65a3122917d553ef10bc84d29 06-Jul-2011 John McCall <rjmccall@apple.com> Call objc_terminate() instead of abort() when a cleanup throws an
exception in Objective-C; in Objective-C++ we still use std::terminate().
This is only available in very recent runtimes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134456 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
9f084a3166b684573ba49df28fc5792bc37d92e1 06-Jul-2011 John McCall <rjmccall@apple.com> Change the driver's logic about Objective-C runtimes: abstract out a
structure to hold inferred information, then propagate each invididual
bit down to -cc1. Separate the bits of "supports weak" and "has a native
ARC runtime"; make the latter a CodeGenOption.

The tool chain is still driving this decision, because it's the place that
has the required deployment target information on Darwin, but at least it's
better-factored now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134453 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
16c3eaeea209487ce688215736f0660fc530c17d 05-Jul-2011 Fariborz Jahanian <fjahanian@apple.com> Don't define __CONSTANT_CFSTRINGS__ with -fno-constant-cfstrings issue.
Patch by Jean-Daniel Dupas.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134414 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
f732f2b11b136f34aecb95b0a2e72f5f272eb723 05-Jul-2011 Douglas Gregor <dgregor@apple.com> Update header-search paths for MinGW, from Ruben Van Boxem

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134406 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
3c54415a4e1db09b210a466469c72d2582ce1d83 02-Jul-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r134305 at Sat. 2nd July 2011.
37187cc4554d34fbbb5f168041d6acc4be028fe9 02-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Make the GCC version proliferation worse by N+1 for the sake of
ArchLinux. =/ Fixes PR10246.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134299 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
dca5226598097add5d86d57b227aa31df27f0ba4 02-Jul-2011 Douglas Gregor <dgregor@apple.com> Add initial *-*-rtems* target, from Joel Sherrill

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134283 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
01b6e31a62e2265849f4388b9be6be0a5d13348d 01-Jul-2011 Douglas Gregor <dgregor@apple.com> When we create a precompiled preamble, don't copy the
CompilerInvocation on the stack, because other objects (e.g., the
CompilerInstance) maintain an intrusive reference-counted pointer to
the CompilerInvocation. This doesn't matter in the normal case,
because we take back the CompilerInvocation. However, during crash
recovery, this leads to us trying to free an object on the stack, and
hilarity ensues. Fixes <rdar://problem/9652540>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134245 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5d9b6bf9de98a33427fc7a3beeca90a3002b4744 29-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Use existing -fcatch-undefined-behavior option,
replacing -freset-local-blocks. // rdar://9227352


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134082 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1077e420b89c9541396135157f22a1eff6062edf 29-Jun-2011 Fariborz Jahanian <fjahanian@apple.com> Under a compiler flag, -freset-local-blocks,
wipe out stack blocks when they go out of scope.
// rdar://9227352


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134045 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
83068315f7d9ed7b82ec35c2c26702151d186a70 28-Jun-2011 Chris Lattner <sabre@nondot.org> Fix PR9279 - Macro expansion stack trace seriously broken with function-style macros, by not recursively printing notes for other 'instantiated from' notes.

This is a one line fix here:
+ // Don't print recursive instantiation notes from an instantiation note.
+ Loc = SM.getSpellingLoc(Loc);

While here, fix the testcase to be more precise (it got filecheck'ized
brutally), and fix EmitCaretDiagnostic to be private and to not pass down
the unused 'Level' argument.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133993 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
d944a9b7a680be2ce74aa9398e0604fdebf0338a 27-Jun-2011 Douglas Gregor <dgregor@apple.com> Improve header search for MinGW(-w64), from Ruben Van Boxem!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133911 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
544607ea288b0ff24f7be0db11fcc6007d78da17 24-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> In TextDiagnosticPrinter::EmitCaretDiagnostic, don't always drop fixits if the caret location
points to a macro instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133802 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
b8b0313e84700b5c6d597b3be4de41c97b7550f1 24-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Rename objc_lifetime -> objc_ownership, and modify diagnostics to talk about 'ownership', not 'lifetime'.

rdar://9477613.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133779 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
3e66003c1f03bf734efbd0f8eea35784a2d78d66 23-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r133721, Fri. 24th Jun.
1626601b00a1feccd6b7a3f54e2991f56b659192 23-Jun-2011 Dylan Noblesmith <nobled@dreamwidth.org> avoid using config.h in public headers

This is the only usage in clang's headers, and it's for a define
that only exists on CMake builds for the sake of the MSVC compiler,
so just use an ifdef instead.

Also add an include for config.h in a file that actually needs it,
and was picking it up by accident indirectly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133710 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
7062281f240ef9c4fb343614fb2406532307c4a5 23-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r133678 at Thu. 23th Jun 2011.
c09ce1224dedc470fce9747e5936ff83cc6762eb 22-Jun-2011 Douglas Gregor <dgregor@apple.com> Copy diagnostic pragmas to the preprocessed output, from Richard Osborne!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133633 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
5dd45f13dc4463f0c18b923fe6795ce55103301d 21-Jun-2011 Bob Wilson <bob.wilson@apple.com> Make InitHeaderSearch::AddPath and HeaderSearchOptions::AddPath consistent
use an "IgnoreSysRoot" argument. HeaderSearchOptions had been using the
opposite form with "IsSysRootRelative", which made for much confusion when
looking at true/false values in calls in AddPath. No functional change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133550 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
13c4f2144b35bda21746eb60ad90e52a9bd8dcda 21-Jun-2011 Bob Wilson <bob.wilson@apple.com> Fix the default libc++ header search path to be sysrooted. Radar 9639692.

The -cxx-isystem path is not prefixed with the sysroot directory, so it's
not a good way for the driver to set the system default C++ search path.
Instead, add -stdlib as a cc1 option and teach the frontend how to find the
headers. The driver can then just pass -stdlib through to "cc1".

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133547 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
e26bdb91b7e3912ffe895b78a446db94471a59dd 21-Jun-2011 Daniel Dunbar <daniel@zuster.org> IRgen: Add a -fuse-register-sized-bitfield-access option, for testing.
- Changes bit-field access policy to try to use (aligned) register sized accesses.

The idea here is that by using larger accesses we expose more coalescing
potential to the backend when we have situations like adjacent bit-fields in the
same structure (which is common), and that the backend should be smart enough to
narrow the accesses down when no coalescing is done or when it is shown not to
be profitable.

--
$ clang -m32 -O3 -S -o - t.c
_f0: ## @f0
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %eax
movb (%eax), %cl
andb $-128, %cl
orb $1, %cl
movb %cl, (%eax)
movb 1(%eax), %cl
andb $-128, %cl
orb $1, %cl
movb %cl, 1(%eax)
movb 2(%eax), %cl
andb $-128, %cl
orb $1, %cl
movb %cl, 2(%eax)
movb 3(%eax), %cl
andb $-128, %cl
orb $1, %cl
movb %cl, 3(%eax)
popl %ebp
ret

$ clang -m32 -O3 -S -o - t.c -Xclang -fuse-register-sized-bitfield-access
_f0: ## @f0
pushl %ebp
movl %esp, %ebp
movl 8(%ebp), %eax
movl $-2139062144, %ecx ## imm = 0xFFFFFFFF80808080
andl (%eax), %ecx
orl $16843009, %ecx ## imm = 0x1010101
movl %ecx, (%eax)
popl %ebp
ret
--

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133532 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
65aa6885818d4b4eea2e5a9d12085b2398148662 21-Jun-2011 Jay Foad <jay.foad@gmail.com> Make more use of llvm::StringRef in various APIs. In particular, don't
use the deprecated forms of llvm::StringMap::GetOrCreateValue().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133515 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
c3b9014c7236a15cf467662264b243a22c420312 21-Jun-2011 Nick Lewycky <nicholas@mxc.ca> Add support for -Wa,--noexecstack when building from a non-assembly file. For
an assembly file it worked correctly, while for a .c file it would given an
error about how --noexecstack is not a supported argument to -Wa.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133489 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
0678899e0d619df03eae2e2d43c3fe1fa958d03a 20-Jun-2011 Douglas Gregor <dgregor@apple.com> Define __cplusplus to 201103L when in (non-GNU) C++0x mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133437 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
e665d6929e11796620ff799bc0186ebd747bfc76 18-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Fix the ARC migrator. -arcmt-modify requires running before the initialization of SourceManager
because it is going to modify the input file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133323 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
c2e70b46b686c8debb3020891a5593f298b053ae 18-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Remove '-arcmt-modify-in-memory', it turned out less useful than we hoped it would be.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133315 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1d7f12b83340610f76a73d21cac391e6feced7aa 17-Jun-2011 Chris Lattner <sabre@nondot.org> Fix a regression introduced by r131955 which broke #include_next in subtle situations
because the Angled directories and the System directories were not being uniqued
together, breaking #include_next. I'll see about a testcase, but it will be insane.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133212 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ebb6164bebf2b1e4f439433e751710b506918f62 17-Jun-2011 Chris Lattner <sabre@nondot.org> code cleanups, no behavior change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133211 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
16c8f9d68ae6d302083763d4733e728634717dec 16-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r133163 at Fri. 17th Jun 2011.
f7f8188fac71e34e09ee457ff6f039f5d14ad117 16-Jun-2011 Chandler Carruth <chandlerc@gmail.com> Raise the ARCMT functionality in Clang into proper FrontendActions.
These are somewhat special in that they wrap any other FrontendAction,
running various ARC transformations or checks prior to the standard
action's run. To implement them easily, this extends FrontendAction to
have a WrapperFrontendAction utility class which forwards all calls by
default to an inner action setup at construction time. This is then
subclassed to override the specific behavior needed by the different
ARCMT tools.

Finally, FrontendTool is taught how to create these wrapper actions from
the existing flags and options structures.

The result is that clangFrontend no longer depends on clangARCMigrate.
This is very important, as clangARCMigrate *heavily* depends on
clangFrontend. Fundamentally ARCMigrate is at the same layer as
a library like Rewrite, sitting firmly on top of the Frontend, but tied
together with the FrontendTool when building the clang binary itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133161 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInstance.cpp
rontendAction.cpp
c37039803a18c7f0f0975a618147d336de3d3d58 16-Jun-2011 NAKAMURA Takumi <geek4civic@gmail.com> Be aware of (x86_64-redhat-linux6E-)g++44 on RHEL5.

AFAIK, RHEL5 (and its clones) provides g++44 as the package "gcc44-c++".
By default, g++-4.1.1 is available, though, its libstdc++ would not be suitable to clang++.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133156 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
098df7f1de80527d7a70e410a5830c8b2d742310 16-Jun-2011 John McCall <rjmccall@apple.com> Unconditionally #define the ARC ownership qualifiers, instead of #defining
them only on Darwin tool chains.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133112 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
8f0e8d22960d56f8390f4971e2c0f2f0a0884602 16-Jun-2011 John McCall <rjmccall@apple.com> The ARC Migration Tool. All the credit goes to Argyrios and Fariborz
for this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133104 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInstance.cpp
ompilerInvocation.cpp
f85e193739c953358c865005855253af4f68a497 16-Jun-2011 John McCall <rjmccall@apple.com> Automatic Reference Counting.

Language-design credit goes to a lot of people, but I particularly want
to single out Blaine Garst and Patrick Beard for their contributions.

Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself,
in no particular order.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133103 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
74da19fc3a52d7e3005eeb7a7833859da84fd12a 15-Jun-2011 Douglas Gregor <dgregor@apple.com> Introduce a -cc1-level option to turn off related result type
inference, to be used (only) by the Objective-C rewriter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133025 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
4c4efee6d3113f20b41efaeec08934332d2ea40e 13-Jun-2011 Douglas Gregor <dgregor@apple.com> Eliminate the -f[no]objc-infer-related-result-type flags; there's no
reason to allow the user to control these semantics through a flag.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132919 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
926df6cfabf3eaa4afc990c097fa4619b76a9b57 11-Jun-2011 Douglas Gregor <dgregor@apple.com> Implement Objective-C Related Result Type semantics.

Related result types apply Cocoa conventions to the type of message
sends and property accesses to Objective-C methods that are known to
always return objects whose type is the same as the type of the
receiving class (or a subclass thereof), such as +alloc and
-init. This tightens up static type safety for Objective-C, so that we
now diagnose mistakes like this:

t.m:4:10: warning: incompatible pointer types initializing 'NSSet *'
with an
expression of type 'NSArray *' [-Wincompatible-pointer-types]
NSSet *array = [[NSArray alloc] init];
^ ~~~~~~~~~~~~~~~~~~~~~~
/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1:
note:
instance method 'init' is assumed to return an instance of its
receiver
type ('NSArray *')
- (id)init;
^

It also means that we get decent type inference when writing code in
Objective-C++0x:

auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil];
// ^ now infers NSMutableArray* rather than id




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132868 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
146480922cfd80b1ca4b022bf242481b3899c62b 10-Jun-2011 Nick Lewycky <nicholas@mxc.ca> __OBJC__ is also a standard predefined macro.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132855 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
863e2850729220ffaad0e1c1c625c7d17c99f07b 10-Jun-2011 Nowar Gu <nowar100@gmail.com> Fix Android.mk.

Delete DiagChecker.cpp from lib/Frontend/.
ndroid.mk
e5df885367b9e122ac11c89ddfbc62375695cdab 10-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r132843 at Fri. 10th Jun 2011.
a9c6441c73686c34fdf5de681bfd81381fd0903c 07-Jun-2011 Nick Lewycky <nicholas@mxc.ca> The macros defined by the language standard are still available even when the
-undef flag is passed in. Also __ASSEMBLER__ with -x assembler-with-cpp. (Don't
ask.)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132708 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
7fee4cded72e2e00956ea34172d9ecc420c3a39f 05-Jun-2011 Rafael Espindola <rafael.espindola@gmail.com> Fix cmake build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132653 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ab3c80e79e09132d1ee51b7c11ca697cb4592913 04-Jun-2011 Richard Smith <richard-llvm@metafoo.co.uk> Remove the old implementation of -verify, which has been dead code since r88750.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132651 91177308-0d34-0410-b5e6-96231b3b80d8
iagChecker.cpp
5a4cca2cc576bb42309e3e86befaa904283e9c8c 03-Jun-2011 Matt Beaumont-Gay <matthewbg@google.com> Don't warn about -Wno-foo where foo is an unknown warning option. Explicitly
passing -Wunknown-warning-option will re-enable warnings about -Wno-foo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132570 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
55ab5b0799c256a719e69ce463652839135e62f7 03-Jun-2011 Eric Christopher <echristo@apple.com> Separate out these paths a bit by architecture. There are likely other
places this is a problem.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132542 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
c7f532f9b8e934a0a284d15a739333372e979f61 03-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r132540 at Fri. 3rd Jun 2011.
b3169da1e57f5feb53f4a0396bd8e7ec70309980 03-Jun-2011 Eric Christopher <echristo@apple.com> Add multi-arch include support for Ubuntu 11.11 with gcc 4.6.0.

Patch by Tobias Hunger!

Fixes PR10008


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132541 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
fb3f4aad0436a9c40e9130598162150890c405b5 02-Jun-2011 Rafael Espindola <rafael.espindola@gmail.com> Implement -fgnu89-inline. Fixes PR10041.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132460 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
43c9791207a2bd7cef8b17e9bfc4dd87db21690f 28-May-2011 Nowar Gu <nowar100@gmail.com> Merge upstream r132249 at Sat. 28th. May 2011.
bb6a5677fb8d1ed68c4facd90795aca28d197266 26-May-2011 Richard Trieu <rtrieu@google.com> Change the include stack of "instantiated from" notes to fall under the control of f/fno-diagnostics-show-note-include-stack flags. This should help with reducing diagnostic spew from macros instantiations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132143 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
477aab6782795e7472055a54108d2df270ce1a89 25-May-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> A StringRef-ication of the DiagnosticIDs API and internals.

Patch by Matthieu Monrocq with tweaks by me to avoid StringRefs in the static
diagnostic data structures, which resulted in a huge global-var-init function.

Depends on llvm commit r132046.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132047 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
arnings.cpp
848afb0c1ff4571ca7a21927ecc2699ea2e7429a 24-May-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r131958 at Tue. 24th May 2011.
74a5fd8bcc68b540b58f6fcd2d80e6e926966e71 24-May-2011 Nico Weber <nicolasweber@gmx.de> Make it possible for external tools to distinguish between paths that come from -I and paths that come from -system. Patch from Paul Holden!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131955 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
4d509341bd5db06a517daa311379f52bb540bc34 21-May-2011 Eli Friedman <eli.friedman@gmail.com> Fix the clang part of PR7952: rewrite the specialization of isa<> in DeclBase,
and stop abusing the multi-level dereference isa<> used to allow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131804 91177308-0d34-0410-b5e6-96231b3b80d8
reateInvocationFromCommandLine.cpp
c9471b0ff1815ed0149dbfcad0f385ed8648eeb0 21-May-2011 Douglas Gregor <dgregor@apple.com> Introduce the -fdiagnostics-format=xxx option to control how Clang
prints the file, line, and column of a diagnostic. We currently
support Clang's normal format, MSVC, and Vi formats.

Note that we no longer change the diagnostic format based on
-fms-extensions.

Patch by Andrew Fish!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131794 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnosticPrinter.cpp
7dfd96fd5f4e63071f5d4f684e9f0e1928d226c7 20-May-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r131722 at Fri. 20th May 2011.
2eb3cce91fa334be35caefedd5374c22d086ad1c 19-May-2011 David Chisnall <csdavec@swan.ac.uk> Add paths used by openSuSE 12.1

Patch by Ismail Dönmez!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131636 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
199e09a93813516a5e8f9ce2c3cd4c18d60961db 18-May-2011 Eric Christopher <echristo@apple.com> Add some support for RHEL5 systems.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131505 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
d01d2b2de449d68e6c44d99a12c0c1fc53222113 14-May-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r131335 at Sat. 14th May 2011.
4b7e048970ddd0d75d428ddbb0ce48a71578fed2 10-May-2011 Francois Pichet <pichet2000@gmail.com> Add a FIXME.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131108 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
a23ae3f45789f40cdfd939117284f977d2dc17a6 07-May-2011 Francois Pichet <pichet2000@gmail.com> Temporary preprocessor hack to get around the Microsoft __identifier(x) extension.
http://msdn.microsoft.com/en-us/library/hzc8ytsz(v=VS.100).aspx

Microsoft doc claims this is a C++/CLI feature but it is really always enabled.
This removes 2 error when parsing MFC code with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131051 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
10620eb5164e31208fcbf0437cd79ae535ed0559 06-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Modify some deleted function methods to better reflect reality:

- New isDefined() function checks for deletedness
- isThisDeclarationADefinition checks for deletedness
- New doesThisDeclarationHaveABody() does what
isThisDeclarationADefinition() used to do
- The IsDeleted bit is not propagated across redeclarations
- isDeleted() now checks the canoncial declaration
- New isDeletedAsWritten() does what it says on the tin.
- isUserProvided() now correct (thanks Richard!)

This fixes the bug that we weren't catching

void foo() = delete;
void foo() {}

as being a redefinition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131013 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
dca8ee8b7bc86076916a3a80f553f7a4e98c14af 06-May-2011 Douglas Gregor <dgregor@apple.com> Introduce a new libclang parsing flag,
CXTranslationUnit_NestedMacroInstantiations, which indicates whether
we want to see "nested" macro instantiations (e.g., those that occur
inside other macro instantiations) within the detailed preprocessing
record. Many clients (e.g., those that only care about visible tokens)
don't care about this information, and in code that uses preprocessor
metaprogramming, this information can have a very high cost.

Addresses <rdar://problem/9389320>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130990 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
7665ad83d8eff7b8b2c5f3b893b6b7ece38f847c 05-May-2011 Daniel Dunbar <daniel@zuster.org> Frontend: Fix a crash in CC_LOG_DIAGNOSTICS handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130909 91177308-0d34-0410-b5e6-96231b3b80d8
ogDiagnosticPrinter.cpp
3dc05418538c719fea48b906bfa4febe5296e126 05-May-2011 Nick Lewycky <nicholas@mxc.ca> Preserve the full name of the file, so that '-c -o foo.pic.o' produces
foo.pic.gcno instead of foo.gcno.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130899 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c1598700010cea9364a58a65e967b0b56361b6aa 05-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Change cycle detection to be based off of a warning flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130898 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8c647deada0c0e8407b4ced00ff09be1261fe147 05-May-2011 Ted Kremenek <kremenek@apple.com> ASTUnit::LoadFromASTFile(): recover the resources from an ASTReader if it crashes during PCH validation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130886 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5ea4f44e34449a78d6b38aa47c14b527839d7aac 04-May-2011 Nick Lewycky <nicholas@mxc.ca> Record where the GCOV data files should be placed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130866 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
14a011688d52794cf58fec8197e4518a54f03d80 04-May-2011 Axel Naumann <Axel.Naumann@cern.ch> Add C++ include paths for libstdc++ with Ubuntu 11.04 and Debian's libstdc++6-4.5, as collected from http://packages.ubuntu.com/search?mode=exactfilename&suite=natty&section=all&arch=any&searchon=contents&keywords=c%2B%2Blocale.h and http://packages.debian.org/wheezy/armel/libstdc++6-4.5-dev/filelist
Fixes compilation with clang++ on Ubuntu 11.04.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130837 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
fe57eef44cc80e5bb51e4f484835be08b8d84256 04-May-2011 Sean Hunt <scshunt@csclub.uwaterloo.ca> Implement a better version of delegating constructor cycle detection.

This is more efficient as it's all done at once at the end of the TU.
This could still get expensive, so a flag is provided to disable it. As
an added bonus, the diagnostics will now print out a cycle.

The PCH test is XFAILed because we currently can't deal with a note
emitted in the header and I, being tired, see no other way to verify the
serialization of delegating constructors. We should probably address
this problem /somehow/ but no good solution comes to mind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130836 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d808bd2978bd4ac95a92b309b038452b533fd7a0 04-May-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ASTUnit::LoadFromCompilerInvocationAction that allows one to create an ASTUnit
from a CompilerInvocation along with an ASTFrontendAction to invoke, and without all the goo
about the precompiled preamble.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130805 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
b2dba4bc0eee144baa60e36599a0887496d1295e 02-May-2011 Chad Rosier <mcrosier@apple.com> When using -std= flag added check to make sure language and standard are compatable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130710 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
0f0cdab31a4f71914b7f654501d69d96e9f378da 02-May-2011 NAKAMURA Takumi <geek4civic@gmail.com> lib/Frontend/InitHeaderSearch.cpp: Tweak AddPath() to accept "/foo/bar" (not "X:\foo\bar") with -isysroot. test/PCH/reloc.c can pass.

FIXME: We should consider better isysroot scheme on Win32 hosts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130683 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f24a151d645abc89f94aa58ad59f3131502041b1 30-Apr-2011 Rafael Espindola <rafael.espindola@gmail.com> Implement -fno-dwarf2-cfi-asm.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130616 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
39cd58cbffd1f7a144483857496df0294ce9c8e9 30-Apr-2011 Chad Rosier <mcrosier@apple.com> Removed redundant case statements

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130564 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
a0fa203f04235cb6d05eeb8cea3392a01aa7571b 30-Apr-2011 Bob Wilson <bob.wilson@apple.com> Add -Oz option and use it to set the inline threshold to 25.
Radar 9333566. Patch by Chad Rosier!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130554 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f79a71908d6f28cb2bc0c081d9a801ed14d61d82 29-Apr-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Add a decl update when a static data member of a class template is instantiated in a different PCH than its containing class. Otherwise we get double definition errors. Fixes a Boost.MPL problem that affects Boost.Accumulators and probably a lot more of Boost.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130488 91177308-0d34-0410-b5e6-96231b3b80d8
ultiplexConsumer.cpp
338d7f7362d18fa9c39c6bb5282b4e20574a9309 28-Apr-2011 Francois Pichet <pichet2000@gmail.com> Upgrade Microsoft's __int8, __int16, __int32 and __int64 types from builtin defines to real types.

Otherwise statements like:
__int64 var = __int64(0);

would be expanded to:
long long var = long long(0);

and fail to compile.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130369 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
014f9720bc53cc748aa13b0773cd67428a9e6ae4 25-Apr-2011 Nico Weber <nicolasweber@gmx.de> Add libstdc++ search paths for GCC 4.6.0 on Arch Linux. Patch by Jakub Wieczorek.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130152 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
58a2cd8c0d52e710cbcc57a67eac7b51b0b831c4 24-Apr-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Synthesizing the definition of an implicit member is an AST modification, so notify any mutation listeners of it. This fixes a crasher in chained PCH, where an implicit destructor in a PCH gets a definition in a chained PCH, which is then lost. However, any further use of the destructor would cause its definition to be regenerated in the final file, hiding the bug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130103 91177308-0d34-0410-b5e6-96231b3b80d8
ultiplexConsumer.cpp
f8c247d247f9f7ab2bf4965677e6d056711c99d5 23-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Move all of the logic for __DEPRECATED to the driver based on comments
from dgregor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130066 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
1cfe3c305c0d5393fd94167808b8f5d96cd65227 23-Apr-2011 Chandler Carruth <chandlerc@gmail.com> Fix Clang's __DEPRECATED define to be controled by -Wdeprecated. This
matches GCC behavior which libstdc++ uses to limit #warning-based
messages about deprecation.

The machinery involves threading this through a new '-fdeprecated-macro'
flag for CC1. The flag defaults to "on", similarly to -Wdeprecated. We
turn the flag off in the driver when the warning is turned off (modulo
matching some GCC bugs). We record this as a language option, and key
the preprocessor on the option when introducing the define.

A separate flag rather than a '-D' flag allows us to properly represent
the difference between C and C++ builds (only C++ receives the define),
and it allows the specific behavior of following -Wdeprecated without
potentially impacting the set of user-provided macro flags.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130055 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
50465d1d2f5f6dd3d8e18e2cf7bad4691e5ca6a8 23-Apr-2011 Chandler Carruth <chandlerc@gmail.com> There were some frustrating problems with the implementation of
-Wwrite-strings. First and foremost, once the positive form of the flag
was passed, it could never be disabled by passing -Wno-write-strings.
Also, the diagnostic engine couldn't in turn use -Wwrite-strings to
control diagnostics (as GCC does) because it was essentially hijacked to
drive the language semantics.

Fix this by giving CC1 a clean '-fconst-strings' flag to enable
const-qualified strings in C and ObjC compilations. Corresponding
'-fno-const-strings' is also added. Then the driver is taught to
introduce '-fconst-strings' in the CC1 command when '-Wwrite-strings'
dominates.

This entire flag is basically GCC-bug-compatibility driven, so we also
match GCC's bug where '-w' doesn't actually disable -Wwrite-strings. I'm
open to changing this though as it seems insane.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130051 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8387e2a41eef6fa17fb140a18c29b6eee9dd2b8a 23-Apr-2011 Francois Pichet <pichet2000@gmail.com> Add -fdelayed-template-parsing option. Using this option all templated function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup.

Using this flag is necessary for compatibility with Microsoft template code.
This also provides some parsing speed improvement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130022 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e8ba8d78a258ec992d3521eebdae8324db777b14 22-Apr-2011 Nick Lewycky <nicholas@mxc.ca> Wire up the -ftest-coverage and -fprofile-arcs flags to .gcno file emission (at
compile time) and .gcda emission (at runtime). --coverage enables both.

This does not yet add the profile_rt library to the link step if -fprofile-arcs
is enabled when linking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129956 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1cfeefdb383b106f63d91dd715f54339467d6aa8 21-Apr-2011 Eli Friedman <eli.friedman@gmail.com> PR9772: Fix the definition of WINT_MIN and WINT_MAX on Linux -ffreestanding.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129907 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
7c40f191b380ac7bc6de01691cb14fb52313f488 20-Apr-2011 Shih-wei Liao <sliao@google.com> Apply changes to migrate to clang upstream r129173 (April 8th, 2011)

Change-Id: I7f3111e997adeab5a428a03180266b05f852763f
ndroid.mk
db57a4cdb0a6abf3239f3a794a900ce312c5887b 19-Apr-2011 Daniel Dunbar <daniel@zuster.org> ADT/Triple: Switch to using .isOSDarwin() predicate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129823 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
7d2b8c1fcc2b707be78b09930a7767477822462f 16-Apr-2011 Douglas Gregor <dgregor@apple.com> Initial work to improve documentation for Clang's diagnostics, from Matthieu Monrocq

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129614 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnosticPrinter.cpp
ccad3db9b95012e260c71ded41c6141619202b09 15-Apr-2011 Fariborz Jahanian <fjahanian@apple.com> Fixes a crash when generating dependency file stuff
and output file is not writable. // rdar://9286457.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129587 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
162e1c1b487352434552147967c3dd296ebee2f7 15-Apr-2011 Richard Smith <richard-llvm@metafoo.co.uk> Support for C++11 (non-template) alias declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129567 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
fc8f0e14ad142ed811e90fbd9a30e419e301c717 15-Apr-2011 Chris Lattner <sabre@nondot.org> fix a bunch of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129559 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7e7fbd05a5dfdb0addfc8b5af2fcbed8c7b5fb87 15-Apr-2011 Peter Collingbourne <peter@pcc.me.uk> C1X: add a language standard

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129553 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
5bbcdbf36f8cf79d99703ef20848c55960065e43 14-Apr-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Chained PCH: Remember when additional specializations are added to a function template from a previous PCH. Fixes the only crasher when using massive chains on Clang's Sema component. We still have some incomplete codegen there.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129516 91177308-0d34-0410-b5e6-96231b3b80d8
ultiplexConsumer.cpp
4dddebfef924be24de74b8bdf722a5cff3f3333f 14-Apr-2011 Sebastian Redl <sebastian.redl@getdesigned.at> Fix -H. It was pretty broken.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129514 91177308-0d34-0410-b5e6-96231b3b80d8
eaderIncludeGen.cpp
a5fc472b353b88be3b4981da946fb01f5a5cc0c6 10-Apr-2011 John McCall <rjmccall@apple.com> Fix a bunch of major problems with __unknown_anytype and properly test
for them. The only major missing feature is references.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129234 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
2eba7abeab4abddd28644200397f8a1d5badccdd 09-Apr-2011 Logan Chien <tzuhsiang.chien@gmail.com> Merge with clang upstream r129173 (Apr 8th 2011)

Upstream Revision
git-id: 0ff32595e4b92c5bdee78946b39f9e990b20cc90
svn-id: 129173
919f2ca3c21f6b590eea50645ff5bedb54d81673 09-Apr-2011 Chris Lattner <sabre@nondot.org> accept -x objc-cpp-output as an alias for -x objective-c-cpp-output,
per PR9577


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129201 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e01eceb54c9235a41675bfd9f32c50bd005fb8d0 07-Apr-2011 Daniel Dunbar <daniel@zuster.org> Frontend/CC_LOG_DIAGNOSTICS: Fix thinko and open diag log in append mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129103 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
b6534bbee90bf73f364072051d10b60352d43c3e 07-Apr-2011 Daniel Dunbar <daniel@zuster.org> Fronted/CC_LOG_DIAGNOSTICS: Wire up dwarf-debug-flags support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129095 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
28f14933edc863821e4f2ffa3663835c62440dcb 07-Apr-2011 Daniel Dunbar <daniel@zuster.org> Fronted/CC_LOG_DIAGNOSTICS: Output main file name, and add support for
outputting dwarf-debug-flags.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129094 91177308-0d34-0410-b5e6-96231b3b80d8
ogDiagnosticPrinter.cpp
5dccf575ad0b45a268d4026047234a6872440c95 07-Apr-2011 Daniel Dunbar <daniel@zuster.org> Fronted/CC_LOG_DIAGNOSTICS: Tweak output form to be plist chunks, and don't
output missing data.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129093 91177308-0d34-0410-b5e6-96231b3b80d8
ogDiagnosticPrinter.cpp
64bfbf573e625c04abc3d40faa9b695fe21ebdbb 07-Apr-2011 Daniel Dunbar <daniel@zuster.org> Frontend: Continue flushing out LogDiagnosticPrinter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129091 91177308-0d34-0410-b5e6-96231b3b80d8
ogDiagnosticPrinter.cpp
9df23493f5b8a223dfbc491e4b7de3850797c2e7 07-Apr-2011 Daniel Dunbar <daniel@zuster.org> Frontend: Sketch a LogDiagnosticPrinter object, and wire CC_LOG_DIAGNOSTICS to
it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129089 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInstance.cpp
ogDiagnosticPrinter.cpp
08c6695f6018fb6cb1a7c7d311a851aa5c233bc0 07-Apr-2011 Daniel Dunbar <daniel@zuster.org> Frontend: Sketch support for -diagnostic-log-file, which still doesn't do anything.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129086 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8f1cc075c36212797ef52dac0e2fe35417a6bb6b 06-Apr-2011 Eric Christopher <echristo@apple.com> Add support for Fedora16, gcc 4.6.0 and Fedora Rawhide.

Patch by Bobby Powers


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129014 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
0c959fc7f1e1006f44eae6fdb5b659eb12bf8ddc 06-Apr-2011 Nowar Gu <nowar100@gmail.com> Add some source files into Android.mk.
ndroid.mk
9a7319305fc25222b91d585dfa056c8cdbac8434 06-Apr-2011 Nowar Gu <nowar100@gmail.com> Merge upstream until 2011.04.05.
a71acfe2e3d065fd32e457f46d46da32a09c62c8 05-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Also update CMakeList.txt

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128854 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ea383c0dffb78aea0c427a6ccf4490a5083fcb6a 05-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add missing file for my previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128853 91177308-0d34-0410-b5e6-96231b3b80d8
reateInvocationFromCommandLine.cpp
832316e9a04242972f4b57281dccb8e4cf5894ea 05-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move Driver::createInvocationFromArgs function to Frontend library to avoid dependency cycle
between libFrontend and libDriver.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128852 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
054e4f50e2f1995e91b0cd3c3258aa252785fe3f 04-Apr-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce Driver::createInvocationFromArgs used to create a CompilerInvocation from command-line args.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128848 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f445debe3a6825e6528655db0906ce4fa41240ea 01-Apr-2011 csmon <csmon@csmon-desktop.(none)> Merge branch 'upstream' into logan-fastforward-20110320
32ad9353327afb9e4e69e16dfffaab704eeaffbe 31-Mar-2011 Matt Beaumont-Gay <matthewbg@google.com> Remove a redundant isValid() check

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128606 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
ad1a4c6e89594e704775ddb6b036ac982fd68cad 31-Mar-2011 Daniel Dunbar <daniel@zuster.org> Change Clang's __VERSION__ to include the same basic info as in clang -v.
- Please never ever ever ever write a tool that sniffs this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128599 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
969323239f16589329d091a2b8ef200fcfe7c9e9 29-Mar-2011 Daniel Dunbar <daniel@zuster.org> Integrated-As: Support -Wa,-L when using the integrated assembler.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128433 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
34b8e6889a12c90e8053fba8a1ea49b17c05ac51 27-Mar-2011 Chandler Carruth <chandlerc@gmail.com> Flip the default for showing include stacks on notes to false. This
required modifying a few tests that specifically use note include stacks
to check the source manager's view of include stacks. I've simply added
the flag to these tests for now, they may have to be more substantially
changed if we decide to remove support for note include stacks
altogether.

Also, add a test for include stacks on notes that was supposed to go in
with the previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128390 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
abaca7a8be8e79cc01354676e3bcb26575640311 27-Mar-2011 Chandler Carruth <chandlerc@gmail.com> Add an option to suppress include stack printing on note diagnostics.
These stacks are often less important than those on primary diagnostics.

As the number of notes grows, this becomes increasingly important. The
include stack printing is clever and doesn't print stacks for adjacent
diagnostics from the same file, but when a note is in between a sequence
of errors in a header file, and the notes all refer to some other file,
we end up getting a worst-case ping-pong of include stacks that take up
a great deal of vertical space.

Still, for now, the default behavior isn't changed. We can evaluate user
feedback with the flag.

Patch by Richard Trieu, a couple of style tweaks from me.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128371 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnosticPrinter.cpp
7f9fc3f7ce076645cb6aefc99c64d9446caf13d6 23-Mar-2011 Chris Lattner <sabre@nondot.org> switch a few Driver APIs to use llvm::ArrayRef, cleaning up code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128142 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
114d63955f8d55e4c2f0350abf907fbb5eeeb08b 23-Mar-2011 Ted Kremenek <kremenek@apple.com> std::vector::data() is not portable to VS. Use a gross hack instead.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128138 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
3c66d30d513106bb794990c5e4ba36a31ac19f15 22-Mar-2011 Daniel Dunbar <daniel@zuster.org> Frontend: Add a more explicit -backend-option flag for passing backend command
line options, instead of leveraging the blanket -mllvm option.
- This allows using the frontend itself without requiring the backend have
those options available (i.e., if the target wasn't built).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128087 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
97d2d2e368d3ead34d83c328383711c7dabab60a 22-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Merge with clang upstream r127980 (Mar 20th 2011)
25a11e1c5fad62dbad25a265e334720157e3fbc1 22-Mar-2011 Ted Kremenek <kremenek@apple.com> Rework crash recovery cleanup in ASTUnit and CIndex to recover more memory during a Sema crash (we have just a handful of leaks left)
and to use the simplified cleanup registration API.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128059 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
da60885cb4ee85d167cf704061f10b758067cf5a 21-Mar-2011 Daniel Dunbar <daniel@zuster.org> Frontend: Change CC_PRINT_HEADERS to not print header depth markers, these don't
really make any sense in this environment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128014 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
eaderIncludeGen.cpp
4f32786ac45210143654390177105eb749b614e9 21-Mar-2011 Ted Kremenek <kremenek@apple.com> Improve crash recovery cleanup to recovery CompilerInstances during crash recovery. This was a huge resource "root" during crashes.

This change requires making a bunch of fundamental Clang structures (optionally) reference counted to allow correct
ownership semantics of these objects (e.g., ASTContext) to play out between an active ASTUnit and CompilerInstance
object.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128011 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendAction.cpp
03201fbbdeb3eb7f465610b09c281ee6aa84e3ca 21-Mar-2011 Ted Kremenek <kremenek@apple.com> Use CrashRecoveryContextCleanup objects to reclaim resources from CompilerInstance objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128009 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
aeafaf67b019bf195fb1adec7a45ab00ace0efb6 20-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Apply changes to migrate to Mar 18th 2011.
ndroid.mk
8e02635c9c276720a1e6f926b33303a53cebe9c7 18-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Merge with clang upstream r127869 (Mar 18th 2011)
47226350c4f8094cf2ebe750351b2b3242709584 19-Mar-2011 Daniel Dunbar <daniel@zuster.org> Preprocessor: Don't define __STDC__ in -traditional-cpp mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127933 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
207f4d8543529221932af82836016a2ef066c917 18-Mar-2011 Peter Collingbourne <peter@pcc.me.uk> Add support for language-specific address spaces. On top of that,
add support for the OpenCL __private, __local, __constant and
__global address spaces, as well as the __read_only, _read_write and
__write_only image access specifiers. Patch originally by ARM;
language-specific address space support by myself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127915 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
2ed42287b9b88a0bb08ab10e95e306da3f294ba9 18-Mar-2011 Daniel Dunbar <daniel@zuster.org> Lexer: Add extremely limited support for -traditional-cpp, ignoring BCPL
comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127910 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
340415c0c7a7fdeb688fe5a0993bdd142cc9f59c 18-Mar-2011 Anders Carlsson <andersca@mac.com> Use the newly added FileManager::getNoncachedStatValue when trying to determine if any files in the preamble have changed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127894 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
0d8d7e6067f9093e7d5abc45c9639ab977aab692 18-Mar-2011 Anders Carlsson <andersca@mac.com> Correctly store and keep track of the FileSystemOptions in ASTUnit and in clang_codeCompleteAt.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127890 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
32096695c76033a6b0b1747c439f7378a11e8312 18-Mar-2011 John McCall <rjmccall@apple.com> The Darwin kernel does not provide useful guard variable support.
Issue this as an IR-gen error; it's not really worthwhile doing this
"right", i.e. in Sema, because IR gen knows a lot of tricks beyond
what the constant evaluator knows.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127854 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
b547eebdffb07dbc2a8239ca93b696b051096933 18-Mar-2011 Ted Kremenek <kremenek@apple.com> Use CrashRecoveryContextCleanup objects to recover an ASTUnit if we crash in ASTUnit::LoadFromCommandLine() and ASTUnit::LoadFromCompilerInvocation().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127851 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1040c227efc6821cd39795206c178894470a1a48 16-Mar-2011 Sandeep Patel <deeppatel1987@gmail.com> Fix duplicate argument processing

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127746 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
9db48467f19d4f0929a5ba40c5e2bd7255dc95f0 15-Mar-2011 NAKAMURA Takumi <geek4civic@gmail.com> lib/Frontend/InitHeaderSearch.cpp: Introduce AddMinGW64CXXPaths(Base) for x86_64-w64-mingw32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127652 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
5370383567e32c840b728bd5d066db281710f2c1 14-Mar-2011 Douglas Gregor <dgregor@apple.com> Add include paths for Gentoo Linux, from Marcin Mirosław!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127582 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
2e2468e2d2ccbb9a38fe3b6b754009af7e5d39a9 14-Mar-2011 Anders Carlsson <andersca@mac.com> Get rid of the static FileManager::FixupRelativePath.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127573 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
b0f4b9a558933b307073f7cd7753602f94354ae9 09-Mar-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce '-chain-include' option to specify headers that will be converted to chained PCHs in memory
without having to use multiple runs and intermediate files.

Intended for testing & debugging of chained PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127339 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
rontendAction.cpp
d271e4b0c6c42a0e670226e697963df427e35a56 07-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Apply changes to merge with clang upstream (6th Mar 2011)
ndroid.mk
27d70656d3ce7c9e030b6dea468cfc96687010d5 09-Mar-2011 Logan Chien <tzuhsiang.chien@gmail.com> Merge with clang upstream (Nov 6th 2011)
299a4a967b02c9f0d0d94ad8560e3ced893f9116 09-Mar-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add 'OverridenFilesKeepOriginalName' field in SourceManager which if true the SourceManager
should report the original file name for contents of files that were overriden by other files,
otherwise it should report the name of the new file. Default is true.

Also add similar field in PreprocessorOptions and pass similar parameter in ASTUnit::LoadFromCommandLine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127289 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
nitPreprocessor.cpp
4e03c2b9d735063a60cd0623423f4814178857ef 07-Mar-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow passing '-###' to ASTUnit::LoadFromCommandLine to print out the cc1 options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127183 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
e6ec11aa15c7104d57009c6e036bf4ae29c35fb2 07-Mar-2011 Douglas Gregor <dgregor@apple.com> Remove the AST printer (-ast-print-xml), which is too incomplete and
too low-level to actually be useful but is just interesting enough for
people to try to use it (which won't actually work beyond toy examples).

To bring back the AST printer, it needs to be:
- Complete, covering all of C/C++/Objective-C
- Documented, with appropriate Schema against which we can validate
the output
- Designed for C/C++/Objective-C, not Clang's specific ASTs
- Stable across Clang versions
- Well-tested


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127141 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
MakeLists.txt
ompilerInvocation.cpp
eclXML.cpp
ocumentXML.cpp
rontendActions.cpp
tmtXML.cpp
ypeXML.cpp
af036a6c25f540a9daf51e721485ae6d0e645bd8 06-Mar-2011 Anders Carlsson <andersca@mac.com> Convert FileManager::FixupRelativePath over to using PathV2.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127133 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ab0d8bde2d8ab54aae3a0d9fce11f29b3d1d0bb4 06-Mar-2011 Douglas Gregor <dgregor@apple.com> Add MinGW GCC 4.5.2 include paths, from Matthieu Monrocq

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127124 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
b1c86492f9a9bef01a4567408c22f961bbd604fe 05-Mar-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Currently we can only remap a file by creating a MemoryBuffer and replacing the file contents with it.
Allow remapping a file by specifying another filename whose contents should be loaded if the original
file gets loaded. This allows to override files without having to create & load buffers in advance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127052 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
acheTokens.cpp
15727ddb11405c45372150b5bfb07dbfa4c9960b 05-Mar-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce OwnsRemappedFileBuffers field in ASTUnit, indicating whether the ASTUnit should delete the remapped buffers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127051 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
9a7e09d82f739c8fd1b6c28787397d698515a871 02-Mar-2011 Rafael Espindola <rafael.espindola@gmail.com> Apply sysroot to system c++ headers too. Fixes PR9372.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126884 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f83f0c15798c0d971f7928314586b68b4d6696e2 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Add gcc-4.4.4 headers on Gentoo systems. Patch by Bertjan Broeksema!"
1e05c2a8f14d4844015bb2fda46100cad2a2c839 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Remove an unintended restriction on sysroots introduced during the Path conversion."
91fa65f80ab5f4a56406138e2b49b53a609a4158 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Tweak libclang's heuristics for building precompiled preambles and caching global code-completion results. In particular, don't perform either operation the first time we parse, but do both after the first reparse. "
0f9da4725b3a66a01e57188f570d851e53b05212 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Fix a think-o. Fixes PR8606."
73d5af460356c46c0e1f98267796879d4c732ac4 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Clean up some names and fix the handling of default sysroots on Windows and other platforms where the textual default of '/' isn't the system's root directory. We should probably still make the textual default platform specific, but this should avoid the particularly bad problem with the previous state: we applied a sysroot of '/' to '/usr/local/google' which added '//usr/local/include' to the windows header search path, a share on another machine named 'usr'. Oops."
36c5fd17f4343759544ab7a6898e54c8c17d93c9 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Switch the sysroot logic to use the Path interface, resolving a FIXME and making the code less gross."
211c7b3b9171999abdb94b4faf3bc92cc0fa719f 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Make sysroot only apply to baked in paths which start with a '/'."
5ecb0486de7ec68e806c3904727ef9080dbe2c03 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Make sure to always check the result of SourceManager::getPresumedLoc(), so that we don't try to make use of an invalid presumed location. Doing so can cause crashes."
8a73224f8ec3c2a7e9804643cf0b72dda027c540 02-Mar-2011 Shih-wei Liao <sliao@google.com> Merge "Improve ASTUnit's capture of diagnostics so that the diagnostic-capturing client lives as long as the ASTUnit itself does. Otherwise, we can end up with crashes when we get a diagnostic outside of parsing/code completion. The circumstances under which this happen are really hard to reproduce, because a file needs to change from under us."
630766057eabe78f9bb2e0c0d023223fb8d0174e 01-Mar-2011 Roman Divacky <rdivacky@freebsd.org> On FreeBSD, make sure /usr/local/include is *not* in the default include
path. This avoids accidentally including the wrong headers.

Patch by Dimitry Andric!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126761 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
cfe9af250f466e7e38becea4428990448ae07737 01-Mar-2011 Roman Divacky <rdivacky@freebsd.org> Implement -mrtd which sets the StdCall calling convention to be the default
one.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126756 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c4d2c9074be6eb2091086eddd6c8f052f3b245c8 28-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Remove '-analyzer-check-objc-mem' flag, the nominee for best misnomer award.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126676 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
fdad992adb31d02ffd87534fbf35245baaaeca96 28-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> Kill 18 month old #if 0'd code in StmtXML.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126670 91177308-0d34-0410-b5e6-96231b3b80d8
tmtXML.cpp
84021556baceb76eedf7d44be8ba71d9b8cfacce 28-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> Rename tok::eom to tok::eod.

The previous name was inaccurate as this token in fact appears at
the end of every preprocessing directive, not just macro definitions.
No functionality change, except for a diagnostic tweak.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126631 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
rintPreprocessedOutput.cpp
05357018b2e5e66559ad0ce2147dc1db9af42b9d 28-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Migrate ArrayBoundCheckerV2 to CheckerV2.

Turns -analyzer-check-buffer-overflows into -analyzer-checker=core.experimental.Overflow

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126609 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
58f2e7c3c3860e410fa3d8252862ef10be7cdc70 28-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Turn -analyzer-stats into -analyzer-checker=debug.Stats

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126608 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
6dd4dffe1090e820e9b5b25eee8ad3907a1aa679 28-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Remove '-analyzer-experimental-checks' flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126607 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
053ec969e3023e4b4a666546476ff74e6bfdfd9a 27-Feb-2011 Logan <tzuhsiang.chien@gmail.com> Merge with clang upstream Nov 10th 2010.
e293d30e858e38f2bb028c37ecac2178f8d78aa9 25-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> Teach objc-rewriter to pass -fobjc-exceptions along.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126497 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7decebfc7b9dc841f228c93cc2e41e3e62911ff8 25-Feb-2011 Ted Kremenek <kremenek@apple.com> Teach TextDiagnosticPrinter to print out '-Werror' in addition to the warning flag for a warning mapped to an error.

For example:

t.c:7:9: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses]

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126466 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
116f3640daee424dfcdbe55e80be5a67476be4b0 25-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Intoduce '-analyzer-checker-help' flag which outputs a list of all available static analyzer checkers.

This is pretty basic for now, eventually checkers should be grouped according to package, hidden checkers should be indicated etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126454 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
65d39251ff57b8e33cf6d3a7fcc6aa1c6f8cdc68 24-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Remove '-analyzer-experimental-internal-checks' flag, it doesn't have any checkers associated with it anymore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126440 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
38c8fe705ec4a8efa8992b99ab6d264fff14ca36 24-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow passing a list of comma separated checker names to -analyzer-checker, e.g:
-analyzer-checker=cocoa,unix

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126372 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d7f758cb88ce56c5f49faae088ab5a4073c28fa6 24-Feb-2011 Chris Lattner <sabre@nondot.org> Reimplement DefineTypeSize in terms of APInt. This eliminates some
magic integer arithmetic and allows it to work with types larger
than 64 bits.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126365 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
14aba76042e041b2c5e439bf4ae353a0a3c7fd73 24-Feb-2011 Douglas Gregor <dgregor@apple.com> Teach NestedNameSpecifier to keep track of namespace aliases the same
way it keeps track of namespaces. Previously, we would map from the
namespace alias to its underlying namespace when building a
nested-name-specifier, losing source information in the process.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126358 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
277a6e752512cff286190d35cb353ce717e86b18 23-Feb-2011 Nick Lewycky <nicholas@mxc.ca> Preserve what the user passed to -include when emitting .d files. Fixes PR8974!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126334 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
nitPreprocessor.cpp
0761e44550f094633bbe7fd4ae1d79ec456fca69 23-Feb-2011 Anders Carlsson <andersca@mac.com> Add a -fcxx-exceptions flag to clang -cc1. This controls the newly added CXXExceptions flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126300 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
5ef04ee40c3332d31b6d1439f50d0ddb45812929 23-Feb-2011 Chandler Carruth <chandlerc@gmail.com> Switch the VerifyDiagnosticsClient to use PresumedLocs now that they
exist. Cheat and do this by adding some wrappers around the PresumedLoc
machinery that directly return the line and column number.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126281 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticsClient.cpp
0bb208c91e91e2fe91e0f487b00ff4b5b30c8cc2 22-Feb-2011 Joerg Sonnenberger <joerg@bec.de> Remove the storage for -cxx-system-include. Make libcxx toolchain
use -nostdinc++ and -cxx-isystem.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126223 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
e9b801f7633b11b18d357a71442bd003435784e8 22-Feb-2011 Anders Carlsson <andersca@mac.com> Make clang -cc1 disable Objective-C exceptions by default, and add a -fobjc-exceptions flag to turn them on.

Update all tests accordingly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126177 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
2df6647847af283302834dadae5d9dcefa7e0ad4 22-Feb-2011 Joerg Sonnenberger <joerg@bec.de> Bug#8945: Add -cxx-isystem option to specify C++ system directories.
It works like -isystem and the search path keeps -isystem and
-cxx-isystem in order relative to each other. -cxx-isystem is only used
for C++ sources though. Drop the existing -cxx-system-include option for
cc1 as it is now redundant.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126167 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
da4b7cf09ebfd4e4098b516081fa9dae2f5c99e0 20-Feb-2011 Anders Carlsson <andersca@mac.com> Add a new ObjCExceptions member variable to LangOptions. This controls whether Objective-C exceptions are enabled or not (they are by default).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126061 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
4b93d660c6326ec79b5e369317d1051cf826c2f3 20-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> Re-instate r125819 and r125820 with no functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126060 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
96b1d4b4eb6b18dd6df7a2c0833332b45840580f 19-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Revert 125820 and 125819 to fix PR9266.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126050 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
5c722c7020b33da57090422b854072258a50b3f0 19-Feb-2011 Douglas Gregor <dgregor@apple.com> When code-completing a case statement for a switch on a value of
enumeration type, prioritize the enumeration constants and don't
provide completions for any other expressions. Fixes <rdar://problem/7283668>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125991 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
906c73ffbc78542ad333becb6e013dd9efc299b6 18-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> Move CompilerInstance::LLVMContext and LLVMContext ownership to CodeGenAction

This removes the final dependency edge from any lib outside of CodeGen
to core. As a result we can, and do, trim the dependency on core
from libclang, PrintFunctionNames, the unit tests and c-index-test.
While at it, review and trim other unneeded dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125820 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
21ac10d5e6f8781b498ed0338af435c117bd27d8 18-Feb-2011 Chris Lattner <sabre@nondot.org> handle labeldecls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125806 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
91a230a15f2aca8f6a8b7fd492525ec372a98e6b 17-Feb-2011 Douglas Gregor <dgregor@apple.com> Eliminate the internal command-line option for viewing inheritance in C++ classes, since it's only really worked for the trivial cases anyway due to lame pseudo-parsing of the class name. The viewInheritance() function is still available for use in the debugger, where this is far more useful

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125762 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ompilerInvocation.cpp
rontendActions.cpp
05c699e97aea64ee8cea1faaca900a39f977350c 17-Feb-2011 NAKAMURA Takumi <geek4civic@gmail.com> lib/Frontend/InitHeaderSearch.cpp: Add mingw-w64's include paths.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125743 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
0aa205765aec0aa5eed672f8e3cade543372edcd 17-Feb-2011 NAKAMURA Takumi <geek4civic@gmail.com> Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 instead.

No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125742 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
125b4cb35536e45201f8f2cb19ee620e3ad67c49 17-Feb-2011 NAKAMURA Takumi <geek4civic@gmail.com> Fix whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125741 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
9d50634cfc268ecc9a7250226dd5ca0e945240d4 17-Feb-2011 Chris Lattner <sabre@nondot.org> fix clang -MM output to escape spaces in filenames. This seems to be
the only character that GCC escapes. PR9224.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125707 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
48601b32321496b07a18fb6631f8563275d8c5fb 16-Feb-2011 Douglas Gregor <dgregor@apple.com> Teach the CXCodeCompleteResults results structure, which stores
code-completion results accessed via libclang, to extend the lifetime
of the allocator used for cached global code-completion results at
least until these completion results are destroyed. Fixes
<rdar://problem/8997369>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125678 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
9b7db6200d366e4964d63ae1f33c7b9d7b9831cb 16-Feb-2011 Douglas Gregor <dgregor@apple.com> Improve the invalidation logic for the cache of global code
completions. We now compute a hash of the names of all top-level
declarations and macro definitions, and invalidate the cache when the
hash value changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125670 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c9f2e0f286500c7e747849b3aa9c0e67a4dc90d7 15-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Use the new registration mechanism on the IdempotentOperationChecker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125611 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c12bbe5cbee8936204d286e17d8e0511dd67ddb4 15-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Fix the distro name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125601 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
adafdbae908a8e798fa4940ed89f61597b3d7ca5 15-Feb-2011 Rafael Espindola <rafael.espindola@gmail.com> Fix include paths on 32 bit ubuntu 10.10.
Original patch by Jonas Bülow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125597 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
8e3df4d0864f0a966c20088ca1a29c3398b7639d 15-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow resolving headers from a PCH even after headers+PCH were moved to another path.

Store in PCH the directory that the PCH was originally created in.
If a header file is not found at the path that we expect it to be and the PCH file
was moved from its original location, try to resolve the file by assuming that
header+PCH were moved together and the header is in the same place relative to the PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125576 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
rontendActions.cpp
43dee220252ef0b42c5f8a3bb1eca97f84f2565f 14-Feb-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Overhauling of the checker registration mechanism.

-Checkers will be defined in the tablegen file 'Checkers.td'.
-Apart from checkers, we can define checker "packages" that will contain a collection of checkers.
-Checkers can be enabled with -analyzer-checker=<name> and disabled with -analyzer-disable-checker=<name> e.g:
Enable checkers from 'cocoa' and 'corefoundation' packages except the self-initialization checker:
-analyzer-checker=cocoa -analyzer-checker=corefoundation -analyzer-disable-checker=cocoa.SelfInit
-Introduces CheckerManager and CheckerProvider. CheckerProviders get the set of checker names to enable/disable and
register them with the CheckerManager which will be the entry point for all checker-related functionality.

Currently only the self-initialization checker takes advantage of the new mechanism.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125503 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f315fa81eef1977b3457fd7a7d4639e060fe7278 14-Feb-2011 Peter Collingbourne <peter@pcc.me.uk> OpenCL: add support for __kernel, kernel keywords and EXTENSION,
FP_CONTRACT pragmas. Patch originally by ARM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125475 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7502c1d3ce8bb97bcc4f7bebef507040bd93b26f 13-Feb-2011 John McCall <rjmccall@apple.com> Give some convenient idiomatic accessors to Stmt::child_range and
Stmt::const_child_range, then make a bunch of places use them instead
of the individual iterator accessors.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125450 91177308-0d34-0410-b5e6-96231b3b80d8
tmtXML.cpp
0a86d44703fc5cd3cd38ea1708176f5b44321ed8 12-Feb-2011 Jeffrey Yasskin <jyasskin@google.com> Add CMake dependencies so that LLVM_USED_LIBS order doesn't matter.

I also sorted the tools/driver dependencies since their order no
longer matters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125417 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
0a480293f726508ad9aed0be39e8c9779e84f2f2 11-Feb-2011 Douglas Gregor <dgregor@apple.com> Rename the operation that loads a preprocessed entity from a given offset to indicate that we're loading from an offset, not an index, lest one be confused. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125394 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5f740c68685eaa02b969e98365129f6fe1e3249b 11-Feb-2011 NAKAMURA Takumi <geek4civic@gmail.com> InitHeaderSearch.cpp: [PR8298] Don't touch drive G: on Windows hosts!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125364 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
be4c8705e499b55548467eb7adaa23cbc6edfef9 10-Feb-2011 Roman Divacky <rdivacky@freebsd.org> Implement mcount profiling, enabled via -pg.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125282 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
886e1606c28e970bb288abf4dbc40feb16822a79 10-Feb-2011 NAKAMURA Takumi <geek4civic@gmail.com> CMake: LLVM_NO_RTTI must be obsolete now!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125275 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
92b97f2d279405751447488504816d82e1906f4f 09-Feb-2011 Douglas Gregor <dgregor@apple.com> Finish up the diagnostic client before we've torn down the ASTReader,
since the diagnostic client might poke at source locations that have
not yet been deserialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125204 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
17d3fea677753e6e3e82ffe2cbdeccbf5f2e7497 09-Feb-2011 Daniel Dunbar <daniel@zuster.org> Driver/Frontend: Wire up -mregparm=.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125201 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d767d81290288c030f3be0be1d3e62b9c8df51dc 09-Feb-2011 Ted Kremenek <kremenek@apple.com> static analyzer: Further reduce the analyzer's memory usage when analyzing sqlite3 by 7-10% by recylcing "uninteresting" ExplodedNodes.

The optimization involves eagerly pruning ExplodedNodes from the ExplodedGraph that contain
practically no difference between the predecessor and successor nodes. For example, if
the state is different between a predecessor and a node, the node is left in. Only for
the 'environment' component of the state do we not care if the ExplodedNodes are different.
This paves the way for future optimizations where we can reclaim the environment objects.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125154 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8ef6c8cb6c5627240e2339fd7062c9873f821d7e 05-Feb-2011 Douglas Gregor <dgregor@apple.com> Improve our uniquing of file entries when files are re-saved or are
overridden via remapping. Thus, when we create a "virtual" file in the
file manager, we still stat() the real file that lives behind it so
that we can provide proper uniquing based on inodes. This helps keep
the file manager much more consistent.

To take advantage of this when reparsing files in libclang, we disable
the use of the stat() cache when reparsing or performing code
completion, since the stat() cache is very likely to be out of date in
this use case.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124971 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendAction.cpp
142f9e99018a85105cee570133c111a52f2053ec 04-Feb-2011 Fariborz Jahanian <fjahanian@apple.com> -fapple-kext cannot have 'weak' visibility in this
abi.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124834 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
2100fe952a644134b1dca462f2e6330cf14ef47c 03-Feb-2011 Oscar Fuentes <ofv@wanadoo.es> Moved here from LLVM Clang's configuration options and related macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124825 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f704c61b3c88659a0c9946ea26d1bbff99803792 03-Feb-2011 Daniel Dunbar <daniel@zuster.org> Frontend: Switch -header-include-file output to use unbuffered raw_ostreams with
the atomic writes option, since the intent is that this option be set for an
entire build, which may have any number of compiler instances writing to the
same output file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124772 91177308-0d34-0410-b5e6-96231b3b80d8
eaderIncludeGen.cpp
b34d69b9292534c1c574f168f0ac10aea652adca 02-Feb-2011 Daniel Dunbar <daniel@zuster.org> Frontend: Add -header-include-file option, for allowing saving header include
information to a file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124750 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
eaderIncludeGen.cpp
b376e5e71aa3e608c0481a9a7facb5d8b29d3163 02-Feb-2011 Daniel Dunbar <daniel@zuster.org> Frontend: Add support (unused) for showing all "interesting" headers, not just
ones outside the predefines buffer (which is what -H does).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124749 91177308-0d34-0410-b5e6-96231b3b80d8
eaderIncludeGen.cpp
8e50a96b387dca7525caa8a6add31420dd82a2cd 02-Feb-2011 Benjamin Kramer <benny.kra@googlemail.com> Add NetBSD target support. Patch by Joerg Sonnenberger.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124736 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
eef63e0997e0f6d6436736ea919b851cfe34955a 02-Feb-2011 Daniel Dunbar <daniel@zuster.org> Frontend: Factor out header include dumping (-H) into its own preprocessor
callbacks class.
- Aside from being generally cleaner, this also allows -H to work correctly in
modes other than standard preprocessing (e.g., -c, -MM, etc.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124723 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInstance.cpp
ompilerInvocation.cpp
eaderIncludeGen.cpp
rintPreprocessedOutput.cpp
dae687575010c9c49a4b552f5eef82cd6279d9ac 01-Feb-2011 Douglas Gregor <dgregor@apple.com> Create a special allocator class for code completion, so that all of
the string copying goes through a single place that can have
associated state.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124698 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
db0835552ff4b640bc908a50ccd075ab63cf6fff 01-Feb-2011 Nick Lewycky <nicholas@mxc.ca> Add updated Debian ARM include path.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124684 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
218937c13ef5b0625a70aad41ca7a92da9278bd2 01-Feb-2011 Douglas Gregor <dgregor@apple.com> Allocate CodeCompletionString and all of its components in a
BumpPtrAllocator, rather than manually new/delete'ing them. This
optimization also allows us to avoid allocating memory for and copying
constant strings (e.g., "return", "class").

This also required embedding the priority and availability of results
within the code completion string, to avoid extra memory allocation
within libclang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124673 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
6f75550e40a9177db9979fc130ce3ece026b137d 01-Feb-2011 Douglas Gregor <dgregor@apple.com> Basic support for -mms-bitfields, from Carl Norum!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124661 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c7a9cda0eb24762a3e9c892b1f4bdc6deb5de0a6 31-Jan-2011 Daniel Dunbar <daniel@zuster.org> libclang: Don't allow RemoveFileOnSignal to be called via libclang, badness can
ensue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124613 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
ff9cd968cd5b623e3ec7e5f862b598cd22f7ec79 31-Jan-2011 Daniel Dunbar <daniel@zuster.org> Frontend: Add an explicit RemoveFileOnSignal flag argument, to control the
automatic behavior (which is undesirable in a multithreaded context).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124612 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
f25649c74397d2620e6ac61f1045261644707c80 29-Jan-2011 Nico Weber <nicolasweber@gmx.de> Support for -plugin-arg- with -add-plugin

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124551 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendAction.cpp
1aa27307c462baaa9e5fda14ff6797dd39fe8b84 27-Jan-2011 Douglas Gregor <dgregor@apple.com> Teach ASTUnit to save the specified target features, since
TargetInfo::CreateTargetInfo() mangles the target options in a way
that is not idempotent. Fixes <rdar://problem/8807535>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124382 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
04331169f04198eb769925fa17696a21989c9d8b 27-Jan-2011 Axel Naumann <Axel.Naumann@cern.ch> TextDiagnosticPrinter.cpp: Show diagnostics as far as possible even with invalid PresomedLoc, instead of just silencing it.

FileManager.cpp: Allow virtual files in nonexistent directories.
FileManager.cpp: Close FileDescriptor for virtual files that correspond to actual files.
FileManager.cpp: Enable virtual files to be created even for files that were flagged as NON_EXISTENT_FILE, e.g. by a prior (unsuccessful) addFile().

ASTReader.cpp: Read a PCH even if the original source files cannot be found.

Add a test for reading a PCH of a file that has been removed and diagnostics referencing that file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124374 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
bd5a94e263137dc3ce7c100485626bae025cf58e 26-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [analyzer] Enable the self-init checker under command-line option '-analyzer-check-objc-self-init' which by default
is enabled by the driver for '--analyze'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124266 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
2bc212120692987b02ae8a85366a58f1c36cc2bf 25-Jan-2011 Ted Kremenek <kremenek@apple.com> Unbreak CMake build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124235 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
5aa74affa5d61d04c4b034b3722ca41aec0cba6e 25-Jan-2011 Nico Weber <nicolasweber@gmx.de> Add -add-plugin flag, which runs plugins in addition to codegen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124227 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendAction.cpp
ultiplexConsumer.cpp
f4c7371fb1d3cebcfb40abad4537bb82515704ea 19-Jan-2011 John McCall <rjmccall@apple.com> Change QualType::getTypePtr() to return a const pointer, then change a
thousand other things which were (generally inadvertantly) relying on that.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123814 91177308-0d34-0410-b5e6-96231b3b80d8
ypeXML.cpp
3f1d1f9131cb8ad24704a193ab29f938e1bc553f 19-Jan-2011 Logan <tzuhsiang.chien@gmail.com> Use automatically generated Version.inc instead.
ndroid.mk
150e0efec6302fa5a8c3b5c3c4ecf5778d3a29f5 19-Jan-2011 Logan <tzuhsiang.chien@gmail.com> Add build rules for clang executable.
ndroid.mk
0b53cf834346d78985aaa9e7300445a39c245614 19-Jan-2011 Douglas Gregor <dgregor@apple.com> Don't silently drop warning flags passed in to
clang_createTranslationUnitFromSourceFile().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123793 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
d8868a634d4fd362243dc646e58c3cf956c81dcd 18-Jan-2011 Douglas Gregor <dgregor@apple.com> Introduce the notion of a "minimal" import of ASTs, to better support LLDB.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123723 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
32bef4edba854303800b3b01cb49a282e5da4f69 10-Jan-2011 Michael J. Spencer <bigcheesegs@gmail.com> Replace all uses of PathV1::exists with PathV2::fs::exists.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123150 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
b466d01e464b21832c23eeed90112bc5c26c0236 07-Jan-2011 Fariborz Jahanian <fjahanian@apple.com> Add all options needed to support -fapple-kext. wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122987 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
112c3307aaa9ae9ee6ff5c2b4f6a53b1ea3c6f19 04-Jan-2011 Fariborz Jahanian <fjahanian@apple.com> Fold -fobjc-nonfragile-abi2 into -fobjc-nonfragile-abi.
// rdar://8818375



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122831 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
af6530c938bfc60902f0dfec1c0808aedbee1663 25-Dec-2010 Michael J. Spencer <bigcheesegs@gmail.com> Remove all uses of PathV1::GetRootDirectory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122552 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
c32647d111e516593b9ba242cad7b8ff4016c155 23-Dec-2010 Ted Kremenek <kremenek@apple.com> Add -fobjc-default-synthesized-properties flag
to allow us to explicitly control whether or
not Objective-C properties are default synthesized.
Currently this feature only works when using
the -fobjc-non-fragile-abi2 flag (so there is
no functionality change), but we can now turn
off this feature without turning off all the features
coupled with -fobjc-non-fragile-abi2.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122519 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c478a1425c055e517169220ea1c1efd857e65f52 23-Dec-2010 Ted Kremenek <kremenek@apple.com> Add WIP prototype of a new buffer overflow
checker based on using raw (symbolic) byte offsets
from a base region.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122469 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c4bf2b9afb7d47445a9dc6bc848657098a4e3851 22-Dec-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Introduced raw_identifier token kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122394 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
fbfd180495e7800975c6d9bdc6d24e706ef70e34 21-Dec-2010 Michael J. Spencer <bigcheesegs@gmail.com> Replace all uses of PathV1::makeAbsolute with PathV2::fs::make_absolute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122340 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
nitPreprocessor.cpp
06a8dc616ec8324694d45cd4d724634a899be9a3 21-Dec-2010 Michael J. Spencer <bigcheesegs@gmail.com> Fix spelling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122339 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
a3d39c066521a76fb30c83c560ece9a18d296b20 21-Dec-2010 Francois Pichet <pichet2000@gmail.com> Add IndirectField case in DeclContextPrinter::PrintDeclContext.
Fix PR8832.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122311 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
256053b31e697fdf0cc48f17d621c82fc3b8dff0 17-Dec-2010 Michael J. Spencer <bigcheesegs@gmail.com> Replace all uses of PathV1::isAbsolute with PathV2::is_{absolute,relative}.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122087 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
nitHeaderSearch.cpp
4eeebc464e1f968d9968a4786c82558f18ac2ed8 16-Dec-2010 Michael J. Spencer <bigcheesegs@gmail.com> MemoryBuffer API update.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121956 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
d64f4c14029f970caafb0bdfcf07f9fecfe5c68b 09-Dec-2010 Douglas Gregor <dgregor@apple.com> Gather cached code completions after the first reparse, not after the
second reparse.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121413 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
3a321e23f66128dbb986343927456ff6702af617 09-Dec-2010 Michael J. Spencer <bigcheesegs@gmail.com> Use error_code instead of std::string* for MemoryBuffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121378 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
f187237d916afa97c491ac32fe98be7d335c5b63 08-Dec-2010 Francois Pichet <pichet2000@gmail.com> Remove the TypesCompatibleExprClass AST node. Merge its functionality into BinaryTypeTraitExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121298 91177308-0d34-0410-b5e6-96231b3b80d8
tmtXML.cpp
1fd9e0def66fbd50e99be5ff87c9fd1c91c428ab 07-Dec-2010 Douglas Gregor <dgregor@apple.com> Use atomic operations for libclang's object count tracking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121073 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
91252d115bdb6f937192a8dbc86c5abe00101436 04-Dec-2010 Peter Collingbourne <peter@pcc.me.uk> Implement -cl-std=

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120882 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
4400cb8c548a90c472444b57690117563f4be195 04-Dec-2010 Peter Collingbourne <peter@pcc.me.uk> Implement -cl-mad-enable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120881 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f0840820b4e28fd0cc04d737382811d7372cb832 04-Dec-2010 Peter Collingbourne <peter@pcc.me.uk> Implement -cl-fast-relaxed-math

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120880 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitPreprocessor.cpp
5f67e13fcdc3c33e9cd5d027bfbb677b726c6f6a 04-Dec-2010 Peter Collingbourne <peter@pcc.me.uk> Implement -cl-unsafe-math-optimizations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120879 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
5d729a3d8eeba59ed97119998f2135ad6d45e876 04-Dec-2010 Peter Collingbourne <peter@pcc.me.uk> Implement -cl-finite-math-only

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120878 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
0982136cb748f4a842141bf199d133126d6be882 04-Dec-2010 Peter Collingbourne <peter@pcc.me.uk> Implement -cl-single-precision-constant

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120877 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
61e07861dd3a70c31f658bad8c4b911994e4933b 04-Dec-2010 Peter Collingbourne <peter@pcc.me.uk> Implement -cl-opt-disable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120876 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
0a3c03cb1fbc1f84f851d6ad642d22b978b031fd 04-Dec-2010 Peter Collingbourne <peter@pcc.me.uk> Refactor optimisation level code

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120875 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
53c92be3b233cede6114702a5f86f146f55d6c6e 04-Dec-2010 Peter Collingbourne <peter@pcc.me.uk> Introduce CompilerInvocation::setLangDefaults function

This patch refactors the CompilerInvocation code to introduce a
CompilerInvocation::setLangDefaults function, which can set up a
LangOptions with the defaults for a given language and language
standard. This function is useful for non-command line based Clang
clients which need to set up a CompilerInvocation manually for a
specific language.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120874 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
895fcca55a6d52a71639f2472a6623ab2dd9f628 01-Dec-2010 Peter Collingbourne <peter@pcc.me.uk> Driver, Frontend: add CUDA language support

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120544 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendActions.cpp
rontendOptions.cpp
8a24341a121e3e004e322ff74301c7ba29b10488 01-Dec-2010 Dan Gohman <gohman@apple.com> Don't check the isysroot path for Path::isValid(); if the user has
specified a syntactically invalid path, it's better to let the OS
diagnose the problem than to silently skip it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120542 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
67aba816901503d9cf7ba699525fa62cc7f8e5e4 30-Nov-2010 Fariborz Jahanian <fjahanian@apple.com> Such function decls,as objc's objc_msgSend, builtins in
a specific language. We are adding such language info. by
extensing Builtins.def and via a language flag added
to LIBBUILTIN/BUILTIN and check for that when deciding
a name is builtin or not. Implements //rdar://8689273.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120429 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
89d9980bbc2e4a4ac86673e6ec16fb9f5babb63b 30-Nov-2010 Douglas Gregor <dgregor@apple.com> When using a precompiled preamble with detailed preprocessing records,
trap the serialized preprocessing records (macro definitions, macro
instantiations, macro definitions) from the generation of the
precompiled preamble, then replay those when walking the list of
preprocessed entities. This eliminates a bug where clang_getCursor()
wasn't able to find preprocessed-entity cursors in the preamble.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120396 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
414cb64f09ce48a36377458ce5e5a90c3ad41d00 30-Nov-2010 Douglas Gregor <dgregor@apple.com> When loading a precompiled preamble, use the file ID of the
precompiled preamble as the "main" source file's file ID within the
source manager. This makes compiling with a precompiled preamble
produce the same source locations as when compiling without the
precompiled preamble; prior to this change, we ended up with different
file IDs for source locations within the precompiled preamble
vs. those after the precompiled preamble, even for entities (e.g.,
preprocessing entities) in the same file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120390 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
03013fa9a0bf1ef4b907f5fec006c8f4000fdd21 29-Nov-2010 Michael J. Spencer <bigcheesegs@gmail.com> Merge System into Support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120297 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
STUnit.cpp
acheTokens.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
7f946ad40877df749ad05392cc4b80dc4189d28f 29-Nov-2010 Douglas Gregor <dgregor@apple.com> When performing code completion within ASTUnit, allocate the AugmentedCodeCompleteConsumer on the heap, so it's always cleaned up properly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120290 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
fbfdb202405df65e054db4ad2111393c1b581d2d 28-Nov-2010 Chandler Carruth <chandlerc@gmail.com> Add GCC 4.4.5 for Gentoo, and order them in a more sensible way. This allows
Gentoo systems with multiple versions to pick up the newest one first. This is
especially important with Gentoo because some of the older versions are left on
systems in strange states.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120238 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
9d2c06001b0c09fdb0f973cd6f8fa5555aea1b5f 25-Nov-2010 Rafael Espindola <rafael.espindola@gmail.com> Add C++ header path for openSUSE 11.4.
Patch by İsmail Dönmez.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120154 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f35142413974e9dfe2c5f202084db4bd1c2073e9 24-Nov-2010 John McCall <rjmccall@apple.com> Add -cc1 -ast-dump-xml, an excessively detailed XML dump of the internals
of the ASTs. Only available in assertions builds. No stability guarantee.

This is intended solely as a debugging tool. I'm not sure if the goals
are sufficiently aligned with the XML printer to allow a common
implementation.

Currently just falls back on the StmtDumper to display statements,
which means it doesn't produce valid XML in those cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120088 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ompilerInvocation.cpp
rontendActions.cpp
898a061f69e1145bf89a987c08203132b9922a3c 23-Nov-2010 Chris Lattner <sabre@nondot.org> change the 'is directory' indicator to be a null-or-not
pointer that is passed down through the APIs, and make
FileSystemStatCache::get be the one that filters out
directory lookups that hit files. This also paves the
way to have stat queries be able to return opened files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120060 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
d6f611198089b78e32d3a15fe8bc986204aee1aa 23-Nov-2010 Chris Lattner <sabre@nondot.org> simplify the cache miss handling code, eliminating CacheMissing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120038 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
10e286aa8d39fb51a21412850265d9dae74613ee 23-Nov-2010 Chris Lattner <sabre@nondot.org> rework the stat cache, pulling it out of FileManager.h into
its own header and giving it some more structure. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120030 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
75dfb65c38d51772df9a00ce2d2feeefd55667ad 23-Nov-2010 Chris Lattner <sabre@nondot.org> tidy up. Split FileManager::getBufferForFile into
two copies, since they are fundamentally different
operations and the StringRef one should go away
(it shouldn't be part of FileManager at least).

Remove some dead arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120013 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
681c74afe6a81161aa13291c6c114e5240b23865 23-Nov-2010 Chris Lattner <sabre@nondot.org> don't allow remapping PTH file paths with -fworking-directory, the
client should just pass in absolute paths.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120012 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
39b49bcaaddb1049234fca9500c0ac02c088e23d 23-Nov-2010 Chris Lattner <sabre@nondot.org> now the FileManager has a FileSystemOpts ivar, stop threading
FileSystemOpts through a ton of apis, simplifying a lot of code.
This also fixes a latent bug in ASTUnit where it would invoke
methods on FileManager without creating one in some code paths
in cindextext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120010 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
rontendAction.cpp
rontendActions.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
7ad97ffa631af6ad678c79b38341ac995f347ce9 23-Nov-2010 Chris Lattner <sabre@nondot.org> give FileManager a 'FileSystemOptions' ivar, which will be used
to simplify a bunch of code in it. It should ultimately get inlined
into FileManager.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120007 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
151466a18671df9cfd9abd59ba53df35b1d687da 23-Nov-2010 Chris Lattner <sabre@nondot.org> Partially revert Doug's PCH validation patch (r98585).

This patch completely defeated the "passing in a prestat'd size
to MemoryBuffer" optimization, leading to an extra fstat call for
every buffer opened, in order to find out if the datestamp and size
of the file on disk matches what is in the stat cache.

I fully admit that I don't completely understand what is going on here:
why punish code when a stat cache isn't in use? what is the point of a
stat cache if you have to turn around and stat stuff to validate it?

To resolve both these issues, just drop the modtime check and check the
file size, which is the important thing anyway. This should also resolve
PR6812, because presumably windows is stable when it comes to file sizes.
If the modtime is actually important, we should get it and keep it on the
first stat.

This eliminates 833 fstat syscalls when processing Cocoa.h, speeding up
system time on -Eonly Cocoa.h from 0.041 to 0.038s.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120001 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
2aa9267cf193e5eceb9fd24a51b51c031b606fe9 19-Nov-2010 Craig Silverstein <csilvers2000@yahoo.com> Several PPCallbacks take an SourceLocation + IdentifierInfo, rather
than a Token that holds the same information all in one easy-to-use
package. There's no technical reason to prefer the former -- the
information comes from a Token originally -- and it's clumsier to use,
so I've changed the code to use tokens everywhere.

Approved by clattner


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119845 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
be3aab6abe5e66bb86596da806acc49614eacb69 18-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use hasErrorOccurred() instead of getNumErrors() where it makes sense.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119746 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
ab41b97c3cddf1bcdd8bf82ab09ed3ceafcd05b1 18-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the hack where, to get the return status, we had special case for VerifyDiagnosticsClient
and just check the number of errors from the DiagnosticClient.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119736 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
erifyDiagnosticsClient.cpp
f2224d89a6ae65a3839529e26d0f6d025d83d6bb 18-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Since multiple diagnostics can share one diagnostic client, have the client keeping track
of the total number of warnings/errors reported.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119731 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
ompilerInstance.cpp
extDiagnosticBuffer.cpp
extDiagnosticPrinter.cpp
33e4e70c8c0a17e0ccb7465d96556b077a68ecb1 18-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactoring of Diagnostic class.

-Move the stuff of Diagnostic related to creating/querying diagnostic IDs into a new DiagnosticIDs class.
-DiagnosticIDs can be shared among multiple Diagnostics for multiple translation units.
-The rest of the state in Diagnostic object is considered related and tied to one translation unit.
-Have Diagnostic point to the SourceManager that is related with. Diagnostic can now accept just a
SourceLocation instead of a FullSourceLoc.
-Reflect the changes to various interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119730 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
ompilerInstance.cpp
extDiagnosticPrinter.cpp
1380a147d4578b619c215b23aa79ce17036d3c46 18-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Rename -Wargument-larger-than -> -Wlarge-by-value-copy
-Improve the diagnostic message
-Add some comments

Suggestions by Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119594 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
3532fdd1db8ff6f353f2a5b215cebe3e0e2ff3c2 18-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce option -Wargument-larger-than[=N] which warns about function definitions if they take by-value
or return by-value any POD that is larger than some threshold (default is 64 bytes).

Implements rdar://8548050.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119583 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e3c60a7ce9e0f42c7ca2344b33203266aceca1db 17-Nov-2010 Douglas Gregor <dgregor@apple.com> Fix source-range information for Objective-C properties. Previously,
we were just getting a range covering only the property name, which is
certainly not correct (and broke token annotation, among other
things).

Also, teach libclang about the relationship between
@synthesize/@dynamic and @property, so we get property name and
cursor-reference information for @synthesize and @dynamic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119409 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
73fc91275a4dc7cb0b0b12a8022319ea78c1f9fe 16-Nov-2010 Douglas Gregor <dgregor@apple.com> Use an OwningPtr for the preamble buffer in ASTUnit. This plugs a leak
where we failed to free this buffer along one of the paths, and
detangles the code a little.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119379 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
93f040e963bb4bd52e2721d54e984a7067479ae1 16-Nov-2010 Nico Weber <nicolasweber@gmx.de> Add gcc-4.4.4 headers on Gentoo systems. Patch by Bertjan Broeksema!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119348 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
8ad8a1cc1e39d70345d45ef1b8564ec6cbf49471 16-Nov-2010 Nico Weber <nicolasweber@gmx.de> Add gcc-4.4.4 headers on Gentoo systems. Patch by Bertjan Broeksema!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119348 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
b51569a0191b8deef95ddcf9ebc18d967f1ca848 16-Nov-2010 Chandler Carruth <chandlerc@gmail.com> Remove an unintended restriction on sysroots introduced during the Path
conversion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119346 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
7c1a1ef39d6768289a90be94a9e706fda59582be 16-Nov-2010 Chandler Carruth <chandlerc@gmail.com> Remove an unintended restriction on sysroots introduced during the Path
conversion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119346 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
a49aed0abc04133112b6d90ce6fced3a43839f1c 16-Nov-2010 Douglas Gregor <doug.gregor@gmail.com> Tweak libclang's heuristics for building precompiled preambles and
caching global code-completion results. In particular, don't perform
either operation the first time we parse, but do both after the first
reparse.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119285 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
08bb4c622d0b79c33b4ac78ce1bec79398953daa 16-Nov-2010 Douglas Gregor <dgregor@apple.com> Tweak libclang's heuristics for building precompiled preambles and
caching global code-completion results. In particular, don't perform
either operation the first time we parse, but do both after the first
reparse.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119285 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
15447c4a4a0a08b392fc81d2a46966ab3a2b19ec 15-Nov-2010 Chandler Carruth <chandlerc@gmail.com> Fix a think-o. Fixes PR8606.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119139 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
5619ae5d25dc77410a444c86606d4ec9bae8b921 15-Nov-2010 Chandler Carruth <chandlerc@gmail.com> Fix a think-o. Fixes PR8606.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119139 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
832646f5719a44ac0e1633d18a8ad329b27d2716 15-Nov-2010 Chandler Carruth <chandlerc@gmail.com> Clean up some names and fix the handling of default sysroots on Windows and
other platforms where the textual default of '/' isn't the system's root
directory. We should probably still make the textual default platform specific,
but this should avoid the particularly bad problem with the previous state: we
applied a sysroot of '/' to '/usr/local/google' which added
'//usr/local/include' to the windows header search path, a share on another
machine named 'usr'. Oops.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119131 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
c09265a5fd94af5dcfd7325d0cb4f04197d65afc 15-Nov-2010 Chandler Carruth <chandlerc@gmail.com> Clean up some names and fix the handling of default sysroots on Windows and
other platforms where the textual default of '/' isn't the system's root
directory. We should probably still make the textual default platform specific,
but this should avoid the particularly bad problem with the previous state: we
applied a sysroot of '/' to '/usr/local/google' which added
'//usr/local/include' to the windows header search path, a share on another
machine named 'usr'. Oops.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119131 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
4c0b716b493957ca286b014766ce3981971c8edb 15-Nov-2010 Chandler Carruth <chandlerc@gmail.com> Switch the sysroot logic to use the Path interface, resolving a FIXME and
making the code less gross.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119099 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f3721457cd9f364f262e7a2d61edcdad05996e61 15-Nov-2010 Chandler Carruth <chandlerc@gmail.com> Switch the sysroot logic to use the Path interface, resolving a FIXME and
making the code less gross.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119099 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ac6c901cc4a6f509867981459765f0af826fa2f2 15-Nov-2010 Chandler Carruth <chandlerc@gmail.com> Make sysroot only apply to baked in paths which start with a '/'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119095 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
5853b0f117ee811388219bce738b24835b8d7fb2 15-Nov-2010 Chandler Carruth <chandlerc@gmail.com> Make sysroot only apply to baked in paths which start with a '/'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@119095 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
70eddbfa09174de7d44b6a5cf7ecd55c4b97bee0 12-Nov-2010 Douglas Gregor <doug.gregor@gmail.com> Make sure to always check the result of
SourceManager::getPresumedLoc(), so that we don't try to make use of
an invalid presumed location. Doing so can cause crashes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118885 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
rintPreprocessedOutput.cpp
extDiagnosticPrinter.cpp
cb7b1e17b63967317ab5cc55682168cf0380519a 12-Nov-2010 Douglas Gregor <dgregor@apple.com> Make sure to always check the result of
SourceManager::getPresumedLoc(), so that we don't try to make use of
an invalid presumed location. Doing so can cause crashes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118885 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
rintPreprocessedOutput.cpp
extDiagnosticPrinter.cpp
8b9e7cba1096fe0c447828dd55688e824b3a80ac 11-Nov-2010 Douglas Gregor <doug.gregor@gmail.com> Improve ASTUnit's capture of diagnostics so that the
diagnostic-capturing client lives as long as the ASTUnit itself
does. Otherwise, we can end up with crashes when we get a diagnostic
outside of parsing/code completion. The circumstances under which this
happen are really hard to reproduce, because a file needs to change
from under us.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118751 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
e47be3e9682e82da15059006f43c7f3c021e4fff 11-Nov-2010 Douglas Gregor <dgregor@apple.com> Improve ASTUnit's capture of diagnostics so that the
diagnostic-capturing client lives as long as the ASTUnit itself
does. Otherwise, we can end up with crashes when we get a diagnostic
outside of parsing/code completion. The circumstances under which this
happen are really hard to reproduce, because a file needs to change
from under us.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118751 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
531336d442213a8330756c491a94f67516f8ed1c 10-Nov-2010 Chris Lattner <sabre@nondot.org> make sure #pragma clang is treated the same way as #pragma gcc in -E mode,
unknown pragmas should just be passed through to the .i file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118659 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
1397399de1cff90e0cb3b1d72097d34bd1a11759 10-Nov-2010 Chris Lattner <sabre@nondot.org> make sure #pragma clang is treated the same way as #pragma gcc in -E mode,
unknown pragmas should just be passed through to the .i file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118659 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
7c0d88100fa7af4bcc103afaa9982b2c2cecb2ec 09-Nov-2010 Benjamin Kramer <benny.kra@googlemail.com> Simplify code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118619 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
edfb7ecea0222be2796469f8c41b836129f833f8 09-Nov-2010 Benjamin Kramer <benny.kra@googlemail.com> Simplify code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118619 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
071ace003555b624992e8655246440a3d01feab2 09-Nov-2010 Douglas Gregor <doug.gregor@gmail.com> Appeasing MSVC, take 3

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118493 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
6665ffbfc397f68e3fb15844597674d5861995b6 09-Nov-2010 Douglas Gregor <dgregor@apple.com> Appeasing MSVC, take 3

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118493 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
1f57e5c69f640bc6e3a5659221a28f2b91df8efb 09-Nov-2010 Douglas Gregor <doug.gregor@gmail.com> Try to appease MSVC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118487 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
b87b29ec2ae449686a745c257e577b7158d8d4aa 09-Nov-2010 Douglas Gregor <dgregor@apple.com> Try to appease MSVC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118487 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
0177efc627a3195239e36a7de23f69f8546c04a0 09-Nov-2010 Douglas Gregor <doug.gregor@gmail.com> Add missing include

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118485 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
4980afd9b5225e207742f0711b392e887619640e 09-Nov-2010 Douglas Gregor <dgregor@apple.com> Add missing include

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118485 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
393a3afae24733ba1be20c83bdddcdd1e68b35d8 09-Nov-2010 Douglas Gregor <doug.gregor@gmail.com> sprintf -> snprintf conversion, from Vladimir Kirillov

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118478 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
5e0fb35232366d1956647c2e01ea183242fba28c 09-Nov-2010 Douglas Gregor <dgregor@apple.com> sprintf -> snprintf conversion, from Vladimir Kirillov

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118478 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
f003df34c3ddd03caf653d35e27c2f345ff23cba 07-Nov-2010 Ted Kremenek <kremenek@apple.com> Change the StringSet used by CalculateHiddenNames() to use a BumpPtrAllocator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118372 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c198f6170f9a66a78f12ab014694e2f5701f7f19 07-Nov-2010 Ted Kremenek <kremenek@apple.com> Change the StringSet used by CalculateHiddenNames() to use a BumpPtrAllocator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118372 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
6dbcbbcfcdcc44c8f7641dc788d2523cf1a09b5b 03-Nov-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Implement -working-directory.

When -working-directory is passed in command line, file paths are resolved relative to the specified directory.
This helps both when using libclang (where we can't require the user to actually change the working directory)
and to help reproduce test cases when the reproduction work comes along.

--FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains
the working directory value if set).
--FileSystemOptions are passed around to various interfaces that perform file operations.
--Opening & reading the content of files should be done only through FileManager. This is useful in general since
file operations will be abstracted in the future for the reproduction mechanism.

FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same
FileManager but with different FileSystemOptions.

Addresses rdar://8583824.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118203 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
rontendAction.cpp
rontendActions.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
389db16c63eec6ecfa9b235155252d8da766e94e 03-Nov-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement -working-directory.

When -working-directory is passed in command line, file paths are resolved relative to the specified directory.
This helps both when using libclang (where we can't require the user to actually change the working directory)
and to help reproduce test cases when the reproduction work comes along.

--FileSystemOptions is introduced which controls how file system operations are performed (currently it just contains
the working directory value if set).
--FileSystemOptions are passed around to various interfaces that perform file operations.
--Opening & reading the content of files should be done only through FileManager. This is useful in general since
file operations will be abstracted in the future for the reproduction mechanism.

FileSystemOptions is independent of FileManager so that we can have multiple translation units sharing the same
FileManager but with different FileSystemOptions.

Addresses rdar://8583824.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118203 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
rontendAction.cpp
rontendActions.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
e21c01406ad622fa33eba6e580833ee8c586691a 02-Nov-2010 Rafael Espindola <rafael.espindola@gmail.com> Add support for Fedora 14. Patch by Daniel Kozlowski.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118035 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
6638b3a15edea25c4b1fdf8046e71d82683d8efa 02-Nov-2010 Rafael Espindola <rafael.espindola@gmail.com> Add support for Fedora 14. Patch by Daniel Kozlowski.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@118035 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
4e2ba30488b90b830998ace0eb27ed3b2384aded 02-Nov-2010 Douglas Gregor <doug.gregor@gmail.com> Teach SourceManager::getPresumedLoc() how to fail gracefully if getLineNumber/getColumnNumber fail

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117990 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
c417fa024495c10a5e678ea36a5f8c715528bdd1 02-Nov-2010 Douglas Gregor <dgregor@apple.com> Teach SourceManager::getPresumedLoc() how to fail gracefully if getLineNumber/getColumnNumber fail

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117990 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
d8b1c9e8bf1d19864330d360bf507f6a5f4c5e7f 01-Nov-2010 Douglas Gregor <doug.gregor@gmail.com> Disable some timing code

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117910 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
9dba61a1e46099b77adf15de224aaa16037a7fff 01-Nov-2010 Douglas Gregor <dgregor@apple.com> Disable some timing code

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117910 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a455aac351075b788decc5c65f3180e1714139f3 29-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> If Consumer object failed to create due to some
user error, fail gracefully. Fixes
pr8508.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117692 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
d305719f9b7e154a822ff6688c663cbd32bb1d7b 29-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> If Consumer object failed to create due to some
user error, fail gracefully. Fixes
pr8508.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117692 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
c7a1e90f74d23e3eef15a83fd845a683973816ac 28-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Simplify ASTUnit's internal timers, by not trying to keep a pile of
timers to be dumped whenever the ASTUnit is destroyed. Instead, just
print the time elapsed for each operation after we perform the
operation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117550 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
213f18b3d654de7d1c7cf4a329ea9d3db1c50b6a 28-Oct-2010 Douglas Gregor <dgregor@apple.com> Simplify ASTUnit's internal timers, by not trying to keep a pile of
timers to be dumped whenever the ASTUnit is destroyed. Instead, just
print the time elapsed for each operation after we perform the
operation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117550 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
875ce536a468f0a958f8667d29acf8da433c69ff 27-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce libclang-level options for C++ precompiled preambles,
separating out chaining precompiled preambles from non-chaining ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117457 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
99ba202f659e1885fa5ee114f97c97cf6a857491 27-Oct-2010 Douglas Gregor <dgregor@apple.com> Introduce libclang-level options for C++ precompiled preambles,
separating out chaining precompiled preambles from non-chaining ones.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117457 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
675414e4f7c3431aa0c68409d879297805865173 27-Oct-2010 Dan Gohman <gohman@apple.com> Add support for code completion on stdin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117414 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
90d9081cacb4b0163f2c7527f666d6515257067c 27-Oct-2010 Dan Gohman <gohman@apple.com> Add support for code completion on stdin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117414 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
45dfd4babec09822b73bb233d1df8ad821d0b922 26-Oct-2010 Dan Gohman <gohman@apple.com> Simplify this code: don't check for the same error two
different ways. Check once, and use an assert to handle
consistency checking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117397 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
694137c54c79a33c9ac6c07e68327750dcd5adf7 26-Oct-2010 Dan Gohman <gohman@apple.com> Simplify this code: don't check for the same error two
different ways. Check once, and use an assert to handle
consistency checking.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117397 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
d9f2c76d28b9f8b2c58282666fc18f592c722496 24-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Put the mechanism in place to track modifications in an AST entity that were committed after
its initial creation/deserialization and store the changes in a chained PCH.

The idea is that the AST entities call methods on the ASTMutationListener to give notifications
of changes; the PCHWriter implements the ASTMutationListener interface and stores the incremental changes
of the updated entity. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117235 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
7b90340c9c7d07aef4e301e72b5e8a30d5f4f0c8 24-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Put the mechanism in place to track modifications in an AST entity that were committed after
its initial creation/deserialization and store the changes in a chained PCH.

The idea is that the AST entities call methods on the ASTMutationListener to give notifications
of changes; the PCHWriter implements the ASTMutationListener interface and stores the incremental changes
of the updated entity. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117235 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
82254439b368de855d1e66440071017a1f2d4f0a 22-Oct-2010 John McCall <rjmccall@apple.com> Substantially revise how clang computes the visibility of a declaration to
more closely parallel the computation of linkage. This gets us to a state
much closer to what gcc emits, modulo bugs, which will undoubtedly arise in
abundance.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117147 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1fb0caaa7bef765b85972274e3b434af2572c141 22-Oct-2010 John McCall <rjmccall@apple.com> Substantially revise how clang computes the visibility of a declaration to
more closely parallel the computation of linkage. This gets us to a state
much closer to what gcc emits, modulo bugs, which will undoubtedly arise in
abundance.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117147 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
01e70084f5d9ddfbb09dcecb498ddce71a5c70ae 21-Oct-2010 Michael J. Spencer <bigcheesegs@gmail.com> Reorganize predefined macros for all Windows targets.

This adds an option to set the _MSC_VER macro without
recompiling. This is very useful when testing compatibility
with the Windows SDK and c++stdlib headers.

-fmsc-version=<version> (defaults to VS2003 (1300))

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116999 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
dae4ac4fe56ec60fc93b3e3c9f51e79e682084b9 21-Oct-2010 Michael J. Spencer <bigcheesegs@gmail.com> Reorganize predefined macros for all Windows targets.

This adds an option to set the _MSC_VER macro without
recompiling. This is very useful when testing compatibility
with the Windows SDK and c++stdlib headers.

-fmsc-version=<version> (defaults to VS2003 (1300))

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116999 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d5513a31553eeb274a7dd16500a01a440297e7a5 21-Oct-2010 Michael J. Spencer <bigcheesegs@gmail.com> Fix Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116990 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
20249a1af2e462dcafdd6a350f1c7967b264ff25 21-Oct-2010 Michael J. Spencer <bigcheesegs@gmail.com> Fix Whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116990 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7909f3babd0bc4778bf77d61e058ccc17ea409ff 19-Oct-2010 Ted Kremenek <kremenek@apple.com> "Fix" bogus idempotent operations warning due to loop unrolling not unrolling enough loops to show that an invariant
doesn't hold. This fix is to increase the loop unrolling count to 4, which experiments show doesn't typically impact
analysis time. The real fix is to modify the IdempotentOperationsChecker to suppress warnings where an analysis point
could be preceded by a point where we gave up due to loop unrolling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116769 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
6648e5d387b5402eae6a597bd46709ac445b4156 19-Oct-2010 Ted Kremenek <kremenek@apple.com> "Fix" bogus idempotent operations warning due to loop unrolling not unrolling enough loops to show that an invariant
doesn't hold. This fix is to increase the loop unrolling count to 4, which experiments show doesn't typically impact
analysis time. The real fix is to modify the IdempotentOperationsChecker to suppress warnings where an analysis point
could be preceded by a point where we gave up due to loop unrolling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116769 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1cb88d1b71caeca401d8412bc21e70adcaa4f6bb 18-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Add declarations nested in a linkage specification to the output of
-ast-print-xml, from Martin Vejnar!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116702 91177308-0d34-0410-b5e6-96231b3b80d8
eclXML.cpp
cf1123b648403f159aeb705e2b8b088258a277ff 18-Oct-2010 Douglas Gregor <dgregor@apple.com> Add declarations nested in a linkage specification to the output of
-ast-print-xml, from Martin Vejnar!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116702 91177308-0d34-0410-b5e6-96231b3b80d8
eclXML.cpp
279a5508dec94431facaacc94ca54f44a04cdaf7 15-Oct-2010 Dan Gohman <gohman@apple.com> Wire up the -fstrict-aliasing and -fno-strict-aliasing options
to CodeGenOption flags.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116530 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
4d5625e15bb215c2241c022df8dc7b04438970c6 15-Oct-2010 Dan Gohman <gohman@apple.com> Wire up the -fstrict-aliasing and -fno-strict-aliasing options
to CodeGenOption flags.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116530 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1d30f193b7bbcd697a26d68697fae3585453317a 14-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Give a default implementation for ASTDeserializationListener's methods, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116506 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
336d43a368cee30549dc21a94e25fb03f887a27e 14-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Give a default implementation for ASTDeserializationListener's methods, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116506 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
2d602ab01fe1ee87df29961b7b1bde328c8ef6a0 14-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce command line option -error-on-deserialized-decl that is accompanied by a name
and emits an error if a declaration with this name is deserialized from PCH.

This is for testing, to make sure that we don't deserialize stuff needlessly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116505 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendAction.cpp
3e78593b1ced32b7e0a97da044213014ee0f6f7c 14-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce command line option -error-on-deserialized-decl that is accompanied by a name
and emits an error if a declaration with this name is deserialized from PCH.

This is for testing, to make sure that we don't deserialize stuff needlessly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116505 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendAction.cpp
d5af1962ea1a1d9856e69ade6e1351180fce2719 14-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce command line option -dump-deserialized-decls which is used to print the PCH decls that got deserialized, for testing purposes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116503 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendAction.cpp
b972858068d2ea77f72a1e7b1812b196afd6be2e 14-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce command line option -dump-deserialized-decls which is used to print the PCH decls that got deserialized, for testing purposes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116503 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendAction.cpp
7241e85cb216e6d122511c74cd96d98d0fd77e30 14-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Eliminate usage of ObjCSuperExpr used for
'super' as receiver of property or a setter/getter
methods. //rdar: //8525788



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116483 91177308-0d34-0410-b5e6-96231b3b80d8
tmtXML.cpp
8ac2d449820fd0df00fcbde5bf82165c1f49854d 14-Oct-2010 Fariborz Jahanian <fjahanian@apple.com> Eliminate usage of ObjCSuperExpr used for
'super' as receiver of property or a setter/getter
methods. //rdar: //8525788



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116483 91177308-0d34-0410-b5e6-96231b3b80d8
tmtXML.cpp
d86fe478c3784909989d0a26ed7cb7f40e8168d1 12-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Parse default arguments within member functions in source order, from
Manuel Klimek! Fixes PR7715.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116311 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
d54eb4410330383f48d3cc22b2ad8d23f120836b 12-Oct-2010 Douglas Gregor <dgregor@apple.com> Parse default arguments within member functions in source order, from
Manuel Klimek! Fixes PR7715.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116311 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
708b5b01a614e256fb0a9c50d0b1d31f138cf2d4 12-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> When we load an ASTUnit from command-line arguments, hold on to the
diagnostics produced by the driver itself. Previously, we were
allowing these to either be dropped or to slip through to stderr.

Fixes <rdar://problem/7595339>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116285 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
4cd912aa94656697a44c3ebb159f05060300524e 12-Oct-2010 Douglas Gregor <dgregor@apple.com> When we load an ASTUnit from command-line arguments, hold on to the
diagnostics produced by the driver itself. Previously, we were
allowing these to either be dropped or to slip through to stderr.

Fixes <rdar://problem/7595339>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116285 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
2c3a26e07309d71be7686e744191fa77fb1fe468 12-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Eliminate the (de-)serialization of code completion results, now that
libclang does not support out-of-process code completion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116253 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
a9f4f620daf073805b89e893afcdc5eb7a9bdc50 12-Oct-2010 Douglas Gregor <dgregor@apple.com> Eliminate the (de-)serialization of code completion results, now that
libclang does not support out-of-process code completion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116253 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
4b8b94dd61d94ab477667c57b4e5222a09336f08 12-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Eliminate -fdiagnostics-binary and all of the infrastructure for
emitting diagnostics in a binary form to be consumed by libclang,
since libclang no longer does any of its work out-of-process, making
this code dead. Besides, this stuff never worked at 100% anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116250 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
d3ab63e0f66429abf2a3e4cde889e420e41e8790 12-Oct-2010 Douglas Gregor <dgregor@apple.com> Eliminate -fdiagnostics-binary and all of the infrastructure for
emitting diagnostics in a binary form to be consumed by libclang,
since libclang no longer does any of its work out-of-process, making
this code dead. Besides, this stuff never worked at 100% anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116250 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
0c9397b58fe69d34f3111c8ffdd450b061eab8f6 11-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Switch c-index-test from clang_codeComplete() over to
clang_codeCompleteAt(). This uncovered a few issues with the latter:

- ASTUnit wasn't saving/restoring diagnostic state appropriately between
reparses and code completions.
- "Overload" completions weren't being passed through to the client



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116241 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
32be4a588fbb87d0d163ead49c42f5438bf0b2b7 11-Oct-2010 Douglas Gregor <dgregor@apple.com> Switch c-index-test from clang_codeComplete() over to
clang_codeCompleteAt(). This uncovered a few issues with the latter:

- ASTUnit wasn't saving/restoring diagnostic state appropriately between
reparses and code completions.
- "Overload" completions weren't being passed through to the client



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116241 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
75e0b8e039854095621567470b9c847b27cd9b51 11-Oct-2010 Axel Naumann <Axel.Naumann@cern.ch> Declare argv parameters as const char* const* instead of to char** to clarify that they are not modified, and to allow for string literals as arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116200 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
9d520c5ae802fc175c61032b289ddd6968e6ddd2 11-Oct-2010 Axel Naumann <Axel.Naumann@cern.ch> Declare argv parameters as const char* const* instead of to char** to clarify that they are not modified, and to allow for string literals as arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116200 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
fdb96458f6712b119e3d2a92df7a8e6221f5c012 11-Oct-2010 Axel Naumann <Axel.Naumann@cern.ch> Tighten up constness of argv parameters to allow for string literals as argumants and to reflect actual (non-modifying) use.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116199 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
7d0c4ccd65b4549283c55e4923602e234f3811c5 11-Oct-2010 Axel Naumann <Axel.Naumann@cern.ch> Tighten up constness of argv parameters to allow for string literals as argumants and to reflect actual (non-modifying) use.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116199 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
cb67d1115dec062a1a2ed09c560ca16743813406 11-Oct-2010 NAKAMURA Takumi <geek4civic@gmail.com> lib/Frontend/InitHeaderSearch.cpp: Fix compatibility to Cygming.

- lib/gcc/include should not be included. Clang oughta have alternatives. (PR7956)
- Cygwin: /usr/include/w32api should be included. gcc/cygwin does.
- gcc/cygwin uses gcc paths as /usr/lib not /lib. They are same on Cygwin environment, though, We have to take what gcc/cygwin does.
- Cygwin-1.7: Use 4.3.4.
- Cygwin-1.5: Use 4.3.2 for gcc-4.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116182 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
32df002017e3e8d86bfd3f7090b341d265676fc9 11-Oct-2010 NAKAMURA Takumi <geek4civic@gmail.com> lib/Frontend/InitHeaderSearch.cpp: Fix compatibility to Cygming.

- lib/gcc/include should not be included. Clang oughta have alternatives. (PR7956)
- Cygwin: /usr/include/w32api should be included. gcc/cygwin does.
- gcc/cygwin uses gcc paths as /usr/lib not /lib. They are same on Cygwin environment, though, We have to take what gcc/cygwin does.
- Cygwin-1.7: Use 4.3.4.
- Cygwin-1.5: Use 4.3.2 for gcc-4.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116182 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
c4457bbd1608b1eaf72d60cf77e400dbf86532f3 08-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Improve XML output for class/struct/union declarations, from Martin Vejnar!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116103 91177308-0d34-0410-b5e6-96231b3b80d8
eclXML.cpp
642bfaa61870b97afc011681fd71e9c414ba2640 08-Oct-2010 Douglas Gregor <dgregor@apple.com> Improve XML output for class/struct/union declarations, from Martin Vejnar!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116103 91177308-0d34-0410-b5e6-96231b3b80d8
eclXML.cpp
66ad399df1fbf7f78561cf89b7d3f4f1a0764fd1 08-Oct-2010 Zonr Chang <zonr@google.com> Slim down the lib/Frontend/Android.mk.
ndroid.mk
051d58508c5d4192f9862818f334cdc0507e34dd 08-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Fix three related, wily issues with the recompilation of precompiled
preambles:

- When we rebuild a precompiled preamble, make sure to disable
skipping anything in the main file; we may have had leftover
preamble-skipping values in the lexer, which leads to very empty
preamble. This is a correctness issue.

- When we rebuild a precompiled preamble, clear out any prior state
in the Diagnostic object. Otherwise, we might think that there
were errors when we were building the preamble itself, and
therefore reject the resulting preamble. This is mainly a
performance issue.

- Don't remove old remappings when digging out the remapping for the
main file. Having the old mappings around does not hurt in the
common case (later remappings will just overwrite them), and is
important when we fail to find a preamble: we don't want to have
removed the remapping, because we'll need it later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116041 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
aa3e6babe646329310388e5b7e0c9045e0018715 08-Oct-2010 Douglas Gregor <dgregor@apple.com> Fix three related, wily issues with the recompilation of precompiled
preambles:

- When we rebuild a precompiled preamble, make sure to disable
skipping anything in the main file; we may have had leftover
preamble-skipping values in the lexer, which leads to very empty
preamble. This is a correctness issue.

- When we rebuild a precompiled preamble, clear out any prior state
in the Diagnostic object. Otherwise, we might think that there
were errors when we were building the preamble itself, and
therefore reject the resulting preamble. This is mainly a
performance issue.

- Don't remove old remappings when digging out the remapping for the
main file. Having the old mappings around does not hurt in the
common case (later remappings will just overwrite them), and is
important when we fail to find a preamble: we don't want to have
removed the remapping, because we'll need it later.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116041 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5775b4da486d47faac404597c46705ad007a3fb3 08-Oct-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Implement -fshort-enums (rdar://8490496).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116020 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
9a2b9d794bdf349b517ff799170f4409f45d147c 08-Oct-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement -fshort-enums (rdar://8490496).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116020 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
2cd1b69b47b1bf345def7c75dc2b11250ebe81f2 07-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Don't force spell checking when code-completing. Let the client decide

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115931 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
3552f66f8a42021811e8ab9d4a9dfd337df2f969 07-Oct-2010 Douglas Gregor <dgregor@apple.com> Don't force spell checking when code-completing. Let the client decide

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115931 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f7ac3dbdc324736ff6c0e40cf31f25884beb63c8 06-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Fix a double-free error that can occur in rare cases where loading
of the precompiled preamble (or any PCH file it depends on) fails
during reparsing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115838 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
37cf66350cb5a2bb68b0b7c7cca552f7a4867348 06-Oct-2010 Douglas Gregor <dgregor@apple.com> Fix a double-free error that can occur in rare cases where loading
of the precompiled preamble (or any PCH file it depends on) fails
during reparsing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115838 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ede69352f84b6dcbd643be99c036ed1df1827333 05-Oct-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Give every file that ASTReader loads a type: module, PCH, precompiled preamble or main file. Base Decls' PCHLevel on this to make it more sane.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115626 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
1d9f1fe7173e3084325f43c78af812a36d8a2a7c 05-Oct-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Give every file that ASTReader loads a type: module, PCH, precompiled preamble or main file. Base Decls' PCHLevel on this to make it more sane.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115626 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
87119a571ff5beacb3596bf7b9219bf855676ff7 04-Oct-2010 Stephen Hines <srhines@google.com> Add libclangFrontend to Android build.

Change-Id: I3496b13f4df1c78c5f35357069fad6fe086cd41b
ndroid.mk
9af26669ef779998420666cd09f0ce399476bef4 01-Oct-2010 Douglas Gregor <doug.gregor@gmail.com> Enable chained precompiled headers for use with precompiled preambles

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115260 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
85e5191934143edfa9fed582149d8f85c99c753f 01-Oct-2010 Douglas Gregor <dgregor@apple.com> Enable chained precompiled headers for use with precompiled preambles

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115260 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
20bbddf97ff0fbaa171310567b9bee78155d50f9 30-Sep-2010 Devang Patel <dpatel@apple.com> Introduce -flimit-debug-info.
In this experimental mode try avoiding debug info emission for classes as much as possible. The goal is to reduce size of produced debuginfo without reducing quality of debug info in general. This is a work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115188 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c69e1cf04323f2e786d40e8a5ba84e77ee1c6827 30-Sep-2010 Devang Patel <dpatel@apple.com> Introduce -flimit-debug-info.
In this experimental mode try avoiding debug info emission for classes as much as possible. The goal is to reduce size of produced debuginfo without reducing quality of debug info in general. This is a work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115188 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
809f4dbe78085c5fbebd490877ac17d7dc8316f5 30-Sep-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added two new command line arguments:
-cfg-add-implicit-dtors - sets CFG::BuildOptions::AddImplicitDtors for AnalysisCosumer to true,
-cfg-add-initializers - sets CFG::BuildOptions::AddInitializers for AnalysisCosumer to true.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115142 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
9121ba232903ebe61e7bbe14ca294cf0f07dfa96 30-Sep-2010 Marcin Swiderski <marcin.sfider@gmail.com> Added two new command line arguments:
-cfg-add-implicit-dtors - sets CFG::BuildOptions::AddImplicitDtors for AnalysisCosumer to true,
-cfg-add-initializers - sets CFG::BuildOptions::AddInitializers for AnalysisCosumer to true.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115142 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
838da053f9a50ed2f0a19a80a715acb882d107c4 29-Sep-2010 Daniel Dunbar <daniel@zuster.org> Frontend/XML: Add support for printing nested structures, patch by Martin Vejnár!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115041 91177308-0d34-0410-b5e6-96231b3b80d8
eclXML.cpp
54d56a5dadb8403a9211e82ab12ffc2e0dd83774 29-Sep-2010 Daniel Dunbar <daniel@zuster.org> Frontend/XML: Add support for printing nested structures, patch by Martin Vejnár!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115041 91177308-0d34-0410-b5e6-96231b3b80d8
eclXML.cpp
16e6a1f078125adf02b1aa1770648629e5c35095 27-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Remove libclang logging code

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114836 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
06e504462014b0506a70c7730ea45c551a103364 27-Sep-2010 Douglas Gregor <dgregor@apple.com> Remove libclang logging code

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114836 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
37de0a87dbd5f7f0d1a8b8b0f6d732b66930f347 25-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> When setting the globally-visible declarations for a particular
identifier, we may have a Sema object but no translation unit scope
(because parsing is finished). In this case, we still need to update
the IdResolver, which might still be used when writing a PCH
containing another PCH (without chaining). This bug manifested as a
failure with precompiled preambles.

Also, add a little environment-variable-sensitive logging for
libclang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114774 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
76dc8890b6c5223de80be8284adbfc63ceeb3a55 25-Sep-2010 Douglas Gregor <dgregor@apple.com> When setting the globally-visible declarations for a particular
identifier, we may have a Sema object but no translation unit scope
(because parsing is finished). In this case, we still need to update
the IdResolver, which might still be used when writing a PCH
containing another PCH (without chaining). This bug manifested as a
failure with precompiled preambles.

Also, add a little environment-variable-sensitive logging for
libclang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114774 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c92c72b85ed922b00010a8d56a6fb05f0e564442 24-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Teach libclang to enable multithreading in LLVM, since libclang clients are likely to be multithreaded. Also move the printing of timers to somewhere better for multithreaded libclang clients

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114760 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
8c8d5412cddcc1c45beb0353d91d7894db74e585 24-Sep-2010 Douglas Gregor <dgregor@apple.com> Teach libclang to enable multithreading in LLVM, since libclang clients are likely to be multithreaded. Also move the printing of timers to somewhere better for multithreaded libclang clients

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114760 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a9b976bc0d468dc6183fae093193ccb992999e33 24-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Synchronize globally-cached code completion results with the results
provided when the optimization is disabled. In particular, split
the completion context CCC_Other into two contexts: CCC_Other, which
means that it's an undisclosed context for which any other results are
unwelcome, and CCC_Recovery, which is used in recovery cases.

Since we're now using the completion context within the completion
results builder, make sure that it's always set to something.

Fixes <rdar://problem/8470644>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114704 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
52779fb71795534d0447f6f4d4a6f6a7b09c4639 24-Sep-2010 Douglas Gregor <dgregor@apple.com> Synchronize globally-cached code completion results with the results
provided when the optimization is disabled. In particular, split
the completion context CCC_Other into two contexts: CCC_Other, which
means that it's an undisclosed context for which any other results are
unwelcome, and CCC_Recovery, which is used in recovery cases.

Since we're now using the completion context within the completion
results builder, make sure that it's always set to something.

Fixes <rdar://problem/8470644>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114704 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
cb37467b4a0e56739b6f60e4f2609bd53bc47286 20-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Tweak priorities for some types and macros:
- In Objective-C, we prefer BOOL to bool for historic reasons;
slightly penalize "bool".
- Treat Nil macro as a NULL pointer constant.
- Treat YES, NO, true, and false macros as constants.
- Treat the bool macro as a type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114356 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
b05496dbd63f03bf474dae2c4d1e2142608780cc 20-Sep-2010 Douglas Gregor <dgregor@apple.com> Tweak priorities for some types and macros:
- In Objective-C, we prefer BOOL to bool for historic reasons;
slightly penalize "bool".
- Treat Nil macro as a NULL pointer constant.
- Treat YES, NO, true, and false macros as constants.
- Treat the bool macro as a type.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114356 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a38c11f3fb24329bddb1e6ac720b82216642e8bc 17-Sep-2010 David Chisnall <csdavec@swan.ac.uk> Add a -ftrapv-handler= option which allows a handler to invoke instead of simply aborting when a signed operation overflows. This mirrors the (GCC-incompatible) behaviour from clang 1.0 and 1.1 when -ftrapv was specified, but allows the handler to be defined for each compilation unit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114192 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7f18e67e1b577a50402e8b43508ab2311a5c45b5 17-Sep-2010 David Chisnall <csdavec@swan.ac.uk> Add a -ftrapv-handler= option which allows a handler to invoke instead of simply aborting when a signed operation overflows. This mirrors the (GCC-incompatible) behaviour from clang 1.0 and 1.1 when -ftrapv was specified, but allows the handler to be defined for each compilation unit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114192 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
674f03f991d458b2d4d692ef022cadb3e040d792 17-Sep-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Use a temporary file for output which gets renamed after all the writing is finished.

This mainly prevents failures and/or crashes when multiple processes try to read/write the same PCH file. (rdar://8392711&8294781); suggestion & review by Daniel!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114187 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
dc24572a44575e07a5d8bb6de52641a69f1bab27 17-Sep-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Use a temporary file for output which gets renamed after all the writing is finished.

This mainly prevents failures and/or crashes when multiple processes try to read/write the same PCH file. (rdar://8392711&8294781); suggestion & review by Daniel!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114187 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
6fafc738f108fecb53cbc53695a4b6ba2126d2c5 17-Sep-2010 Ted Kremenek <kremenek@apple.com> Handle '#line' in '-E' that has an empty file name. Fixes <rdar://problem/8439412>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114142 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
2346513da49f0a3e4f0deaf198e708d18390b41e 17-Sep-2010 Ted Kremenek <kremenek@apple.com> Handle '#line' in '-E' that has an empty file name. Fixes <rdar://problem/8439412>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114142 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
810032993c6c0095c4d9399da1af2daccd0bec1e 15-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a new code-completion context for a parenthesized
expression, e.g., after the '(' that could also be a type cast. Here,
we provide types as code-completion results in C/Objective-C (C++
already had them), although we wouldn't in a normal expression context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113904 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
0268810a46780144a2d5fb5a017c938d1199189c 15-Sep-2010 Douglas Gregor <dgregor@apple.com> Introduce a new code-completion context for a parenthesized
expression, e.g., after the '(' that could also be a type cast. Here,
we provide types as code-completion results in C/Objective-C (C++
already had them), although we wouldn't in a normal expression context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113904 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
fe0fb28bcfc69003c77765352186302b6ba30a90 14-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> Revert "CMake: Update to use standard CMake dependency tracking facilities instead"

This reverts commit r113631

Conflicts:

CMakeLists.txt
lib/CodeGen/CMakeLists.txt

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113817 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
560a921b85773ac7c2d1a7a4aec4682c822c5cb4 14-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> Revert "CMake: Update to use standard CMake dependency tracking facilities instead"

This reverts commit r113631

Conflicts:

CMakeLists.txt
lib/CodeGen/CMakeLists.txt

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113817 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
02a17d852b933851761dd6b3ddc1a16dc6f067e6 11-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> The two libclang crash-recovery tests that involve precompiled
preambles end up leaving the precompiled preambles around. This is by
design, since we do minimal cleanup during crash recovery. However,
it's unfortunate for testing, so introduce a hook that allows these
two tests to put the precompiled preamble somewhere where we can
delete them after testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113698 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
424668cc90a07f3f98b36dad252940a43ded83d8 11-Sep-2010 Douglas Gregor <dgregor@apple.com> The two libclang crash-recovery tests that involve precompiled
preambles end up leaving the precompiled preambles around. This is by
design, since we do minimal cleanup during crash recovery. However,
it's unfortunate for testing, so introduce a hook that allows these
two tests to put the precompiled preamble somewhere where we can
delete them after testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113698 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ea16ebcd8036ad8e93baf672fabbc9ed288886e8 11-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> If we fail to create a temporary file for the precompiled preamble,
just abort creation of the precompiled preamble rather than doing
silly things. This is the second part of the fix for the weird
preamble-related failures on Windows. Big thanks to Francois Pichet
for the great detective work!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113697 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
2cd4fd4b7554480cbea67b48de5e5d467d06e292 11-Sep-2010 Douglas Gregor <dgregor@apple.com> If we fail to create a temporary file for the precompiled preamble,
just abort creation of the precompiled preamble rather than doing
silly things. This is the second part of the fix for the weird
preamble-related failures on Windows. Big thanks to Francois Pichet
for the great detective work!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113697 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1b066c4b364f08f934a7ecd8b8a7422746df3a5d 11-Sep-2010 Nuno Lopes <nunoplopes@sapo.pt> add latest gentoo gcc path

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113696 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
0d155a5e1d6406d27df5779d0c9fb98d49a713a0 11-Sep-2010 Nuno Lopes <nunoplopes@sapo.pt> add latest gentoo gcc path

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113696 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
6ecbd199e489d97fa4f8700ce1e0fa1a54ff5ef7 11-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Tweak GetPreamblePCHPath() to more closely match the behavior of the
Windows GetTempPath() function, and be sure to create the directory in
which the precompiled preamble will reside before creating the
temporary file itself.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113695 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c6cb2b02f0f4b3f162985803df3729b4def32108 11-Sep-2010 Douglas Gregor <dgregor@apple.com> Tweak GetPreamblePCHPath() to more closely match the behavior of the
Windows GetTempPath() function, and be sure to create the directory in
which the precompiled preamble will reside before creating the
temporary file itself.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113695 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ce4a93145e30d33d8d68c38494b33c3d58e1eb06 11-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Make sure we're producing a newline in the preprocessed output before
emitting a #pragma, whenever one is needed. Fixes <rdar://problem/8417307>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113648 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
fe6834af25d0809215c9e205c9983dd6d3f968b4 11-Sep-2010 Douglas Gregor <dgregor@apple.com> Make sure we're producing a newline in the preprocessed output before
emitting a #pragma, whenever one is needed. Fixes <rdar://problem/8417307>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113648 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
42591fac8f92efab995608d36060579a9b688d66 10-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> CMake: Update to use standard CMake dependency tracking facilities instead
of whatever we were using before...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113631 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
5a7f34958ca6f2fa8a52e9921cf521cbb92ae070 10-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> CMake: Update to use standard CMake dependency tracking facilities instead
of whatever we were using before...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113631 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
996a1a87865785d4f872248ffd2b25d09dc9e2a7 10-Sep-2010 Tom Care <tcare@apple.com> Added AnalyzerStatsChecker, a path sensitive check that reports visitation statistics about analysis. Running clang with the -analyzer-stats flag will emit warnings containing the information. We can then run a postanalysis script to take this data and give useful information about how much the analyzer missed in a project.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113568 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
52d861ce41ce84d8389495ea78d97bcc962ac5ba 10-Sep-2010 Tom Care <tom.care@uqconnect.edu.au> Added AnalyzerStatsChecker, a path sensitive check that reports visitation statistics about analysis. Running clang with the -analyzer-stats flag will emit warnings containing the information. We can then run a postanalysis script to take this data and give useful information about how much the analyzer missed in a project.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113568 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8ea9a768ef739f6f6613b795348f963ad5d05850 10-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> When we parse a pragma, keep track of how that pragma was originally
spelled (#pragma, _Pragma, __pragma). In -E mode, use that information
to add appropriate newlines when translating _Pragma and __pragma into
#pragma, like GCC does. Fixes <rdar://problem/8412013>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113553 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
80c60f72848896f867f6b7e664e7060d9e78f019 10-Sep-2010 Douglas Gregor <dgregor@apple.com> When we parse a pragma, keep track of how that pragma was originally
spelled (#pragma, _Pragma, __pragma). In -E mode, use that information
to add appropriate newlines when translating _Pragma and __pragma into
#pragma, like GCC does. Fixes <rdar://problem/8412013>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113553 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
db9e273557e708b67967606cced6ac21b01919a6 09-Sep-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Add -cxx-system-include option which can be used to specify an
explicit list for the C++ system include directories at the -cc1 level, as an
alternative to the horrible AddDefaultCPlusPlusIncludePaths().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113505 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
80c26f44a6f8d859a2a3babb06bd3ca8d86f2623 09-Sep-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Add -cxx-system-include option which can be used to specify an
explicit list for the C++ system include directories at the -cc1 level, as an
alternative to the horrible AddDefaultCPlusPlusIncludePaths().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113505 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
ea36025f37130429176b06cbd27038f2502193f3 09-Sep-2010 Daniel Dunbar <daniel@zuster.org> Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113504 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
d11ee7f66213bc418df192b7724d3aed349a642c 09-Sep-2010 Daniel Dunbar <daniel@zuster.org> Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113504 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
a38512534c7e4455907c202408362c1d0b265e85 09-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Clean up CMake dependencies

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113489 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ec9bf475657e4fd7c8e920ff816a4e3cdb2ea213 09-Sep-2010 Douglas Gregor <dgregor@apple.com> Clean up CMake dependencies

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113489 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
d1bfe6a5dd276ca0d117e33a407dfdd55139c1c5 09-Sep-2010 Daniel Dunbar <daniel@zuster.org> Add another missing CMake dependency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113443 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
5a978479a793f1f4a77990f66d7cb8861c62975f 09-Sep-2010 Daniel Dunbar <daniel@zuster.org> Add another missing CMake dependency.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113443 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
5aed99a6e77ca28d524315fc3d500610e4abc5af 08-Sep-2010 Douglas Gregor <doug.gregor@gmail.com> Clean up some of the CMake dependencies

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113416 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
bfae8bd6259460ae0668cad39c141504511d19b0 08-Sep-2010 Douglas Gregor <dgregor@apple.com> Clean up some of the CMake dependencies

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113416 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
0cf061458462e3bf54de44bae1b344a94bd6b993 08-Sep-2010 Daniel Dunbar <daniel@zuster.org> Frontend/-H: Add comment on why I used a temporary string here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113379 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
4566d1a0e5750dc21bd9120be3e1a98d60db5620 08-Sep-2010 Daniel Dunbar <daniel@zuster.org> Frontend/-H: Add comment on why I used a temporary string here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113379 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
204a7f67fcbc9fe518a8b81a6289eafee3974c4f 06-Sep-2010 Steven Watanabe <steven@providere-consulting.com> Tell the VS headers that char16_t and char32_t are keywords, so yvals.h doesn't try to define them as typedefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113126 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
343d65c0739f9d4d6c6345a38a7228bafb1de4df 06-Sep-2010 Steven Watanabe <steven@providere-consulting.com> Tell the VS headers that char16_t and char32_t are keywords, so yvals.h doesn't try to define them as typedefs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113126 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
660296621869d6930ba782384219f5a75b728e68 04-Sep-2010 Chris Lattner <sabre@nondot.org> zap dead code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113074 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
66392d4260cdd1a98f9ce908d99e3cf9a31432e2 04-Sep-2010 Chris Lattner <sabre@nondot.org> zap dead code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113074 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
28d8dd06c6ab62181857e0b3c6489c69abb10690 03-Sep-2010 Chris Lattner <sabre@nondot.org> fix lookup of bits/c++config.h on mingw, patch by Ismail Donmez!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112969 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
8e9006bb31184a38b7c4c9d3d3040394652cbd9b 03-Sep-2010 Chris Lattner <sabre@nondot.org> fix lookup of bits/c++config.h on mingw, patch by Ismail Donmez!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112969 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
239ed4ddaa811148d6670f651bdcf756b5689e3e 03-Sep-2010 Francois Pichet <pichet2000@gmail.com> First test commit by Francois Pichet. _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES is not a predefined macro, remove it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112953 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
c5138b295744357e53d971b8751091fdd3487a2d 03-Sep-2010 Francois Pichet <pichet2000@gmail.com> First test commit by Francois Pichet. _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES is not a predefined macro, remove it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112953 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
a0c4d36c100b81356d3cd749c2adfef1d4f61868 03-Sep-2010 Dawn Perchik <dawn@burble.org> Add support for Borland extensions via option -fborland-extensions
(original patch r112791 was reverted due to a bug).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112915 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
400b607546a8dbfcee3b690f3d0a2fee0ea6480b 03-Sep-2010 Dawn Perchik <dawn@burble.org> Add support for Borland extensions via option -fborland-extensions
(original patch r112791 was reverted due to a bug).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112915 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
5930ab8acac5864b91f7fc1a2091fda9d7df99d7 02-Sep-2010 Dawn Perchik <dawn@burble.org> Reverting rev 112791 - apparently -fborland-extensions is on all the time?!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112797 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d0b4e7c8723c031cd8d743b2ff63943a3d0563ff 02-Sep-2010 Dawn Perchik <dawn@burble.org> Reverting rev 112791 - apparently -fborland-extensions is on all the time?!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112797 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
a4202c183705c285d7639e9fbc347c6d2173263e 02-Sep-2010 Dawn Perchik <dawn@burble.org> Add support for Borland extensions via option -fborland-extensions


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112791 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
621a2f36af707747d70b8103bda6f65237fce899 02-Sep-2010 Dawn Perchik <dawn@burble.org> Add support for Borland extensions via option -fborland-extensions


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112791 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
4def1671196598f73a50accb31919c57a0c3af9d 01-Sep-2010 Benjamin Kramer <benny.kra@googlemail.com> StringRefize.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112718 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticsClient.cpp
0080f0ca30cd35e59347d632a261951f01a8129e 01-Sep-2010 Benjamin Kramer <benny.kra@googlemail.com> StringRefize.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112718 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticsClient.cpp
fce30c2bb8de7dcfca56fcdb86cbd518aef03930 01-Sep-2010 Chris Lattner <sabre@nondot.org> add a new version of mingw, patch by İsmail "cartman" Dönmez
in PR8049


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112710 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
6a081405e3c8cd41ac68db9e961fe7016900ccd8 01-Sep-2010 Chris Lattner <sabre@nondot.org> add a new version of mingw, patch by İsmail "cartman" Dönmez
in PR8049


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112710 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
dd05b835a041a6852ed28cfe69e14383ba81560c 01-Sep-2010 Anton Korobeynikov <asl@math.spbu.ru> Add NetBSD include search path

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112663 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ab079419ff2e52652be349e949202a2470f8d253 01-Sep-2010 Anton Korobeynikov <asl@math.spbu.ru> Add NetBSD include search path

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112663 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
a1c236d50d5636695c66bc18ccbc0ff8d54ac475 30-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Predeclare class type_info in Microsoft mode, from Francois Pichet!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112478 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
5c0ca52e40e0b9e3c2da7abba47b18e468c84060 30-Aug-2010 Douglas Gregor <dgregor@apple.com> Predeclare class type_info in Microsoft mode, from Francois Pichet!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112478 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
95e4f1e7d35937e30026eb7c44e91f98bedecdf2 30-Aug-2010 Duncan Sands <baldrick@free.fr> Straighten out target triples provided on the command line
before using them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112468 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
2dc14532b641bae011a374e2c6c393d2196c1411 30-Aug-2010 Duncan Sands <baldrick@free.fr> Straighten out target triples provided on the command line
before using them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112468 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
9862d9eaf9393e2ccaaf28901d794dd1c771f080 27-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Suggest "const" and "volatile" code completions after a function
declarator, the very definition of "low-hanging fruit".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112274 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1a480c403a3b141ab89c9c59cf7b681102a1bfab 27-Aug-2010 Douglas Gregor <dgregor@apple.com> Suggest "const" and "volatile" code completions after a function
declarator, the very definition of "low-hanging fruit".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112274 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
fd844a2662de6fd5d6ddf2bb6f155f536bb93c6b 27-Aug-2010 Dan Gohman <gohman@apple.com> createMainFileID doesn't need its IncludePos argument, since
the main file isn't an included file, and the IncludePos is
always SourceLocation().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112269 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
f155dfa4e284be7dca8f1abf002476b2aaee8546 27-Aug-2010 Dan Gohman <gohman@apple.com> createMainFileID doesn't need its IncludePos argument, since
the main file isn't an included file, and the IncludePos is
always SourceLocation().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112269 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
45a85e0c449024f48a113c336e73d4458e81c72b 26-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Implement code completion for @selector expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112186 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
458433d2f0f5c96a9e0d21decdd44bebccf20b11 26-Aug-2010 Douglas Gregor <dgregor@apple.com> Implement code completion for @selector expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112186 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
6a611fd3a13f7e773427f2fbde993354ca269f54 26-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Move the sorting of code-completion results out of the main path and
into the clients, e.g., the printing code-completion consumer and
c-index-test. Clients may want to re-sort the results anyway.

Provide a libclang function that sorts the results.

3rd try. How embarrassing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112180 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1e5e6684b0f27701e6f7c65f8c6a32a10cbcc3ed 26-Aug-2010 Douglas Gregor <dgregor@apple.com> Move the sorting of code-completion results out of the main path and
into the clients, e.g., the printing code-completion consumer and
c-index-test. Clients may want to re-sort the results anyway.

Provide a libclang function that sorts the results.

3rd try. How embarrassing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112180 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
0fcb42021cd2e1bf18acae23907f8dc24ea6bd8c 26-Aug-2010 Daniel Dunbar <daniel@zuster.org> Revert r112149, "Move the sorting of code-completion results out of the main
path and ...", it is failing tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112161 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1cb237fbf9e52e17f1e03b6f80c1114f47f93781 26-Aug-2010 Daniel Dunbar <daniel@zuster.org> Revert r112149, "Move the sorting of code-completion results out of the main
path and ...", it is failing tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112161 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5437fa02575af032848585514761237d247306df 26-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Move the sorting of code-completion results out of the main path and
into the clients, e.g., the printing code-completion consumer and
c-index-test. Clients may want to re-sort the results anyway.

Provide a libclang function that sorts the results.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112149 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
be13afea6d9a5dc8877d5553552bd07c733a99bf 26-Aug-2010 Douglas Gregor <dgregor@apple.com> Move the sorting of code-completion results out of the main path and
into the clients, e.g., the printing code-completion consumer and
c-index-test. Clients may want to re-sort the results anyway.

Provide a libclang function that sorts the results.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112149 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
38a65ea54243f58b04c53c0f78468d09101f99a9 26-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Revert "Move the sorting of code-completion results out of the main path and
into the clients", because the C standard library sucks. Where's my
stable sort, huh?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112121 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
9214819c7d4b24fd1b38480d845d8e345d8f0196 26-Aug-2010 Douglas Gregor <dgregor@apple.com> Revert "Move the sorting of code-completion results out of the main path and
into the clients", because the C standard library sucks. Where's my
stable sort, huh?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112121 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
57cdd35c3f7e8cd5709b481bbcb036d6c3e5d022 26-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Move the sorting of code-completion results out of the main path and
into the clients, e.g., the printing code-completion consumer and
c-index-test. Clients may want to re-sort the results anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112095 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c7ed372ec7b1c9be05d022e9bc23cd8641f2b28b 26-Aug-2010 Douglas Gregor <dgregor@apple.com> Move the sorting of code-completion results out of the main path and
into the clients, e.g., the printing code-completion consumer and
c-index-test. Clients may want to re-sort the results anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112095 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
264c06db04c1167a291971ffc26e35d54df69dfd 25-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> When combining the code-completion results from Sema long with the
code-completion results cached by ASTUnit, sort the resulting result
set. This makes testing far, far easier, so this commit also includes
tests for the previous few fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112070 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
721f359a350059a81945baa08f63b2e5feceb044 25-Aug-2010 Douglas Gregor <dgregor@apple.com> When combining the code-completion results from Sema long with the
code-completion results cached by ASTUnit, sort the resulting result
set. This makes testing far, far easier, so this commit also includes
tests for the previous few fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112070 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
68f97134f4d9e4aae51b028b8c7ddf94e6c9e081 25-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Add a missing case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112065 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
59a66946aa7723c7b14831aa50902d533baaa957 25-Aug-2010 Douglas Gregor <dgregor@apple.com> Add a missing case

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112065 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a90d7c02cd1c0f588b6b551fea01ef5ebac5d265 25-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Fix an off-by-one error when computing the precompiled preamble for
code completion. We were allowing the preamble to include the line
that we're code-completing on. Again, testcase is forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112064 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c9c29a8d7a0f78ddf2b393dd92f77c7f2046179c 25-Aug-2010 Douglas Gregor <dgregor@apple.com> Fix an off-by-one error when computing the precompiled preamble for
code completion. We were allowing the preamble to include the line
that we're code-completing on. Again, testcase is forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112064 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
95d31779393e796fc9cdaa33e01b9194d6dba262 25-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Make the cursor kind of macro-name-only completions produced by
ASTUnit match those produced directly by code completion. Test case is
forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112063 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
4125c37c71c6c8475019497de837204f0ee4370f 25-Aug-2010 Douglas Gregor <dgregor@apple.com> Make the cursor kind of macro-name-only completions produced by
ASTUnit match those produced directly by code completion. Test case is
forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112063 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
231359e094850dbfe8004082a68c92df1dcd4c2a 25-Aug-2010 John McCall <rjmccall@apple.com> Teach Sema to live without CodeCompleteConsumer.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112028 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
0a2c5e256abb4dc031c21fe4dc92c4f3afe9947c 25-Aug-2010 John McCall <rjmccall@apple.com> Teach Sema to live without CodeCompleteConsumer.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112028 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
62a6d22982dfe5e4b392d19cd3fff33faea9c8b8 25-Aug-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Add basic -H support.
- I didn't implement the GCC "multiple include guard" detection parts, because
it doesn't seem useful or obvious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111983 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rintPreprocessedOutput.cpp
f7c16d903f11814e2d6780e2a2e189b7a7afc4ed 25-Aug-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Add basic -H support.
- I didn't implement the GCC "multiple include guard" detection parts, because
it doesn't seem useful or obvious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111983 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rintPreprocessedOutput.cpp
bb44022c369641f5140992eaf3d30eaf9baaf25c 25-Aug-2010 Chris Lattner <sabre@nondot.org> correct the -isystem option to not add the -isysroot path. Only the weird
-iwithsysroot flag should do that. This fixes rdar://8345942


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111979 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
23637beead1fce7dac755890c9482bcdce538b87 25-Aug-2010 Chris Lattner <sabre@nondot.org> correct the -isystem option to not add the -isysroot path. Only the weird
-iwithsysroot flag should do that. This fixes rdar://8345942


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111979 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
e731c90a1e65ea98d8e8bd78129559b3c6cfc0ab 25-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Implement code completion for preprocessor expressions and in macro
arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111976 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f29c5233085a5af795c3c01b94d319e5b3235d56 25-Aug-2010 Douglas Gregor <dgregor@apple.com> Implement code completion for preprocessor expressions and in macro
arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111976 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
667a23a6e818bba7d3744897dc4f49a5e6aed9c2 24-Aug-2010 Chris Lattner <sabre@nondot.org> Implement -iwithsysroot, an apple extension which is a close cousin of -isystem.
Instead of implementing -isystem, I accidentally implemented this cousin. Next
up is to implement -isystem right.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111966 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
9db9ad3f084d3c70cff01a10d4fd90901982b37b 24-Aug-2010 Chris Lattner <sabre@nondot.org> Implement -iwithsysroot, an apple extension which is a close cousin of -isystem.
Instead of implementing -isystem, I accidentally implemented this cousin. Next
up is to implement -isystem right.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111966 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f3739ad6499abeda23f00c56dc350e58432b9ce5 24-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Implement preprocessor code completion where a macro name is expected,
e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname>
expression in a preprocessor conditional.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111954 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1fbb447e9d43c2c676e94081fbfee7eb6cbe933b 24-Aug-2010 Douglas Gregor <dgregor@apple.com> Implement preprocessor code completion where a macro name is expected,
e.g., after #ifdef/#ifndef or #undef, or inside a defined <macroname>
expression in a preprocessor conditional.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111954 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a7befb4924e868ae850ff7d664fca7037dca751c 24-Aug-2010 Peter Collingbourne <peter@pcc.me.uk> Move ExecuteCompilerInvocation to a new library FrontendTool

r110903 introduced a dependency from Frontend to every library that
declared an Action by introducing Action references that previously
resided in the driver in the file ExecuteCompilerInvocation.cpp.
This patch moves ExecuteCompilerInvocation to a new library named
FrontendTool which is intended to bear these dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111873 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
xecuteCompilerInvocation.cpp
1b7255de78c99ef2b8a06bb5261a3c776ac1db36 24-Aug-2010 Peter Collingbourne <peter@pcc.me.uk> Move ExecuteCompilerInvocation to a new library FrontendTool

r110903 introduced a dependency from Frontend to every library that
declared an Action by introducing Action references that previously
resided in the driver in the file ExecuteCompilerInvocation.cpp.
This patch moves ExecuteCompilerInvocation to a new library named
FrontendTool which is intended to bear these dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111873 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
xecuteCompilerInvocation.cpp
0722c716f747c52573dd1914d30acf539dd3f50c 24-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce new libclang API functions that determine the availability
of a cursor or code-completion result, e.g., whether that result
refers to an unavailable, deleted, or deprecated declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111858 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
58ddb60f409125eda5436c4a1f070f7fa4744295 24-Aug-2010 Douglas Gregor <dgregor@apple.com> Introduce new libclang API functions that determine the availability
of a cursor or code-completion result, e.g., whether that result
refers to an unavailable, deleted, or deprecated declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111858 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
2760eaacfd41dc20fd39a0fa43674569f4e7e134 23-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Don't include macro results when we're completing a declarator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111830 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
6d72cbedbab7eea947f34ddc6a44c3b308530034 23-Aug-2010 Douglas Gregor <dgregor@apple.com> Don't include macro results when we're completing a declarator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111830 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
9283ece07ecfa7c92c89fff2750ec0023344437f 23-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a new code-completion point when we're parsing a
declarator. Here, we can only see a few things (e.g., cvr-qualifiers,
nested name specifiers) and we do not want to provide other non-macro
completions. Previously, we would end up in recovery mode and would
provide a large number of non-relevant completions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111818 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
2ccccb3ff40c64927817a7e1ddf1da8c188ed224 23-Aug-2010 Douglas Gregor <dgregor@apple.com> Introduce a new code-completion point when we're parsing a
declarator. Here, we can only see a few things (e.g., cvr-qualifiers,
nested name specifiers) and we do not want to provide other non-macro
completions. Previously, we would end up in recovery mode and would
provide a large number of non-relevant completions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111818 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f426ebb119fdd3f6ec97bf4500a0f0a826d25e52 22-Aug-2010 John McCall <rjmccall@apple.com> Abstract out member-pointer creation. I'm really unhappy about the current
duplication between the constant and non-constant paths in all of this.

Implement ARM ABI semantics for member pointer constants and conversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111772 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
875ab10245d3bf37252dd822aa1616bb0a391095 22-Aug-2010 John McCall <rjmccall@apple.com> Abstract out member-pointer creation. I'm really unhappy about the current
duplication between the constant and non-constant paths in all of this.

Implement ARM ABI semantics for member pointer constants and conversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111772 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
08f845b775c7be1a417b1b20b445d47b5c72a1bb 22-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Detabify.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111768 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
a7e6845660f91ec611427e1db842780e1ec12bdb 22-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Detabify.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111768 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
367213bcd822d77d3c24e3607b4ce3b1127dd5af 21-Aug-2010 Michael J. Spencer <bigcheesegs@gmail.com> Visual Studio tools used on win32 hosts when targeting win32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111748 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ff58e3610f4e12094def69eb2d6dcb4330378d8f 21-Aug-2010 Michael J. Spencer <bigcheesegs@gmail.com> Visual Studio tools used on win32 hosts when targeting win32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111748 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
8934b1f5573981ddd54316ad5b708bbd34f07ed4 21-Aug-2010 Michael J. Spencer <bigcheesegs@gmail.com> Fix typo in comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111729 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
13cfedb26c07dbe4ff20214943d231f7c93be81e 21-Aug-2010 Michael J. Spencer <bigcheesegs@gmail.com> Fix typo in comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111729 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
e20fbc00b00b6a10c2d54afbd4a5ecd92a981b00 20-Aug-2010 John McCall <rjmccall@apple.com> Another step in the process of making the parser depend on Sema:
- move DeclSpec &c into the Sema library
- move ParseAST into the Parse library
Reflect this change in a thousand different includes.
Reflect this change in the link orders.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111667 91177308-0d34-0410-b5e6-96231b3b80d8
iagChecker.cpp
rontendAction.cpp
19510856727e0e14a3696b2a72c35163bff2a71f 20-Aug-2010 John McCall <rjmccall@apple.com> Another step in the process of making the parser depend on Sema:
- move DeclSpec &c into the Sema library
- move ParseAST into the Parse library
Reflect this change in a thousand different includes.
Reflect this change in the link orders.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111667 91177308-0d34-0410-b5e6-96231b3b80d8
iagChecker.cpp
rontendAction.cpp
98eb196c332809b7a4a052da7a2bb5c852185fae 20-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Eliminate some extraneous whitespace in the machine-parseable Fix-It output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111610 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
bf5e09d185275a1942223ecb58e20c2d88dcc340 20-Aug-2010 Douglas Gregor <dgregor@apple.com> Eliminate some extraneous whitespace in the machine-parseable Fix-It output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111610 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
936b38da144dacc0ec064733fa7087005934ed90 20-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> When performing code-completion in the presence of a preamble, make
sure to (1) actually use the remapped files we were given rather
than old data, and (2) keep the remapped files alive until the
code-completion results are destroyed. Big thanks to Daniel for the
test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111597 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
2283d79155a3e82442fce124ce5fd704ca138801 20-Aug-2010 Douglas Gregor <dgregor@apple.com> When performing code-completion in the presence of a preamble, make
sure to (1) actually use the remapped files we were given rather
than old data, and (2) keep the remapped files alive until the
code-completion results are destroyed. Big thanks to Daniel for the
test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111597 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c4b3b75c58743b26dc338d75a7ad9f5c04756a96 20-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> When we decide not to reuse a precompiled preamble, clear out the
previous precompiled preamble completely. Fixes <rdar://problem/8330950>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111590 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f128fed9c2ae16d3d6d8b8580b7a257e5c0a7754 20-Aug-2010 Douglas Gregor <dgregor@apple.com> When we decide not to reuse a precompiled preamble, clear out the
previous precompiled preamble completely. Fixes <rdar://problem/8330950>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111590 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
bf4c70994c4cdf4a5f753f26a60a583bf148f2f4 19-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Add machine-parseable Fix-It output as part of diagnostics, under the
flag -fdiagnostics-parseable-fixits, from Eelis van der Weegen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111557 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnosticPrinter.cpp
4786c15f4977c7cee98fde3ebdee213dba23848b 19-Aug-2010 Douglas Gregor <dgregor@apple.com> Add machine-parseable Fix-It output as part of diagnostics, under the
flag -fdiagnostics-parseable-fixits, from Eelis van der Weegen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111557 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnosticPrinter.cpp
8b8975c21a44531fff2b362b5dfce66773cd6fbc 19-Aug-2010 Daniel Dunbar <daniel@zuster.org> Fix a loop overrun in ComputePreamble when the last remapped file was erased,
and reenable crash recovery test.
- Reparsing is still very crashy / weird, so I had to sprinkle random code into
the remapped input to get it to do what I want (i.e., crash!).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111550 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c1cf1586f7bbdf8a955a3be79309834ebc25c3af 19-Aug-2010 Daniel Dunbar <daniel@zuster.org> Fix a loop overrun in ComputePreamble when the last remapped file was erased,
and reenable crash recovery test.
- Reparsing is still very crashy / weird, so I had to sprinkle random code into
the remapped input to get it to do what I want (i.e., crash!).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111550 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
cae4686e6b3c3e989fcbc91bc929f4ca932dc9c2 19-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Plug a leak when precompiling the preamble in ASTUnit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111504 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
671947b18dba342f9aba022ee992babef325a833 19-Aug-2010 Douglas Gregor <dgregor@apple.com> Plug a leak when precompiling the preamble in ASTUnit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111504 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
fb02bbdc892a0ca973c62791119dc169c7af6563 19-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Make sure to initialize ASTUnit::UnsafeToFree

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111490 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
8b1540c159093e0e627ebf6542d0c0b7aba99eaf 19-Aug-2010 Douglas Gregor <dgregor@apple.com> Make sure to initialize ASTUnit::UnsafeToFree

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111490 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
47e65e63326505b86ac2e0dfb20c13b6c71db714 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename the ASTReader header files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111474 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
6ab7cd853e9c15cf986a8a7c3db1f8d20e275409 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename the ASTReader header files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111474 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
461310d47dfb77ed4b176cfa19358bddeb732a35 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> More PCH -> AST renaming.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111472 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
rontendAction.cpp
3c7f4134603d04b44f997b43c0a9def270f25386 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> More PCH -> AST renaming.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111472 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
rontendAction.cpp
6bdcfea8ff12cd4079b3653e5cd7d638c7d74ed1 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename various classes from PCH to AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111471 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendAction.cpp
571db7f0cb31789737be92fce1c1b738e6dbe795 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename various classes from PCH to AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111471 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendAction.cpp
7b39a2cadf9d62647f3aa572c52b77ea4114a599 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename PCHReader to ASTReader.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111467 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
c43b54cbc10654ed59de797898042e1a05265246 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename PCHReader to ASTReader.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111467 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
2b04aa75877c5fd8a9f679930c923b44ca8eef08 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename PCHWriter.h to ASTWriter.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111466 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
rontendActions.cpp
7faa2ec03a7ef120ac165bb45b6c70a8b20c9f1c 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename PCHWriter.h to ASTWriter.h

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111466 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
rontendActions.cpp
c9b42df920d69f0a2e4779bfbea6234cf355539d 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename PCHWriter to ASTWriter

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111463 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a4232eb646d89e7d52424bb42eb87d9061f39e63 19-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Rename PCHWriter to ASTWriter

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111463 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1d5396c869da5ce72c03d36182326ffeeae53653 19-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> When creating an ASTUnit by parsing source code, set DisableFree to
false (not true), so that the CompilerInstance will actually free data
structures when it's done. This fixes a major leak with libclang's
in-process code completion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111457 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f421089b73800066bbf43613c9a8422a96c1b0c3 19-Aug-2010 Douglas Gregor <dgregor@apple.com> When creating an ASTUnit by parsing source code, set DisableFree to
false (not true), so that the CompilerInstance will actually free data
structures when it's done. This fixes a major leak with libclang's
in-process code completion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111457 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f1614cb6e4f1056850a71f1a0e3372aaee2cedb4 19-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Simplify the ownership model for DiagnosticClients, which was really
convoluted and a bit leaky. Now, the Diagnostic object owns its
DiagnosticClient.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111437 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
erifyDiagnosticsClient.cpp
bdbb004f38978da0c4a75af3294d1c7b5ff84af1 19-Aug-2010 Douglas Gregor <dgregor@apple.com> Simplify the ownership model for DiagnosticClients, which was really
convoluted and a bit leaky. Now, the Diagnostic object owns its
DiagnosticClient.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111437 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
erifyDiagnosticsClient.cpp
cb6c24a9e86453b63863ce1eb8645e1690c9b542 18-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Simplify FixItHint by eliminated the unnecessary InsertionLoc
location. Patch by Eelis van der Weegen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111362 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
783c56f47745f719590b17afd7ed937bf2407b53 18-Aug-2010 Douglas Gregor <dgregor@apple.com> Simplify FixItHint by eliminated the unnecessary InsertionLoc
location. Patch by Eelis van der Weegen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111362 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
9d8054f58cc6a8478af79fb7a1ae65c7580bfd49 17-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Fix CMake build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111284 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
11e6f610916437c5e67065533f5ecd98bc56794d 17-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Fix CMake build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111284 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
4f7121ffc46611335a36c15ea42d6591b8c288ab 17-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Reintroduce the serialization library, with fixed dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111279 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
MakeLists.txt
ompilerInstance.cpp
ompilerInvocation.cpp
rontendActions.cpp
eneratePCH.cpp
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
857281328fa824782bdd979c3bfdd97ecdbc1609 17-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Reintroduce the serialization library, with fixed dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111279 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
MakeLists.txt
ompilerInstance.cpp
ompilerInvocation.cpp
rontendActions.cpp
eneratePCH.cpp
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
3c414771dd09faf7277d629451f9e43bfc3dc4bf 17-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to add type parameter support for attribute iboutletcollection.
Radar 8308053.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111275 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
a8fb24fa3151567056f6125999cea69e39604f35 17-Aug-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to add type parameter support for attribute iboutletcollection.
Radar 8308053.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111275 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
74aa4b52a2fc66418a5a92bb7bdbb1723dab7b95 17-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Revert Sebastian's build-breaking patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111265 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
MakeLists.txt
ompilerInstance.cpp
ompilerInvocation.cpp
rontendActions.cpp
eneratePCH.cpp
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
4557e473c9e673e7e6f7063478f63a5b3c6c10b2 17-Aug-2010 Douglas Gregor <dgregor@apple.com> Revert Sebastian's build-breaking patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111265 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
MakeLists.txt
ompilerInstance.cpp
ompilerInvocation.cpp
rontendActions.cpp
eneratePCH.cpp
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
872b3d65f022356f3a636c05506960639b5550db 17-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Create a new Serialization module that contains all the PCH code, and will contain all the module code in the future. Update the Makefiles, CMake projects and the Xcode project. I hope I did everything right for Xcode. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111258 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
MakeLists.txt
ompilerInstance.cpp
ompilerInvocation.cpp
rontendActions.cpp
eneratePCH.cpp
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
93c972945bccd1a966b0445f9ed45db433b77bc1 17-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Create a new Serialization module that contains all the PCH code, and will contain all the module code in the future. Update the Makefiles, CMake projects and the Xcode project. I hope I did everything right for Xcode. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111258 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
MakeLists.txt
ompilerInstance.cpp
ompilerInvocation.cpp
rontendActions.cpp
eneratePCH.cpp
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
74eb8a54dbbd107d42e78dd297f011cf7f8e7f31 17-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Fix a typo in a diag name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111257 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
11c3dc45a89f632b5fb52610d5cb217bfc062e9a 17-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Fix a typo in a diag name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111257 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
07f1c636bc60ee0c863003e37257f59d4fa978f4 17-Aug-2010 Benjamin Kramer <benny.kra@googlemail.com> Convert all uses of StringLiteral::getStrData() to StringLiteral::getString()
and remove getStrData(). Patch by Peter Davies (with some tweaks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111229 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterStmt.cpp
tmtXML.cpp
2f4eaef37476ae6891ede8ba215d0f6fd093629b 17-Aug-2010 Benjamin Kramer <benny.kra@googlemail.com> Convert all uses of StringLiteral::getStrData() to StringLiteral::getString()
and remove getStrData(). Patch by Peter Davies (with some tweaks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111229 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterStmt.cpp
tmtXML.cpp
6f19bd8cb2e5b8d98c26078ab462866b2ce6fce9 17-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> When the # of top-level declarations changes after reparsing a
translation unit, refresh code-completion results because they've
probably changed. However, enforce a cooldown period between
refreshes, to avoid thrashing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111218 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
727d93ef49e18147149354fadd10e86b13bc4ab0 17-Aug-2010 Douglas Gregor <dgregor@apple.com> When the # of top-level declarations changes after reparsing a
translation unit, refresh code-completion results because they've
probably changed. However, enforce a cooldown period between
refreshes, to avoid thrashing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111218 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
0e4e4d37c1309007566f8892aa97b1e03d1dc9ef 17-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Move include to the proper place. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111204 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
349d38cef04ddf8938047c1b542a799aa82dfe84 17-Aug-2010 Douglas Gregor <dgregor@apple.com> Move include to the proper place. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111204 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
4d161c2637ac59f9a396956092ca081a55770cb9 17-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Implement support for cached code completions for
nested-name-specifiers. Also includes fixes to the generation of
nested-name-specifier result in the non-cached case; we were producing
lame results for namespaces and namespace aliases, which (1) didn't
always have nested-name-specifiers when we want them, and (2) did not
have the necessary "::" as part of the completion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111203 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a5fb7c3b56c3698e19a7c1e97d41150de33cf6c9 17-Aug-2010 Douglas Gregor <dgregor@apple.com> Implement support for cached code completions for
nested-name-specifiers. Also includes fixes to the generation of
nested-name-specifier result in the non-cached case; we were producing
lame results for namespaces and namespace aliases, which (1) didn't
always have nested-name-specifiers when we want them, and (2) did not
have the necessary "::" as part of the completion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111203 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
729bfd5fc9111474148534d2dd7f8cbb252749db 16-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Formatting fixes. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111186 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5535d5721b6bfb5df9583bc0632da910a176109d 16-Aug-2010 Douglas Gregor <dgregor@apple.com> Formatting fixes. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111186 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
6bfb73328826b5cf1a418587bbda9f2cacc2b5bd 16-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Implement name hiding of cached global code-completion results.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111184 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5f808c2bfe2f95c984029d76deb4aaebcad30cbc 16-Aug-2010 Douglas Gregor <dgregor@apple.com> Implement name hiding of cached global code-completion results.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111184 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
281a448f99d96c70851d296209e8d764b27f9592 16-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Move some code out-of-line which has long since grown too large to be
inlined. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111176 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
697ca6dc944fd1233a6f07f0777807fbab6a31c1 16-Aug-2010 Douglas Gregor <dgregor@apple.com> Move some code out-of-line which has long since grown too large to be
inlined. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111176 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
6dd2f47245158616b9670b2f620223143b28ee30 16-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add two options for playing with modules.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111166 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
xecuteCompilerInvocation.cpp
e55fd871b0cf3e4ebc708cf46831908d74eab40a 16-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add two options for playing with modules.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111166 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
xecuteCompilerInvocation.cpp
51bc53eb6a607d6da76ab71891ee2060929e2411 16-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> When caching code completions for global declarations, keep track of
the usage type of each declaration result, then compare those types to
the preferred type of the completion. This provides parity in the
priority calculation between the code-completion results produced
directly from Sema and those cached by ASTUnit.

For the standard Cocoa.h (+ others) example, there's a penalty of 3-4
hundredeths of a second when caching the global results (for ~31,000
results), because we need an ASTContext-agnostic representation of
types for the comparison, and therefore we use... strings. Eventually,
we'd like to implement a more efficient ASTContext-agnostic encoding
of types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111165 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f5586f6b311c98e1022a8fe0609053849b70d323 16-Aug-2010 Douglas Gregor <dgregor@apple.com> When caching code completions for global declarations, keep track of
the usage type of each declaration result, then compare those types to
the preferred type of the completion. This provides parity in the
priority calculation between the code-completion results produced
directly from Sema and those cached by ASTUnit.

For the standard Cocoa.h (+ others) example, there's a penalty of 3-4
hundredeths of a second when caching the global results (for ~31,000
results), because we need an ASTContext-agnostic representation of
types for the comparison, and therefore we use... strings. Eventually,
we'd like to implement a more efficient ASTContext-agnostic encoding
of types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111165 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
de68a1e2d5a3ca09420aaba4a9614c619b0cc920 16-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Dereferencing NULL pointers is such poor form.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111150 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c4421e966d77a18f815284175b3fcbb46f36fa39 16-Aug-2010 Douglas Gregor <dgregor@apple.com> Dereferencing NULL pointers is such poor form.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111150 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
9cf955365328fd5615ede5512c0e6a3647c33e79 16-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> When caching global completion results, keep track of the simplified
type class, so that we can adjust priorities appropriately when the
preferred type for the context and the actual type of the completion
are similar.

This gets us one step closer to parity of the cached completion
results with the non-cached completion results.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111139 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1827e10051638770ad9ccf3e285caf95f995afd1 16-Aug-2010 Douglas Gregor <dgregor@apple.com> When caching global completion results, keep track of the simplified
type class, so that we can adjust priorities appropriately when the
preferred type for the context and the actual type of the completion
are similar.

This gets us one step closer to parity of the cached completion
results with the non-cached completion results.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111139 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
22954e9be5e8890823d1a8165ad0ca9e8ea0fad7 15-Aug-2010 Benjamin Kramer <benny.kra@googlemail.com> Open AST/PCH files in binary mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111106 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
1395c5d00588a9c3154683ffe6c223bb7af2fbf2 15-Aug-2010 Benjamin Kramer <benny.kra@googlemail.com> Open AST/PCH files in binary mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111106 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
8fd84e931fd6134623479a3bb0b0c12cc97a10bc 15-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Remove ATTRIBUTE_UNUSED from the common pattern of disallowing copying.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111101 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticsClient.cpp
c83d2d7d8914a0fe00d679a262f2bdae7689f16d 15-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove ATTRIBUTE_UNUSED from the common pattern of disallowing copying.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111101 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticsClient.cpp
caea399c474ff56d8f379772bff1ebef78570717 15-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Extend the code-completion caching infrastructure to include global
declarations (in addition to macros). Each kind of declaration maps to
a certain set of completion contexts, and the ASTUnit completion logic
introduces the completion strings for those declarations if the actual
code-completion occurs in one of the contexts where it matters.

There are a few new code-completion-context kinds. Without these,
certain completions (e.g., after "using namespace") would need to
suppress all global completions, which would be unfortunate.

Note that we don't get the priorities right for global completions,
because we don't have enough type information. We'll need a way to
compare types in an ASTContext-agnostic way before this can be
implemented.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111093 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
8071e4212ae08f8014e0c3ae6d18b7388003a5cc 15-Aug-2010 Douglas Gregor <dgregor@apple.com> Extend the code-completion caching infrastructure to include global
declarations (in addition to macros). Each kind of declaration maps to
a certain set of completion contexts, and the ASTUnit completion logic
introduces the completion strings for those declarations if the actual
code-completion occurs in one of the contexts where it matters.

There are a few new code-completion-context kinds. Without these,
certain completions (e.g., after "using namespace") would need to
suppress all global completions, which would be unfortunate.

Note that we don't get the priorities right for global completions,
because we don't have enough type information. We'll need a way to
compare types in an ASTContext-agnostic way before this can be
implemented.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111093 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
07f6f492d4efad860caa7bf931501624a5f8cb6c 15-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Add ATTRIBUTE_UNUSED to methods not supposed to be used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111087 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticsClient.cpp
ed635e4bff56ffc50d9ad2929eee9d7ffc516c2d 15-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add ATTRIBUTE_UNUSED to methods not supposed to be used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111087 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticsClient.cpp
b5e64b39ff15ccc53e83c452425ac31f172ed7f6 14-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Implement caching of code-completion results for macro definitions
when the CXTranslationUnit_CacheCompletionResults option is given to
clang_parseTranslationUnit(). Essentially, we compute code-completion
results for macro definitions after we have parsed the file, then
store an ASTContext-agnostic version of those results (completion
string, cursor kind, priority, and active contexts) in the
ASTUnit. When performing code completion in that ASTUnit, we splice
the macro definition results into the results provided by the actual
code-completion (which has had macros turned off) before libclang gets
those results. We use completion context information to only splice in
those results that make sense for that context.

With a completion involving all of the macros from Cocoa.h and a few other
system libraries (totally ~8500 macro definitions) living in a
precompiled header, we get about a 9% performance improvement from
code completion, since we no longer have to deserialize all of the
macro definitions from the precompiled header.

Note that macro definitions are merely the canary; the cache is
designed to also support other top-level declarations, which should be
a bigger performance win. That optimization will be next.

Note also that there is no mechanism for determining when to throw
away the cache and recompute its contents.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111051 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
87c08a5d6b9e1e44ae6f554df40139d3a6f60b33 14-Aug-2010 Douglas Gregor <dgregor@apple.com> Implement caching of code-completion results for macro definitions
when the CXTranslationUnit_CacheCompletionResults option is given to
clang_parseTranslationUnit(). Essentially, we compute code-completion
results for macro definitions after we have parsed the file, then
store an ASTContext-agnostic version of those results (completion
string, cursor kind, priority, and active contexts) in the
ASTUnit. When performing code completion in that ASTUnit, we splice
the macro definition results into the results provided by the actual
code-completion (which has had macros turned off) before libclang gets
those results. We use completion context information to only splice in
those results that make sense for that context.

With a completion involving all of the macros from Cocoa.h and a few other
system libraries (totally ~8500 macro definitions) living in a
precompiled header, we get about a 9% performance improvement from
code completion, since we no longer have to deserialize all of the
macro definitions from the precompiled header.

Note that macro definitions are merely the canary; the cache is
designed to also support other top-level declarations, which should be
a bigger performance win. That optimization will be next.

Note also that there is no mechanism for determining when to throw
away the cache and recompute its contents.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111051 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
85d6a41b8f1a0d389d1cacd48a838485e68b3013 13-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Change Sema's UnusedStaticFuncs to UnusedFileScopedDecls to allow also keeping track of unused file scoped variables.

This is only preparation, currently only static function definitions are tracked, as before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111025 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
49b96d1a382ae9f31456166f1a734d3f7f30b992 13-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change Sema's UnusedStaticFuncs to UnusedFileScopedDecls to allow also keeping track of unused file scoped variables.

This is only preparation, currently only static function definitions are tracked, as before.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111025 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
85fbb33344df0c86fc29baa47a50e28f91f5ed1f 13-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Add a new cc1 option -fix-what-you-can which when combined with the fix-it mode
will apply all fixes even when there were other errors in the file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111020 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1450f265fcc84a7ca64dd9f3b8d4492c5bd55e23 13-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Add a new cc1 option -fix-what-you-can which when combined with the fix-it mode
will apply all fixes even when there were other errors in the file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111020 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
191829473d215228fe1fdd5f3d26ba8409b4c534 13-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Implement clang_saveTranslationUnit(), which saves a translation unit
into a PCH/AST file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111006 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
7ae2faafd30524ef5f863bb3b8701977888839bb 13-Aug-2010 Douglas Gregor <dgregor@apple.com> Implement clang_saveTranslationUnit(), which saves a translation unit
into a PCH/AST file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111006 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
3b4b03ffddbcdc9be55c8eb54c6b490b4722b1cd 13-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Teach ASTUnit to hold on to the Sema object and ASTConsumer that are
used when parsing (or re-parsing) a file. Also, when loading a
precompiled header into ASTUnit, create a Sema object that holds onto
semantic-analysis information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111003 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
CHReader.cpp
914ed9d30e9abf829a62aa996b083b1e47c19ff6 13-Aug-2010 Douglas Gregor <dgregor@apple.com> Teach ASTUnit to hold on to the Sema object and ASTConsumer that are
used when parsing (or re-parsing) a file. Also, when loading a
precompiled header into ASTUnit, create a Sema object that holds onto
semantic-analysis information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111003 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
CHReader.cpp
1b21c5748eeb17fbe28d96c73e96f70001495043 13-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Zap unused UnaryOperator::OffsetOf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110996 91177308-0d34-0410-b5e6-96231b3b80d8
tmtXML.cpp
de7e66256b1bdfcf6526994825a8c8fced52a31c 13-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Zap unused UnaryOperator::OffsetOf.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110996 91177308-0d34-0410-b5e6-96231b3b80d8
tmtXML.cpp
6ee0140392b426ee881e710747aa6e16c1927122 13-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> The Sema object will get destroyed before all of the others anyway. We don't need to force it

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110993 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
1e3a97c98a9ad099410fa5172ce8783baf0da0fd 13-Aug-2010 Douglas Gregor <dgregor@apple.com> The Sema object will get destroyed before all of the others anyway. We don't need to force it

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110993 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
735b542c2c94910a3d522283864f85c27ff602cf 13-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Instead of modifying the ObjC AST to not modify existing declarations, teach chained PCH to overwrite declarations from earlier PCH files in dependent ones. Tell Sema to note when it changes AST nodes so that they have to be reserialized. Finally, the ObjCProtocolDecls created in forward decls, like the ObjCInterfaceDecls in @class forward decls, are not lexically part of the decl context; only the definition is.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110989 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
0b17c61e8f143901ce11b4a6e5129ac63aaeee04 13-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Instead of modifying the ObjC AST to not modify existing declarations, teach chained PCH to overwrite declarations from earlier PCH files in dependent ones. Tell Sema to note when it changes AST nodes so that they have to be reserialized. Finally, the ObjCProtocolDecls created in forward decls, like the ObjCInterfaceDecls in @class forward decls, are not lexically part of the decl context; only the definition is.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110989 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
ea10e49a098ef488e8341bae88112449d3f74233 13-Aug-2010 John McCall <rjmccall@apple.com> Just disable the hidden-visibility optimization for now by hiding it behind
a -cc1 option. The Darwin linker complains about mixed visibility when linking
gcc-built objects with clang-built objects, and the optimization isn't really
that valuable. Platforms with less ornery linkers can feel free to enable this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110979 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
279b5eb6910d64a293e9c0e2887a05c65d8737d7 13-Aug-2010 John McCall <rjmccall@apple.com> Just disable the hidden-visibility optimization for now by hiding it behind
a -cc1 option. The Darwin linker complains about mixed visibility when linking
gcc-built objects with clang-built objects, and the optimization isn't really
that valuable. Platforms with less ornery linkers can feel free to enable this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110979 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
9419e93fc798a72419e44677651eef9772cde858 13-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Teach CompilerInstance to create and hold on to the Sema object used
for parsing, so that it can persist beyond the lifetime of the parsing
call.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110978 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendAction.cpp
f18d0d8b39e891460d50f8a8b85029885b264986 13-Aug-2010 Douglas Gregor <dgregor@apple.com> Teach CompilerInstance to create and hold on to the Sema object used
for parsing, so that it can persist beyond the lifetime of the parsing
call.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110978 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendAction.cpp
c0e51be6ec0f57f9caaf16bdd3ef20a8b37466c9 12-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Move Sema's headers into include/clang/Sema, renaming a few along the way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110945 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
e737f5041a36d0befb39ffeed8d50ba15916d3da 12-Aug-2010 Douglas Gregor <dgregor@apple.com> Move Sema's headers into include/clang/Sema, renaming a few along the way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110945 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
e58479760ac3cc56f8f59ddf7e25982298581bf2 12-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added locations and type source info for DeclarationName inside UsingDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110912 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
ef3dce817d43faadbf21ce9102d33a9d84b02e09 12-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added locations and type source info for DeclarationName inside UsingDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110912 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
2dff8200f405aac350f70fb311eead277759f99e 12-Aug-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Move the bulk of the cc1_main() processing into
ExecuteCompilerInvocation in libFrontend.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110903 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
xecuteCompilerInvocation.cpp
8eb2b0141d81d7d1026fad2d1a631f40eb3747a6 12-Aug-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Move the bulk of the cc1_main() processing into
ExecuteCompilerInvocation in libFrontend.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110903 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
xecuteCompilerInvocation.cpp
6a774b93f00e617be48c091a95becdec6ceff849 12-Aug-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Add -target-linker-version, for specifying the version string of the
linker in use.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110871 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
39065a5494613952b4810d1d6b28348cef155e12 12-Aug-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Add -target-linker-version, for specifying the version string of the
linker in use.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110871 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
14f796cba920ce6012f5248a3f6e94b45579abd6 12-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> -Make TokenID of IdentifierInfo read-only, remove setTokenID().
-There are 2 instances that change the TokenID for GNU libstdc++ 4.2 compatibility.
To handler those cases introduce a RevertedTokenID bitfield, RevertTokenIDToIdentifier() and hasRevertedTokenIDToIdentifier() methods.
Store the bitfield in PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110868 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
646395bbcaa849c94bc2a3246c71d809ca719f01 12-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Make TokenID of IdentifierInfo read-only, remove setTokenID().
-There are 2 instances that change the TokenID for GNU libstdc++ 4.2 compatibility.
To handler those cases introduce a RevertedTokenID bitfield, RevertTokenIDToIdentifier() and hasRevertedTokenIDToIdentifier() methods.
Store the bitfield in PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110868 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
f7401424f9b5b4648e180a80a6552e6e93c802ae 12-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added locations and type source info for DeclarationName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110860 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
2577743c5650c646fb705df01403707e94f2df04 12-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added locations and type source info for DeclarationName.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110860 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
07d87b418a9899b382796c698ebab186067d61ee 11-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Reintroduce the ASTConsumer/ASTUnit fix from r110610, it has nothing to do with the breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110840 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
CHReader.cpp
27372b4f1f402e95dd479ecf40c39ca71c15619f 11-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Reintroduce the ASTConsumer/ASTUnit fix from r110610, it has nothing to do with the breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110840 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
CHReader.cpp
5d3034c743bbb00d634e9c128bf84aa68b769951 11-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Fix a thinko in the creation of temporary files for the precompiled preamble

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110804 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
6bf1830875673d6bd6c5bfcd65c9dcabfb45958b 11-Aug-2010 Douglas Gregor <dgregor@apple.com> Fix a thinko in the creation of temporary files for the precompiled preamble

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110804 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5a24acfed51d1233e325f43af5b2147ad9c31e04 11-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Speculatively revert r110610 " Make ObjCInterfaceDecl redeclarable,
and create separate decl nodes for forward declarations and the
definition," which appears to be causing significant Objective-C
breakage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110803 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
deacbdca554298ccdf636f19c6094a8825ec6b34 11-Aug-2010 Douglas Gregor <dgregor@apple.com> Speculatively revert r110610 " Make ObjCInterfaceDecl redeclarable,
and create separate decl nodes for forward declarations and the
definition," which appears to be causing significant Objective-C
breakage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110803 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
53b1f07486423ff3b40eae2530ab805fae553e82 10-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added TypeLocs to VAArgExpr node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110666 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
2cad900202561cdda18ea6cc51ddbf3e20e3c23a 10-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added TypeLocs to VAArgExpr node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110666 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
8b2ab3d4c434dcd30cb229b0dfdbe35a0679d5d5 10-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added TypeLocs to TypesCompatibleExpr node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110663 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
3fcb73dae91be42b071cf0dde9222b7ec362146d 10-Aug-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added TypeLocs to TypesCompatibleExpr node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110663 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
9d202272883096751921e0860f9df659d4ab66b6 09-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> - Make ObjCInterfaceDecl redeclarable, and create separate decl nodes for forward declarations and the definition.
- Eagerly create ObjCInterfaceTypes for declarations.
- The two above changes lead to a 0.5% increase in memory use and no speed regression when parsing Cocoa.h. On the other hand, now chained PCH works when there's a forward declaration in one PCH and the interface definition in another.
- Add HandleInterestingDecl to ASTConsumer. PCHReader passes the "interesting" decls it finds to this function instead of HandleTopLevelDecl. The default implementation forwards to HandleTopLevelDecl, but ASTUnit's handler for example ignores them. This fixes a potential crash when lazy loading of PCH data would cause ASTUnit's "top level" declaration collection to change while being iterated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110610 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
74c730ad1f6818b676b0bad46d806a9176950328 09-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> - Make ObjCInterfaceDecl redeclarable, and create separate decl nodes for forward declarations and the definition.
- Eagerly create ObjCInterfaceTypes for declarations.
- The two above changes lead to a 0.5% increase in memory use and no speed regression when parsing Cocoa.h. On the other hand, now chained PCH works when there's a forward declaration in one PCH and the interface definition in another.
- Add HandleInterestingDecl to ASTConsumer. PCHReader passes the "interesting" decls it finds to this function instead of HandleTopLevelDecl. The default implementation forwards to HandleTopLevelDecl, but ASTUnit's handler for example ignores them. This fixes a potential crash when lazy loading of PCH data would cause ASTUnit's "top level" declaration collection to change while being iterated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110610 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
fc7d1f5af026e40e9f2b4b27149287259ba44128 09-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Use precompiled preambles for in-process code completion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110596 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
df95a13ec73d2cdaea79555cb412d767f4963120 09-Aug-2010 Douglas Gregor <dgregor@apple.com> Use precompiled preambles for in-process code completion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110596 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f48e64a1f5927a2676559410dea6255b147417cd 09-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Complete PCH support for ObjCPropertyImplDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110570 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
2f92230035e1dc53a560247aee2bec167a90ba7e 09-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Complete PCH support for ObjCPropertyImplDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110570 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
b38704938e9fea65d2754b16fb8af4642e9b010f 09-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support ObjC implementation decls for PCH.

Strictly speaking, implementations don't go in headers but there's no law against it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110567 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
9d50c0635fb213b2a1857e3f8488580f0dab2f98 09-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support ObjC implementation decls for PCH.

Strictly speaking, implementations don't go in headers but there's no law against it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110567 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
50ed01d948df5b72a80feefa99499ea770f57a3e 09-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Refactor into functions PCH reading/writing the CXXBaseOrMemberInitializers. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110566 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
8e706f4b8da141612861e127610141b8d17a9667 09-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactor into functions PCH reading/writing the CXXBaseOrMemberInitializers. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110566 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
da89be4d508f5ce9fabb8972d3c1859904971ceb 08-Aug-2010 Eric Christopher <echristo@apple.com> Make -funroll-loops turn on loop unrolling in the optimizer instead
of just ignoring it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110525 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f84d409903dd4107c8cef5a08fcfce6e5c21d4de 08-Aug-2010 Eric Christopher <echristo@apple.com> Make -funroll-loops turn on loop unrolling in the optimizer instead
of just ignoring it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110525 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
fd312ab07bcfd032c1b23f91281d20cff0ac9278 08-Aug-2010 Benjamin Kramer <benny.kra@googlemail.com> Push location through the MacroUndefined PPCallback and use it to print #undefs in -dD mode. (PR7818)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110523 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
2f05449fa1c9015a84b74c3308b856fc704662be 08-Aug-2010 Benjamin Kramer <benny.kra@googlemail.com> Push location through the MacroUndefined PPCallback and use it to print #undefs in -dD mode. (PR7818)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110523 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
0cf5885d618c1de7806e691c328c1540fa040a19 07-Aug-2010 John McCall <rjmccall@apple.com> Store inheritance paths after CastExprs instead of inside them.
This takes some trickery since CastExpr has subclasses (and indeed,
is abstract).

Also, smoosh the CastKind into the bitfield from Expr.

Drops two words of storage from Expr in the common case of expressions
which don't need inheritance paths. Avoids a separate allocation and
another word of overhead in cases needing inheritance paths. Also has
the advantage of not leaking memory, since destructors for AST nodes are
never run.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110507 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
f871d0cc377a1367b519a6cce26be74607566eba 07-Aug-2010 John McCall <rjmccall@apple.com> Store inheritance paths after CastExprs instead of inside them.
This takes some trickery since CastExpr has subclasses (and indeed,
is abstract).

Also, smoosh the CastKind into the bitfield from Expr.

Drops two words of storage from Expr in the common case of expressions
which don't need inheritance paths. Avoids a separate allocation and
another word of overhead in cases needing inheritance paths. Also has
the advantage of not leaking memory, since destructors for AST nodes are
never run.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110507 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
00347577a8dfbe4a887692877d4b6f1b40ccf0ea 07-Aug-2010 Tom Care <tcare@apple.com> Removed IdempotentOperationChecker from default analysis and returned back to a flag (-analyzer-check-idempotent-operations)
- Added IdempotentOperationChecker to experimental analyses for testing purposes
- Updated test cases to explictly call the checker

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110482 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1fafd1d96419f587763d1b81332d8f476aeace2e 07-Aug-2010 Tom Care <tcare@apple.com> Removed IdempotentOperationChecker from default analysis and returned back to a flag (-analyzer-check-idempotent-operations)
- Added IdempotentOperationChecker to experimental analyses for testing purposes
- Updated test cases to explictly call the checker

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110482 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
794c6eb2e42c58ba28b94e413956d60371789345 06-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Remove the DeclaredInCondition bit now that it's no longer used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110432 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
a834888ecc3ea36ea78a585209f422c7730d437a 06-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Remove the DeclaredInCondition bit now that it's no longer used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110432 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
bd3d5c86e1d33b6fdeee105df72deab786b391f3 06-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add an environment variable that makes libclang use chaining for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110414 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f65339e0f1b9ccfc0c92c85f68bb2e72ea48a27b 06-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add an environment variable that makes libclang use chaining for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110414 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
e96911b46b92e26170d9186ae780f0bb98a322fc 05-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Collect namespaces that need updating in a PCH chain. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110378 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
a7be5065edc93ab52a25b2588a23a41a4beba21e 05-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Collect namespaces that need updating in a PCH chain. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110378 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
d6e15f41553ad6b1f3fd96e849206662a44bbf04 05-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Write various C++-specific records to chained PCHs. Tests will come later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110357 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
4056680e3c154ef84874410eba55323f9b07aad6 05-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Write various C++-specific records to chained PCHs. Tests will come later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110357 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
89cc2c329f847a0130e07320136ebd80003076be 05-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Store the pending implicit instantiations in the PCH and perform them at the end of the translation unit that
included the PCH, as God intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110324 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
0e0363866792b309d70e9c8e92b4c239773af89c 05-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Store the pending implicit instantiations in the PCH and perform them at the end of the translation unit that
included the PCH, as God intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110324 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
eace58812aa8b0d5c0d21acb5d4f796579306528 05-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support #pragma weak for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110323 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
72b90571b1783b17c3f2204cec5ca440edc38bee 05-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support #pragma weak for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110323 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
da90bfd83a2e0a5ab0b0f375538b365dccc8fec5 05-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Make sure C++ variable definitions are actually passed to the consumer when loaded from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110322 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
3f95477f28ef3baaf79001a5654785c8b2075710 05-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make sure C++ variable definitions are actually passed to the consumer when loaded from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110322 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
5c951e24438098b51b8f63ee847fe742ca043b24 05-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Give clang_codeCompleteAt() an "options" parameter, and add a new
flags enumeration + default-generating function that allows
code-completion to be customized via the libclang API.

Plus, turn on spell-checking when performing code completion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110319 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
cee235cdf0b8047761ffac598c4c3a32ab7411a2 05-Aug-2010 Douglas Gregor <dgregor@apple.com> Give clang_codeCompleteAt() an "options" parameter, and add a new
flags enumeration + default-generating function that allows
code-completion to be customized via the libclang API.

Plus, turn on spell-checking when performing code completion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110319 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
0629e6403126369d15585aeed9a7f6faf7f5cf17 05-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Implement #pragma GCC visibility.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110315 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
aa8b0d19244a6e7e8e5798fcc6aef003c274d3e0 05-Aug-2010 Eli Friedman <eli.friedman@gmail.com> Implement #pragma GCC visibility.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110315 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
1e48cb457525a84b10d7b7547cc5cfb6028729c8 05-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Activate selectors in chained PCH. Chained PCH now works for Objective-C.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110262 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
a68340fd55e177a5849cb3adbf66aedce1f6e91b 05-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Activate selectors in chained PCH. Chained PCH now works for Objective-C.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110262 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
da6088235d224960c0550d773ccf52ec0f30c100 04-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Bring stats for the method pool back.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110247 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
fa78dec572259aca763457b435744f79d822c5d4 04-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Bring stats for the method pool back.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110247 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
1ee3a7bdf44744b4054a264b2624196454011d5d 04-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Implement per-file reading of the selector table. This disables statistics about method pool hits for the moment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110245 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
725cd9686a0f5bb6c994cb3e43f58b63567c6860 04-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Implement per-file reading of the selector table. This disables statistics about method pool hits for the moment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110245 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
cc6cf891751fb70255436b252b16a52ef03f1738 04-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> When chaining, only write interesting selectors to the PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110229 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
e58aa890e8de55bb3146e6ea9fbbba3a58ce30c6 04-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> When chaining, only write interesting selectors to the PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110229 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
c91e4df8ec4e2ede28b49167cdf6257fe29798e4 04-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Store the IDs of selectors in the PCH file explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110219 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
5d05007b7a7883159154e3f65f338a2542d53913 04-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Store the IDs of selectors in the PCH file explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110219 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
26026941fc4320195396993deda95bd82085bdb2 04-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> When performing in-process code completion, don't free the remapped
file buffers until the code completion results are destroyed;
diagnostics may end up referring into the source.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110216 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
b75d3dfa4ca6531858b8132eb4db7260408671cf 04-Aug-2010 Douglas Gregor <dgregor@apple.com> When performing in-process code completion, don't free the remapped
file buffers until the code completion results are destroyed;
diagnostics may end up referring into the source.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110216 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
032a73441a64b80e3afb55c58cd3690acc990357 04-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Add code-completion support directly to ASTUnit, which performs code
completion within the translation unit using the same command-line
arguments for parsing the translation unit. Eventually, we'll reuse
the precompiled preamble to improve code-completion performance, and
this also gives us a place to cache results.

Expose this function via the new libclang function
clang_codeCompleteAt(), which performs the code completion within a
CXTranslationUnit. The completion occurs in-process
(clang_codeCompletion() runs code completion out-of-process).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110210 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
1abc6bca3d7fb0e7b1e40fbcad6cfb5e10594548 04-Aug-2010 Douglas Gregor <dgregor@apple.com> Add code-completion support directly to ASTUnit, which performs code
completion within the translation unit using the same command-line
arguments for parsing the translation unit. Eventually, we'll reuse
the precompiled preamble to improve code-completion performance, and
this also gives us a place to cache results.

Expose this function via the new libclang function
clang_codeCompleteAt(), which performs the code completion within a
CXTranslationUnit. The completion occurs in-process
(clang_codeCompletion() runs code completion out-of-process).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110210 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
01ccd68608704022514f7d2d138351dbc34677a0 04-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> When we try (but fail) to build a precompiled preamble, wait for a
short "cooling off" period (defaulting to 5 reparses) before trying to
build a precompiled preamble again. Previously, if we failed to build
the precompiled preamble at any time, we just gave up the whole
charade any never tried again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110187 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
eababfbddb74d186f78783a9731a78ad371c9800 04-Aug-2010 Douglas Gregor <dgregor@apple.com> When we try (but fail) to build a precompiled preamble, wait for a
short "cooling off" period (defaulting to 5 reparses) before trying to
build a precompiled preamble again. Previously, if we failed to build
the precompiled preamble at any time, we just gave up the whole
charade any never tried again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110187 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
7bf5f75ae18799018157d0c4bc3a48015e8a00f8 03-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Incomplete promotion of selector info to per-file data.
Store all selectors in the selector hash table instead of only those from the method pool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110158 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
059612dd3429cef2d61f11950f3d93a40182bf69 03-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Incomplete promotion of selector info to per-file data.
Store all selectors in the selector hash table instead of only those from the method pool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110158 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
5f27c69b53e8789ea0094a2dae81c52ae3233823 03-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> When using a precompiled preamble, keep track of the top-level
declarations that we saw when creating the precompiled preamble, and
provide those declarations in addition to the declarations parsed in
the main source file when traversing top-level declarations. This
makes the use of precompiled preambles a pure optimization, rather
than changing the semantics of the parsed translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110131 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
eb8837b88c18631c69ac75f64ab1853762063180 03-Aug-2010 Douglas Gregor <dgregor@apple.com> When using a precompiled preamble, keep track of the top-level
declarations that we saw when creating the precompiled preamble, and
provide those declarations in addition to the declarations parsed in
the main source file when traversing top-level declarations. This
makes the use of precompiled preambles a pure optimization, rather
than changing the semantics of the parsed translation unit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110131 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
d84a5286c5960d75c657b6096721cafd1ab1fae6 03-Aug-2010 Eli Friedman <eli.friedman@gmail.com> PR7795: Fix the definition of __WCHAR_MAX__ with -fshort-wchar.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110126 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
1d832436e9cd9223cbad66c5ca9ac87ed5c8560c 03-Aug-2010 Eli Friedman <eli.friedman@gmail.com> PR7795: Fix the definition of __WCHAR_MAX__ with -fshort-wchar.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110126 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
8562f1694038d5e0cc63fe2b2a7254ae1c1e7d1f 03-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Apart from storing/retrieving the previous redeclaration from PCH, also store/retrieve the most recent
redeclaration. That way we are sure that the full redeclarations chain is loaded.

When using chained PCHs, first declarations point to the most recent redeclarations in the same PCH.
To address this use a REDECLS_UPDATE_LATEST record block to keep track of which first declarations need
to point to a most recent redeclaration in another PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110125 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
a865005c74019184e04f7fcdd4d61c31c095a4ff 03-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Apart from storing/retrieving the previous redeclaration from PCH, also store/retrieve the most recent
redeclaration. That way we are sure that the full redeclarations chain is loaded.

When using chained PCHs, first declarations point to the most recent redeclarations in the same PCH.
To address this use a REDECLS_UPDATE_LATEST record block to keep track of which first declarations need
to point to a most recent redeclaration in another PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110125 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
67575e6c198aea7ed5369be14ffb1972069287a8 03-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Send AST dumping/printing to stdout instead of stderr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110123 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
bc1e1467f747d653c402ae58ed200b9f8a736a01 03-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Send AST dumping/printing to stdout instead of stderr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110123 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
566d849afc7e06d39cd5a216dd1b8cc424df4a6e 03-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Avoid writing a VTABLE_USES record in PCH if there are no entries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110122 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
be4ebcdaa03a84d915b37f96d241b74eece67c92 03-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Avoid writing a VTABLE_USES record in PCH if there are no entries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110122 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
fdf77a2e808522be8aa86999d4880e83bf1230f3 03-Aug-2010 Chris Lattner <sabre@nondot.org> fix some undefined behavior, PR7779.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110116 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
8074ab3c3cda3534e595c67f485d7711c48b493d 03-Aug-2010 Chris Lattner <sabre@nondot.org> fix some undefined behavior, PR7779.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110116 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
1458cf7089a51cdadbf843725671a677d5fc73e5 03-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> Reshuffle the PCH generator action and consumer, so that we can re-use
it while generating precompiled preambles. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110108 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
rontendActions.cpp
eneratePCH.cpp
1d715ac14bf440664fb0d1425ea882274f994f57 03-Aug-2010 Douglas Gregor <dgregor@apple.com> Reshuffle the PCH generator action and consumer, so that we can re-use
it while generating precompiled preambles. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110108 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
rontendActions.cpp
eneratePCH.cpp
cf96172b257a1c4ed57cc7d0c03dd5c247413214 03-Aug-2010 Ted Kremenek <kremenek@apple.com> Add -cc1 option '-unoptimized-cfg' to toggle using a CFG (for static analysis) that doesn't prune CFG edges.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110087 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
9b823e8e1ccb8a2cb49923bad22a80ca96f41f92 03-Aug-2010 Ted Kremenek <kremenek@apple.com> Add -cc1 option '-unoptimized-cfg' to toggle using a CFG (for static analysis) that doesn't prune CFG edges.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110087 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
bed047d6d8212b07caa84c04cd21bedabd95cd4f 03-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Simplify global method pool implementation in Sema. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110078 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
db9d2145f1d85f64dba2c9b92416621ce01090a6 03-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Simplify global method pool implementation in Sema. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110078 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
751e91df279f335bb382e5e21b289cbe5eb9df7b 02-Aug-2010 Douglas Gregor <doug.gregor@gmail.com> When using a precompiled preamble, save the diagnostics produced when
creating the preamble and "replay" them when reusing the
preamble. Also, fix a thinko in the copying of the preamble when
building the precompiled preamble.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110061 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c0659ec614c428c7d15746fcad15d50a2703751d 02-Aug-2010 Douglas Gregor <dgregor@apple.com> When using a precompiled preamble, save the diagnostics produced when
creating the preamble and "replay" them when reusing the
preamble. Also, fix a thinko in the copying of the preamble when
building the precompiled preamble.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110061 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a5437a650cfeee303355437565b3f5e280b9e967 02-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Query only the latest version of an identifier in the PCH chain. Make sure this version holds the entire declaration chain. This is a much saner solution than trying to merge the info from all elements, and makes redeclarations work properly. Expand the declarations test case to cover more compliated cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110052 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
d8c5abb096a5f6babb3709180fe304be5462bcc1 02-Aug-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Query only the latest version of an identifier in the PCH chain. Make sure this version holds the entire declaration chain. This is a much saner solution than trying to merge the info from all elements, and makes redeclarations work properly. Expand the declarations test case to cover more compliated cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110052 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
738e778a32a604d13a3c9decbe36f7015bd41763 02-Aug-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr for them that will deserialize them when needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110031 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
76c38d385447b7acdff2d7e6b13fa8580e7174a7 02-Aug-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr for them that will deserialize them when needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110031 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
f4192a65178ccc46be0f11e157fca184e4f63832 02-Aug-2010 Daniel Dunbar <daniel@zuster.org> Driver/OpenBSD: Update toolchain for compiler changes / C++; patch by Jonathan
Gray.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109994 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
95c0457054518102af6250e718a13a5b2ee5dbea 02-Aug-2010 Daniel Dunbar <daniel@zuster.org> Driver/OpenBSD: Update toolchain for compiler changes / C++; patch by Jonathan
Gray.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109994 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
6ccdbb83af9f43824191783b6842a9628f048e43 31-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Implement dependency analysis for the precompiled preamble. If any of
the files in the precompiled preamble have changed since it was build,
force the preamble to be rebuilt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109937 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
cc5888d833caf90ebda37f24da40d2cd06b4d820 31-Jul-2010 Douglas Gregor <dgregor@apple.com> Implement dependency analysis for the precompiled preamble. If any of
the files in the precompiled preamble have changed since it was build,
force the preamble to be rebuilt.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109937 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
115479f12e541be79b31aaddefda8406d020d3e2 30-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Add some timers to ASTUnit that are only enabled when the LIBCLANG_TIMING environment variable is set.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109890 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
385103b79c5338a2be5da0ca70652400bc267371 30-Jul-2010 Douglas Gregor <dgregor@apple.com> Add some timers to ASTUnit that are only enabled when the LIBCLANG_TIMING environment variable is set.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109890 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
cbc7a49cdd749ac1ab8c5b25b56c4d447c129748 30-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Safely get a data pointer for vectors that might be empty.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109867 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
ade5000c8763f4bec41f452d7efa3a9b2a6d4712 30-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Safely get a data pointer for vectors that might be empty.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109867 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
e836e2ffc74196e0bd61526cb2959092c291e3a2 30-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Refactor the way PCHReader tracks whether we are in recursive loading.

-Replace CurrentlyLoadingTypeOrDecl with a counting scheme (NumCurrentElementsDeserializing)
-Provide outside access to the mechanism by adding methods StartedDeserializing/FinishedDeserializing
to ExternalASTSource.

These are preparation for the next commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109856 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
29ee3a273f58e16df7f2c524ab62a869e44fc9b1 30-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactor the way PCHReader tracks whether we are in recursive loading.

-Replace CurrentlyLoadingTypeOrDecl with a counting scheme (NumCurrentElementsDeserializing)
-Provide outside access to the mechanism by adding methods StartedDeserializing/FinishedDeserializing
to ExternalASTSource.

These are preparation for the next commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109856 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
6227b1e56f35a4dae53d631d392a83ab8a75feef 30-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make macro weirdness in chained PCH work. This required changing the way PCHReader and PCHWriter are initialized to correctly pick up all initializer. On the upside, this means that there is far less repetition in the dependent PCH now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109823 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendAction.cpp
rontendActions.cpp
eneratePCH.cpp
CHReader.cpp
CHWriter.cpp
ffaab3e2bb13991bb3357e80f14bcae3745b2347 30-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make macro weirdness in chained PCH work. This required changing the way PCHReader and PCHWriter are initialized to correctly pick up all initializer. On the upside, this means that there is far less repetition in the dependent PCH now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109823 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendAction.cpp
rontendActions.cpp
eneratePCH.cpp
CHReader.cpp
CHWriter.cpp
8fac2eb1ee050aaf6cab1fb5e944c2b20c5a8b7b 29-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Change the name to something less terrible; suggestion by Doug. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109797 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
4ac7c0bb39696e92fd220118fedc484c09a69870 29-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Change the name to something less terrible; suggestion by Doug. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109797 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
2dd234de53b4b4648fa47a275bfe10ecfcbc9d50 29-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Implement PCH support for offsetof(base-specifier).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109785 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
afbf3127cbdebc7d3d8711c51b1d013afa57e849 29-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Implement PCH support for offsetof(base-specifier).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109785 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
1ac53087c7b810990070ff80e5953669d339c55d 29-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Merge PCHWriterDecl.cpp's isRequiredDecl and CodeGenModule::MayDeferGeneration into a new function,
DeclIsRequiredFunctionOrFileScopedVar.

This is essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl
needs to be deserialized during PCH loading for codegen purposes.
Since this logic is shared by CodeGen and the PCH mechanism, move it to the ASTContext,
thus CodeGenModule's GetLinkageForFunction/GetLinkageForVariable and the GVALinkage enum is moved out of CodeGen.

This fixes current (and avoids future) codegen-from-PCH bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109784 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
90e99a84ddd020e8fda79643748243725a2ed071 29-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Merge PCHWriterDecl.cpp's isRequiredDecl and CodeGenModule::MayDeferGeneration into a new function,
DeclIsRequiredFunctionOrFileScopedVar.

This is essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl
needs to be deserialized during PCH loading for codegen purposes.
Since this logic is shared by CodeGen and the PCH mechanism, move it to the ASTContext,
thus CodeGenModule's GetLinkageForFunction/GetLinkageForVariable and the GVALinkage enum is moved out of CodeGen.

This fixes current (and avoids future) codegen-from-PCH bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109784 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
48a788b3337f2e9299486bb1edb4dc1fe7dadd16 29-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Store latest redeclaration for each redeclarable template declaration

This patch adds a Latest field to RedeclarableTemplateDecl's CommonBase
class which is used to store the latest redeclaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109755 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
8a798a7f7d88dc9865fad7da648e5cef8580c65a 29-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Store latest redeclaration for each redeclarable template declaration

This patch adds a Latest field to RedeclarableTemplateDecl's CommonBase
class which is used to store the latest redeclaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109755 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
3a0ba0efc321d7b1ab3ab2b970b5645fd226a4e2 29-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Refactor redeclarable template declarations

This patch refactors much of the common code in ClassTemplateDecl and
FunctionTemplateDecl into a common base class RedeclarableTemplateDecl
together with support functions in a template class RedeclarableTemplate.

The patch also includes similar refactoring for these classes' PCH
reader and writer implementations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109754 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
9eabebafc165a67812eacc184806e7bf34c5f0a5 29-Jul-2010 Peter Collingbourne <peter@pcc.me.uk> Refactor redeclarable template declarations

This patch refactors much of the common code in ClassTemplateDecl and
FunctionTemplateDecl into a common base class RedeclarableTemplateDecl
together with support functions in a template class RedeclarableTemplate.

The patch also includes similar refactoring for these classes' PCH
reader and writer implementations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109754 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
9b3f11b867b9814e1115515b52c705ffbd031b09 29-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Turn off precompiled preamble support for C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109680 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
fd0b87006b478bb573d369385aed64a58225264d 29-Jul-2010 Douglas Gregor <dgregor@apple.com> Turn off precompiled preamble support for C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109680 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
76ba917f0d1583d4d4e8ea1e4d847704ba95416e 28-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Support extended vector types in chained PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109675 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
a9f2368a4016901b5e2ed109b1eead2835ca8242 28-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Support extended vector types in chained PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109675 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
e442ccca49e07ee0bc13f1c3869a3e14a84792b4 28-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Record macros in dependent PCHs. Also add various info tables to dependent PCHs; tests for this to follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109554 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
083abdf67f157e9d2ab5a8c9d5e71240479d3c99 28-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Record macros in dependent PCHs. Also add various info tables to dependent PCHs; tests for this to follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109554 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
a915993c76603465b3def06980568a439b01be57 28-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Revert r109546, it broke linux build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109550 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
a6d6af308bfc9b72467b432a045a9fc6673e3821 28-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r109546, it broke linux build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109550 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
2720313679e66d9ef60cef891cedce6423348ac5 28-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Merge PCHWriterDecl.cpp's isRequiredDecl and CodeGenModule::MayDeferGeneration into a new function,
DeclIsRequiredFunctionOrFileScopedVar.

This function is part of the public CodeGen interface since it's essentially a CodeGen predicate that is also
needed by the PCH mechanism to determine whether a decl needs to be deserialized during PCH loading for codegen purposes.
This fixes current (and avoids future) codegen-from-PCH bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109546 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
ee94e2d10728d1b6a87a11aeee122e8759f58c63 28-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Merge PCHWriterDecl.cpp's isRequiredDecl and CodeGenModule::MayDeferGeneration into a new function,
DeclIsRequiredFunctionOrFileScopedVar.

This function is part of the public CodeGen interface since it's essentially a CodeGen predicate that is also
needed by the PCH mechanism to determine whether a decl needs to be deserialized during PCH loading for codegen purposes.
This fixes current (and avoids future) codegen-from-PCH bugs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109546 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
9c1ce01fea4f9ad7401f4ba8ad6cc07960e8b71e 27-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Update the list of lexical decls in the TU for chained PCHs. This makes -ast-print show the decls from the dependent PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109524 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
d692af71226d2fb537d86c670af96114ddd485c3 27-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Update the list of lexical decls in the TU for chained PCHs. This makes -ast-print show the decls from the dependent PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109524 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
8765b545071328c6752d14cc000404fb86a4949c 27-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Fix use-after-free with precompiled preambles

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109505 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
28233428da1ebec20c893d6297ae3191318940dd 27-Jul-2010 Douglas Gregor <dgregor@apple.com> Fix use-after-free with precompiled preambles

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109505 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
6a0a593883b4e65eb3e350a9e85504e72f290c97 27-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Always deserialize from PCH file scoped variables with non trivial constructor/destructor.

Fixes http://llvm.org/PR7692

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109501 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
90176d1ef0c3a8c4e87184920cc2ec65e1394d0a 27-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Always deserialize from PCH file scoped variables with non trivial constructor/destructor.

Fixes http://llvm.org/PR7692

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109501 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
386fd78fece26a30bb1ffb629efe4417f46f3dce 27-Jul-2010 Ted Kremenek <kremenek@apple.com> PTH generation: Don't save the leading '#' token in a null directive. This unbreaks using PTH with Boost (<rdar://problem/8227989>).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109484 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
5c53f4cb1e46691d788db27153b406869cc4c53f 27-Jul-2010 Ted Kremenek <kremenek@apple.com> PTH generation: Don't save the leading '#' token in a null directive. This unbreaks using PTH with Boost (<rdar://problem/8227989>).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109484 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
0c0f4c87e5846ea10c13074b7cd298df0246a8e9 27-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Implement -fno-validate-pch at the -cc1 level, which suppresses most
of the usual consistency checks used to determine when a precompiled
header is incompatible with the translation unit it's being loaded
into.

Enable this option when loading a precompiled preamble, because the
preamble loader will be performing all of this checking itself. Enable
the preamble-based test now that it's working.

This option is also useful for debugging Clang's PCH
(<rdar://problem/7532213>).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109475 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
rontendAction.cpp
CHReader.cpp
fae3b2f4743dad616623c4df2fdb0f5128bd36d9 27-Jul-2010 Douglas Gregor <dgregor@apple.com> Implement -fno-validate-pch at the -cc1 level, which suppresses most
of the usual consistency checks used to determine when a precompiled
header is incompatible with the translation unit it's being loaded
into.

Enable this option when loading a precompiled preamble, because the
preamble loader will be performing all of this checking itself. Enable
the preamble-based test now that it's working.

This option is also useful for debugging Clang's PCH
(<rdar://problem/7532213>).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109475 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
rontendAction.cpp
CHReader.cpp
9ccff7c5d83a7c5465439c70de8543f13e72cdfd 27-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> - Fix recording of offsets of types in dependent PCHs.
- Stop reading in (and thus deserializing) every declaration in the TU when creating a dependent PCH.
- Switch the storage of a decl context's lexical declarations to a blob containing the IDs instead of a record. This is the only sane way of supporting update records later on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109474 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
681d7237e1014bf64dd5ead6bf74ae55cdd19e61 27-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> - Fix recording of offsets of types in dependent PCHs.
- Stop reading in (and thus deserializing) every declaration in the TU when creating a dependent PCH.
- Switch the storage of a decl context's lexical declarations to a blob containing the IDs instead of a record. This is the only sane way of supporting update records later on.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109474 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
923d0beb91543df63b166abaad9288a74dda8795 26-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce basic support for loading a precompiled preamble while
reparsing an ASTUnit. When saving a preamble, create a buffer larger
than the actual file we're working with but fill everything from the
end of the preamble to the end of the file with spaces (so the lexer
will quickly skip them). When we load the file, create a buffer of the
same size, filling it with the file and then spaces. Then, instruct
the lexer to start lexing after the preamble, therefore continuing the
parse from the spot where the preamble left off.

It's now possible to perform a simple preamble build + parse (+
reparse) with ASTUnit. However, one has to disable a bunch of checking
in the PCH reader to do so. That part isn't committed; it will likely
be handled with some other kind of flag (e.g., -fno-validate-pch).

As part of this, fix some issues with null termination of the memory
buffers created for the preamble; we were trying to explicitly
NULL-terminate them, even though they were also getting implicitly
NULL terminated, leading to excess warnings about NULL characters in
source files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109445 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
rontendActions.cpp
nitPreprocessor.cpp
f4f6c9db68465b886ec2e596feaa6ecc782395a4 26-Jul-2010 Douglas Gregor <dgregor@apple.com> Introduce basic support for loading a precompiled preamble while
reparsing an ASTUnit. When saving a preamble, create a buffer larger
than the actual file we're working with but fill everything from the
end of the preamble to the end of the file with spaces (so the lexer
will quickly skip them). When we load the file, create a buffer of the
same size, filling it with the file and then spaces. Then, instruct
the lexer to start lexing after the preamble, therefore continuing the
parse from the spot where the preamble left off.

It's now possible to perform a simple preamble build + parse (+
reparse) with ASTUnit. However, one has to disable a bunch of checking
in the PCH reader to do so. That part isn't committed; it will likely
be handled with some other kind of flag (e.g., -fno-validate-pch).

As part of this, fix some issues with null termination of the memory
buffers created for the preamble; we were trying to explicitly
NULL-terminate them, even though they were also getting implicitly
NULL terminated, leading to excess warnings about NULL characters in
source files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109445 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
rontendActions.cpp
nitPreprocessor.cpp
5089d4a591bffa4b39ee39080762dfb74578f878 26-Jul-2010 Dan Gohman <gohman@apple.com> It's not necessary to call flush() on a raw_ostream immediately prior
to deleting it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109441 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
55c6570bf6f4342203eb0ff0816fe28e6c55964a 26-Jul-2010 Dan Gohman <gohman@apple.com> It's not necessary to call flush() on a raw_ostream immediately prior
to deleting it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109441 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
b2e3e246d5d736b72f0bd1190324a1029b09ffba 26-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Add source location information to C++ base specifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109396 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
5606220447c7901ba8d80147ddab893bb7949dd5 26-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Add source location information to C++ base specifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109396 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
ec0411dcec95d71321fd94a2c43124ba484ffb22 26-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Eliminate the "minimal" and printing parser actions, which only ever
worked for C anyway. Also kills the -cc1 options -parse-noop and
-parse-print-callbacks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109392 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInvocation.cpp
rontendActions.cpp
rintParserCallbacks.cpp
87c300738174924453648c3b2d6f366c8284fac4 26-Jul-2010 Douglas Gregor <dgregor@apple.com> Eliminate the "minimal" and printing parser actions, which only ever
worked for C anyway. Also kills the -cc1 options -parse-noop and
-parse-print-callbacks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109392 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInvocation.cpp
rontendActions.cpp
rintParserCallbacks.cpp
dc44f37a59e789997989d105bd99501f3670f56f 25-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Make ASTContext always use the BumpPtrAllocator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109375 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
63fe86bee66fc145942c56b2cc564ea0b9b9ea12 25-Jul-2010 Douglas Gregor <dgregor@apple.com> Make ASTContext always use the BumpPtrAllocator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109375 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
53793a835ead00d024b1940db756112d90f889c3 25-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Remove emacs file mode marker on file with .cpp extension.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109366 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
df22c2cc7703c7df04eadd2e6e59c61f545a5741 25-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Remove emacs file mode marker on file with .cpp extension.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109366 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
0bb3e1e552279777c62ac9bc6a59d80daac039f7 24-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Add header searching for llvm-gcc trunk on Gentoo AMD64. Patch by Mark Wood!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109357 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
6693534adb31fdd13b1ee873df3e90c99f916ad5 24-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Add header searching for llvm-gcc trunk on Gentoo AMD64. Patch by Mark Wood!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109357 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
5c18faecb596790da7431f9d1bec5b7352acf219 24-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Put a newline at the end of the padded buffers used for the
precompiled preamble. This will suppress the -pedantic "no newline at
end of file" warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109301 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
592508ed997e52207cf380f9b6eb9943994ad7ae 24-Jul-2010 Douglas Gregor <dgregor@apple.com> Put a newline at the end of the padded buffers used for the
precompiled preamble. This will suppress the -pedantic "no newline at
end of file" warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109301 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
9b6d8026553e199a41b41914960219b68872c7f7 24-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Once we've built (or reused) a precompiled preamble, create the
appropriately-padded main file buffer (that has spaces in the extra
"reserved" space) and thread that buffer through to the parsing
function. This still does nothing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109299 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
754f3490c5b0f5d83361f001bc87944f23644abb 24-Jul-2010 Douglas Gregor <dgregor@apple.com> Once we've built (or reused) a precompiled preamble, create the
appropriately-padded main file buffer (that has spaces in the extra
"reserved" space) and thread that buffer through to the parsing
function. This still does nothing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109299 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
8d1a8fdcbf69a8d6412b2afe5a796f871ab1fe7d 24-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Once we've built a precompiled preamble, keep track of the details of
that preamble (the preamble text, preamble file, reserved main file
size). Check these details when we try to rebuild the precompiled
preamble, and when nothing has changed, re-use the precompiled
preamble.

This code is still very much a WIP, and can't even properly be tested
because we have no way to use the precompiled preamble yet. "Trust me"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109294 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
175c4a9aa61f4449f27b729737e4438684ac6d92 24-Jul-2010 Douglas Gregor <dgregor@apple.com> Once we've built a precompiled preamble, keep track of the details of
that preamble (the preamble text, preamble file, reserved main file
size). Check these details when we try to rebuild the precompiled
preamble, and when nothing has changed, re-use the precompiled
preamble.

This code is still very much a WIP, and can't even properly be tested
because we have no way to use the precompiled preamble yet. "Trust me"



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109294 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
8a7147e794521b8646609a08f4eb09949196e2af 24-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make declarations in the dependent PCH visible, for C at least.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109292 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
CHWriterDecl.cpp
f2f0f03d08c6143137a79a8edffc7d41823bc3c7 24-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make declarations in the dependent PCH visible, for C at least.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109292 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
CHWriterDecl.cpp
be2ba10d823d15fba129f64cfa8eafa3b25d9989 23-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> PCH read/write for selector reference pool.
Finishes off radar 6507158.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109256 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
320198303df7c16950d83ae79c3f702b84badcf7 23-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> PCH read/write for selector reference pool.
Finishes off radar 6507158.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109256 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
4c9e58af596c095fd9c9bda4a7c45a8f7aa02044 23-Jul-2010 Zhongxing Xu <xuzhongxing@gmail.com> Fix build on Ubuntu 10.04.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109208 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ad23ebe22b7e52e3875981eeb46a1fd61a7554fb 23-Jul-2010 Zhongxing Xu <xuzhongxing@gmail.com> Fix build on Ubuntu 10.04.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109208 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
05deb583e203ac91118d09b5adbbafef964ca566 23-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Basic plumbing for generating a precompiled preamble for an
ASTUnit/CXTranslationUnit. We can't actually use this preamble yet,
however.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109202 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
nitPreprocessor.cpp
44c181aec37789f25f6c15543c164416f72e562a 23-Jul-2010 Douglas Gregor <dgregor@apple.com> Basic plumbing for generating a precompiled preamble for an
ASTUnit/CXTranslationUnit. We can't actually use this preamble yet,
however.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109202 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
nitPreprocessor.cpp
6a150dcbcaa6edce3fe2f1f88b0ba039c9cfac03 23-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Thread bitstream cursors all the way through the AST reading stuff. This way, reading a trivial 2-element chained file actually works.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109191 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
577d4796d358c0e72ebaa023113505226ab51b4f 23-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Thread bitstream cursors all the way through the AST reading stuff. This way, reading a trivial 2-element chained file actually works.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109191 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
c3024bdaee612382a1eee67b77aff7a6450feaa6 22-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> atch for implementation of objective-c's -Wselector
warning flag in clang. Little more to do
for a PCH issue. Radar 6507158.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109129 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
3fe104154dd2e8ffb351142d74f308938b5c99bf 22-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> atch for implementation of objective-c's -Wselector
warning flag in clang. Little more to do
for a PCH issue. Radar 6507158.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109129 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
fe518bd1efb8e68767c0d55220996f6b325ee42f 22-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write C++0x static_assert for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109123 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
0d396896998685809bda7444d772bbeb5bbe9b46 22-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write C++0x static_assert for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109123 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
8e781090dd2d0dd492b7a0a1b2dc75e645bb3a65 22-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow loading declcontext information from any file in the chain. Properly write source locations to dependent files. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109119 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
0fa7d0b15ea2a224bfe43ac745d411f915da87dd 22-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow loading declcontext information from any file in the chain. Properly write source locations to dependent files. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109119 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
994e5a2fd3895964e9d2109dac1318c0afbdb490 22-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write FriendTemplateDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109113 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
554e6aa2da082575514607c3639c246c04b3232a 22-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write FriendTemplateDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109113 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
33a4d62010b996b75c4a7f2f8dff9acbdf258cc5 22-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support C++ try/catch statements for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109112 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
7cb45e37b6f924d9ddbc53ac023bbaadb4ca3534 22-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support C++ try/catch statements for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109112 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
95afc56e2c030dbee39a8823fe2f0848b0968638 22-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow loading macros from any file in the chain. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109048 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
d27d3fc2f1c02e77f43e1af43ed5386474e3d56e 22-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow loading macros from any file in the chain. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109048 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
33a9fdd3e6ab60906e036d79a659956bce5fd24f 21-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Promote some macro-related stuff to per-file data. Fix a cache-inefficient nested loop by inverting the nesting. Store the size of each file in the chain; will need this later for statement offsets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109030 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
04e6fd4a5ceded0a442a6b3e6b87057b9d643fe3 21-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Promote some macro-related stuff to per-file data. Fix a cache-inefficient nested loop by inverting the nesting. Store the size of each file in the chain; will need this later for statement offsets.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109030 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
66dd0c4c4765ddfc60470965325a5ace160ececd 21-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow loading identifiers from any file in the chain. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108974 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
11f5ccf2d88c2ea600ed950831f100ed96d89fed 21-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow loading identifiers from any file in the chain. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108974 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
fd422e6372ed50a66cb48278622015b2be7fa3cc 21-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Apparently not every system thinks that references in pairs are as cool as I think.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108959 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
971dd4498f1118abd12e001add0df06e97669b61 21-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Apparently not every system thinks that references in pairs are as cool as I think.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108959 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
0486cef036a7ab29b46ada65da13e80f348813e1 21-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow loading declarations from any file in the chain. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108956 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
cb526aa1184d2aa19bbfdfb1080f1fc87d9bb711 21-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow loading declarations from any file in the chain. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108956 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
bfc599b2a8a8c5ece3f41a0b14281bb9e12d93fd 21-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow loading types from any file in the chain. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108954 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
aaec0aa844781dc7c3462ba140e004e589ccd355 21-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow loading types from any file in the chain. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108954 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
9a959363391bcd367004cfae81d293f31ec68b9e 20-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow loading source locations from any file in the chain. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108942 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
190faf7c30890479925193b074571e5dc30c3f53 20-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Allow loading source locations from any file in the chain. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108942 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
34d8fd40385964a903e1a311dd8956f46944b9e5 20-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> More work on getting PCHReader to handle multiple files. Promote SLocOffsets to per-file data. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108930 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
518d8cb31d26ea098eba79274abbfae1b4976853 20-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> More work on getting PCHReader to handle multiple files. Promote SLocOffsets to per-file data. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108930 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
24cd40c4d68f72d4c2d96358cc3d0e6833b2c1ee 20-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a new lexer function to compute the "preamble" of a file,
which is the part of the file that contains all of the initial
comments, includes, and preprocessor directives that occur before any
of the actual code. Added a new -print-preamble cc1 action that is
only used for testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108913 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendActions.cpp
f033f1da4a34f8df6e95e9929dc04ff54bb8fb01 20-Jul-2010 Douglas Gregor <dgregor@apple.com> Introduce a new lexer function to compute the "preamble" of a file,
which is the part of the file that contains all of the initial
comments, includes, and preprocessor directives that occur before any
of the actual code. Added a new -print-preamble cc1 action that is
only used for testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108913 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendActions.cpp
5416a2ad2fd6ad18846b9c2f6122ae0d417e24dd 20-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Hide FunctionTemplateDecl's specializations folding set as implementation detail and introduce
FunctionTemplateDecl::findSpecialization.

Redeclarations of specializations will not cause the previous decl to be removed from the set,
the set will keep the canonical decl. findSpecialization will return the most recent redeclaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108834 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
2c853e401ca406d417eb916e867226050e7be06b 20-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Hide FunctionTemplateDecl's specializations folding set as implementation detail and introduce
FunctionTemplateDecl::findSpecialization.

Redeclarations of specializations will not cause the previous decl to be removed from the set,
the set will keep the canonical decl. findSpecialization will return the most recent redeclaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108834 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
e964246c6f1d92ddfb1dcdb01743d0040a403654 20-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Whether the specialization should be added to template's folding set when read from PCH,
is determined by a isCanonicalDecl check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108833 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
bc5ab7c9e307fea5ecb979b30815da7a370e1c05 20-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Whether the specialization should be added to template's folding set when read from PCH,
is determined by a isCanonicalDecl check.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108833 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
a7a77ab274626a371e240b9e49c9231bdb7df092 20-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Update ImplicitCastExpr to be able to represent an XValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108807 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
906082edf2aea1c6de2926f93a8d7121e49d2a54 20-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Update ImplicitCastExpr to be able to represent an XValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108807 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
dea602e97a01fd130399c3a750dc53a79d205591 20-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Remove PCHReader::getStream(), it was unused. Inline PCHReader::getDelsCursor() into its sole caller and remove it. This reduces the attack surface of multiple PCH files towards code outside the PCH implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108763 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
2f82c5855eb93bc8467cefdb87a39167f4f53575 20-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Remove PCHReader::getStream(), it was unused. Inline PCHReader::getDelsCursor() into its sole caller and remove it. This reduces the attack surface of multiple PCH files towards code outside the PCH implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108763 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
b2a6c4f5c08ad62942bcb0a644965e5e12af086e 20-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Promote IdentifierOffsets to per-file data.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108762 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
2da08f9d8dff5f2a0ffb0cef72db80f03900a2cf 20-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Promote IdentifierOffsets to per-file data.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108762 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
cbe067facaa11ed67cd63550729f8962bf4cd751 20-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Promote DeclOffsets and TypeOffsets to per-file data.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108760 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
12d6da0675fa7df09e3f078995774b350e3a4652 20-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Promote DeclOffsets and TypeOffsets to per-file data.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108760 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
c8ce3346d45378ed47546672a86c1bf47e87802e 19-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a new libclang API, clang_reparseTranslationUnit(), which
reparses an already-parsed translation unit. At the moment it's just a
convenience function, but we hope to use it for performance
optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108756 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
abc563f554951259bbe0315055cad92ee14d87e4 19-Jul-2010 Douglas Gregor <dgregor@apple.com> Introduce a new libclang API, clang_reparseTranslationUnit(), which
reparses an already-parsed translation unit. At the moment it's just a
convenience function, but we hope to use it for performance
optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108756 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
012d398f3b451e075acb13a766a44c4ce52aee68 19-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Promote the identifier table to per-file data. Also, if a CHAINED_METADATA record exists, it has to be the first thing in the PCH file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108748 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
93fb9ed05655512cb14022c667058c078ca90b3c 19-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Promote the identifier table to per-file data. Also, if a CHAINED_METADATA record exists, it has to be the first thing in the PCH file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108748 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
219f777d069dc9f1da85dd831ddc4e90f4de72fa 19-Jul-2010 Daniel Dunbar <daniel@zuster.org> Driver: Change the driver to take the path to the main executable, instead of
taking it in pieces.
- Fixes a problem where the Clang executable path was not initialized properly
on Win32, because sys::Path::getBasename() doesn't do what I always think it
does. Imagine that, a sys::Path interface that is confusing!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108667 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
0bbad519aa068206f1e158d5073f72a39fbe83c5 19-Jul-2010 Daniel Dunbar <daniel@zuster.org> Driver: Change the driver to take the path to the main executable, instead of
taking it in pieces.
- Fixes a problem where the Clang executable path was not initialized properly
on Win32, because sys::Path::getBasename() doesn't do what I always think it
does. Imagine that, a sys::Path interface that is confusing!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108667 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ef006823ecd2344aa0b47065d6d2b2bcbe95a853 18-Jul-2010 Chris Lattner <sabre@nondot.org> BUILD_ARCHIVE is the default for libraries, no need to set it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108633 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
9638eef7e3b2ca30406c5d369a44aa49ff26b201 18-Jul-2010 Chris Lattner <sabre@nondot.org> BUILD_ARCHIVE is the default for libraries, no need to set it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108633 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
f80e489a72ca033e1ac2774d2632cdeb23e36ece 17-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Added PCH/ASTImporter code for ObjCIvarDecl's field.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108627 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
ac0021ba802e193e0f9f8207768c7862c7603bc0 17-Jul-2010 Fariborz Jahanian <fjahanian@apple.com> Added PCH/ASTImporter code for ObjCIvarDecl's field.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108627 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
c3bf73de9094c00b7b1f5c02f5b275f151ce7ef2 17-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Teach the PCH reader to load the dependency when encountering a chain metadata record. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108578 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
fbd4bf16341c1b23181c829ef2630d9a643e793c 17-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Teach the PCH reader to load the dependency when encountering a chain metadata record. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108578 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
e6a0e5758438f5c53d9385967995845e91537401 16-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Separate out the initial loading of a PCH so that loading chained PCHs can reuse it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108551 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
cdf3b83617a3e2471d592795622561506af9109e 16-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Separate out the initial loading of a PCH so that loading chained PCHs can reuse it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108551 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
2ef327113881d21ba9dfe6fa4dea0d560015a553 16-Jul-2010 Tom Care <tcare@apple.com> Improved false positive rate for the idempotent operations checker and moved it into the default path-sensitive analysis options.
- Added checks for static local variables, self assigned parameters, and truncating/extending self assignments
- Removed command line option (now default with --analyze)
- Updated test cases to pass with idempotent operation warnings

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108550 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
df4ca423ec7d9b62842e112d1b824faa08b64810 16-Jul-2010 Tom Care <tcare@apple.com> Improved false positive rate for the idempotent operations checker and moved it into the default path-sensitive analysis options.
- Added checks for static local variables, self assigned parameters, and truncating/extending self assignments
- Removed command line option (now default with --analyze)
- Updated test cases to pass with idempotent operation warnings

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108550 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
79468dc5067ac2f8f762224af0984c45ad8c5ce9 16-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> First baby steps towards PCHReader being able to keep track of multiple PCH files. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108537 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
9137a5230d3164b96beb14ffb87863234b7d240f 16-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> First baby steps towards PCHReader being able to keep track of multiple PCH files. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108537 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
4dfaa12aafc5b7cea1f53ecfcb28c1d6bb278645 16-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add a little more data to chained PCHs. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108528 91177308-0d34-0410-b5e6-96231b3b80d8
eneratePCH.cpp
CHReader.cpp
CHWriter.cpp
1476ed40ef6ef144937821da888c7e4d9ea0acd7 16-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add a little more data to chained PCHs. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108528 91177308-0d34-0410-b5e6-96231b3b80d8
eneratePCH.cpp
CHReader.cpp
CHWriter.cpp
9a6bcc47604104b8f8daa852872a56e9288192ed 16-Jul-2010 Daniel Dunbar <daniel@zuster.org> Suppress !+Asserts warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108480 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
c76c9e0856ff3aa47590474c9404dfb598c0564c 16-Jul-2010 Daniel Dunbar <daniel@zuster.org> Suppress !+Asserts warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108480 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
e55ffc39c073e8d63f41950bdf9549ecea8931e3 15-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add a callback interface that allows interested parties to get notified whenever PCHReader deserializes a type or decl (and possibly other things in the future). Have PCHWriter implement these callbacks as noops and register to receive them if we're chaining PCHs. This will allow PCHWriter to track the IDs of these things, which it needs to write the dependent files. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108383 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
eneratePCH.cpp
CHReader.cpp
CHWriter.cpp
30c514c225342844700ed4640ec6d90ddf0e12b2 15-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add a callback interface that allows interested parties to get notified whenever PCHReader deserializes a type or decl (and possibly other things in the future). Have PCHWriter implement these callbacks as noops and register to receive them if we're chaining PCHs. This will allow PCHWriter to track the IDs of these things, which it needs to write the dependent files. WIP

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108383 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
eneratePCH.cpp
CHReader.cpp
CHWriter.cpp
daa3becb617ed9681cfa2593306b3a4d65a68b18 15-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> There is another implementation of PCHReaderListener around. Update it to the new interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108377 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
cb481aacdc0f08e225c68c99c65351b367042475 15-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> There is another implementation of PCHReaderListener around. Update it to the new interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108377 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
8254d63f615f04f3b27894c9e0a355e20f43a6f7 15-Jul-2010 Benjamin Kramer <benny.kra@googlemail.com> Pass StringRefs by value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108375 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
ec1b1cc006cef19e0a95d0ea6fbfd37d0d615066 15-Jul-2010 Benjamin Kramer <benny.kra@googlemail.com> Pass StringRefs by value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108375 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
11594551693b1db92840bf1640d087ce1062609f 14-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Increase the max PCH level for declarations to 7. Add a FromPCH flag to types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108354 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
07a353c2af3a3c557205466d4f4ed2513462ebfe 14-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Increase the max PCH level for declarations to 7. Add a FromPCH flag to types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108354 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
0cd8d6184b6aebaf1137b99b19c027a418830f86 14-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make PCHReader cope with PCH files containing more than one predefines buffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108340 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
7e9ad8b4fd446ca7cc0e630edee56d8fcc4553de 14-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Make PCHReader cope with PCH files containing more than one predefines buffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108340 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
13767543229d759e3c51dea5fa1cc531effb08ce 13-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Downgrade the "when type is in parentheses, array cannot have dynamic
size" error for code like

new (int [size])

to a warning, add a Fix-It to remove the parentheses, and make this
diagnostic work properly when it occurs in a template
instantiation. <rdar://problem/8018245>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108242 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
rintParserCallbacks.cpp
4bd40318cbea15310a37343db46de96c4fcc15e6 13-Jul-2010 Douglas Gregor <dgregor@apple.com> Downgrade the "when type is in parentheses, array cannot have dynamic
size" error for code like

new (int [size])

to a warning, add a Fix-It to remove the parentheses, and make this
diagnostic work properly when it occurs in a template
instantiation. <rdar://problem/8018245>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108242 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
rintParserCallbacks.cpp
441770637fa1297a3bd9af909de9d22ad5ff518e 13-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Modify the pragma handlers to accept and use StringRefs instead of IdentifierInfos.

When loading the PCH, IdentifierInfos that are associated with pragmas cause declarations that use these identifiers to be deserialized (e.g. the "clang" pragma causes the "clang" namespace to be loaded).
We can avoid this if we just use StringRefs for the pragmas.

As a bonus, since we don't have to create and pass IdentifierInfos, the pragma interfaces get a bit more simplified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108237 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
rintPreprocessedOutput.cpp
9b36c3f0de0105e903130bbda3c4aea7d792c0af 13-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Modify the pragma handlers to accept and use StringRefs instead of IdentifierInfos.

When loading the PCH, IdentifierInfos that are associated with pragmas cause declarations that use these identifiers to be deserialized (e.g. the "clang" pragma causes the "clang" namespace to be loaded).
We can avoid this if we just use StringRefs for the pragmas.

As a bonus, since we don't have to create and pass IdentifierInfos, the pragma interfaces get a bit more simplified.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108237 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
rintPreprocessedOutput.cpp
bf00306c12102e6443ae9092468957ffbb78bb74 13-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Fix a documentation paste-o and eliminate a useless function parameter, both found by Sebastian

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108214 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
dd41ed59cf7aefabd40bf766d8fcc7ebd759c8e5 13-Jul-2010 Douglas Gregor <dgregor@apple.com> Fix a documentation paste-o and eliminate a useless function parameter, both found by Sebastian

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108214 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
b963de31cf8e86bbd3c31cc7cf390c841fd38031 13-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Split the normal and chained PCH writing paths and add a tiny bit of implementation to the latter. WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108200 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
1dc13a15e789a174e5e5855efe27036dd7a9d252 13-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Split the normal and chained PCH writing paths and add a tiny bit of implementation to the latter. WIP.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108200 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
f94636d5d9d1bab3df1fc74110172702d6364feb 12-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Simplify code using the new FoldingSetImpl::InsertNode() overload.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108198 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
0a67eddc8fa2d6d1319deff0d52850f079753b2a 12-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Simplify code using the new FoldingSetImpl::InsertNode() overload.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108198 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
178c744476aee16b6222312c569a8734cbd7aa84 11-Jul-2010 Chandler Carruth <chandlerc@gmail.com> Switch to void-cast for this. Chris prefers that over the attribute, I'll
probably try and switch more of these if I can.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108085 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
1bdb5a68912ff114fcf681bfb823fff0d1c25a84 11-Jul-2010 Chandler Carruth <chandlerc@gmail.com> Switch to void-cast for this. Chris prefers that over the attribute, I'll
probably try and switch more of these if I can.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108085 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
7b7f3ae3c22c171cde1bfa557fabd2751fe5b9d5 11-Jul-2010 Chandler Carruth <chandlerc@gmail.com> Mark assert-only variables as unused.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108068 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
fb3f9bebda0e968aeac885c2ddc965af060e9f7e 11-Jul-2010 Chandler Carruth <chandlerc@gmail.com> Mark assert-only variables as unused.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108068 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
343bc4ac3ca28ee5f51fb8c03f2145c3c20e44b0 10-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Add PCH support for the remaining C++ exprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108042 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
6d00c1365dd3601f6d93bbda9162913c57ae788f 10-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add PCH support for the remaining C++ exprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108042 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
2e74cc0d3c3242219269522966bad1ccf6a5b78c 09-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Reorganize how ClassTemplate[Partial]SpecializationDecls are read/written to avoid the
possibility of adding an unitialized one into the folding set.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108016 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
ecf966e837097fb2ea0a80391e129bed7361d396 09-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Reorganize how ClassTemplate[Partial]SpecializationDecls are read/written to avoid the
possibility of adding an unitialized one into the folding set.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108016 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
9b78ff56fdd867d47f9e9077afa1610ebbea5dfc 09-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> isMemberSpecialization -> setMemberSpecialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108015 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
64a5e2c4398105dfc05df7cc3de0e80bcee8e15a 09-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> isMemberSpecialization -> setMemberSpecialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108015 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
70b3e1446cbd99e41a4ebe2fd9aecb0be3157904 09-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> When given the -chained-pch option and a previous PCH file, have the PCHWriter emit a CHAINED_METADATA record instead of METADATA, and write a link to the previous file there.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108014 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
CHWriter.cpp
77f4603c8b142e642300959a601ecec2b7c8e288 09-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> When given the -chained-pch option and a previous PCH file, have the PCHWriter emit a CHAINED_METADATA record instead of METADATA, and write a link to the previous file there.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108014 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
CHWriter.cpp
76d326d5bb72ebad17e459432e88e1d31d133764 09-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Correctly initialize Reader to null.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107994 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
fae4f1546ab0fa645aeebb8da069a41538a53779 09-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Correctly initialize Reader to null.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107994 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
d1db18e9958d5e8ffa3b787045dd166e83929539 09-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Really respect -chained-pch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107993 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
6a695cf3c273def77a2fd1cd8ec3a15225728cdf 09-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Really respect -chained-pch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107993 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
b615eefeb4419b77f5ce726813aaa3a5cf352536 09-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce -f{no-}spell-checking options to enable/disable
spell-checking. By default, spell-checking is enabled for Clang
(obviously) but disabled in CIndex for performance reasons.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107992 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
CHReader.cpp
CHWriter.cpp
a0068fc64351db9c47916566e3b85ab733cd8d6d 09-Jul-2010 Douglas Gregor <dgregor@apple.com> Introduce -f{no-}spell-checking options to enable/disable
spell-checking. By default, spell-checking is enabled for Clang
(obviously) but disabled in CIndex for performance reasons.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107992 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
CHReader.cpp
CHWriter.cpp
4d800b41a27e7e5d94b365878b30034539a0d3b7 09-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add a frontend option -chained-pch and don't pass an active PCH reader to the PCH writer if it is not set, preventing creation of chained PCH files. Since the reader is so far unused, effectively no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107936 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendActions.cpp
d6ac4524cd441808f152f7e10900a8315ea31c08 09-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add a frontend option -chained-pch and don't pass an active PCH reader to the PCH writer if it is not set, preventing creation of chained PCH files. Since the reader is so far unused, effectively no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107936 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendActions.cpp
aeee5b8269a59ef2e1a65ed73458b26b2b56ec2a 09-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Some preparatory work for chained PCH. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107915 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendActions.cpp
eneratePCH.cpp
CHWriter.cpp
a93e3b5bde9f0a7b59215f19f176f7d69881b81c 09-Jul-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Some preparatory work for chained PCH. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107915 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendActions.cpp
eneratePCH.cpp
CHWriter.cpp
5f44093649015a532b5b78ad95584f469469d668 08-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce PCHReader::GetTranslationUnitDecl() and use it instead of ReadDeclRecord when initializing.

ReadDeclRecord would hit assertion if the translation unit declaration was already loaded during
IdentifierInfo initialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107885 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
8871a44ae61cf97ff6fff4c640fadce9ba4cf1b0 08-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce PCHReader::GetTranslationUnitDecl() and use it instead of ReadDeclRecord when initializing.

ReadDeclRecord would hit assertion if the translation unit declaration was already loaded during
IdentifierInfo initialization.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107885 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
a17bffb76acc003b51a88f817a23071877f7c539 08-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support TemplateTemplateParmDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107884 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
bfcc92c3476ada55ceeea49e43e6d2e083252830 08-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support TemplateTemplateParmDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107884 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
b69c35fbf8635a267215a83b4e9fd980019f003a 08-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> For TagType and TemplateSpecializationType, isDependent calculation may be invalid because some decls that the
calculation is using may still be initializing.
Thus, store the isDependent flag to PCH and restore directly to Type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107873 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
be191100e034b23a3e13053757a57b7f5068c24a 08-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> For TagType and TemplateSpecializationType, isDependent calculation may be invalid because some decls that the
calculation is using may still be initializing.
Thus, store the isDependent flag to PCH and restore directly to Type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107873 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
7b1d67a3a0fd7ca693a5633b00b44341f09af5b9 08-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write the C++ parts of DeclRefExpr and MemberExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107872 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
663e380d7b2de2bbf20e886e05371195bea9adc4 08-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write the C++ parts of DeclRefExpr and MemberExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107872 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
e8f2e77a0856219a9a733aaba4b7ec1edcdeab0b 08-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix reading of UsingDecl from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107871 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
82f8e796d6ffce1d63729a2df87c1060edf6593a 08-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix reading of UsingDecl from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107871 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
0ec494632efdc9cd55608bc98d175a68084acbad 08-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Reinstate the fix for PR7556. A silly use of isTrivial() was
suppressing copies of objects with trivial copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107857 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ed8abf18329df67b0abcbb3a10458bd8c1d2a595 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Reinstate the fix for PR7556. A silly use of isTrivial() was
suppressing copies of objects with trivial copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107857 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
fa0b6fca56fc75c359c07a5fb1a6f328c93e61ca 08-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Revert r107828 and r107827, the fix for PR7556, which seems to be
breaking bootstrap on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107837 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
84745677f64863e025a6733cb29d0b94bc3a6ae2 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Revert r107828 and r107827, the fix for PR7556, which seems to be
breaking bootstrap on Linux.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107837 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
38c8fe9cdead9e73d84548a6e3c8a9fb680bcb98 08-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect its
newly-narrowed scope. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107828 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
016a4a90c8e75d59de731fa3aa98f0a55656e66c 08-Jul-2010 Douglas Gregor <dgregor@apple.com> Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect its
newly-narrowed scope. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107828 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
6f4bed50c076d7c8dd115c4c8af150d44bb6b379 07-Jul-2010 Chris Lattner <sabre@nondot.org> add driver support for minix, patch by Kees van Reeuwijk
from PR7583


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107788 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
38e317d6dce161b249508686cc67eb7176958762 07-Jul-2010 Chris Lattner <sabre@nondot.org> add driver support for minix, patch by Kees van Reeuwijk
from PR7583


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107788 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
5bb1017fb87e3604dce928f5e35f7be3926e3df0 07-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix broken reading of NestedNameSpecifiers from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107784 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
d2bb2c0942d7db565b0f29a8d1640bb97d781cae 07-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix broken reading of NestedNameSpecifiers from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107784 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
94123548cbd76ff3947606562988fdcb26a047d1 07-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Delay passing InterestingDecls to the Consumer until when we know we are not in recursive loading and the
declarations are fully initialized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107783 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
bb80a8e8887c1ec74ee135d4ad9455eafedf1508 07-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Delay passing InterestingDecls to the Consumer until when we know we are not in recursive loading and the
declarations are fully initialized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107783 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
4148efd0094233b24bbcd4772fa5073decacf7c7 07-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Simplify code. FunctionDecl and ObjCMethodDecl have some common interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107769 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
9d96f9239e9250864435b25ed93bf6d08c4e5feb 07-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Simplify code. FunctionDecl and ObjCMethodDecl have some common interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107769 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
385b4d574901c8b01c0f9fa4c86a9eb5e6ca9461 06-Jul-2010 Tom Care <tcare@apple.com> Added a path-sensitive idempotent operation checker (-analyzer-idempotent-operation). Finds idempotent and/or tautological operations in a path sensitive context, flagging operations that have no effect or a predictable effect.

Example:
{
int a = 1;
int b = 5;
int c = b / a; // a is 1 on all paths
}

- New IdempotentOperationChecker class
- Moved recursive Stmt functions in r107675 to IdempotentOperationChecker
- Minor refactoring of SVal to allow checking for any integer
- Added command line option for check
- Added basic test cases

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107706 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
db2fa8a7eb67b1e8f32a590b8e000e1259cff91a 06-Jul-2010 Tom Care <tcare@apple.com> Added a path-sensitive idempotent operation checker (-analyzer-idempotent-operation). Finds idempotent and/or tautological operations in a path sensitive context, flagging operations that have no effect or a predictable effect.

Example:
{
int a = 1;
int b = 5;
int c = b / a; // a is 1 on all paths
}

- New IdempotentOperationChecker class
- Moved recursive Stmt functions in r107675 to IdempotentOperationChecker
- Minor refactoring of SVal to allow checking for any integer
- Added command line option for check
- Added basic test cases

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107706 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ffcfbc7cbfad7c434a138737989688d7e25ddb45 06-Jul-2010 Duncan Sands <baldrick@free.fr> Pacify versions of gcc that think these variables may be used
uninitialized (which doesn't seem to be the case), by giving
them arbitrary initial values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107679 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
1f377b1783c98ddcdd3cd9e8223bec93ab51381f 06-Jul-2010 Duncan Sands <baldrick@free.fr> Pacify versions of gcc that think these variables may be used
uninitialized (which doesn't seem to be the case), by giving
them arbitrary initial values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107679 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
f4eb7c7bcaa4adb3b6436f16b71c245dc7950a6f 06-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write function template specializations for PCH, properly this time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107665 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
057d9afdc7e8027f3b928f0dd8d7d921d7cd5615 06-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write function template specializations for PCH, properly this time.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107665 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
a4d872ad267282e1d826162dcb75eaa296e5ec65 06-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Add to PCH missing Sema information about VTable uses and dynamic classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107664 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
d455add086f1dfa16ae87dc310e49493bbc2b0a6 06-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add to PCH missing Sema information about VTable uses and dynamic classes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107664 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
926f569ddfc6386101edb7436f3fe6f27be9f258 06-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Allow a CXXRecordDecl to get a DefinitionData pointer even when its owner is still initializing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107663 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
0f47bb98cbc52a6ead2aef8a2f8315c0b6167e6c 06-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow a CXXRecordDecl to get a DefinitionData pointer even when its owner is still initializing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107663 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
c4ce1c451893942c9c0c13dea42fe696f735e163 06-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write instantiated-from-member of EnumDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107662 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
74228274ba9b27a26a311010b02c371f558e3bfc 06-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write instantiated-from-member of EnumDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107662 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
9af53812d5977e79d0330e7c38c2ce9eb0791eda 05-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write the identifier namespace in PCH for decls that may modify it.

We can now use a PCH'ed <map>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107617 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
c8f9af2943699ff623ca08f2e5ed4d72e0351189 05-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write the identifier namespace in PCH for decls that may modify it.

We can now use a PCH'ed <map>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107617 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
10bfc5813682c82c3e0329ed8582e8d92f8f4f1f 05-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write some source location for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107616 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
7b081c8604efd33bc7f7e5c1e9427a031eedb2b4 05-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write some source location for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107616 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
e0dabf9cc0f323ab90e963233fd9a7aafd1c4b5a 04-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix a regression of a previous commit of mine (rdar://8158953).

Some of the invariant checks for creating Record/Enum types don't hold true during PCH reading.
Introduce more suitable ASTContext::getRecordType() and getEnumType().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107598 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
400f5125e2432d648f2c8a31b36a7f318a880c47 04-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix a regression of a previous commit of mine (rdar://8158953).

Some of the invariant checks for creating Record/Enum types don't hold true during PCH reading.
Introduce more suitable ASTContext::getRecordType() and getEnumType().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107598 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
e4c9c5400738b7bfb9a477049993f16696ce32b1 04-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write more information of ASTContext for PCH. Overriden methods and instantiated-from information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107597 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
c91e9f439ae85d5f79a6b65672f1d7d1b55ccda0 04-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write more information of ASTContext for PCH. Overriden methods and instantiated-from information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107597 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
a0b52cc3c2161509acf2c0b9470cb8db105d2ff8 04-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Don't try to install the __[u]int128_t identifier if it is already installed by PCHReader.

Currently, adding it to visible decls of a PCH'ed translation unit has no effect because
adding visible decls before deserialization has no effect (the decls won't be visible).
This will be fixed in a future commit; then it will force deserialization of visible decls, so avoid pointlessly installing it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107595 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
006113841bdae1edb77aef75ba1ffdf2e55a3094 04-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Don't try to install the __[u]int128_t identifier if it is already installed by PCHReader.

Currently, adding it to visible decls of a PCH'ed translation unit has no effect because
adding visible decls before deserialization has no effect (the decls won't be visible).
This will be fixed in a future commit; then it will force deserialization of visible decls, so avoid pointlessly installing it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107595 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
b62cb6845cd31f69da52198bc0c51b68462adb45 04-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Write/read ParmVarDecl's UninstantiatedDefaultArg for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107594 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
691d77f20763915fc7c9b34e29939d225fd0b4d2 04-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Write/read ParmVarDecl's UninstantiatedDefaultArg for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107594 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
5e881aacf6176c20270f664a85761351158f9c78 04-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write specialization info of static data members for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107593 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
9421adc43891e272156fab640e5d5ee5054b779c 04-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write specialization info of static data members for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107593 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
bb7bf9bbd7e455154fd2d481f3c3c5446b871135 03-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> When setting the anonymous namespace at PCH reading, it may still be initializing so avoid
the invariant checks at NamespaceDecl::setAnonymousNamespace().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107566 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
a038c1dcface5a404d540a0d0688962cbe656af9 03-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> When setting the anonymous namespace at PCH reading, it may still be initializing so avoid
the invariant checks at NamespaceDecl::setAnonymousNamespace().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107566 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
8894af18af4f933e99fef9641fc225b9823a385c 03-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Lazily declare default constructors. We now delay the construction of
declarations for implicit default constructors, copy constructors,
copy assignment operators, and destructors. On a "simple" translation
unit that includes a bunch of C++ standard library headers, we
generate relatively few of these implicit declarations now:

4/159 implicit default constructors created
18/236 implicit copy constructors created
70/241 implicit copy assignment operators created
0/173 implicit destructors created

And, on this translation unit, this optimization doesn't really
provide any benefit. I'll do some more performance measurements soon,
but this completes the implementation work for <rdar://problem/8151045>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107551 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
1827403a7138946305c0058f262e02b595cf882f 03-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare default constructors. We now delay the construction of
declarations for implicit default constructors, copy constructors,
copy assignment operators, and destructors. On a "simple" translation
unit that includes a bunch of C++ standard library headers, we
generate relatively few of these implicit declarations now:

4/159 implicit default constructors created
18/236 implicit copy constructors created
70/241 implicit copy assignment operators created
0/173 implicit destructors created

And, on this translation unit, this optimization doesn't really
provide any benefit. I'll do some more performance measurements soon,
but this completes the implementation work for <rdar://problem/8151045>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107551 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
1cdf4d0686667b7f80c37cdc87679d824819bb5a 03-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Lazily declare implicit copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107543 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
225843186e3972ce798d3de00f86da9008b15a0e 03-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare implicit copy constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107543 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
040dd7f2bf53b5ad1e95f385bfe2201f73ebf7c4 03-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write CastExpr's CXXBaseSpecifierArray for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107542 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
0745d0a648b75bd304045309276c70a755adaafb 03-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write CastExpr's CXXBaseSpecifierArray for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107542 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
644868591f60eec090c00a4fe6a92fcb9b4abf8b 03-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix broken PCH support for CXXDefaultArgExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107541 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
8a50733034edd6a349b34e2b9f0c8d0a874846d3 03-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix broken PCH support for CXXDefaultArgExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107541 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
cbc2ab01c76cc7dea081cd23071514d88bc9fae9 02-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Lazily declare copy-assignment operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107521 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
a376d10acfacf19d6dfa41069f7929739a18dd7a 02-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare copy-assignment operators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107521 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
b9aa39a0fad9109684a960bf91e13ceeeb2425e3 02-Jul-2010 Douglas Gregor <doug.gregor@gmail.com> Lazily declare the implicitly-declared destructor in a C++ class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107510 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
4923aa25eb39d64106a5817c02d560a3aecf8b2c 02-Jul-2010 Douglas Gregor <dgregor@apple.com> Lazily declare the implicitly-declared destructor in a C++ class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107510 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
fae7b154d0b498ac5775692a2b37bfb3deb1ab9e 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Handle CXXConstructorDecl, CXXDestructorDecl, and CXXConversionDecl for PCH.

<vector> header can be used correctly through PCH now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107483 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
91468328268f8be076c399e8482ec3cf98fe90cc 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Handle CXXConstructorDecl, CXXDestructorDecl, and CXXConversionDecl for PCH.

<vector> header can be used correctly through PCH now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107483 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
e404c1a41ce0c69171c8fbdb99c80504e82a7029 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix reading FunctionDecls from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107477 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
5efb06f306c6526ad02ee2c166cbf67c04e38311 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix reading FunctionDecls from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107477 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
a456f63160a50c9e3f13b7e7e89639738d8fdaf5 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix reading ClassTemplateDecl's ClassTemplateSpecializationDecls and ClassTemplatePartialSpecializationDecls.

Store/read also their template arguments because they may be initializing and not be able to provide them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107476 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
7d530487714b300be95fd71de68a3287078a814f 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix reading ClassTemplateDecl's ClassTemplateSpecializationDecls and ClassTemplatePartialSpecializationDecls.

Store/read also their template arguments because they may be initializing and not be able to provide them.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107476 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
3a3d08e839c78fe8dda69c3706825826dce92b3e 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fully read/write CXXRecordDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107475 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
37ffed3b7f229844cae2463ff82b527506c86c74 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fully read/write CXXRecordDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107475 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
2cd4f003670a4514880e76c571d7fa1289e9732b 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix reading of DependentNameType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107474 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
f48d45e3e36c132bdee3373beec4e8b19ae3f9c4 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix reading of DependentNameType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107474 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
f2606db18b5d64f241d74dc4e967347ad3da4792 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Allow reading of InjectedClassNameType from PCH even when its decl is currently initializing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107473 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
43921b53b582145f0d1b7c48223bd4d9f0a9d1be 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Allow reading of InjectedClassNameType from PCH even when its decl is currently initializing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107473 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
6f522b8456e2c2afd750e0a5984ac42d974d83a0 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix broken reading of member pointer from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107472 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
240437bbb96898e2cd019ffbc5303cd42e3d4f5f 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix broken reading of member pointer from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107472 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
8e3a4439cca2392c63451037ca97eb7037574c91 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> - Allow a typedef type to be read from PCH even if its decl is currently initializing.
- Fix creation of TemplateSpecializationType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107471 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
9763e221e16026ddf487d2564ed349d2c874a1a1 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> - Allow a typedef type to be read from PCH even if its decl is currently initializing.
- Fix creation of TemplateSpecializationType.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107471 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
4d891224eae3a35804e9e06d258cf660ade02cda 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix broken reading of "#lines" from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107470 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
f52a5d23965abe1a11ca7f283fec1adc1a339516 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix broken reading of "#lines" from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107470 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
c19cf9ab4601e8c5fe1d1f3cb82536c2aeeccf10 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Generally types expect an initialized TypeDecl; its safer and less complicated to delay PCH reading the type of a TypeDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107469 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
d8a0c6f92c13b06f24ef894099b9fca1004d445b 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Generally types expect an initialized TypeDecl; its safer and less complicated to delay PCH reading the type of a TypeDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107469 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
b69c228c5fc1240fbc72e8f9ac48f5d58a77581c 02-Jul-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Add some side-effect free Create methods for TypeDecl subclasses and use them for PCH reading.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107468 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
b8b03e6df1cc89e701a809c6a47c41f31b7a9e50 02-Jul-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add some side-effect free Create methods for TypeDecl subclasses and use them for PCH reading.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107468 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
a0173ee552a235c935e2df51cb90f44298f9e385 01-Jul-2010 Daniel Dunbar <daniel@zuster.org> Driver/IRgen: Add support for -momit-leaf-frame-pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107367 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1ad6648cce57bd187f1853f58fef26cd9bf4934f 01-Jul-2010 Daniel Dunbar <daniel@zuster.org> Driver/IRgen: Add support for -momit-leaf-frame-pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107367 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ab17688c1774eba014f3a29f1c26fd5bb0704a4b 30-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix PCH support for UnresolvedUsingTypenameDecl and UnresolvedUsingValueDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107268 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
8f4eae96bef0902d93535c18b69154ce66f5e546 30-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix PCH support for UnresolvedUsingTypenameDecl and UnresolvedUsingValueDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107268 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
26f9c6bc93729a39f21a24cf3e3088c04b2f6a5f 30-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support DependentSizedArrayType for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107267 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ae8b17f1d5d303af53db5a4f4a375ea6b9356566 30-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support DependentSizedArrayType for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107267 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
3924a168ffe6ebbe459db98208b195266f0ae147 30-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support ParenListExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107266 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
37bdfe284ad365f753741d1d89c078c148b3f4af 30-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support ParenListExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107266 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
781ff00c44ba720f21e47a90727103817f632a34 30-Jun-2010 Daniel Dunbar <daniel@zuster.org> Headers: Define __INT64_TYPE__ in terms of getInt64Type(), which isn't always
'long'. The practical upshot is so that the uint64_t we define in our stdint.h
ends up being compatible with that defined by gcc (at least on Darwin), which
otherwise could lead to type incompatibilities with other system headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107255 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
7f3a545ba6ccfbe8b7f5268e4cfbee52ec2c4d4c 30-Jun-2010 Daniel Dunbar <daniel@zuster.org> Headers: Define __INT64_TYPE__ in terms of getInt64Type(), which isn't always
'long'. The practical upshot is so that the uint64_t we define in our stdint.h
ends up being compatible with that defined by gcc (at least on Darwin), which
otherwise could lead to type incompatibilities with other system headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107255 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
f5b2e4e507e7014d09331fda4e7f0d5682d13660 30-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support C++ friend declarations for PCH.

This commit 'introduces' a slightly different way to restore the state of the AST object.
It makes PCHDeclReader/PCHDeclWriter friends and gives them access to the private members of the object.
The rationale is to avoid using/modifying the AST interfaces for PCH read/write so that to:

-Avoid complications with objects that have side-effects during creation or when using some setters.
-Not 'pollute' the AST interface with methods only used by the PCH reader/writer
-Allow AST objects to be read-only.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107219 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
6764334dfa73d67cbbb1b1fc8fe00440aad00f2a 30-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support C++ friend declarations for PCH.

This commit 'introduces' a slightly different way to restore the state of the AST object.
It makes PCHDeclReader/PCHDeclWriter friends and gives them access to the private members of the object.
The rationale is to avoid using/modifying the AST interfaces for PCH read/write so that to:

-Avoid complications with objects that have side-effects during creation or when using some setters.
-Not 'pollute' the AST interface with methods only used by the PCH reader/writer
-Allow AST objects to be read-only.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107219 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
418c103ccdfb96ce21b9e8e7a7caf63149fa93c0 30-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> When we know that we are at sub-statement reading (which is all of PCHStmtReader) use the "faster" ReadSubStmt. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107218 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
d98a2ab9275f896df49e42ea4e4b8871610e0f45 30-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> When we know that we are at sub-statement reading (which is all of PCHStmtReader) use the "faster" ReadSubStmt. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107218 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
0c80347b98aef998afb205199b74c5050d63556c 29-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Modify the way sub-statements are stored and retrieved from PCH.

Before this commit, sub-stmts were stored as encountered and when they were placed in the Stmts stack we had to know what index
each stmt operand has. This complicated supporting variable sub-stmts and sub-stmts that were contained in TypeSourceInfos, e.g.

x = sizeof(int[1]);

would crash PCH.

Now, sub-stmts are stored in reverse order, from last to first, so that when reading them, in order to get the next sub-stmt we just
need to pop the last stmt from the stack. This greatly simplified the way stmts are written and read (just use PCHWriter::AddStmt and
PCHReader::ReadStmt accordingly) and allowed variable stmt operands and TypeSourceInfo exprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107087 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterStmt.cpp
919e693e80632d214c1f3110f6ee5d1c0b61f06b 29-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Modify the way sub-statements are stored and retrieved from PCH.

Before this commit, sub-stmts were stored as encountered and when they were placed in the Stmts stack we had to know what index
each stmt operand has. This complicated supporting variable sub-stmts and sub-stmts that were contained in TypeSourceInfos, e.g.

x = sizeof(int[1]);

would crash PCH.

Now, sub-stmts are stored in reverse order, from last to first, so that when reading them, in order to get the next sub-stmt we just
need to pop the last stmt from the stack. This greatly simplified the way stmts are written and read (just use PCHWriter::AddStmt and
PCHReader::ReadStmt accordingly) and allowed variable stmt operands and TypeSourceInfo exprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107087 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterStmt.cpp
17aaf043b494268cda3be5cc9bcf2ee686ed3777 28-Jun-2010 Ted Kremenek <kremenek@apple.com> Remove state assertion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107064 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
6a9ca7abf027388179632502db502616d8105c3e 28-Jun-2010 Ted Kremenek <kremenek@apple.com> Remove state assertion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107064 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
7b86fbd2229b97a524780b2dd7289f498190eabe 28-Jun-2010 Ted Kremenek <kremenek@apple.com> Don't crash in InitializePreprocessor() when there is no valid PTHManager. Fixes <rdar://problem/8098441>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107061 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
4ae4c919205307c6e98e6c920aa55019040cbe77 28-Jun-2010 Ted Kremenek <kremenek@apple.com> Don't crash in InitializePreprocessor() when there is no valid PTHManager. Fixes <rdar://problem/8098441>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107061 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
1dafad294043b0c3960a1515e7fcc675930a3e31 28-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support CXXPseudoDestructorExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106999 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
de4bd18bb45a1db68996cfb949db3015fc25d10d 28-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support CXXPseudoDestructorExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106999 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
55e641cf56260e9213e724a3fff7cebd2adbf890 28-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support DependentScopeDeclRefExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106998 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
12dffcddb60380c5bed4f085a1f51534afda3b87 28-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support DependentScopeDeclRefExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106998 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
b616e6b9e75231db0a1859cb27db96186c789b94 28-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Refactor PCH reading/writing of template arguments passed to expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106997 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
36c76f0bea0d3595a25a5362225c642019cc3176 28-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Refactor PCH reading/writing of template arguments passed to expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106997 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
3482f19f4c5f7de444c38951620262bfb2951319 28-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix PCH emitting/reading for template arguments that contain expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106996 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterStmt.cpp
17cfdeda476aa8899f0ccedd9cb9cdb76e89b6b4 28-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix PCH emitting/reading for template arguments that contain expressions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106996 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterStmt.cpp
5c7218457cd04feadea685d7ee9c2d286e9894dc 28-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix various bugs in recent commits for C++ PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106995 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriterDecl.cpp
dc767e368471288bef8716d19b0e929647246bfc 28-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix various bugs in recent commits for C++ PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106995 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriterDecl.cpp
3d897ad92331e29821c049ff0eaae548fd17a3b4 26-Jun-2010 Chris Lattner <sabre@nondot.org> Implement support for -fwrapv, rdar://7221421

As part of this, pull together trapv handling into the same enum.

This also add support for NSW multiplies.

This also makes PCH disagreement on overflow behavior silent, since it
really doesn't matter except for warnings and codegen (no macros get
defined etc).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106956 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
CHReader.cpp
CHWriter.cpp
a4d71455f0d418e16cc0c5c5aa55a3bad3494aee 26-Jun-2010 Chris Lattner <sabre@nondot.org> Implement support for -fwrapv, rdar://7221421

As part of this, pull together trapv handling into the same enum.

This also add support for NSW multiplies.

This also makes PCH disagreement on overflow behavior silent, since it
really doesn't matter except for warnings and codegen (no macros get
defined etc).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106956 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
CHReader.cpp
CHWriter.cpp
44fad217d390a45a6e927140bfcbd59c5f4fbab5 26-Jun-2010 Chris Lattner <sabre@nondot.org> Implement support for #pragma message, patch by Michael Spencer!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106950 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
abfe094ce71c42656dcb84a3bdc3e79cb3c16fc3 26-Jun-2010 Chris Lattner <sabre@nondot.org> Implement support for #pragma message, patch by Michael Spencer!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106950 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
a31bec64c1fc6fcd43f7e93085022a97cb1f43b9 25-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support NonTypeTemplateParmDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106860 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
b24e199fbd17af780ab000c5862d191e4daffc0f 25-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support NonTypeTemplateParmDecl for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106860 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
05929aa2fc1138bdcb9234a9f21b6fe637a506a6 25-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Make PCHWriter::FlushStmts() robust. If we added null Stmts, reading them back got messed up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106859 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterStmt.cpp
c4117aae93de65206fec2c82db82ee060b6fbe88 25-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make PCHWriter::FlushStmts() robust. If we added null Stmts, reading them back got messed up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106859 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterStmt.cpp
cda37f2f04caa0b1544b6ee8cbe37924fc48e04f 25-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support DependentTemplateSpecializationType and ElaboratedType for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106858 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
3acad62a239448bef0f5848b2a0d5f7dfefd3d14 25-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support DependentTemplateSpecializationType and ElaboratedType for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106858 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
8efebfa38ab1e86467c0c56b5de690947e5c0f2b 25-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Add forgotten breaks in case statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106857 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
a56b049b009725efdf5b540128c90ec21e3eb9c1 25-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add forgotten breaks in case statements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106857 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
36633ae1d4e6cff08557e7dcfaaad355015f7306 25-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support UnresolvedLookupExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106832 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
bd65bb511c26549c96b829c1282e4c877588564a 25-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support UnresolvedLookupExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106832 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
48d8d808b7f109f33eeda88192874b0708684892 25-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support UnresolvedMemberExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106831 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
a77eb0862507b900a10fa352af1568e639ed10b1 25-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support UnresolvedMemberExpr for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106831 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
228a2984922c1fec42ec263a8cdddc47ac8e3f91 25-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Print source location when we encounter unhandled statement during PCH writing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106830 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterStmt.cpp
12bf28f398b5f1684ceb8b471e6ebab360c2b4fd 25-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Print source location when we encounter unhandled statement during PCH writing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106830 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterStmt.cpp
7d27f659adcea1d3605989af56f3716b7694ddb7 24-Jun-2010 Eric Christopher <echristo@apple.com> Remove HAS_TLS define.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106786 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
a4f6bba83c6504ef3267b1c11bc5c042adc8fdb5 24-Jun-2010 Eric Christopher <echristo@apple.com> Remove HAS_TLS define.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106786 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
93f872664c3a7ed49491f9ca37ccb00d581dd5eb 24-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support a couple more C++ Exprs for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106727 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterStmt.cpp
8dfbd8b252ba4e6cf4b7a3422f6ef0ca21312dfe 24-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support a couple more C++ Exprs for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106727 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterStmt.cpp
8155d93bd71c5b902b0b190fada0f956d8575d1b 24-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix broken de/serialization for a couple of C++ Exprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106726 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
5e1b7c2f419544a88537f7ff4e32ed744ba7b44e 24-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix broken de/serialization for a couple of C++ Exprs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106726 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
45ead230aed931bef48b9d4e6600941081df44ae 24-Jun-2010 Eric Christopher <echristo@apple.com> More clang support for darwin tls. Add a __has_feature macro and
target specific preprocessor define as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106715 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
1f84f8d970a673e487b40d341cd3e8d52ca9cc22 24-Jun-2010 Eric Christopher <echristo@apple.com> More clang support for darwin tls. Add a __has_feature macro and
target specific preprocessor define as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106715 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
391ab4776eb37da646a7597c3fd4f1f19167daaa 23-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support C++ class template specializations and partial specializations for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106625 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
dd41c14bfd7686b556de2acf6952e21a4f80b7aa 23-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support C++ class template specializations and partial specializations for PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106625 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
9484f8eade39f9d22deb26abdd6c1c804b820eac 23-Jun-2010 Chris Lattner <sabre@nondot.org> improve altivec vector bool/pixel support, patch by Anton Yartsev
with several tweaks by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106619 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
788b0fd67e1992f23555454efcdb16a19dfefac3 23-Jun-2010 Chris Lattner <sabre@nondot.org> improve altivec vector bool/pixel support, patch by Anton Yartsev
with several tweaks by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106619 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
a20e00282c792f039b1abecec2b00fb392a19dae 23-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to provide separate ASTs for multiple ObjC class extension
declarations (implements radar 7928731).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106597 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
80aa1cd7973561889e51c1c152c8990a8de9c953 23-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to provide separate ASTs for multiple ObjC class extension
declarations (implements radar 7928731).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106597 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
93ee72fccf528c96e49532cc03b120a715477488 22-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write CXXDeleteExpr from/to PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106552 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
95fc98ce95d4faa4f1bb2783384150530404ea6f 22-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write CXXDeleteExpr from/to PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106552 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
22e7cc5bf05a33c9a303befd932bbc1cf6e10d26 22-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support emitting/reading function templates to/from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106534 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
f511ba6277d240bbee1064715da8362a6edee5f3 22-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support emitting/reading function templates to/from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106534 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
c3a55600fa04db93b614d29f665b284fd5bb409e 22-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> -Introduce PCHReader::ReadTemplateArgumentLoc()
-Introduce PCHWriter::AddTemplateArgumentLocInfo()
-Modify PCHWriter::AddTemplateArgumentLoc() to also write TemplateArgumentLoc's TemplateArgument
and move the existing calls of AddTemplateArgumentLoc() to AddTemplateArgumentLocInfo().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106533 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
44f8c37e378f716e8cbb600e3800f437cf58f9e5 22-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> -Introduce PCHReader::ReadTemplateArgumentLoc()
-Introduce PCHWriter::AddTemplateArgumentLocInfo()
-Modify PCHWriter::AddTemplateArgumentLoc() to also write TemplateArgumentLoc's TemplateArgument
and move the existing calls of AddTemplateArgumentLoc() to AddTemplateArgumentLocInfo().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106533 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
b377aed9fc0a90a0788af717c5a37c871061b7ce 22-Jun-2010 Chris Lattner <sabre@nondot.org> implement support for -finstrument-functions, patch by Nelson
Elhage!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106507 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7255a2d997b15beae82e627052fdb1b2474495c2 22-Jun-2010 Chris Lattner <sabre@nondot.org> implement support for -finstrument-functions, patch by Nelson
Elhage!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106507 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
880e7654b8ac173f0275d947ccd0d328efc2926b 22-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Alter the internal representation of the condition variable in
if/while/switch/for statements to ensure that walking the children of
these statements actually works. Previously, we stored the condition
variable as a VarDecl. However, StmtIterator isn't able to walk from a
VarDecl to a set of statements, and would (in some circumstances) walk
beyond the end of the list of statements, cause Bad Behavior.

In this change, we've gone back to representing the condition
variables as DeclStmts. While not as memory-efficient as VarDecls, it
greatly simplifies iteration over the children.

Fixes the remainder of <rdar://problem/8104754>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106504 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
43dec6bbde2d0a16c35978983761c8b7030c8e18 22-Jun-2010 Douglas Gregor <dgregor@apple.com> Alter the internal representation of the condition variable in
if/while/switch/for statements to ensure that walking the children of
these statements actually works. Previously, we stored the condition
variable as a VarDecl. However, StmtIterator isn't able to walk from a
VarDecl to a set of statements, and would (in some circumstances) walk
beyond the end of the list of statements, cause Bad Behavior.

In this change, we've gone back to representing the condition
variables as DeclStmts. While not as memory-efficient as VarDecls, it
greatly simplifies iteration over the children.

Fixes the remainder of <rdar://problem/8104754>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106504 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
e9eecb2c037cebd9074b23bb571313ba6ab39bee 21-Jun-2010 Tom Care <tcare@apple.com> Bug 7377: printf checking fails to flag some undefined behavior
http://llvm.org/bugs/show_bug.cgi?id=7377

Updated format string highlighting and fixits to take advantage of the new CharSourceRange class.
- Change HighlightRange to allow highlighting whitespace only in a CharSourceRange (for warnings about the ' ' (space) flag)
- Change format specifier range helper function to allow for half-open ranges (+1 to end)
- Enabled previously failing tests (FIXMEs/XFAILs removed)
- Small fixes and additions to format string test cases

M test/Sema/format-strings.c
M test/Sema/format-strings-fixit.c
M lib/Frontend/TextDiagnosticPrinter.cpp
M lib/Sema/SemaChecking.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106480 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
45f9b7e8f23072d662ee1cc758f4ecb0da5e3322 21-Jun-2010 Tom Care <tcare@apple.com> Bug 7377: printf checking fails to flag some undefined behavior
http://llvm.org/bugs/show_bug.cgi?id=7377

Updated format string highlighting and fixits to take advantage of the new CharSourceRange class.
- Change HighlightRange to allow highlighting whitespace only in a CharSourceRange (for warnings about the ' ' (space) flag)
- Change format specifier range helper function to allow for half-open ranges (+1 to end)
- Enabled previously failing tests (FIXMEs/XFAILs removed)
- Small fixes and additions to format string test cases

M test/Sema/format-strings.c
M test/Sema/format-strings-fixit.c
M lib/Frontend/TextDiagnosticPrinter.cpp
M lib/Sema/SemaChecking.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106480 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
e7c0620f661ae13977dd84808a6272d8b256e4ff 21-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Combine ClassTemplateDecl's PreviousDeclaration with CommonPtr, as in FunctionTemplateDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106412 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
5bf1bdc2fedb0c29b5fcdb4abc852aa85b4fe26a 21-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Combine ClassTemplateDecl's PreviousDeclaration with CommonPtr, as in FunctionTemplateDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106412 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
c347f6656222239271e001ee9cb969b5bea560a5 20-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Support PCH emitting/reading of using declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106404 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
b01a552d7bafb889305affe83018563620aab326 20-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Support PCH emitting/reading of using declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106404 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
bb3361ff7f150d36dd53faa5ca84345b98878041 19-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Include a hack to allow loading of templated CXXRecordDecls and test template reading from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106393 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
28d16d79e464063c09aa63c87afe10c25cb66c7c 19-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Include a hack to allow loading of templated CXXRecordDecls and test template reading from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106393 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
7d389db9973da96f2d8d1c6b883b870982cb29ec 19-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Initial support for reading templates from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106392 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
8731ca76acf81826df7048bffd0c44c7c0f96c7f 19-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Initial support for reading templates from PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106392 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
8afa992603cad8847139aafd3de333f80f757cd5 19-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Initial support for writing templates to PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106391 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
90b715e0df34eae2b50b9b43ec60828ed31dcf94 19-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Initial support for writing templates to PCH.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106391 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
78eef07e2d081112922d5c5de20af6780c2a1f91 19-Jun-2010 Chris Lattner <sabre@nondot.org> introduce a new CharSourceRange class, and enhance the diagnostics routines
to use them instead of SourceRange. CharSourceRange is just a SourceRange
plus a bool that indicates whether the range has the end character resolved
or whether the end location is the start of the end token. While most of
the compiler wants to think of ranges that have ends that are the start of
the end token, the printf diagnostic stuff wants to highlight ranges within
tokens.

This is transparent to the diagnostic stuff. To start taking advantage of
the new capabilities, you can do something like this:
Diag(..) << CharSourceRange::getCharRange(Begin,End)





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106338 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
0a76aae8c03cb7dd7bdbe683485560afaf695959 19-Jun-2010 Chris Lattner <sabre@nondot.org> introduce a new CharSourceRange class, and enhance the diagnostics routines
to use them instead of SourceRange. CharSourceRange is just a SourceRange
plus a bool that indicates whether the range has the end character resolved
or whether the end location is the start of the end token. While most of
the compiler wants to think of ranges that have ends that are the start of
the end token, the printf diagnostic stuff wants to highlight ranges within
tokens.

This is transparent to the diagnostic stuff. To start taking advantage of
the new capabilities, you can do something like this:
Diag(..) << CharSourceRange::getCharRange(Begin,End)





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106338 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
b2f395069145e9853bfc33a63dd0aa0efb5ff1e2 18-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Given Decl::isUsed() a flag indicating when to consider the "used"
attribute as part of the calculation. Sema::MarkDeclReferenced(), and
a few other places, want only to consider the "used" bit to determine,
e.g, whether to perform template instantiation. Fixes a linkage issue
with Boost.Serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106252 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
c070cc602d6eefea881f71a60de09e05b54c3fdd 18-Jun-2010 Douglas Gregor <dgregor@apple.com> Given Decl::isUsed() a flag indicating when to consider the "used"
attribute as part of the calculation. Sema::MarkDeclReferenced(), and
a few other places, want only to consider the "used" bit to determine,
e.g, whether to perform template instantiation. Fixes a linkage issue
with Boost.Serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106252 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
00f90b974369ccd699c3d29e4edef8526d78083c 17-Jun-2010 Sean Hunt <rideau3@gmail.com> Update CMake build for new attribute changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106188 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ee6e4b4baa1acd85ba8b142862ac5986621aaffd 17-Jun-2010 Sean Hunt <rideau3@gmail.com> Update CMake build for new attribute changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106188 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
cac02dc2db388820b0353c8b6509b3b709274344 17-Jun-2010 Sean Hunt <rideau3@gmail.com> Implement first TD-based usage of attributes.

Currently, there are two effective changes:

- Attr::Kind has been changed to attr::Kind, in a separate namespace
rather than the Attr class. This is because the enumerator needs to
be visible to parse.
- The class definitions for the C++0x attributes other than aligned are
generated by TableGen.

The specific classes generated by TableGen are controlled by an array in
TableGen (see the accompanying commit to the LLVM repository). I will be
expanding the amount of code generated as I develop the new attributes system
while initially keeping it confined to these attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106172 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
387475d0c18aaeb022108de9d33b6c9fb7998843 17-Jun-2010 Sean Hunt <rideau3@gmail.com> Implement first TD-based usage of attributes.

Currently, there are two effective changes:

- Attr::Kind has been changed to attr::Kind, in a separate namespace
rather than the Attr class. This is because the enumerator needs to
be visible to parse.
- The class definitions for the C++0x attributes other than aligned are
generated by TableGen.

The specific classes generated by TableGen are controlled by an array in
TableGen (see the accompanying commit to the LLVM repository). I will be
expanding the amount of code generated as I develop the new attributes system
while initially keeping it confined to these attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106172 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
9388e882c413cd3d9720f708bfcd275fd69c2be0 16-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Allow passing -cc1 level arguments to plugins. Patch by Troy Straszheim!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106113 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
3177aae51a21f61ab483c52f97124bdb707da7f1 16-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Allow passing -cc1 level arguments to plugins. Patch by Troy Straszheim!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106113 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8b151f9b241277103b89f553c98d96edc18ad99a 16-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Add Cygwin C++ header search path.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106108 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ea9e56d38485921d596f2366d625c471a6d3c15a 16-Jun-2010 Douglas Gregor <dgregor@apple.com> Add Cygwin C++ header search path.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106108 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
83b724f3af834f993bf0162ced6a67045622cc18 15-Jun-2010 Chris Lattner <sabre@nondot.org> fix the various buildbot failures by ensuring that tokens are really completely initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106043 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
c54539cd173e20d8b179b9488fabfc5eb4cf5ee6 15-Jun-2010 Chris Lattner <sabre@nondot.org> fix the various buildbot failures by ensuring that tokens are really completely initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106043 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
d84a77d95c4b19bcc6ea57f2af78189ba3cb7ec5 15-Jun-2010 Chris Lattner <sabre@nondot.org> fix an uninitialized variable, patch by Michael Spencer!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106025 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
90db74c361f16de5f22c53358ed48797bc4888fc 15-Jun-2010 Chris Lattner <sabre@nondot.org> fix an uninitialized variable, patch by Michael Spencer!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106025 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
fba74842b08b8c1cd5ea9d1c4968cde0db848703 15-Jun-2010 Daniel Dunbar <daniel@zuster.org> Break Frontend's dependency on Rewrite, Checker and CodeGen in shared library configuration

Currently, all AST consumers are located in the Frontend library,
meaning that in a shared library configuration, Frontend has a
dependency on Rewrite, Checker and CodeGen. This is suboptimal for
clients which only wish to make use of the frontend. CodeGen in
particular introduces a large number of unwanted dependencies.

This patch breaks the dependency by moving all AST consumers with
dependencies on Rewrite, Checker and/or CodeGen to their respective
libraries. The patch therefore introduces dependencies in the other
direction (i.e. from Rewrite, Checker and CodeGen to Frontend).

After applying this patch, Clang builds correctly using CMake and
shared libraries ("cmake -DBUILD_SHARED_LIBS=ON").

N.B. This patch includes file renames which are indicated in the
patch body.

Changes in this revision of the patch:
- Fixed some copy-paste mistakes in the header files
- Modified certain aspects of the coding to comply with the LLVM
Coding Standards

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106010 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
nalysisConsumer.cpp
ackendUtil.cpp
MakeLists.txt
odeGenAction.cpp
ixItRewriter.cpp
rontendActions.cpp
TMLDiagnostics.cpp
TMLPrint.cpp
listDiagnostics.cpp
ewriteMacros.cpp
ewriteObjC.cpp
ewriteTest.cpp
9b414d3e2d0cb84512b55a3275a98490b090162a 15-Jun-2010 Daniel Dunbar <daniel@zuster.org> Break Frontend's dependency on Rewrite, Checker and CodeGen in shared library configuration

Currently, all AST consumers are located in the Frontend library,
meaning that in a shared library configuration, Frontend has a
dependency on Rewrite, Checker and CodeGen. This is suboptimal for
clients which only wish to make use of the frontend. CodeGen in
particular introduces a large number of unwanted dependencies.

This patch breaks the dependency by moving all AST consumers with
dependencies on Rewrite, Checker and/or CodeGen to their respective
libraries. The patch therefore introduces dependencies in the other
direction (i.e. from Rewrite, Checker and CodeGen to Frontend).

After applying this patch, Clang builds correctly using CMake and
shared libraries ("cmake -DBUILD_SHARED_LIBS=ON").

N.B. This patch includes file renames which are indicated in the
patch body.

Changes in this revision of the patch:
- Fixed some copy-paste mistakes in the header files
- Modified certain aspects of the coding to comply with the LLVM
Coding Standards

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106010 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
nalysisConsumer.cpp
ackendUtil.cpp
MakeLists.txt
odeGenAction.cpp
ixItRewriter.cpp
rontendActions.cpp
TMLDiagnostics.cpp
TMLPrint.cpp
listDiagnostics.cpp
ewriteMacros.cpp
ewriteObjC.cpp
ewriteTest.cpp
2951755e71ff826af2b7ab12b34b5c6e4d662222 15-Jun-2010 Douglas Gregor <doug.gregor@gmail.com> Implement -fvisibility-inlines-hidden. <rdar://problem/7819834>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106003 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7cf84d66965a7706004d8590b5af5fe54b85f525 15-Jun-2010 Douglas Gregor <dgregor@apple.com> Implement -fvisibility-inlines-hidden. <rdar://problem/7819834>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@106003 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ef8553d28faea6ae7a1eb37d376f7c266fd97103 15-Jun-2010 Ted Kremenek <kremenek@apple.com> Change AnalysisConsumer to analyze functions created by instantiantiating a macro. Fixes PR 7361.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105984 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
fcd783d583d270b7ec1ec3e0fcf83cd93d30e381 15-Jun-2010 Ted Kremenek <kremenek@apple.com> Change AnalysisConsumer to analyze functions created by instantiantiating a macro. Fixes PR 7361.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105984 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
6cc15814fa9598e449ef5c8cccd5ba8158aacb69 15-Jun-2010 Chris Lattner <sabre@nondot.org> fix the inline asm diagnostics to emit the error on the primary
source code location instead of on the note. Previously we generated:

<inline asm>:1:2: error: unrecognized instruction
barf
^
t.c:4:8: note: generated from here
asm ("barf");
^

Now we generate:

t.c:4:8: error: unrecognized instruction
asm ("barf");
^
<inline asm>:1:2: note: instantated into assembly here
barf
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105978 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
99e14a04887570b11df90daf2e8a7adf84599b01 15-Jun-2010 Chris Lattner <sabre@nondot.org> fix the inline asm diagnostics to emit the error on the primary
source code location instead of on the note. Previously we generated:

<inline asm>:1:2: error: unrecognized instruction
barf
^
t.c:4:8: note: generated from here
asm ("barf");
^

Now we generate:

t.c:4:8: error: unrecognized instruction
asm ("barf");
^
<inline asm>:1:2: note: instantated into assembly here
barf
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105978 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
fddca0b2ea59c096c8d2f9a99214844e420c902e 12-Jun-2010 Chris Lattner <sabre@nondot.org> fix PR7360: -P mode turns off line markers, but not blank space.
Apparently some programs which abuse the preprocessor depend
on this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105889 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
6133aeb97da5cab2d75c5f2c2f2561ea1b8fd0ff 12-Jun-2010 Chris Lattner <sabre@nondot.org> fix PR7360: -P mode turns off line markers, but not blank space.
Apparently some programs which abuse the preprocessor depend
on this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105889 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
3b566498b52227123af5d3fc1baef3e75f886f15 12-Jun-2010 Argiris Kirtzidis <akyrtzi@gmail.com> Fix PCH issue. Attributes of a declaration were truncated to just one when the decl was read from a PCH file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105852 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
1715bf5ed87c792c63278e739bc492921d512a88 12-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix PCH issue. Attributes of a declaration were truncated to just one when the decl was read from a PCH file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105852 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
93917b47ee01d6d44dd5e735ec9275be58af79e3 12-Jun-2010 Daniel Dunbar <daniel@zuster.org> Driver: Fix arg_iterator typing to reflect that it is really an iterator over Arg*s.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105838 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7e4953e5c60409007545288f14b430bd23d68570 12-Jun-2010 Daniel Dunbar <daniel@zuster.org> Driver: Fix arg_iterator typing to reflect that it is really an iterator over Arg*s.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105838 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
a43550aaf54e10207fc8e05c90ab03c8eb83e510 11-Jun-2010 Daniel Dunbar <daniel@zuster.org> Preprocessor: Ignore unknown pragmas in -E -dM and -Eonly modes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105830 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
rintPreprocessedOutput.cpp
c72cc5072cdc1a1a6e05f9d0f962f293a69248c4 11-Jun-2010 Daniel Dunbar <daniel@zuster.org> Preprocessor: Ignore unknown pragmas in -E -dM and -Eonly modes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105830 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
rintPreprocessedOutput.cpp
4bf99130178f92af4eb958837bff9d6266f06227 11-Jun-2010 Jeffrey Yasskin <jyasskin@google.com> Add an option -fshow-overloads=best|all to limit the number of overload
candidates printed. We default to 'all'. At the moment, 'best' prints only
the first 4 overloads, but we'll improve that over time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105815 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
arnings.cpp
5edbdcc62098e305cd55654814dcf783a3f3c477 11-Jun-2010 Jeffrey Yasskin <jyasskin@google.com> Add an option -fshow-overloads=best|all to limit the number of overload
candidates printed. We default to 'all'. At the moment, 'best' prints only
the first 4 overloads, but we'll improve that over time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105815 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
arnings.cpp
fed3a2b1dfd4e96b8bf74851e80e2f162f81b4ec 11-Jun-2010 Charles Davis <cdavis@mines.edu> Add an option to specify the target C++ ABI to the frontend. Use it to
select either the default Itanium ABI or the new, experimental Microsoft ABI.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105804 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
98b7c5c496dfccb39287b8f7d8f1444594936d10 11-Jun-2010 Charles Davis <cdavis@mines.edu> Add an option to specify the target C++ ABI to the frontend. Use it to
select either the default Itanium ABI or the new, experimental Microsoft ABI.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105804 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
52b136ace347ee82e11145927e37980157bacb35 11-Jun-2010 John McCall <rjmccall@apple.com> Split DependentNameType into two types. DependentNameType represents the
case of an elaborated-type-specifier like 'typename A<T>::foo', and
DependentTemplateSpecializationType represents the case of an
elaborated-type-specifier like 'typename A<T>::template B<T>'. The TypeLoc
representation of a DependentTST conveniently exactly matches that of an
ElaboratedType wrapping a TST.

Kill off the explicit rebuild methods for RebuildInCurrentInstantiation;
the standard implementations work fine because the nested name specifier
is computable in the newly-entered context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105801 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
33500955d731c73717af52088b7fc0e7a85681e7 11-Jun-2010 John McCall <rjmccall@apple.com> Split DependentNameType into two types. DependentNameType represents the
case of an elaborated-type-specifier like 'typename A<T>::foo', and
DependentTemplateSpecializationType represents the case of an
elaborated-type-specifier like 'typename A<T>::template B<T>'. The TypeLoc
representation of a DependentTST conveniently exactly matches that of an
ElaboratedType wrapping a TST.

Kill off the explicit rebuild methods for RebuildInCurrentInstantiation;
the standard implementations work fine because the nested name specifier
is computable in the newly-entered context.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105801 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
a91bdaf5ba082ab564e6833ce3c0bff95bcc0d3c 10-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Another chunk of the new RecursiveASTVisitor implementation: switch the return
value semantics such that we recurse while the visitors return true, and halt
as soon as one returns false. Patch by csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105787 91177308-0d34-0410-b5e6-96231b3b80d8
oostConAction.cpp
e3e210c3aa3c1b289eee669a1d235fc16df384a0 10-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Another chunk of the new RecursiveASTVisitor implementation: switch the return
value semantics such that we recurse while the visitors return true, and halt
as soon as one returns false. Patch by csilvers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105787 91177308-0d34-0410-b5e6-96231b3b80d8
oostConAction.cpp
45c7a473777f44c696935e15fd46f32ff5a7c0aa 10-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Fix crashes on error paths.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105759 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
bfbb39deabba4f7b8c89d69a28653074c8936086 10-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Fix crashes on error paths.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105759 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8b88f6aaa408a4b026615a2fb474e5fe6032c0f7 09-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Major redesign of the RecursiveASTVisitor. This implements the majority of the
new design discussed on cfe-dev, with further steps in that direction to come.
It is already much more complete than the previous visitor.

Patch by Zhanyong and Craig with 80 column wraps and one missing declaration
added by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105709 91177308-0d34-0410-b5e6-96231b3b80d8
oostConAction.cpp
dfc35e33177a433b56454f1d2b5e53734f65b288 09-Jun-2010 Chandler Carruth <chandlerc@gmail.com> Major redesign of the RecursiveASTVisitor. This implements the majority of the
new design discussed on cfe-dev, with further steps in that direction to come.
It is already much more complete than the previous visitor.

Patch by Zhanyong and Craig with 80 column wraps and one missing declaration
added by me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105709 91177308-0d34-0410-b5e6-96231b3b80d8
oostConAction.cpp
ed5bf62969af84e508b62c0a9b19756bbfb2ce38 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Makefiles: Set Clang CPP compiler flags in a single location, instead of scattered throughout the project Makefiles.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105638 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
c4dec1c58eeb2ef46cdb64120eb6b819c6927afb 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Makefiles: Set Clang CPP compiler flags in a single location, instead of scattered throughout the project Makefiles.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105638 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
e55e5e35d511ea62e635374aeca1c09ba7ce6d88 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.
- This eliminates most dependencies on how Clang is installed relative to LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105637 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
afed099bd2e759efd4bb63fdc525d3445f94cc13 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Makefile: Switch Clang Makefiles to always include the top-level Clang Makefile.
- This eliminates most dependencies on how Clang is installed relative to LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105637 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
3ba00f979a2385769bc39cfb2252bad422ed5cc4 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Add CodeGenAction support for handling LLVM IR.
- This magically enables using 'clang -cc1' as a replacement for most of 'llvm-as', 'llvm-dis', 'llc' and 'opt' functionality.

For example, 'llvm-as' is:
$ clang -cc1 -emit-llvm-bc FOO.ll -o FOO.bc
and 'llvm-dis' is:
$ clang -cc1 -emit-llvm FOO.bc -o -
and 'opt' is, e.g.:
$ clang -cc1 -emit-llvm -O3 -o FOO.opt.ll FOO.ll
and 'llc' is, e.g.:
$ clang -cc1 -S -o - FOO.ll

The nice thing about using the backend tools this way is that they are guaranteed to exactly match how the compiler generates code (for example, setting the same backend options).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105583 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
4cbbd94d0abeec2d7e7438d098527aa340d82389 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Add CodeGenAction support for handling LLVM IR.
- This magically enables using 'clang -cc1' as a replacement for most of 'llvm-as', 'llvm-dis', 'llc' and 'opt' functionality.

The nice thing about using the backend tools this way is that they are guaranteed to exactly match how the compiler generates code (for example, setting the same backend options).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105583 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/ $ clang -cc1 -S -o - FOO.ll
/external/clang/ $ clang -cc1 -emit-llvm -O3 -o FOO.opt.ll FOO.ll
/external/clang/ and 'llc' is, e.g.:
/external/clang/ and 'llvm-dis' is:
/external/clang/ and 'opt' is, e.g.:
/external/clang/ $ clang -cc1 -emit-llvm FOO.bc -o -
/external/clang/ $ clang -cc1 -emit-llvm-bc FOO.ll -o FOO.bc
/external/clang/For example, 'llvm-as' is:
odeGenAction.cpp
b2f19d93581316bbc24232d5cb21e2456b0174cd 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Add FrontendAction support for handling LLVM IR inputs.
- These inputs follow an abbreviated execution path, but are still worth handling by FrontendAction so they reuse all the other clang -cc1 features.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105582 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
rontendAction.cpp
rontendOptions.cpp
faddc3e53a95c68f2c3a966e0f1e6eba110dafd6 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Add FrontendAction support for handling LLVM IR inputs.
- These inputs follow an abbreviated execution path, but are still worth handling by FrontendAction so they reuse all the other clang -cc1 features.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105582 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
rontendAction.cpp
rontendOptions.cpp
31872aeb4b269da230e208919b62f969b6074bdd 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> FrontendAction: Track active file kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105581 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
rontendAction.cpp
685ac6665a3f91f9a66a9f44b6bf755a0cd929ea 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> FrontendAction: Track active file kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105581 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
rontendAction.cpp
567dd6d28eb19059b7320dcd22dd1b1bdad51a9c 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Rename hasASTSupport to hasASTFileSupport, which is more accurate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105580 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
rontendAction.cpp
eb58d831b283a9fa030a2eccc6e23480108d2fa1 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Rename hasASTSupport to hasASTFileSupport, which is more accurate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105580 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
rontendAction.cpp
edd99976f3c84ceada8362c9bde5a888d491f40c 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Move some initialization from CompilerInstance to FrontendAction, to parallel what is done for AST inputs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105579 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendAction.cpp
2056048f0f619adadc9a5416a2c4cdf95c58eef7 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Move some initialization from CompilerInstance to FrontendAction, to parallel what is done for AST inputs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105579 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendAction.cpp
7bc60e6bbf3053b1c09889a69518c41400425e8a 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Change FrontendAction::BeginSourceFile to take the input kind instead of an IsAST bool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105578 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendAction.cpp
d3598a65716e120aef45aa2841d730e03f7101fe 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Change FrontendAction::BeginSourceFile to take the input kind instead of an IsAST bool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105578 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
rontendAction.cpp
0327e4d2889dff7be09081612d739050c28cfd9d 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Lift InputKind enumeration to top level.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105577 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
rontendOptions.cpp
c34ce3fa613d5e4a283e53615fceafd17390445b 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Lift InputKind enumeration to top level.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105577 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
rontendOptions.cpp
1775ce89bfb6e4e2e12ab90fd14d79f6c1b790ae 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Drop unnecessary TargetData argument to EmitBackendOutput, we always
create modules which have target data strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105576 91177308-0d34-0410-b5e6-96231b3b80d8
ackendUtil.cpp
odeGenAction.cpp
05a7f3ddce9a88249b05b896e70f66e9ed381743 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Drop unnecessary TargetData argument to EmitBackendOutput, we always
create modules which have target data strings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105576 91177308-0d34-0410-b5e6-96231b3b80d8
ackendUtil.cpp
odeGenAction.cpp
7e57b403c3b116ac039e8c7d9779912d73af8216 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Factor clang::EmitBackendOutput out of CodeGenAction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105575 91177308-0d34-0410-b5e6-96231b3b80d8
ackendUtil.cpp
MakeLists.txt
odeGenAction.cpp
897c6768db8e09c692009280d9f1d71fb17023bf 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Factor clang::EmitBackendOutput out of CodeGenAction.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105575 91177308-0d34-0410-b5e6-96231b3b80d8
ackendUtil.cpp
MakeLists.txt
odeGenAction.cpp
d9cfd944264c27b84b837f39d57ed00f4f6a5b36 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Add CodeGenOptions::SimplifyLibCalls, and eliminate LangOptions argument to BackendConsumer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105574 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
ompilerInvocation.cpp
6b0cf67ae72a9ebb90e94cc9a14e09364a2b3466 08-Jun-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Add CodeGenOptions::SimplifyLibCalls, and eliminate LangOptions argument to BackendConsumer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105574 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
ompilerInvocation.cpp
b9805b6ffe18062027f2150f0b701d2873617fc5 05-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added AccessSpecDecl node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105525 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
6206d53f67613958ae1b023aba337ebb46f11a8b 05-Jun-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added AccessSpecDecl node.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105525 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
c3b388c3d05f654a6c8e2effe6025ba53df5b7f2 04-Jun-2010 John McCall <rjmccall@apple.com> Remember type source information for Objective C property declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105484 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
83a230c83a54190366138c1a4f4310ef838b88fc 04-Jun-2010 John McCall <rjmccall@apple.com> Remember type source information for Objective C property declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105484 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
40d63d2c8b4cedfec60ffcbb7a6b45bf38dcc993 04-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Added a field to BlockDeclRefExpr for future use.
No functionality change yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105479 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
89f9d3a7651d1225f3f56ae3387c83b98a26da00 04-Jun-2010 Fariborz Jahanian <fjahanian@apple.com> Added a field to BlockDeclRefExpr for future use.
No functionality change yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105479 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ed1df1cc938948a624a244c9378256fe55da1fbf 04-Jun-2010 Rafael Espindola <rafael.espindola@gmail.com> Add ARM paths for debian. Not enough to bootstrap on a beagle board, but
moves us further.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105468 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
e7d6c2cae6a9b9985db02cfc8bb4e7b714630ed5 04-Jun-2010 Rafael Espindola <rafael.espindola@gmail.com> Add ARM paths for debian. Not enough to bootstrap on a beagle board, but
moves us further.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105468 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
a43dea209d7c936286e7f1099fde4e9dae27f1a1 04-Jun-2010 John McCall <rjmccall@apple.com> Restructure how we interpret block-literal declarators. Correctly handle
the case where we pick up block arguments from a typedef. Save the block
signature as it was written, and preserve same through PCH.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105466 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
82dc00948fe7116edd31bfa07a728fda98648be1 04-Jun-2010 John McCall <rjmccall@apple.com> Restructure how we interpret block-literal declarators. Correctly handle
the case where we pick up block arguments from a typedef. Save the block
signature as it was written, and preserve same through PCH.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105466 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
caa539fd0a5b9e2033a60a4c1f5910208c49c454 03-Jun-2010 John McCall <rjmccall@apple.com> Hack in some really terrible C++ record PCH support that I need right now.
This is required in order to test:

The ASTImporter should set base classes after formally entering the definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105401 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
5250f27420386452a21692a6292c99ee7febdac4 03-Jun-2010 John McCall <rjmccall@apple.com> Hack in some really terrible C++ record PCH support that I need right now.
This is required in order to test:

The ASTImporter should set base classes after formally entering the definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105401 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
eb7bf6982e51f00b2c122e7a2489ab1486a15380 02-Jun-2010 Daniel Dunbar <daniel@zuster.org> Fix undefined behavior, noticed by GCC 4.5. Patch by Dimitry Andric!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105329 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
8ee59398df0e6df2e32109d078235a33b005840c 02-Jun-2010 Daniel Dunbar <daniel@zuster.org> Fix undefined behavior, noticed by GCC 4.5. Patch by Dimitry Andric!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105329 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
60d14ff16083101abbc6348f09103f753473c090 01-Jun-2010 John McCall <rjmccall@apple.com> Alter the ExternalASTSource interface to permit by-name lookups. PCH continues to
bring in the entire lookup table at once.

Also, give ExternalSemaSource's vtable a home. This is important because otherwise
any reference to it will cause RTTI to be emitted, and since clang is compiled
with -fno-rtti, that RTTI will contain unresolved references (to ExternalASTSource's
RTTI). So this change makes it possible to subclass ExternalSemaSource from projects
compiled with RTTI, as long as the subclass's home is compiled with -fno-rtti.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105268 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
76bd1f387e6a7b7abfe53f63b3bd429b97bb80f0 01-Jun-2010 John McCall <rjmccall@apple.com> Alter the ExternalASTSource interface to permit by-name lookups. PCH continues to
bring in the entire lookup table at once.

Also, give ExternalSemaSource's vtable a home. This is important because otherwise
any reference to it will cause RTTI to be emitted, and since clang is compiled
with -fno-rtti, that RTTI will contain unresolved references (to ExternalASTSource's
RTTI). So this change makes it possible to subclass ExternalSemaSource from projects
compiled with RTTI, as long as the subclass's home is compiled with -fno-rtti.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105268 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
b7be965ff561d784a5de8d794b56a442085c8760 30-May-2010 Sean Hunt <rideau3@gmail.com> Convert DeclNodes to use TableGen.

The macros required for DeclNodes use have changed to match the use of
StmtNodes. The FooFirst enumerator constants have been named firstFoo
to match usage elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105165 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
CHReaderDecl.cpp
CHWriterDecl.cpp
9a55591af3e5506b95a9718e15380129fbfc5ebc 30-May-2010 Sean Hunt <rideau3@gmail.com> Convert DeclNodes to use TableGen.

The macros required for DeclNodes use have changed to match the use of
StmtNodes. The FooFirst enumerator constants have been named firstFoo
to match usage elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105165 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
CHReaderDecl.cpp
CHWriterDecl.cpp
dadac2fbc85c6586a03cad5864e6dfd103b8b99b 29-May-2010 Douglas Gregor <doug.gregor@gmail.com> More PowerPC paths on Darwin

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105084 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
616d4362f01a8f819f9351372c3c4368777d4480 29-May-2010 Douglas Gregor <dgregor@apple.com> More PowerPC paths on Darwin

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105084 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
6e8e911453bdc45be50bcae039fbb19f22532af1 29-May-2010 Douglas Gregor <doug.gregor@gmail.com> Add C++ include paths for Darwin PowerPC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105083 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
582c30135dce1857db62e58b916ab0fa5edfb1d6 29-May-2010 Douglas Gregor <dgregor@apple.com> Add C++ include paths for Darwin PowerPC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105083 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
dd38166c84bd66e066cbcd063cdbd2c820e4d8fa 29-May-2010 Chris Lattner <sabre@nondot.org> add fedora 13 paths, patch by Hendrik Richter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105082 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
4336e191cc52aa1ef72f9a542f5a6d5f9f02a825 29-May-2010 Chris Lattner <sabre@nondot.org> add fedora 13 paths, patch by Hendrik Richter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105082 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
33bf24b6c409519bd3bff02fca66988e073d85e4 28-May-2010 John McCall <rjmccall@apple.com> Roll back r104941.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104990 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
2b7baf0816a40af3fde3a3e174192a549b785a50 28-May-2010 John McCall <rjmccall@apple.com> Roll back r104941.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104990 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
e9cdeb7fd5820349ea2b677c5f4175bc8c060ca6 28-May-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Let the backend decide which scheduler and register allocator to use.

Currently, the backend uses the same policy, but it will soon switch to
-regalloc=fast for -O0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104984 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
be2e9a88ba4028d6152b7b8a613b949a5fc7b903 28-May-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Let the backend decide which scheduler and register allocator to use.

Currently, the backend uses the same policy, but it will soon switch to
-regalloc=fast for -O0.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104984 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
65c142e3f6681b65406f8c9f0ac7cf3de866e010 28-May-2010 John McCall <rjmccall@apple.com> Add a new attribute on records, __attribute__((adl_invisible)), and define
the x86-64 __va_list_tag with this attribute. The attribute causes the
affected type to behave like a fundamental type when considered by ADL.

(x86-64 is the only target we currently provide with a struct-based
__builtin_va_list)

Fixes PR6762.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104941 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
1d0a5856d066f9030efbe3e0d9bbbb50ea597b99 28-May-2010 John McCall <rjmccall@apple.com> Add a new attribute on records, __attribute__((adl_invisible)), and define
the x86-64 __va_list_tag with this attribute. The attribute causes the
affected type to behave like a fundamental type when considered by ADL.

(x86-64 is the only target we currently provide with a struct-based
__builtin_va_list)

Fixes PR6762.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104941 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
7fa8719ed14ce506a4953ee99ed77a4b392f6c91 28-May-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Sprinkle in some C++ header paths for ARM/Darwin. Also, don't add x86
paths on non-x86.

I really detest this file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104921 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f2070b374c1d6fc72aa6bdb2f49c1efdc4f6d963 28-May-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Sprinkle in some C++ header paths for ARM/Darwin. Also, don't add x86
paths on non-x86.

I really detest this file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104921 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
c175747434bdf4aa1e4541220c97563377fdf96d 28-May-2010 Dan Gohman <gohman@apple.com> Add several more predefines from modern versions of GCC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104906 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
cfeac3441afb44c9af86eef0c911a5d90d561192 28-May-2010 Dan Gohman <gohman@apple.com> Add several more predefines from modern versions of GCC.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104906 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
807e8d4b1a45c03d5ad2a9b97a9543392e6b3754 27-May-2010 Dan Gohman <gohman@apple.com> MemoryBuffer::getSTDIN may return a null pointer if an error occurs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104856 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
6f118975f9ca6318a933ee4bfad19fae628c9a8d 27-May-2010 Dan Gohman <gohman@apple.com> MemoryBuffer::getSTDIN may return a null pointer if an error occurs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104856 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
f1818a1b5d2e88240fd840caa0718fd044a34f85 27-May-2010 Daniel Dunbar <daniel@zuster.org> Driver: Add clang -cc1 -mrelax-all option, which sets relaxes all instructions when using -integrated-as.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104807 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
ompilerInvocation.cpp
4ecc9b73b3716775ed4e09091e300796a9a72378 27-May-2010 Daniel Dunbar <daniel@zuster.org> Driver: Add clang -cc1 -mrelax-all option, which sets relaxes all instructions when using -integrated-as.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104807 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
ompilerInvocation.cpp
2da5d143b02c2fdcfba7ba6ccc2976b8af46bb92 27-May-2010 Daniel Dunbar <daniel@zuster.org> AST: Add AlignMac68kAttr, not yet used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104800 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
4e9255f4ad5f87217995eeb488a7c5b336bb732d 27-May-2010 Daniel Dunbar <daniel@zuster.org> AST: Add AlignMac68kAttr, not yet used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104800 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
8df8ff1b1d982e97d323d354379234802b6b9b3d 27-May-2010 Daniel Dunbar <daniel@zuster.org> AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104795 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
8a2c92cab213bd7e28ff669577e815cd70bafbe3 27-May-2010 Daniel Dunbar <daniel@zuster.org> AST: Rename PragmaPackAttr to MaxFieldAlignmentAttr, which is more accurate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104795 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
0b8d012741cb3cc7abad47ab4f1d515717ad4505 26-May-2010 Ted Kremenek <kremenek@apple.com> Predefine the '__clang_analyzer__' macro when using '-analyze'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104742 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
f0af777aff72b58333edcf258e30998e865bdef3 26-May-2010 Ted Kremenek <kremenek@apple.com> Predefine the '__clang_analyzer__' macro when using '-analyze'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104742 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
5c336528495f889677e7ab8b3297f290242cedd1 25-May-2010 Douglas Gregor <doug.gregor@gmail.com> Only enable code patterns (e.g., try { statements } catch (...) {
statements }) in the code-completion results if explicitly requested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104637 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
d8e8a58ee35ab334ab9d0c2154dca029c1822e8a 25-May-2010 Douglas Gregor <dgregor@apple.com> Only enable code patterns (e.g., try { statements } catch (...) {
statements }) in the code-completion results if explicitly requested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104637 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
cddae629ede973537d1fce280ff1e9b156d03fb6 25-May-2010 Daniel Dunbar <daniel@zuster.org> Driver/Frontend: Add -emit-codegen-only, for running irgen + codegen but not the
.s printer or .o writer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104623 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
ompilerInvocation.cpp
32148cef25570a4fbe3ad0ec497ce3ae2cf1b774 25-May-2010 Daniel Dunbar <daniel@zuster.org> Driver/Frontend: Add -emit-codegen-only, for running irgen + codegen but not the
.s printer or .o writer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104623 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
ompilerInvocation.cpp
da6a5de860411b5c59bc3c6232aeedabf616ce2a 25-May-2010 Fariborz Jahanian <fjahanian@apple.com> Refactoring of block-pointer type rewrite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104614 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
4fc8453dd02d015b1161d83a5740632617aedd12 25-May-2010 Fariborz Jahanian <fjahanian@apple.com> Refactoring of block-pointer type rewrite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104614 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
148d97db992e278d5f010f3c6495ce95dfa04093 25-May-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to rewrite block pointers as arguments to
methods. (Radar 7987817).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104608 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
1f90622e9d24064164df1608ea125d0ed451ac68 25-May-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to rewrite block pointers as arguments to
methods. (Radar 7987817).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104608 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
e1845d45666f1b8b3171475c5582fe35646c853b 24-May-2010 Chris Lattner <sabre@nondot.org> when too many errors are emitted, and we produce:
fatal error: too many errors emitted, stopping now [-ferror-limit=]

Tell the user that this is controlled with -ferror-limit=, like above.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104528 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
d342bf7fdb5a16fe73e46a8c995ad89cf79a7bad 24-May-2010 Chris Lattner <sabre@nondot.org> when too many errors are emitted, and we produce:
fatal error: too many errors emitted, stopping now [-ferror-limit=]

Tell the user that this is controlled with -ferror-limit=, like above.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104528 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
dd8f540d0d83ecc148a23fc69df3f67acf6169b2 24-May-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a rewriting bug where a local static objective-c
pointer is copied into a block. Fixes radar 7924024.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104526 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
a5a7987394ca15334c03b7e168677a8056561062 24-May-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a rewriting bug where a local static objective-c
pointer is copied into a block. Fixes radar 7924024.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104526 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
a48ce8c26a04c0aed2beedab272edfe2ab04ec82 24-May-2010 Fariborz Jahanian <fjahanian@apple.com> Fix an objective-c rewriter bug when pre-processed file's
class declaration's @end is not followed by a new-line.
(radar 7946975).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104512 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
73d1eb064350d5310f0475366cbe54d2d1da27bb 24-May-2010 Fariborz Jahanian <fjahanian@apple.com> Fix an objective-c rewriter bug when pre-processed file's
class declaration's @end is not followed by a new-line.
(radar 7946975).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104512 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
973cacc0c894666f112192441f78e8eb3c27736b 21-May-2010 John McCall <rjmccall@apple.com> Propagate access specifiers to anonymous union members nested within classes.
Fixes <rdar://problem/7987650>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104376 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
aec0371e62be013a2e6466688ccf6a7460880262 21-May-2010 John McCall <rjmccall@apple.com> Propagate access specifiers to anonymous union members nested within classes.
Fixes <rdar://problem/7987650>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104376 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
4041ec10a1f4467c0a13b60fa6bc8fd81ebcb9b4 20-May-2010 Daniel Dunbar <daniel@zuster.org> Driver: Move some argument lookup utilities into driver::ArgList.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104237 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
03e8ab2947a848fb0ce723dcebb1c19697614307 20-May-2010 Daniel Dunbar <daniel@zuster.org> Driver: Move some argument lookup utilities into driver::ArgList.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104237 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
50be5101831a8e3679e18775b41816c9ddfc39ca 19-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added basic source locations to Elaborated and DependentName types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104169 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
e4da7a034a2fcf4b14d0bcc28d05de0878159061 19-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added basic source locations to Elaborated and DependentName types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104169 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
dc4d6feb0c4f81110cef67e785e3e8374384ba5f 19-May-2010 Ted Kremenek <kremenek@apple.com> Add clang support for IBOutletCollection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104135 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
857e918a8a40deb128840308a318bf623d68295f 19-May-2010 Ted Kremenek <kremenek@apple.com> Add clang support for IBOutletCollection.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104135 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
01890a8487ae3330abc501b455e2092545d54775 18-May-2010 Douglas Gregor <doug.gregor@gmail.com> Add support for Microsoft's __thiscall, from Steven Watanabe!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104026 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
f813a2c03fcb05381b3252010435f557eb6b3cde 18-May-2010 Douglas Gregor <dgregor@apple.com> Add support for Microsoft's __thiscall, from Steven Watanabe!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104026 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
055908c1d57477c8acfdd29dc9653fa490de95dc 18-May-2010 Douglas Gregor <doug.gregor@gmail.com> "The attached patch allows clang to find the headers
for Visual Studio 2010. It also adds a registry search
for the Express edition,", from Steven Watanabe!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104015 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
80f93d9fe82ebe7e58913646248240de838283be 18-May-2010 Douglas Gregor <dgregor@apple.com> "The attached patch allows clang to find the headers
for Visual Studio 2010. It also adds a registry search
for the Express edition,", from Steven Watanabe!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104015 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
62f0c356fe4509df60876dd69cc9a81e72206055 18-May-2010 Zhongxing Xu <xuzhongxing@gmail.com> Add option '-analyzer-max-loop', which specifies the maximum
number of times the analyzer will go through a loop.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104007 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ompilerInvocation.cpp
6362b893731ccf4480a96527db9e55e04b801503 18-May-2010 Zhongxing Xu <xuzhongxing@gmail.com> Add option '-analyzer-max-loop', which specifies the maximum
number of times the analyzer will go through a loop.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104007 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ompilerInvocation.cpp
1618cd6e889cc500331f22b88f66af4ae2cce3d5 17-May-2010 John McCall <rjmccall@apple.com> Clean up some more uses of getAs<ObjCInterfaceType>() that Fariborz pointed
out. The remaining ones are okay.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103973 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
506b57e8b79d7dc2c367bf2ee7ec95420ad3fc8f 17-May-2010 John McCall <rjmccall@apple.com> Clean up some more uses of getAs<ObjCInterfaceType>() that Fariborz pointed
out. The remaining ones are okay.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103973 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
cfb3432a76540a80edbbbb6eb2a4095fa74ec55e 16-May-2010 mike-m <mikem.llvm@gmail.com> Moved clang-builtin include dir position to immediately precede C includes.
This aligns with how gcc compiler does things.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103912 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
79bc57c074cb91f574fba19215f95b63dcf6b04b 16-May-2010 mike-m <mikem.llvm@gmail.com> Moved clang-builtin include dir position to immediately precede C includes.
This aligns with how gcc compiler does things.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103912 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
3fcd73074210c791a68eeda2d8d6728d5f486bc8 16-May-2010 John McCall <rjmccall@apple.com> Emit a type record for TYPE_OBJC_OBJECT in the PCH file. I'm not
entirely sure what this does, to be honest.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103895 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
a53d2cbe37e4be0d95b9d3e09f74eafae31fc940 16-May-2010 John McCall <rjmccall@apple.com> Emit a type record for TYPE_OBJC_OBJECT in the PCH file. I'm not
entirely sure what this does, to be honest.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103895 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
f4f254c60f644f08dea9cfbe0865016a5ef748a6 15-May-2010 John McCall <rjmccall@apple.com> Substantially alter the design of the Objective C type AST by introducing
ObjCObjectType, which is basically just a pair of
one of {primitive-id, primitive-Class, user-defined @class}
with
a list of protocols.
An ObjCObjectPointerType is therefore just a pointer which always points to
one of these types (possibly sugared). ObjCInterfaceType is now just a kind
of ObjCObjectType which happens to not carry any protocols.

Alter a rather large number of use sites to use ObjCObjectType instead of
ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather
than hashing them in a FoldingSet. Remove some number of methods that are no
longer used, at least after this patch.

By simplifying ObjCObjectPointerType, we are now able to easily remove and apply
pointers to Objective-C types, which is crucial for a certain kind of ObjC++
metaprogramming common in WebKit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103870 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
c12c5bba6ceb6acd4e51e7a0fc03257da9cfd44e 15-May-2010 John McCall <rjmccall@apple.com> Substantially alter the design of the Objective C type AST by introducing
ObjCObjectType, which is basically just a pair of
one of {primitive-id, primitive-Class, user-defined @class}
with
a list of protocols.
An ObjCObjectPointerType is therefore just a pointer which always points to
one of these types (possibly sugared). ObjCInterfaceType is now just a kind
of ObjCObjectType which happens to not carry any protocols.

Alter a rather large number of use sites to use ObjCObjectType instead of
ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather
than hashing them in a FoldingSet. Remove some number of methods that are no
longer used, at least after this patch.

By simplifying ObjCObjectPointerType, we are now able to easily remove and apply
pointers to Objective-C types, which is crucial for a certain kind of ObjC++
metaprogramming common in WebKit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103870 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
8b9ae4311f89abe3c417577a4e6e23a504f5d33f 15-May-2010 Douglas Gregor <doug.gregor@gmail.com> Implement semantic analysis and an AST representation for the named
return value optimization. Sema marks return statements with their
NRVO candidates (which may or may not end up using the NRVO), then, at
the end of a function body, computes and marks those variables that
can be allocated into the return slot.

I've checked this locally with some debugging statements (not
committed), but there won't be any tests until CodeGen comes along.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103865 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
5077c3876beeaed32280af88244e8050078619a8 15-May-2010 Douglas Gregor <dgregor@apple.com> Implement semantic analysis and an AST representation for the named
return value optimization. Sema marks return statements with their
NRVO candidates (which may or may not end up using the NRVO), then, at
the end of a function body, computes and marks those variables that
can be allocated into the return slot.

I've checked this locally with some debugging statements (not
committed), but there won't be any tests until CodeGen comes along.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103865 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
7424ed8f5eff898e865a2efceca5ef14b81d6b76 15-May-2010 Douglas Gregor <doug.gregor@gmail.com> Recognize when the named return value optimization applies in a
"return" statement and mark the corresponding CXXConstructExpr as
elidable. Teach CodeGen that eliding a temporary is different from
eliding an object construction.

This is just a baby step toward NRVO.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103849 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
3c9034cb7ff1d6c1e4ecd1b44c98f553df013c7c 15-May-2010 Douglas Gregor <dgregor@apple.com> Recognize when the named return value optimization applies in a
"return" statement and mark the corresponding CXXConstructExpr as
elidable. Teach CodeGen that eliding a temporary is different from
eliding an object construction.

This is just a baby step toward NRVO.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103849 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
4d7353a63e9957701befb8527d7d59de89d000e0 14-May-2010 Daniel Dunbar <daniel@zuster.org> Revert r103770, "Added basic source locations to Elaborated and DependentName
types.", it is breaking Clang bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103775 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
a63db84b164d3f1c987a3ea6251e3092db4f317b 14-May-2010 Daniel Dunbar <daniel@zuster.org> Revert r103770, "Added basic source locations to Elaborated and DependentName
types.", it is breaking Clang bootstrap.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103775 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ef012445d431eb51de6ce033e117106624a1dc73 14-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added basic source locations to Elaborated and DependentName types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103770 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
5431299f6e1e1d14b39b924fe24bf04035f4ae42 14-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Added basic source locations to Elaborated and DependentName types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103770 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
a78927d6476067d6c7a68d6bc21c93d66f265594 13-May-2010 Douglas Gregor <doug.gregor@gmail.com> Rework when and how vtables are emitted, by tracking where vtables are
"used" (e.g., we will refer to the vtable in the generated code) and
when they are defined (i.e., because we've seen the key function
definition). Previously, we were effectively tracking "potential
definitions" rather than uses, so we were a bit too eager about emitting
vtables for classes without key functions.

The new scheme:
- For every use of a vtable, Sema calls MarkVTableUsed() to indicate
the use. For example, this occurs when calling a virtual member
function of the class, defining a constructor of that class type,
dynamic_cast'ing from that type to a derived class, casting
to/through a virtual base class, etc.
- For every definition of a vtable, Sema calls MarkVTableUsed() to
indicate the definition. This happens at the end of the translation
unit for classes whose key function has been defined (so we can
delay computation of the key function; see PR6564), and will also
occur with explicit template instantiation definitions.
- For every vtable defined/used, we mark all of the virtual member
functions of that vtable as defined/used, unless we know that the key
function is in another translation unit. This instantiates virtual
member functions when needed.
- At the end of the translation unit, Sema tells CodeGen (via the
ASTConsumer) which vtables must be defined (CodeGen will define
them) and which may be used (for which CodeGen will define the
vtables lazily).

From a language perspective, both the old and the new schemes are
permissible: we're allowed to instantiate virtual member functions
whenever we want per the standard. However, all other C++ compilers
were more lazy than we were, and our eagerness was both a performance
issue (we instantiated too much) and a portability problem (we broke
Boost test cases, which now pass).

Notes:
(1) There's a ton of churn in the tests, because the order in which
vtables get emitted to IR has changed. I've tried to isolate some of
the larger tests from these issues.
(2) Some diagnostics related to
implicitly-instantiated/implicitly-defined virtual member functions
have moved to the point of first use/definition. It's better this
way.
(3) I could use a review of the places where we MarkVTableUsed, to
see if I missed any place where the language effectively requires a
vtable.

Fixes PR7114 and PR6564.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103718 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
6fb745bdf1ff1e32caf07e42093a7920726892c1 13-May-2010 Douglas Gregor <dgregor@apple.com> Rework when and how vtables are emitted, by tracking where vtables are
"used" (e.g., we will refer to the vtable in the generated code) and
when they are defined (i.e., because we've seen the key function
definition). Previously, we were effectively tracking "potential
definitions" rather than uses, so we were a bit too eager about emitting
vtables for classes without key functions.

The new scheme:
- For every use of a vtable, Sema calls MarkVTableUsed() to indicate
the use. For example, this occurs when calling a virtual member
function of the class, defining a constructor of that class type,
dynamic_cast'ing from that type to a derived class, casting
to/through a virtual base class, etc.
- For every definition of a vtable, Sema calls MarkVTableUsed() to
indicate the definition. This happens at the end of the translation
unit for classes whose key function has been defined (so we can
delay computation of the key function; see PR6564), and will also
occur with explicit template instantiation definitions.
- For every vtable defined/used, we mark all of the virtual member
functions of that vtable as defined/used, unless we know that the key
function is in another translation unit. This instantiates virtual
member functions when needed.
- At the end of the translation unit, Sema tells CodeGen (via the
ASTConsumer) which vtables must be defined (CodeGen will define
them) and which may be used (for which CodeGen will define the
vtables lazily).

From a language perspective, both the old and the new schemes are
permissible: we're allowed to instantiate virtual member functions
whenever we want per the standard. However, all other C++ compilers
were more lazy than we were, and our eagerness was both a performance
issue (we instantiated too much) and a portability problem (we broke
Boost test cases, which now pass).

Notes:
(1) There's a ton of churn in the tests, because the order in which
vtables get emitted to IR has changed. I've tried to isolate some of
the larger tests from these issues.
(2) Some diagnostics related to
implicitly-instantiated/implicitly-defined virtual member functions
have moved to the point of first use/definition. It's better this
way.
(3) I could use a review of the places where we MarkVTableUsed, to
see if I missed any place where the language effectively requires a
vtable.

Fixes PR7114 and PR6564.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103718 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
8f4b74e651450b38ef1b217fcf9b6c430424230a 13-May-2010 Chris Lattner <sabre@nondot.org> "this patch properly addresses escaping < and > which might appear
(e.g. for C++ operators) in the xml dump.

I also re-enabled the unit test for ast-print-xml (or so I think)
at least, make test didn't fail..."

patch by Sebastien Binet!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103671 91177308-0d34-0410-b5e6-96231b3b80d8
eclXML.cpp
edd8df9cd260a74cfeea3c921a78d5f33c659573 13-May-2010 Chris Lattner <sabre@nondot.org> "this patch properly addresses escaping < and > which might appear
(e.g. for C++ operators) in the xml dump.

I also re-enabled the unit test for ast-print-xml (or so I think)
at least, make test didn't fail..."

patch by Sebastien Binet!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103671 91177308-0d34-0410-b5e6-96231b3b80d8
eclXML.cpp
ab1f1819386bd718899582eb6426b2619b11e2cf 11-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Merged Elaborated and QualifiedName types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103517 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
ewriteObjC.cpp
465d41b92b2c862f3062c412a0538db65c6a2661 11-May-2010 Abramo Bagnara <abramo.bagnara@gmail.com> Merged Elaborated and QualifiedName types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103517 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
ewriteObjC.cpp
9b92799c22e4763de73b8143738963b518327a75 10-May-2010 Ted Kremenek <kremenek@apple.com> Convert CXXTempory[] in CXXExprWithTemporaries to be allocated using ASTContext's allocator. Fixes <rdar://problem/7961605>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103421 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
d04ed416be7c55bddddab1fa3fd38a0113a6b3da 10-May-2010 Ted Kremenek <kremenek@apple.com> Convert CXXTempory[] in CXXExprWithTemporaries to be allocated using ASTContext's allocator. Fixes <rdar://problem/7961605>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103421 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
f60cac43575e3fa97a7c405b0b4de60b760daf3b 10-May-2010 Douglas Gregor <doug.gregor@gmail.com> Improved -ast-print-xml for C++, from Sebastien Binet!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103412 91177308-0d34-0410-b5e6-96231b3b80d8
eclXML.cpp
ocumentXML.cpp
4bd98e886012817fcfd40aa4c8329fa48f69b0a9 10-May-2010 Douglas Gregor <dgregor@apple.com> Improved -ast-print-xml for C++, from Sebastien Binet!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103412 91177308-0d34-0410-b5e6-96231b3b80d8
eclXML.cpp
ocumentXML.cpp
f4304a25d5df6f5a44db3b4d49a35fa55417ae4b 10-May-2010 Chris Lattner <sabre@nondot.org> pch'ify CXXNewExpr and CXXZeroInitValueExpr



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103390 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
5921863d8f24084797863b5df37842113bac4352 10-May-2010 Chris Lattner <sabre@nondot.org> pch'ify CXXNewExpr and CXXZeroInitValueExpr



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103390 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
2a29863f61f241641ffa8c7398233e4e5f32abe0 10-May-2010 Chris Lattner <sabre@nondot.org> pchify CXXTemporary, CXXBindTemporaryExpr, and
CXXExprWithTemporaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103387 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterStmt.cpp
d2598368876cfe40bc8465540033bc5b5e58d8af 10-May-2010 Chris Lattner <sabre@nondot.org> pchify CXXTemporary, CXXBindTemporaryExpr, and
CXXExprWithTemporaries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103387 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterStmt.cpp
31a064dad51d5659cd05a6ab87843e5cf00238b5 09-May-2010 Chris Lattner <sabre@nondot.org> pch'ify default argument definitions and uses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103376 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
030854b95f7bfd86aaa8afd9ae1aff9768a37e9a 09-May-2010 Chris Lattner <sabre@nondot.org> pch'ify default argument definitions and uses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103376 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
d5f99d18d76cc4f105361876e34c2a0f703efeb3 09-May-2010 Chris Lattner <sabre@nondot.org> pch'ify 'this' and 'throw'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103375 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
2fbdfcdf3bbf7b941853d38b123930755e837437 09-May-2010 Chris Lattner <sabre@nondot.org> pch'ify 'this' and 'throw'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103375 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
b6538bba80f90fb335518f7cc1f06b441db35702 09-May-2010 Chris Lattner <sabre@nondot.org> pch'ify typeid.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103374 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
14ab24f01e36d495fce183aa67b41e45cdd54f39 09-May-2010 Chris Lattner <sabre@nondot.org> pch'ify typeid.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103374 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
f7557522cd45846f3c017490748ed7b2b97bdd83 09-May-2010 Chris Lattner <sabre@nondot.org> pchify CXXMemberCallExpr correctly. Before it would serialize
and deserialize as a CallExpr which is close, but ends up
deserializing with the wrong stmt class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103371 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
1817bd483b538fd3f4530649f5cb900bad9e8a76 09-May-2010 Chris Lattner <sabre@nondot.org> pchify CXXMemberCallExpr correctly. Before it would serialize
and deserialize as a CallExpr which is close, but ends up
deserializing with the wrong stmt class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103371 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
15d6c2fb6d490811b41792b7d90331fb9c16694e 08-May-2010 Douglas Gregor <doug.gregor@gmail.com> When we encounter a non-dependent type during template instantiation,
mark any declarations we see inside of that type as
"referenced". Fixes PR7079.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103323 91177308-0d34-0410-b5e6-96231b3b80d8
oostConAction.cpp
b4eeaff1595b7d0a8fbc2b3c8bec7dc63f48b7fd 08-May-2010 Douglas Gregor <dgregor@apple.com> When we encounter a non-dependent type during template instantiation,
mark any declarations we see inside of that type as
"referenced". Fixes PR7079.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103323 91177308-0d34-0410-b5e6-96231b3b80d8
oostConAction.cpp
34554d5a66067c6aec5d0aa846c1ce041156c76d 08-May-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a recursive AST visitor that makes it trivial to recursively
walk an entire AST, including all of the types, declarations,
statements, and expressions, and allowing one to easily override the
behavior of the walk at any particular node kind.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103308 91177308-0d34-0410-b5e6-96231b3b80d8
oostConAction.cpp
d30bf2eb6d6bbebd41236bf205d3a6dfc51a3659 08-May-2010 Douglas Gregor <dgregor@apple.com> Introduce a recursive AST visitor that makes it trivial to recursively
walk an entire AST, including all of the types, declarations,
statements, and expressions, and allowing one to easily override the
behavior of the walk at any particular node kind.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103308 91177308-0d34-0410-b5e6-96231b3b80d8
oostConAction.cpp
b063d153c55d662ec34f4773387bc45d2289ff74 07-May-2010 Chris Lattner <sabre@nondot.org> add PCH support for a bunch of C++ Decls, patch by
Andrew Sutton!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103301 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
6ad9ac097918fbdeb443ea7b99d4db9e49b28534 07-May-2010 Chris Lattner <sabre@nondot.org> add PCH support for a bunch of C++ Decls, patch by
Andrew Sutton!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103301 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
74394426709e00bd461014ec2bf112e672e8147d 07-May-2010 Douglas Gregor <doug.gregor@gmail.com> Add missing #include

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103260 91177308-0d34-0410-b5e6-96231b3b80d8
oostConAction.cpp
ffb507a07b56a4849df387de6f9fca98e5df8e2a 07-May-2010 Douglas Gregor <dgregor@apple.com> Add missing #include

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103260 91177308-0d34-0410-b5e6-96231b3b80d8
oostConAction.cpp
cf4d346eac81f9f25f32ed2a905eef44e41892fa 07-May-2010 Douglas Gregor <doug.gregor@gmail.com> Add a stub frontend action for BoostCon, for next week's workshop.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103258 91177308-0d34-0410-b5e6-96231b3b80d8
oostConAction.cpp
MakeLists.txt
ompilerInvocation.cpp
f78cc4360eb4284091d0d38f3055084360f8c753 07-May-2010 Douglas Gregor <dgregor@apple.com> Add a stub frontend action for BoostCon, for next week's workshop.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103258 91177308-0d34-0410-b5e6-96231b3b80d8
oostConAction.cpp
MakeLists.txt
ompilerInvocation.cpp
ceb8f0bff12c7c148c9e64c7d133d5ac0f01c653 06-May-2010 Douglas Gregor <doug.gregor@gmail.com> Rework our handling of temporary objects within the conditions of
if/switch/while/do/for statements. Previously, we would end up either:

(1) Forgetting to destroy temporaries created in the condition (!),
(2) Destroying the temporaries created in the condition *before*
converting the condition to a boolean value (or, in the case of a
switch statement, to an integral or enumeral value), or
(3) In a for statement, destroying the condition's temporaries at
the end of the increment expression (!).

We now destroy temporaries in conditions at the right times. This
required some tweaking of the Parse/Sema interaction, since the parser
was building full expressions too early in many places.

Fixes PR7067.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103187 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
586596fd7f7a336a2847b300c80614dcf39ab6d5 06-May-2010 Douglas Gregor <dgregor@apple.com> Rework our handling of temporary objects within the conditions of
if/switch/while/do/for statements. Previously, we would end up either:

(1) Forgetting to destroy temporaries created in the condition (!),
(2) Destroying the temporaries created in the condition *before*
converting the condition to a boolean value (or, in the case of a
switch statement, to an integral or enumeral value), or
(3) In a for statement, destroying the condition's temporaries at
the end of the increment expression (!).

We now destroy temporaries in conditions at the right times. This
required some tweaking of the Parse/Sema interaction, since the parser
was building full expressions too early in many places.

Fixes PR7067.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103187 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
90689fa57b96f8c0546c0578029a11f320f0501c 06-May-2010 mike-m <mikem.llvm@gmail.com> Reverted part of r103177 (repositioning of clang-builtin include/)
which breaks clang-i686-xp-msvc9 test-clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103180 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
c3ec9ae41335d4f8f1c21278ddfe7d37a9e0d551 06-May-2010 mike-m <mikem.llvm@gmail.com> Reverted part of r103177 (repositioning of clang-builtin include/)
which breaks clang-i686-xp-msvc9 test-clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103180 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
e693ca7f4a7de59d4aae0c2cd61331c61a4f0d78 06-May-2010 mike-m <mikem.llvm@gmail.com> Reposition clang-builtin include/ to immediately precede /usr/include/,
matching gcc compiler. Fixes #include_next <...> shenanigans that lead to
file-not-found failures with <cstddef> on libstdc++ 4.3.[012].

Updated C++ include header search paths for various Debian/Ubuntu and Fedora
linux distros.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103177 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ac78b7a7af0e67f2f4f45d9d94393c281ff4417b 06-May-2010 mike-m <mikem.llvm@gmail.com> Reposition clang-builtin include/ to immediately precede /usr/include/,
matching gcc compiler. Fixes #include_next <...> shenanigans that lead to
file-not-found failures with <cstddef> on libstdc++ 4.3.[012].

Updated C++ include header search paths for various Debian/Ubuntu and Fedora
linux distros.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103177 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
e2ba5f6ed00499333dc72435d27c59a500d0f6ec 06-May-2010 John McCall <rjmccall@apple.com> Remember the number of positive and negative bits used by the enumerators of
an enum in the enum decl itself. Use some spare bits from TagDecl for this
purpose.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103173 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
1b5a618c59025898806160ed5e7f0ff5bb79e482 06-May-2010 John McCall <rjmccall@apple.com> Remember the number of positive and negative bits used by the enumerators of
an enum in the enum decl itself. Use some spare bits from TagDecl for this
purpose.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103173 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
73361dc73a0970d16bce096df7f15c202e416f74 06-May-2010 Zhongxing Xu <xuzhongxing@gmail.com> Make -analyzer-inline-call not a separate analysis. Instead it's a boolean
flag now, and can be used with other analyses. Only turned it on for C++
methods for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103160 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ompilerInvocation.cpp
7b99d12b4ca67fccdf5090761ba257732e954e75 06-May-2010 Zhongxing Xu <xuzhongxing@gmail.com> Make -analyzer-inline-call not a separate analysis. Instead it's a boolean
flag now, and can be used with other analyses. Only turned it on for C++
methods for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103160 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ompilerInvocation.cpp
10250b5323c9c3d19a405b6ff110092038e9a6f6 05-May-2010 Fariborz Jahanian <fjahanian@apple.com> This patch deals with Sema Part of Setter/Getter synthesis
of properties which are of C++ objects. Code Gen to follow
(Radar 7468090).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103123 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
17cb326cb62a59f53d92236394af40eaae4eddbd 05-May-2010 Fariborz Jahanian <fjahanian@apple.com> This patch deals with Sema Part of Setter/Getter synthesis
of properties which are of C++ objects. Code Gen to follow
(Radar 7468090).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103123 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
5298358af2b55df2607ae4da3d9f83ad7ca3ba0e 05-May-2010 mike-m <mikem.llvm@gmail.com> Test commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103090 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
a608737659d4330d9ae7622bf1a87c33b9d97072 05-May-2010 mike-m <mikem.llvm@gmail.com> Test commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103090 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
468e42e9ca5531889f8f1aa4fa467d277c701638 05-May-2010 Douglas Gregor <doug.gregor@gmail.com> Unbreak CMake build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103077 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
71b1d0e5f07de274af2b3c48955af66b1b7f0403 05-May-2010 Douglas Gregor <dgregor@apple.com> Unbreak CMake build.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103077 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
7555360af98ab525a27eea7e9a131f3691f70610 05-May-2010 Chris Lattner <sabre@nondot.org> fit in 80 cols


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103075 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
0e3cc05542e62fe89345ce94a73494525ee463e0 05-May-2010 Chris Lattner <sabre@nondot.org> fit in 80 cols


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103075 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
d7b1b0252ec628aaa782bf0f9dc041f10b1a449b 04-May-2010 Chris Lattner <sabre@nondot.org> add a new -fdiagnostics-show-category=none/id/name option, giving control
over choice of:

t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat]
t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,1]
t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,Format String]

dox to come.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103056 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnosticPrinter.cpp
6fbe8398ba1680ffc5daa7395850ff8765b7905b 04-May-2010 Chris Lattner <sabre@nondot.org> add a new -fdiagnostics-show-category=none/id/name option, giving control
over choice of:

t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat]
t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,1]
t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,Format String]

dox to come.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103056 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnosticPrinter.cpp
ff1c25eea3870b8220aa484b3b51e348c90d2566 04-May-2010 Chris Lattner <sabre@nondot.org> When -fdiagnostics-print-source-range-info is specified,
print the diagnostic category number in the [] at the end
of the line. For example:

$ cat t.c
#include <stdio.h>
void foo() {
printf("%s", 4);
}
$ clang t.c -fsyntax-only -fdiagnostics-print-source-range-info
t.c:3:11:{3:10-3:12}{3:15-3:16}: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,1]
printf("%s", 4);
~^ ~
1 warning generated.

Clients that want category information can now pick the number
out of the output, rdar://7928231.

More coming.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103053 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
c9b889044c8e1e2d6ab194e34e8b74f6998094fa 04-May-2010 Chris Lattner <sabre@nondot.org> When -fdiagnostics-print-source-range-info is specified,
print the diagnostic category number in the [] at the end
of the line. For example:

$ cat t.c
#include <stdio.h>
void foo() {
printf("%s", 4);
}
$ clang t.c -fsyntax-only -fdiagnostics-print-source-range-info
t.c:3:11:{3:10-3:12}{3:15-3:16}: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,1]
printf("%s", 4);
~^ ~
1 warning generated.

Clients that want category information can now pick the number
out of the output, rdar://7928231.

More coming.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103053 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
9690fb779e330e800ecbe4af654426df396fb59a 04-May-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a limit on the depth of the macro instantiation backtrace
printed in a diagnostic, similar to the limit we already have on the
depth of the template instantiation backtrace. The macro instantiation
backtrace is limited to 10 "instantiated from:" diagnostics; when it's
longer than that, we'll show the first half, then say how many were
suppressed, then show the second half. The limit can be changed with
-fmacro-instantiation-limit=N, and turned off with N=0.

This eliminates a lot of note spew with libraries making use of the
Boost.Preprocess library.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103014 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnosticPrinter.cpp
6c1cb9916e9988dcdd65b9266dbe24afd173427a 04-May-2010 Douglas Gregor <dgregor@apple.com> Introduce a limit on the depth of the macro instantiation backtrace
printed in a diagnostic, similar to the limit we already have on the
depth of the template instantiation backtrace. The macro instantiation
backtrace is limited to 10 "instantiated from:" diagnostics; when it's
longer than that, we'll show the first half, then say how many were
suppressed, then show the second half. The limit can be changed with
-fmacro-instantiation-limit=N, and turned off with N=0.

This eliminates a lot of note spew with libraries making use of the
Boost.Preprocess library.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103014 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnosticPrinter.cpp
5384ba8b400b9a4ca79adb962a536a2ed70fe66f 03-May-2010 Ted Kremenek <kremenek@apple.com> Workaround: Don't add ObjCMethodDecls to the vector of TopLevelDecls since they don't go in
the DeclContext for the translation unit. This is to workaround a fundamental issue in how
ObjC decls (within an @implementation) are parsed before the ObjCContainerDecl is available.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102944 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
da5a428bf3db404fe3c91b689cd87c68789d6db9 03-May-2010 Ted Kremenek <kremenek@apple.com> Workaround: Don't add ObjCMethodDecls to the vector of TopLevelDecls since they don't go in
the DeclContext for the translation unit. This is to workaround a fundamental issue in how
ObjC decls (within an @implementation) are parsed before the ObjCContainerDecl is available.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102944 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
736558e2d2981e16f7d75a1000cf52d76090ed91 03-May-2010 Douglas Gregor <doug.gregor@gmail.com> Diagnose unused exception parameters under a different warning group
(-Wunused-exception-parameter) than normal variables, since it's more
common to name and then ignore an exception parameter. This warning is
neither enabled by default nor by -Wall. Fixes <rdar://problem/7931045>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102931 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
324b54d3f60d92a82815512119791ce1c285b63e 03-May-2010 Douglas Gregor <dgregor@apple.com> Diagnose unused exception parameters under a different warning group
(-Wunused-exception-parameter) than normal variables, since it's more
common to name and then ignore an exception parameter. This warning is
neither enabled by default nor by -Wall. Fixes <rdar://problem/7931045>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102931 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
b25932702102e3b4659dccf5ecca468d70b00876 01-May-2010 Douglas Gregor <doug.gregor@gmail.com> Bump default template instantiation depth to 1024, as required by C++0x

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102847 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e2e69ef80ac09a489d00ce104e2e87867dc3dd26 01-May-2010 Douglas Gregor <dgregor@apple.com> Bump default template instantiation depth to 1024, as required by C++0x

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102847 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
69a171bc0a3ffed1931471a024d33b2fd00291bb 30-Apr-2010 Ted Kremenek <kremenek@apple.com> Don't perform AnalysisBasedWarnings in Sema or run the static analyzer when a
fatal error has occurred.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102778 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
99e8192c4c8f1f596f9969e5f2cdafcee64ddaac 30-Apr-2010 Ted Kremenek <kremenek@apple.com> Don't perform AnalysisBasedWarnings in Sema or run the static analyzer when a
fatal error has occurred.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102778 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
5dd8851e7d2128cac870e40baa24ce0ff692eec4 30-Apr-2010 Zhongxing Xu <xuzhongxing@gmail.com> Remove unused trait.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102690 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
a8b4a1e26ae91e5113892702c5a6a2824adca777 30-Apr-2010 Zhongxing Xu <xuzhongxing@gmail.com> Remove unused trait.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102690 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
0735908236b79ce2d8b4aebac3acda52a8449d68 30-Apr-2010 Zhongxing Xu <xuzhongxing@gmail.com> Refactor the AnalysisConsumer to analyze functions after the whole
translation unit is parsed. This enables us to inline some calls when still
analyzing one function at a time.

Actions are classified into Function, CXXMethod, ObjCMethod,
ObjCImplementation.

This does not hurt performance much. The analysis time for sqlite3.c:

before:
real 17m52.440s
user 17m49.460s
sys 0m2.010s

after:
real 18m0.500s
user 17m56.900s
sys 0m2.330s

DisplayProgress option is broken now. -inine-call action is removed. It
will be reenabled in another form, perhaps as an indenpendant option.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102689 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ed8afacb8118b71bcfa8017059e51da325e7691b 30-Apr-2010 Zhongxing Xu <xuzhongxing@gmail.com> Refactor the AnalysisConsumer to analyze functions after the whole
translation unit is parsed. This enables us to inline some calls when still
analyzing one function at a time.

Actions are classified into Function, CXXMethod, ObjCMethod,
ObjCImplementation.

This does not hurt performance much. The analysis time for sqlite3.c:

before:
real 17m52.440s
user 17m49.460s
sys 0m2.010s

after:
real 18m0.500s
user 17m56.900s
sys 0m2.330s

DisplayProgress option is broken now. -inine-call action is removed. It
will be reenabled in another form, perhaps as an indenpendant option.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102689 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
18831a00f5d41b750b8cebc06f134ca87f4946f9 30-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Add Clang version inspection macros. Fixes PR6681.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102686 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
4290fbd89e851c1f1240a007461f4afd940cbb47 30-Apr-2010 Douglas Gregor <dgregor@apple.com> Add Clang version inspection macros. Fixes PR6681.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102686 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
bd4dc7bc1a9a10e61919674824c305ed68290a25 29-Apr-2010 Daniel Dunbar <daniel@zuster.org> Remove a FIXME that is unlikely to be fixed (streaming code generation).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102623 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
f80cb75376f2a814adf37c3afeaba0f6b553ac9d 29-Apr-2010 Daniel Dunbar <daniel@zuster.org> Remove a FIXME that is unlikely to be fixed (streaming code generation).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102623 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
ff815a8ec7c7a20cf1d174eedc7b09f1b4d69db1 29-Apr-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Tie backend verification passes to CodeGenOptions::VerifyModule,
instead of NDEBUG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102622 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
ompilerInvocation.cpp
8a5e83c0237a39341736bc3e6068bf8ecf8e0daa 29-Apr-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Tie backend verification passes to CodeGenOptions::VerifyModule,
instead of NDEBUG.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102622 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
ompilerInvocation.cpp
089b1bece1d6f9ecb72db87e0e01965be9a91742 29-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Teach __builtin_offsetof to compute the offsets of members of base
classes, since we only warn (not error) on offsetof() for non-POD
types. We store the base path within the OffsetOfExpr itself, then
evaluate the offsets within the constant evaluator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102571 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
cc8a5d5f90bbbbcb46f342117b851b7e07ec34f1 29-Apr-2010 Douglas Gregor <dgregor@apple.com> Teach __builtin_offsetof to compute the offsets of members of base
classes, since we only warn (not error) on offsetof() for non-POD
types. We store the base path within the OffsetOfExpr itself, then
evaluate the offsets within the constant evaluator.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102571 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ce6b353d4b551b98c4282486fd13ef3b3bcf6e31 29-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Completely reimplement __builtin_offsetof, based on a patch by Roberto
Amadini.

This change introduces a new expression node type, OffsetOfExpr, that
describes __builtin_offsetof. Previously, __builtin_offsetof was
implemented using a unary operator whose subexpression involved
various synthesized array-subscript and member-reference expressions,
which was ugly and made it very hard to instantiate as a
template. OffsetOfExpr represents the AST more faithfully, with proper
type source information and a more compact representation.

OffsetOfExpr also has support for dependent __builtin_offsetof
expressions; it can be value-dependent, but will never be
type-dependent (like sizeof or alignof). This commit introduces
template instantiation for __builtin_offsetof as well.

There are two major caveats to this patch:

1) CodeGen cannot handle the case where __builtin_offsetof is not a
constant expression, so it produces an error. So, to avoid
regressing in C, we retain the old UnaryOperator-based
__builtin_offsetof implementation in C while using the shiny new
OffsetOfExpr implementation in C++. The old implementation can go
away once we have proper CodeGen support for this case, which we
expect won't cause much trouble in C++.

2) __builtin_offsetof doesn't work well with non-POD class types,
particularly when the designated field is found within a base
class. I will address this in a subsequent patch.

Fixes PR5880 and a bunch of assertions when building Boost.Python
tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102542 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
tmtXML.cpp
8ecdb65716cd7914ffb2eeee993fa9039fcd31e8 29-Apr-2010 Douglas Gregor <dgregor@apple.com> Completely reimplement __builtin_offsetof, based on a patch by Roberto
Amadini.

This change introduces a new expression node type, OffsetOfExpr, that
describes __builtin_offsetof. Previously, __builtin_offsetof was
implemented using a unary operator whose subexpression involved
various synthesized array-subscript and member-reference expressions,
which was ugly and made it very hard to instantiate as a
template. OffsetOfExpr represents the AST more faithfully, with proper
type source information and a more compact representation.

OffsetOfExpr also has support for dependent __builtin_offsetof
expressions; it can be value-dependent, but will never be
type-dependent (like sizeof or alignof). This commit introduces
template instantiation for __builtin_offsetof as well.

There are two major caveats to this patch:

1) CodeGen cannot handle the case where __builtin_offsetof is not a
constant expression, so it produces an error. So, to avoid
regressing in C, we retain the old UnaryOperator-based
__builtin_offsetof implementation in C while using the shiny new
OffsetOfExpr implementation in C++. The old implementation can go
away once we have proper CodeGen support for this case, which we
expect won't cause much trouble in C++.

2) __builtin_offsetof doesn't work well with non-POD class types,
particularly when the designated field is found within a base
class. I will address this in a subsequent patch.

Fixes PR5880 and a bunch of assertions when building Boost.Python
tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102542 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
tmtXML.cpp
5ec92586b706c909381ae0b72d9c5d1f7b51f726 28-Apr-2010 Chris Lattner <sabre@nondot.org> add regex support for -verify mode. You can now do things like
expected-error-re {{someregex}}

Patch by mike-m!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102516 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticsClient.cpp
60909e1242f19aa8b1b87110aaa8e394f329ae96 28-Apr-2010 Chris Lattner <sabre@nondot.org> add regex support for -verify mode. You can now do things like
expected-error-re {{someregex}}

Patch by mike-m!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102516 91177308-0d34-0410-b5e6-96231b3b80d8
erifyDiagnosticsClient.cpp
b539d102e1ea422fd034283578a5bbae9aaccfaa 28-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> More of Sema to implement initialization of
ivar of c++ object types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102500 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
e4498c6d66a8f472cba29b6158a2e86dfc60d0ef 28-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> More of Sema to implement initialization of
ivar of c++ object types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102500 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
4578a3a1441eb22b68d909fa35d82e6ee7204e38 27-Apr-2010 John McCall <rjmccall@apple.com> Make the InjectedClassNameType the canonical type of the current instantiation
of a class template or class template partial specialization. That is to
say, in
template <class T> class A { ... };
or
template <class T> class B<const T*> { ... };
make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType
when written inside the appropriate context. This allows us to track the
current instantiation appropriately even inside AST routines. It also allows
us to compute a DeclContext for a type much more efficiently, at some extra
cost every time we write a template specialization (which can be optimized,
but I've left it simple in this patch).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102407 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
31f17ecbef57b5679c017c375db330546b7b5145 27-Apr-2010 John McCall <rjmccall@apple.com> Make the InjectedClassNameType the canonical type of the current instantiation
of a class template or class template partial specialization. That is to
say, in
template <class T> class A { ... };
or
template <class T> class B<const T*> { ... };
make 'A<T>' and 'B<const T*>' sugar for the corresponding InjectedClassNameType
when written inside the appropriate context. This allows us to track the
current instantiation appropriately even inside AST routines. It also allows
us to compute a DeclContext for a type much more efficiently, at some extra
cost every time we write a template specialization (which can be optimized,
but I've left it simple in this patch).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102407 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
f0b2cb14108d2702641a133c26524a792e2221b5 27-Apr-2010 Chris Lattner <sabre@nondot.org> fix PR6936: don't generate line marker directives when preprocessing
.S files. "# 123" is passed through as-is, not treated as a line
marker in this mode. No testcase, because it would be nasty and isn't
worth it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102391 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
fcaa9e787037b22a6833d4562fed3105c5b55f71 27-Apr-2010 Chris Lattner <sabre@nondot.org> fix PR6936: don't generate line marker directives when preprocessing
.S files. "# 123" is passed through as-is, not treated as a line
marker in this mode. No testcase, because it would be nasty and isn't
worth it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102391 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
6cb535784c071d1a662aeac8e548e8757dd1a969 26-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce Type::isStructureOrClassType(), which does the obvious
thing. Audit all uses of Type::isStructure(), changing those calls to
isStructureOrClassType() as needed (which is alsmost
everywhere). Fixes the remaining failure in Boost.Utility/Swap.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102386 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
fb87b89fc9eb103e19fb8e4b925c23f0bd091b99 26-Apr-2010 Douglas Gregor <dgregor@apple.com> Introduce Type::isStructureOrClassType(), which does the obvious
thing. Audit all uses of Type::isStructure(), changing those calls to
isStructureOrClassType() as needed (which is alsmost
everywhere). Fixes the remaining failure in Boost.Utility/Swap.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102386 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
ff0b45f255aedeca5155e50ef2c603c26142f4fc 26-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Make the static type of the exception variable in an Objective-C
@catch a VarDecl. The dynamic type is still a ParmVarDecl, but that
will change soon. No effective functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102341 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
ewriteObjC.cpp
c00d8e18ad3d903acfeb5d05163ce90713066a3f 26-Apr-2010 Douglas Gregor <dgregor@apple.com> Make the static type of the exception variable in an Objective-C
@catch a VarDecl. The dynamic type is still a ParmVarDecl, but that
will change soon. No effective functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102341 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
ewriteObjC.cpp
28663098d9dadc09d3707587bbbe47adad6cda7b 25-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Switch this to new API.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102280 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
89fe01900eb7e6832e24d729590d6a51e3eba740 25-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Switch this to new API.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102280 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
a0494768db49126986e425913f6ad77f9e3dfdce 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add BasePath arguments to all cast expr constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102258 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
41b2dcd465f1e438502c420effc9d0c747f9db8f 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add BasePath arguments to all cast expr constructors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102258 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
b9421286fab2bf4dc529511a4cb675bc243c741f 24-Apr-2010 Daniel Dunbar <daniel@zuster.org> NeXT: Clean up dispatch method policy selection.
- Replace -cc1 level -fobjc-legacy-dispatch with -fobjc-dispatch-method={legacy,non-legacy,mixed}.

- Lift "mixed" vs "non-mixed" policy choice up to driver level, instead of being buried in CGObjCMac.cpp.

- No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102255 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f643b9b338b797a824447207d7eab5f1187f4f34 24-Apr-2010 Daniel Dunbar <daniel@zuster.org> NeXT: Clean up dispatch method policy selection.
- Replace -cc1 level -fobjc-legacy-dispatch with -fobjc-dispatch-method={legacy,non-legacy,mixed}.

- Lift "mixed" vs "non-mixed" policy choice up to driver level, instead of being buried in CGObjCMac.cpp.

- No intended functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102255 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8bf515b1f6e8ecdcbd3ebcc99fe08ea22fc7fd95 24-Apr-2010 Anders Carlsson <andersca@mac.com> CastExpr should not hold a pointer to the base path. More cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102249 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
f1b48b7014992155286d58bb1676f9f51031d18b 24-Apr-2010 Anders Carlsson <andersca@mac.com> CastExpr should not hold a pointer to the base path. More cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102249 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
be7e68c63d57cc96d6855a1575abd9e40c28dd16 24-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Update prototypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102241 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
d9d3a1ce369755f2a913f02dbd222338087cc6a4 24-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Update prototypes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102241 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
1a7697cc5fa364c548f50fd8931d22e84cecc74d 24-Apr-2010 John McCall <rjmccall@apple.com> Recommit r102215, this time being more careful to only set the "principal
declaration" (i.e. the only which will actually be looked up) to have the
non-member-operator bit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102231 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
76d326448d7e4c10b2896edc2ee855d1e68d1b88 24-Apr-2010 John McCall <rjmccall@apple.com> Recommit r102215, this time being more careful to only set the "principal
declaration" (i.e. the only which will actually be looked up) to have the
non-member-operator bit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102231 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
fe52a675aa4ca1019099e1b0379ebe00e0f111dc 24-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Teach clang -fixit to modify files in-place, or -fixit=suffix to create new
files with the additional suffix in the middle.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102230 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ixItRewriter.cpp
rontendActions.cpp
ba5f6eced29937e4e4851a2c0980744768413d66 24-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Teach clang -fixit to modify files in-place, or -fixit=suffix to create new
files with the additional suffix in the middle.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102230 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
ixItRewriter.cpp
rontendActions.cpp
6742ed0fae1d786bcc2e6c9b4cca19f35fd13bd6 24-Apr-2010 Devang Patel <dpatel@apple.com> Revert r102215. This causes clang crash while compiling a test case from gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102224 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
f0bf4d554f2513cbb4bec952c81ced59279ad91e 24-Apr-2010 Devang Patel <dpatel@apple.com> Revert r102215. This causes clang crash while compiling a test case from gdb testsuite.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102224 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
1a2c1a806b8322d095e20481a2815bc4275900aa 24-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Improve the AST representation of Objective-C @try/@catch/@finally
statements. Instead of the @try having a single @catch, where all of
the @catch's were chained (using an O(n^2) algorithm nonetheless),
@try just holds an array of its @catch blocks. The resulting AST is
slightly more compact (not important) and better represents the actual
language semantics (good).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102221 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
8f5e3dd32e443768d9dbbad7191e123e6733750c 24-Apr-2010 Douglas Gregor <dgregor@apple.com> Improve the AST representation of Objective-C @try/@catch/@finally
statements. Instead of the @try having a single @catch, where all of
the @catch's were chained (using an O(n^2) algorithm nonetheless),
@try just holds an array of its @catch blocks. The resulting AST is
slightly more compact (not important) and better represents the actual
language semantics (good).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102221 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
301ea81936fb6061341b17d73c34d9fbd2fdb423 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add an InheritancePath parameter to the ImplicitCastExpr constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102218 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
88465d3e996e627bbaa11099b039ddab66d5af2c 24-Apr-2010 Anders Carlsson <andersca@mac.com> Add an InheritancePath parameter to the ImplicitCastExpr constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102218 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
e5b8fd3a48d3c993d29d3a262ff21a36b8a6521d 23-Apr-2010 John McCall <rjmccall@apple.com> Transition the last acceptable-result filter kind in LookupResult over to use
a simple IDNS mask by introducing a namespace for non-member operators.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102215 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
f88b0d6c99e6473e78331271935986535dc4603c 23-Apr-2010 John McCall <rjmccall@apple.com> Transition the last acceptable-result filter kind in LookupResult over to use
a simple IDNS mask by introducing a namespace for non-member operators.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102215 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
f0b08496aea4aaa2fbe12b8c3af61072c206a30c 23-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> More work toward implementing
NeXt's -fno-constant-cfstrings - wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102189 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2bb5ddaff86ee73d2cea7ec1835978afc88a83f0 23-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> More work toward implementing
NeXt's -fno-constant-cfstrings - wip.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102189 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
806e8fff4c2c5fd5ee89dbd375eab3426121d97d 23-Apr-2010 Chris Lattner <sabre@nondot.org> add GNU C++ include paths for Fedora 11,12 x86_64,
patch by mikem!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102177 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ea00f847a0e1771b1fcfe683d3506940dc2de1ec 23-Apr-2010 Chris Lattner <sabre@nondot.org> add GNU C++ include paths for Fedora 11,12 x86_64,
patch by mikem!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102177 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
b33c766ae8d0e73ae511dff8698d811044968849 22-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Check for -fno-constant-cfstrings consistency
in pch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102130 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
4c9d8d0eca5ca635d9a30222f690db9140e98325 22-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Check for -fno-constant-cfstrings consistency
in pch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102130 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
b2df6b5289dd2d3b7e4b077ae4555145f6fc9c61 22-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Support for -fno-constant-cfstrings option - wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102112 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
33e982bf782d851bfe5767acb1336fcf3419ac6b 22-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Support for -fno-constant-cfstrings option - wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102112 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
9b22a175df4d06c7fb6b1597444442b241ba6255 21-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Sink the _GNU_SOURCE definition down into the target configuration,
and only define it where we know we need it---Linux and Cygwin. Thanks
to Chris for the prodding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101989 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
2b003fd2766914133fa7418e1b368ca171ac4205 21-Apr-2010 Douglas Gregor <dgregor@apple.com> Sink the _GNU_SOURCE definition down into the target configuration,
and only define it where we know we need it---Linux and Cygwin. Thanks
to Chris for the prodding.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101989 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
aa598756ea06cb4de58fa775892e02f57e71537b 21-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Overhaul the AST representation of Objective-C message send
expressions, to improve source-location information, clarify the
actual receiver of the message, and pave the way for proper C++
support. The ObjCMessageExpr node represents four different kinds of
message sends in a single AST node:

1) Send to a object instance described by an expression (e.g., [x method:5])
2) Send to a class described by the class name (e.g., [NSString method:5])
3) Send to a superclass class (e.g, [super method:5] in class method)
4) Send to a superclass instance (e.g., [super method:5] in instance method)

Previously these four cases where tangled together. Now, they have
more distinct representations. Specific changes:

1) Unchanged; the object instance is represented by an Expr*.

2) Previously stored the ObjCInterfaceDecl* referring to the class
receiving the message. Now stores a TypeSourceInfo* so that we know
how the class was spelled. This both maintains typedef information
and opens the door for more complicated C++ types (e.g., dependent
types). There was an alternative, unused representation of these
sends by naming the class via an IdentifierInfo *. In practice, we
either had an ObjCInterfaceDecl *, from which we would get the
IdentifierInfo *, or we fell into the case below...

3) Previously represented by a class message whose IdentifierInfo *
referred to "super". Sema and CodeGen would use isStr("super") to
determine if they had a send to super. Now represented as a
"class super" send, where we have both the location of the "super"
keyword and the ObjCInterfaceDecl* of the superclass we're
targetting (statically).

4) Previously represented by an instance message whose receiver is a
an ObjCSuperExpr, which Sema and CodeGen would check for via
isa<ObjCSuperExpr>(). Now represented as an "instance super" send,
where we have both the location of the "super" keyword and the
ObjCInterfaceDecl* of the superclass we're targetting
(statically). Note that ObjCSuperExpr only has one remaining use in
the AST, which is for "super.prop" references.

The new representation of ObjCMessageExpr is 2 pointers smaller than
the old one, since it combines more storage. It also eliminates a leak
when we loaded message-send expressions from a precompiled header. The
representation also feels much cleaner to me; comments welcome!

This patch attempts to maintain the same semantics we previously had
with Objective-C message sends. In several places, there are massive
changes that boil down to simply replacing a nested-if structure such
as:

if (message has a receiver expression) {
// instance message
if (isa<ObjCSuperExpr>(...)) {
// send to super
} else {
// send to an object
}
} else {
// class message
if (name->isStr("super")) {
// class send to super
} else {
// send to class
}
}

with a switch

switch (E->getReceiverKind()) {
case ObjCMessageExpr::SuperInstance: ...
case ObjCMessageExpr::Instance: ...
case ObjCMessageExpr::SuperClass: ...
case ObjCMessageExpr::Class:...
}

There are quite a few places (particularly in the checkers) where
send-to-super is effectively ignored. I've placed FIXMEs in most of
them, and attempted to address send-to-super in a reasonable way. This
could use some review.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101972 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
04badcf84c8d504d8491c7c7e29b58f52cb16640 21-Apr-2010 Douglas Gregor <dgregor@apple.com> Overhaul the AST representation of Objective-C message send
expressions, to improve source-location information, clarify the
actual receiver of the message, and pave the way for proper C++
support. The ObjCMessageExpr node represents four different kinds of
message sends in a single AST node:

1) Send to a object instance described by an expression (e.g., [x method:5])
2) Send to a class described by the class name (e.g., [NSString method:5])
3) Send to a superclass class (e.g, [super method:5] in class method)
4) Send to a superclass instance (e.g., [super method:5] in instance method)

Previously these four cases where tangled together. Now, they have
more distinct representations. Specific changes:

1) Unchanged; the object instance is represented by an Expr*.

2) Previously stored the ObjCInterfaceDecl* referring to the class
receiving the message. Now stores a TypeSourceInfo* so that we know
how the class was spelled. This both maintains typedef information
and opens the door for more complicated C++ types (e.g., dependent
types). There was an alternative, unused representation of these
sends by naming the class via an IdentifierInfo *. In practice, we
either had an ObjCInterfaceDecl *, from which we would get the
IdentifierInfo *, or we fell into the case below...

3) Previously represented by a class message whose IdentifierInfo *
referred to "super". Sema and CodeGen would use isStr("super") to
determine if they had a send to super. Now represented as a
"class super" send, where we have both the location of the "super"
keyword and the ObjCInterfaceDecl* of the superclass we're
targetting (statically).

4) Previously represented by an instance message whose receiver is a
an ObjCSuperExpr, which Sema and CodeGen would check for via
isa<ObjCSuperExpr>(). Now represented as an "instance super" send,
where we have both the location of the "super" keyword and the
ObjCInterfaceDecl* of the superclass we're targetting
(statically). Note that ObjCSuperExpr only has one remaining use in
the AST, which is for "super.prop" references.

The new representation of ObjCMessageExpr is 2 pointers smaller than
the old one, since it combines more storage. It also eliminates a leak
when we loaded message-send expressions from a precompiled header. The
representation also feels much cleaner to me; comments welcome!

This patch attempts to maintain the same semantics we previously had
with Objective-C message sends. In several places, there are massive
changes that boil down to simply replacing a nested-if structure such
as:

if (message has a receiver expression) {
// instance message
if (isa<ObjCSuperExpr>(...)) {
// send to super
} else {
// send to an object
}
} else {
// class message
if (name->isStr("super")) {
// class send to super
} else {
// send to class
}
}

with a switch

switch (E->getReceiverKind()) {
case ObjCMessageExpr::SuperInstance: ...
case ObjCMessageExpr::Instance: ...
case ObjCMessageExpr::SuperClass: ...
case ObjCMessageExpr::Class:...
}

There are quite a few places (particularly in the checkers) where
send-to-super is effectively ignored. I've placed FIXMEs in most of
them, and attempted to address send-to-super in a reasonable way. This
could use some review.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101972 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
d1af63ce83d16bd87e384423c83aad7fbba431e1 20-Apr-2010 Chris Lattner <sabre@nondot.org> change FullSourceLoc to have a *const* SourceManager&, eliminating
a const_cast.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101940 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
5c5db4e94bd1243ba92563acba51ba66afa94917 20-Apr-2010 Chris Lattner <sabre@nondot.org> change FullSourceLoc to have a *const* SourceManager&, eliminating
a const_cast.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101940 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
d8dc8f7f327f2d7f4517e71b54ddaf38b6e7c3e9 20-Apr-2010 Chris Lattner <sabre@nondot.org> push some source location information down through the compiler,
into ContentCache::getBuffer. This allows it to produce
diagnostics on the broken #include line instead of without a
location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101939 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
rontendActions.cpp
CHWriter.cpp
rintPreprocessedOutput.cpp
ewriteMacros.cpp
e127a0d80155b45dafe77f2b4380e5fa111a3345 20-Apr-2010 Chris Lattner <sabre@nondot.org> push some source location information down through the compiler,
into ContentCache::getBuffer. This allows it to produce
diagnostics on the broken #include line instead of without a
location.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101939 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
rontendActions.cpp
CHWriter.cpp
rintPreprocessedOutput.cpp
ewriteMacros.cpp
91330e6d7da91efa05ff0ff63b3f8f47f48fa8c4 20-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Keep proper source location information for the type in an Objective-C
@encode expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101907 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
81d3466d037dc5844234c7a93dab21a6ad986e7d 20-Apr-2010 Douglas Gregor <dgregor@apple.com> Keep proper source location information for the type in an Objective-C
@encode expression.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101907 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
c693861122503dacd40daf3b2fba092db42513c6 20-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a limit on the depth of the template instantiation backtrace
we will print with each error that occurs during template
instantiation. When the backtrace is longer than that, we will print
N/2 of the innermost backtrace entries and N/2 of the outermost
backtrace entries, then skip the middle entries with a note such as:

note: suppressed 2 template instantiation contexts; use
-ftemplate-backtrace-limit=N to change the number of template
instantiation entries shown

This should eliminate some excessively long backtraces that aren't
providing any value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101882 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
arnings.cpp
575cf3791216c33770ba950430493cdd43099f8f 20-Apr-2010 Douglas Gregor <dgregor@apple.com> Introduce a limit on the depth of the template instantiation backtrace
we will print with each error that occurs during template
instantiation. When the backtrace is longer than that, we will print
N/2 of the innermost backtrace entries and N/2 of the outermost
backtrace entries, then skip the middle entries with a note such as:

note: suppressed 2 template instantiation contexts; use
-ftemplate-backtrace-limit=N to change the number of template
instantiation entries shown

This should eliminate some excessively long backtraces that aren't
providing any value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101882 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
arnings.cpp
944c37abb8acd1e14e73176922ee351db6a0f62f 20-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Keep track of the actual storage specifier written on a variable or
function declaration, since it may end up being changed (e.g.,
"extern" can become "static" if a prior declaration was static). Patch
by Enea Zaffanella and Paolo Bolzoni.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101826 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
ewriteObjC.cpp
16573fa9705b546b7597c273b25b85d6321e2b33 20-Apr-2010 Douglas Gregor <dgregor@apple.com> Keep track of the actual storage specifier written on a variable or
function declaration, since it may end up being changed (e.g.,
"extern" can become "static" if a prior declaration was static). Patch
by Enea Zaffanella and Paolo Bolzoni.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101826 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
ewriteObjC.cpp
f659b239aa691ee558fd4ba0ef0a68ce396857d3 19-Apr-2010 Dan Gohman <gohman@apple.com> Fix -Wcast-qual warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101786 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
odeGenAction.cpp
nitHeaderSearch.cpp
cb421fa690da545b58a720abe5f1c49b166dbde7 19-Apr-2010 Dan Gohman <gohman@apple.com> Fix -Wcast-qual warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101786 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
odeGenAction.cpp
nitHeaderSearch.cpp
1cfbc68a39712b410f0b5859b87b57f9ff749cea 17-Apr-2010 Chandler Carruth <chandlerc@gmail.com> Add support for '-fgnu-keywords' and '-fasm' to Clang's driver. They are not
implemented precisely the same as GCC, but the distinction GCC makes isn't
useful to represent. This allows parsing code which uses GCC-specific keywords
('asm', etc.) without parsing in a fully GNU mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101667 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
CHReader.cpp
CHWriter.cpp
eb5d7b752651283de5abfcc2f91df7227582a08d 17-Apr-2010 Chandler Carruth <chandlerc@gmail.com> Add support for '-fgnu-keywords' and '-fasm' to Clang's driver. They are not
implemented precisely the same as GCC, but the distinction GCC makes isn't
useful to represent. This allows parsing code which uses GCC-specific keywords
('asm', etc.) without parsing in a fully GNU mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101667 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
CHReader.cpp
CHWriter.cpp
ac31224820a92c7e38e632c807a8ee55dbfa69a3 17-Apr-2010 Anders Carlsson <andersca@mac.com> Vtable -> VTable renames across the board.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101666 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
046c294a43024874ff35656c6e785b64e72f1f36 17-Apr-2010 Anders Carlsson <andersca@mac.com> Vtable -> VTable renames across the board.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101666 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
13946c261d641cd1745b59d36ae1420c2aea20ae 17-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Add raw_ostream operators to NamedDecl for convenience. Switch over all users of getNameAsString on a stream.

The next step is to print the name directly into the stream, avoiding a temporary std::string copy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101632 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
nalysisConsumer.cpp
900fc6388e803868a34b9483510c345e9b49d7eb 17-Apr-2010 Benjamin Kramer <benny.kra@googlemail.com> Add raw_ostream operators to NamedDecl for convenience. Switch over all users of getNameAsString on a stream.

The next step is to print the name directly into the stream, avoiding a temporary std::string copy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101632 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
nalysisConsumer.cpp
b76c03eb4cfd2b99f928da6f1c140dd0f69fcd82 16-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Add a write(raw_ostream&) method to RewriteBuffer. This uses an inefficient
implementation today but is the right place if we want to make it faster some
day.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101521 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
0ade808e0ac411baa2dbc1f76ad352b9b6d6d3f8 16-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Add a write(raw_ostream&) method to RewriteBuffer. This uses an inefficient
implementation today but is the right place if we want to make it faster some
day.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101521 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
63cf21ad395b25304c3b88e695b8b39e8363782c 16-Apr-2010 Dan Gohman <gohman@apple.com> Remove this hard-coded buffer size. In some basic experiments preprocessing
large files, this doesn't seem significantly better than just letting
raw_ostream pick a buffer size.

This code predates raw-ostream's automatic buffer sizing; in fact, it
was introduced as part of the code which would eventually become
raw_ostream.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101473 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
8ed4ff6d05ef41027ddaa13000309e719fa27ce8 16-Apr-2010 Dan Gohman <gohman@apple.com> Remove this hard-coded buffer size. In some basic experiments preprocessing
large files, this doesn't seem significantly better than just letting
raw_ostream pick a buffer size.

This code predates raw-ostream's automatic buffer sizing; in fact, it
was introduced as part of the code which would eventually become
raw_ostream.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101473 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
f9d964f9fe4a459d1d5e4b5c0acb2f5f7f9bdf1b 16-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Only predefine the macro _GNU_SOURCE in C++ mode when we're on a
platform that typically uses glibc. Fixes a Boost.Thread compilation
failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101450 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
66791df8d8b65c68de9ecf3246e895919af75bc2 16-Apr-2010 Douglas Gregor <dgregor@apple.com> Only predefine the macro _GNU_SOURCE in C++ mode when we're on a
platform that typically uses glibc. Fixes a Boost.Thread compilation
failure.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101450 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
5f1658f13c94164a82fbecc27a3ae477db32b195 16-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Fix a bug in caret-line-pruning logic that only happens when we have a
source line wider than the terminal where the associated fix-it line
is longer than the caret line. Previously, we would crash in this
case, which was rather unfortunate. Fixes <rdar://problem/7856226>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101426 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
ce487ef6c1ba3b35250ce5bfe053e24e34a854e6 16-Apr-2010 Douglas Gregor <dgregor@apple.com> Fix a bug in caret-line-pruning logic that only happens when we have a
source line wider than the terminal where the associated fix-it line
is longer than the caret line. Previously, we would crash in this
case, which was rather unfortunate. Fixes <rdar://problem/7856226>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101426 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
279ac317a9a1a8b5bc8d3684ac88a11de012eb36 15-Apr-2010 Daniel Dunbar <daniel@zuster.org> clang -cc1: Add a -fno-bitfield-type-align option, for my own testing purposes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101370 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
fb937b8c5f1c5dc9cfd4223b5cae230cc42b0287 15-Apr-2010 Daniel Dunbar <daniel@zuster.org> clang -cc1: Add a -fno-bitfield-type-align option, for my own testing purposes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101370 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
44e64d8461f2b4c565061fa2ecdf8268ac3d2351 15-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Teach -fixit to modify all of its inputs instead of just the main file, unless
-fixit-at specified a particular fixit to fix, or the -o flag was used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101359 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
rontendActions.cpp
d4a97a18ea3cda3ba095e7c0c6708e7a39cf31db 15-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Teach -fixit to modify all of its inputs instead of just the main file, unless
-fixit-at specified a particular fixit to fix, or the -o flag was used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101359 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
rontendActions.cpp
85a48e3c8e72f61fb888510213917546e6b4fdec 15-Apr-2010 Daniel Dunbar <daniel@zuster.org> Driver/Frontend: Add support for -mllvm, which forwards options to the LLVM option parser.
- Note that this is a behavior change, previously -mllvm at the driver level forwarded to clang -cc1. The driver does a little magic to make sure that '-mllvm -disable-llvm-optzns' works correctly, but other users will need to be updated to use -Xclang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101354 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
3f87fb08dd502309960646db01099fb4c1be9a7c 15-Apr-2010 Daniel Dunbar <daniel@zuster.org> Driver/Frontend: Add support for -mllvm, which forwards options to the LLVM option parser.
- Note that this is a behavior change, previously -mllvm at the driver level forwarded to clang -cc1. The driver does a little magic to make sure that '-mllvm -disable-llvm-optzns' works correctly, but other users will need to be updated to use -Xclang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101354 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e1e4187656e16bead3702efa068aadfb0055f962 15-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Once we've emitted a fatal diagnostic, keep counting errors but with a
separate count of "suppressed" errors. This way, semantic analysis
bits that depend on the error count to determine whether problems
occured (e.g., some template argument deduction failures, jump-scope
checking) will not get confused.

The actual problem here is that a missing #include (which is a fatal
error) could cause the jump-scope checker to run on invalid code,
which it is not prepared to do. Trivial fix for both
<rdar://problem/7775941> and <rdar://problem/7775709>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101297 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
1864f2eb59471d07db51adfc3e5b1a229eed631a 15-Apr-2010 Douglas Gregor <dgregor@apple.com> Once we've emitted a fatal diagnostic, keep counting errors but with a
separate count of "suppressed" errors. This way, semantic analysis
bits that depend on the error count to determine whether problems
occured (e.g., some template argument deduction failures, jump-scope
checking) will not get confused.

The actual problem here is that a missing #include (which is a fatal
error) could cause the jump-scope checker to run on invalid code,
which it is not prepared to do. Trivial fix for both
<rdar://problem/7775941> and <rdar://problem/7775709>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101297 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
68d1a1233f34d9e9a10f37795f647e662cde4b28 14-Apr-2010 Chris Lattner <sabre@nondot.org> Improve line marker directive locations, patch by Jordy Rose


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101226 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
86d0ef74303e9164a0860ce849af597d34f937ab 14-Apr-2010 Chris Lattner <sabre@nondot.org> Improve line marker directive locations, patch by Jordy Rose


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101226 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
9520402122df38f8744cb71ee30e5eadc448e7cc 14-Apr-2010 Chris Lattner <sabre@nondot.org> make the token paste avoidance logic turn "..." into ".. ." instead of ". . ."
when avoiding paste. Patch by David Peixotto!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101218 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
8877321ca66b2887c2f377a7f724a62f34fdf1cd 14-Apr-2010 Chris Lattner <sabre@nondot.org> make the token paste avoidance logic turn "..." into ".. ." instead of ". . ."
when avoiding paste. Patch by David Peixotto!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101218 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
2b3730baddad5e06c1498de980ca3efe66e5d893 14-Apr-2010 Chris Lattner <sabre@nondot.org> implement altivec.h and a bunch of support code, patch by Anton Yartsev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101215 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
dd17394d225b06376e9ae1d23f36cec463fdef01 14-Apr-2010 Chris Lattner <sabre@nondot.org> implement altivec.h and a bunch of support code, patch by Anton Yartsev!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101215 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
6e1f2241cecf3eebbc551d4bc83938136d12ea78 14-Apr-2010 Ted Kremenek <kremenek@apple.com> Use ASTVector instead of std::vector for the Exprs in InitListExpr. Performance
measurements of '-fsyntax-only' on combine.c (403.gcc) shows no real performance
change, but now the vector isn't leaked.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101195 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
ewriteObjC.cpp
709210feee317b8d6690dd1d15c2b74cfe55e261 14-Apr-2010 Ted Kremenek <kremenek@apple.com> Use ASTVector instead of std::vector for the Exprs in InitListExpr. Performance
measurements of '-fsyntax-only' on combine.c (403.gcc) shows no real performance
change, but now the vector isn't leaked.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101195 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
ewriteObjC.cpp
b5c540c06ef57575c8cb5a930d6801e420faf122 13-Apr-2010 Chris Lattner <sabre@nondot.org> make the rewriter add a #ifndef around the #define of __attribute__.
Without it, there is no reason for a compiler that supports it to
emit the dead static globals that the rewriter labels attribute(used).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101149 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
553e583e1d30fe30ac2de3526536bbebee6da1ce 13-Apr-2010 Chris Lattner <sabre@nondot.org> make the rewriter add a #ifndef around the #define of __attribute__.
Without it, there is no reason for a compiler that supports it to
emit the dead static globals that the rewriter labels attribute(used).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101149 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
f85dad13171f398cad222114a718c21f62746e61 13-Apr-2010 Zhongxing Xu <xuzhongxing@gmail.com> Add a cc1 option to specify the max number of nodes the analyzer can explore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101120 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ompilerInvocation.cpp
c09289d104b8e01ecd998e3f08b2b0561049e1dc 13-Apr-2010 Zhongxing Xu <xuzhongxing@gmail.com> Add a cc1 option to specify the max number of nodes the analyzer can explore.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101120 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ompilerInvocation.cpp
2d91a1377ad849f233142ccf2b00ea7e2df6620d 13-Apr-2010 Chris Lattner <sabre@nondot.org> add frontend support for -fdata-sections and -ffunction-sections,
patch by Sylvere Teissier!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101108 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
ompilerInvocation.cpp
bbea7168326d810eff18dfb8bc43c7790fd55010 13-Apr-2010 Chris Lattner <sabre@nondot.org> add frontend support for -fdata-sections and -ffunction-sections,
patch by Sylvere Teissier!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101108 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
ompilerInvocation.cpp
e9a71191c7e6eb880bc6a7251e8392d433f36b8c 13-Apr-2010 Chris Lattner <sabre@nondot.org> cache the PP's SourceManager.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101099 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
df721408f54f87a790fb986dfd64984472a1f892 13-Apr-2010 Chris Lattner <sabre@nondot.org> cache the PP's SourceManager.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101099 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
bf6f8d6d95b389127f90c317ff7d56e59103de6a 13-Apr-2010 Chris Lattner <sabre@nondot.org> make the preprocessor listen to linemarker directives in -E mode,
PR6101. This is based on a patch and testcase by Jordy Rose!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101097 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
88aae9188a64fe6385c7057af068aaeb8fc96b8e 13-Apr-2010 Chris Lattner <sabre@nondot.org> make the preprocessor listen to linemarker directives in -E mode,
PR6101. This is based on a patch and testcase by Jordy Rose!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101097 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
db32f0eee66682b5023179ce31968f6eab3e6244 12-Apr-2010 Chris Lattner <sabre@nondot.org> fix PR6814 - Only print [-pedantic] on a diagnostic if -pedantic
actually turned it on. If a diag is produced by a warning which
is an extension but defaults to on, and has no warning group, don't
print any option info.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101071 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
04e442714c292d9381cad2ac14087991132bddca 12-Apr-2010 Chris Lattner <sabre@nondot.org> fix PR6814 - Only print [-pedantic] on a diagnostic if -pedantic
actually turned it on. If a diag is produced by a warning which
is an extension but defaults to on, and has no warning group, don't
print any option info.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101071 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
f853e7319cfb327c5390166b53f7c5d812bdbf1e 11-Apr-2010 Chris Lattner <sabre@nondot.org> add haiku support, patch by Paul Davey!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100982 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
86ed3a326342fa2a8c9d9b5d1d7280c9bad2b007 11-Apr-2010 Chris Lattner <sabre@nondot.org> add haiku support, patch by Paul Davey!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100982 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
095e284e099479579bfe3d3c8d623c429d7337cd 10-Apr-2010 Anders Carlsson <andersca@mac.com> Rename -dump-record-layouts to -fdump-record-layouts now that the option behaves like aa flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100943 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
46116ce06ae28e3fc3a34c513f2f63ac02d9a194 10-Apr-2010 Anders Carlsson <andersca@mac.com> Rename -dump-record-layouts to -fdump-record-layouts now that the option behaves like aa flag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100943 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
4f4bd835ccc14c54177e9e7ad97bbdd09b161630 09-Apr-2010 John McCall <rjmccall@apple.com> Turn access control on by default in -cc1.
Remove -faccess-control from -cc1; add -fno-access-control.
Make the driver pass -fno-access-control by default.
Update a bunch of tests to be correct under access control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100880 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7002f4c03c2d0544f4e8bea8d3a5636519081e35 09-Apr-2010 John McCall <rjmccall@apple.com> Turn access control on by default in -cc1.
Remove -faccess-control from -cc1; add -fno-access-control.
Make the driver pass -fno-access-control by default.
Update a bunch of tests to be correct under access control.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100880 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
12d8eca5dacd9cb347e2f464e9f3109affae7657 09-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> On Windows, disable the modification-time check for files used in
precompiled headers and/or when reading the contents of the file into
memory. These checks seem to be causing spurious regression-test
failures on Windows.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100866 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
9f692a0308975cf24ef117c05e31284a1a944e86 09-Apr-2010 Douglas Gregor <dgregor@apple.com> On Windows, disable the modification-time check for files used in
precompiled headers and/or when reading the contents of the file into
memory. These checks seem to be causing spurious regression-test
failures on Windows.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100866 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
b33ebd3aa2318ef1938cac5f5720f122342ff798 09-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a regression caused by implementing cstyle methods
for objc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100865 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
4ecb25fa94897b2c03510292acace710e5262ba5 09-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a regression caused by implementing cstyle methods
for objc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100865 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
5739fe3c388afdb288db79183b966aeb96dead6e 08-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Implement method type encoding in the presense
of c-style arguments. Completes radar 7445205.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100813 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
7732cc9c0fdc97a2f8cce4e5933d8103213d1aef 08-Apr-2010 Fariborz Jahanian <fjahanian@apple.com> Implement method type encoding in the presense
of c-style arguments. Completes radar 7445205.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100813 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
bb65e4697e4cc2e9014b3df33fc0ef721b5ccb94 08-Apr-2010 Jeffrey Yasskin <jyasskin@google.com> Make CXXScopeSpec invalid when incomplete, and propagate that into any
Declarator that depends on it. This fixes several redundant errors and bad
recoveries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100779 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
9ab14541716928894821cf5d53d6b4c95ffdf3a3 08-Apr-2010 Jeffrey Yasskin <jyasskin@google.com> Make CXXScopeSpec invalid when incomplete, and propagate that into any
Declarator that depends on it. This fixes several redundant errors and bad
recoveries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100779 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
bc9820dd532c8e9fc7d5a6ab51566a640cd52780 08-Apr-2010 Daniel Dunbar <daniel@zuster.org> Fronted: Kill overly specialized RecordLayoutDumper, just make -dump-record-layouts a bit that Sema honors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100747 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ompilerInvocation.cpp
rontendActions.cpp
b69eca5d2196c06870d3eeb62d689feebaaa8a4d 08-Apr-2010 Daniel Dunbar <daniel@zuster.org> Fronted: Kill overly specialized RecordLayoutDumper, just make -dump-record-layouts a bit that Sema honors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100747 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ompilerInvocation.cpp
rontendActions.cpp
e41639e4277f1104b3a4d724c727645bda80231d 08-Apr-2010 Daniel Dunbar <daniel@zuster.org> AST: Move C++ record layout dumping to ASTContext::DumpRecordLayout.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100746 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
bf9e48cbaaa23d990dbedf9489513500bd0b9751 08-Apr-2010 Daniel Dunbar <daniel@zuster.org> AST: Move C++ record layout dumping to ASTContext::DumpRecordLayout.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100746 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
731460ad614733c4e2912d935e56d15752cb5cb1 08-Apr-2010 Chris Lattner <sabre@nondot.org> refactor out a function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100733 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
d6f1906ffaf38285328facd1b6f043eeee991247 08-Apr-2010 Chris Lattner <sabre@nondot.org> refactor out a function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100733 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
aecd161d5b3d17a438a22589367b948b85fc28ad 08-Apr-2010 Chris Lattner <sabre@nondot.org> rename llvm::llvm_report_error -> llvm::report_fatal_error



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100708 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendActions.cpp
angStandards.cpp
CHWriterDecl.cpp
83e7a78a9fa3fc495a575bca0e3d4d7ce26184ef 08-Apr-2010 Chris Lattner <sabre@nondot.org> rename llvm::llvm_report_error -> llvm::report_fatal_error



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100708 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendActions.cpp
angStandards.cpp
CHWriterDecl.cpp
0f96ef65426bcb7db60a4f1d4ca31d90b46b0e5f 07-Apr-2010 Chris Lattner <sabre@nondot.org> add clang -cc1 level support for "-ferror-limit 42"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100687 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
arnings.cpp
c100214fdc41a7ea215f75d433eb1cb829fd4330 07-Apr-2010 Chris Lattner <sabre@nondot.org> add clang -cc1 level support for "-ferror-limit 42"


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100687 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
arnings.cpp
9c669c7b673233e4aac507ecb3daf6acdfc2fba7 07-Apr-2010 Chris Lattner <sabre@nondot.org> Instead of counting totally diagnostics, split the count into a count
of errors and warnings. This allows us to emit something like this:

2 warnings and 1 error generated.

instead of:

3 diagnostics generated.

This also stops counting 'notes' because they are just follow-on information
about the previous diag, not a diagnostic in themselves.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100675 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
53eee7ba970d21ff15bbd4334164037a3b4cc4b8 07-Apr-2010 Chris Lattner <sabre@nondot.org> Instead of counting totally diagnostics, split the count into a count
of errors and warnings. This allows us to emit something like this:

2 warnings and 1 error generated.

instead of:

3 diagnostics generated.

This also stops counting 'notes' because they are just follow-on information
about the previous diag, not a diagnostic in themselves.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100675 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
4dcf536e5962635a4d142254b6e9fbaded04ac78 06-Apr-2010 Chris Lattner <sabre@nondot.org> teach clang to install the inline asm diagnostic handler,
allowing backend errors to be mapped through clang's
diagnostics subsystem, including the backend location info.

We now get:

$ clang asm.c -c -o t.o -integrated-as
<inline asm>:1:2: error: unrecognized instruction
abc incl %eax
^
1 diagnostic generated.

With colors, and correct "# diagnostics generated".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100543 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
6da9eb661616ffd702deeb37e6872dd2294c8fef 06-Apr-2010 Chris Lattner <sabre@nondot.org> teach clang to install the inline asm diagnostic handler,
allowing backend errors to be mapped through clang's
diagnostics subsystem, including the backend location info.

We now get:

$ clang asm.c -c -o t.o -integrated-as
<inline asm>:1:2: error: unrecognized instruction
abc incl %eax
^
1 diagnostic generated.

With colors, and correct "# diagnostics generated".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100543 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
727a0d35b531c1f0358d73d0b60149506703f171 06-Apr-2010 Chris Lattner <sabre@nondot.org> reduce indentation, tidy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100537 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
cabae68037bd3740ac4fb73382e04cd365457c17 06-Apr-2010 Chris Lattner <sabre@nondot.org> reduce indentation, tidy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100537 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
a48848339a02b2830dfd40d5684e3084046d4b79 06-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Make code-completion for Objective-C message sends to "id" work in the
presence of precompiled headers by forcibly loading all of the
methods we know about from the PCH file before constructing our
code-completion list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100535 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
719770dcfcb3987e8a2377dcca97955301445eb5 06-Apr-2010 Douglas Gregor <dgregor@apple.com> Make code-completion for Objective-C message sends to "id" work in the
presence of precompiled headers by forcibly loading all of the
methods we know about from the PCH file before constructing our
code-completion list.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100535 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
c7e067ddabdbf39335bdb2325abbc708cbd59e5e 06-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Make Diagnostic reference-counted, which is simpler than juggling
maybe-ownership vs. ownership.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100498 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
ompilerInstance.cpp
rontendAction.cpp
28019772db70d4547be05a042eb950bc910f134f 06-Apr-2010 Douglas Gregor <dgregor@apple.com> Make Diagnostic reference-counted, which is simpler than juggling
maybe-ownership vs. ownership.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100498 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
ompilerInstance.cpp
rontendAction.cpp
f980d86f4cf44a22403e95ab884f05fcd518ecc9 06-Apr-2010 Chris Lattner <sabre@nondot.org> Match MemoryBuffer API changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100484 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
CHReader.cpp
a0a270c0f1c0a4e3482438bdc5f4a7bd3d25f0a6 06-Apr-2010 Chris Lattner <sabre@nondot.org> Match MemoryBuffer API changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100484 91177308-0d34-0410-b5e6-96231b3b80d8
rontendAction.cpp
CHReader.cpp
0f3039072ad62586586cbef5a24faee2f1bcfd1c 05-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Clarify the ownership semantics of the Diagnostic object used by
ASTUnit. Previously, we would end up with use-after-free errors
because the Diagnostic object would be creating in one place (say,
CIndex) and its ownership would not be transferred into the
ASTUnit. Fixes <rdar://problem/7818608>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100464 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
rontendAction.cpp
3687e9d3a5dbfa9963af02a49a2b139d91310813 05-Apr-2010 Douglas Gregor <dgregor@apple.com> Clarify the ownership semantics of the Diagnostic object used by
ASTUnit. Previously, we would end up with use-after-free errors
because the Diagnostic object would be creating in one place (say,
CIndex) and its ownership would not be transferred into the
ASTUnit. Fixes <rdar://problem/7818608>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100464 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
rontendAction.cpp
ae380213277a4a1ee0ee0dd751434c4c51948992 05-Apr-2010 Douglas Gregor <doug.gregor@gmail.com> Minor ASTUnit cleanups:
- Rename "Diagnostics" and related to "StoredDiagnostics", to better
capture what we're actually storing.
- Move SourceManager and FileManager to the heap.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100441 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
405634b215f19eec7183bd8005e34aa5a02f64a1 05-Apr-2010 Douglas Gregor <dgregor@apple.com> Minor ASTUnit cleanups:
- Rename "Diagnostics" and related to "StoredDiagnostics", to better
capture what we're actually storing.
- Move SourceManager and FileManager to the heap.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100441 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
dd5363786ff4332ede0ec9794026fce405e13503 01-Apr-2010 Daniel Dunbar <daniel@zuster.org> Driver: Add support for a CLANGXX_IS_PRODUCTION build variable, which enable
Clang++ support, even in "Production" mode (for testing purposes).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100119 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5d93ed3c7a2dae0a8f422747e269963b3ef11d95 01-Apr-2010 Daniel Dunbar <daniel@zuster.org> Driver: Add support for a CLANGXX_IS_PRODUCTION build variable, which enable
Clang++ support, even in "Production" mode (for testing purposes).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100119 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
b88ea9f1d1a402b0c9479c1c71a10cf65a5d4157 31-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Reinstate my CodeModificationHint -> FixItHint renaming patch, without
the C-only "optimization".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100022 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
TMLDiagnostics.cpp
extDiagnosticPrinter.cpp
849b243d4065f56742a4677d6dc8277609a151f8 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Reinstate my CodeModificationHint -> FixItHint renaming patch, without
the C-only "optimization".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100022 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
TMLDiagnostics.cpp
extDiagnosticPrinter.cpp
725b41e4eefc6d19b6215f24489acbc2e1641765 31-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Rename TypenameType to DependentNameType in anticipation of some
refactoring work in this area.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100019 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
4714c12a1ab759156b78be8f109ea4c12213af57 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Rename TypenameType to DependentNameType in anticipation of some
refactoring work in this area.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100019 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
100fdef5f9490615be95cc921c88cdba11c36d85 31-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Revert r100008, which inexplicably breaks the clang-i686-darwin10 builder

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100018 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
TMLDiagnostics.cpp
extDiagnosticPrinter.cpp
275313cbb0847f1f117f60d144d113804d4fa42d 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Revert r100008, which inexplicably breaks the clang-i686-darwin10 builder

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100018 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
TMLDiagnostics.cpp
extDiagnosticPrinter.cpp
e885f84e7a6e363a54b9100afd1c63364808d959 31-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Rename CodeModificationHint to FixItHint, since we've been using the
term "fix-it" everywhere and even *I* get tired of long names
sometimes. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100008 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
TMLDiagnostics.cpp
extDiagnosticPrinter.cpp
d0ebe080eee7c37e73754068b47fd90cc506e128 31-Mar-2010 Douglas Gregor <dgregor@apple.com> Rename CodeModificationHint to FixItHint, since we've been using the
term "fix-it" everywhere and even *I* get tired of long names
sometimes. No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100008 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
TMLDiagnostics.cpp
extDiagnosticPrinter.cpp
2ffdc0f8242c22c4bca8bbc2390be61a8a80e4b8 31-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Remember the regparm attribute in FunctionType::ExtInfo.
Fixes PR3782.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99940 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
425ef72306d4ff6b3698b744353e5f0e56b4b884 31-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> Remember the regparm attribute in FunctionType::ExtInfo.
Fixes PR3782.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99940 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
433d7d2c70b9be3f9edd40579f512ecab8755049 30-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> the big refactoring bits of PR3782.

This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99920 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ewriteObjC.cpp
264ba48dc98f3f843935a485d5b086f7e0fdc4f1 30-Mar-2010 Rafael Espindola <rafael.espindola@gmail.com> the big refactoring bits of PR3782.

This introduces FunctionType::ExtInfo to hold the calling convention and the
noreturn attribute. The next patch will extend it to include the regparm
attribute and fix the bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99920 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ewriteObjC.cpp
3eb0bd13d535d47ac1c5235d9cfd9173fd800a53 30-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Teach Clang's -cc1 option -print-stats to print LLVM statistics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99894 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
95dd5583e3900443a1d7970d557d8c54aa320601 30-Mar-2010 Douglas Gregor <dgregor@apple.com> Teach Clang's -cc1 option -print-stats to print LLVM statistics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99894 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
16d4b975a57ec29128a54004ed0ec65eaf776670 24-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Implement support for -nostdc++. Fixes PR6446.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99417 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
4c2bcad7b843c10fd4a2ffd43da40bfefb4dc8ba 24-Mar-2010 Douglas Gregor <dgregor@apple.com> Implement support for -nostdc++. Fixes PR6446.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99417 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
nitHeaderSearch.cpp
4e23ad955904b39bf926ac393cc6100c11b64d08 23-Mar-2010 Daniel Dunbar <daniel@zuster.org> PPCallbacks: Add hook for reaching the end of the main file, and fix DependencyFile to not do work in its destructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99257 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
rontendAction.cpp
dbd8209b33e6c9f151e4913a9c095d64a95439c4 23-Mar-2010 Daniel Dunbar <daniel@zuster.org> PPCallbacks: Add hook for reaching the end of the main file, and fix DependencyFile to not do work in its destructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99257 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
rontendAction.cpp
a80645719e6a724695641d997c6f831b4ddf7177 21-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Keep track of the size/modification time of each file source-location
entry in a precompiled header, so that we can detect modified files
even when we miss in the stat cache.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99149 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2d52be56ff595341be3c6cec337af6763804ce66 21-Mar-2010 Douglas Gregor <dgregor@apple.com> Keep track of the size/modification time of each file source-location
entry in a precompiled header, so that we can detect modified files
even when we miss in the stat cache.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99149 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
e2a6a781c8824ddde4d2d8b2d92ee37cddff8732 20-Mar-2010 Daniel Dunbar <daniel@zuster.org> C++: Add support for -fno-use-cxa-atexit.
- So much typing, so little gain...

Also, rename the __cxx_global_initialization function just to match llvm-gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99039 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
efb0fa9e11f75af51744a6159530ef7cc8efa24a 20-Mar-2010 Daniel Dunbar <daniel@zuster.org> C++: Add support for -fno-use-cxa-atexit.
- So much typing, so little gain...

Also, rename the __cxx_global_initialization function just to match llvm-gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99039 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
effc786f47716410eb470ac4ed0294abe4deb3b6 19-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Remove the capture, serialization, and deserialization of comment
ranges as part of the ASTContext. This code is not and was never used,
but contributes ~250k to the size of the Cocoa.h precompiled
header.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99007 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
c6fbbedb3e90ff2f04828c36fd839e01468679f5 19-Mar-2010 Douglas Gregor <dgregor@apple.com> Remove the capture, serialization, and deserialization of comment
ranges as part of the ASTContext. This code is not and was never used,
but contributes ~250k to the size of the Cocoa.h precompiled
header.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99007 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ea1881b7369a4b0ad8b95cdced0fb0cc25b7379a 19-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Implement serialization and lazy deserialization of the preprocessing
record (which includes all macro instantiations and definitions). As
with all lay deserialization, this introduces a new external source
(here, an external preprocessing record source) that loads all of the
preprocessed entities prior to iterating over the entities.

The preprocessing record is an optional part of the precompiled header
that is disabled by default (enabled with
-detailed-preprocessing-record). When the preprocessor given to the
PCH writer has a preprocessing record, that record is written into the
PCH file. When the PCH reader is given a PCH file that contains a
preprocessing record, it will be lazily loaded (which, effectively,
implicitly adds -detailed-preprocessing-record). This is the first
case where we have sections of the precompiled header that are
added/removed based on a compilation flag, which is
unfortunate. However, this data consumes ~550k in the PCH file for
Cocoa.h (out of ~9.9MB), and there is a non-trivial cost to gathering
this detailed preprocessing information, so it's too expensive to turn
on by default. In the future, we should investigate a better encoding
of this information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99002 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
6a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bc 19-Mar-2010 Douglas Gregor <dgregor@apple.com> Implement serialization and lazy deserialization of the preprocessing
record (which includes all macro instantiations and definitions). As
with all lay deserialization, this introduces a new external source
(here, an external preprocessing record source) that loads all of the
preprocessed entities prior to iterating over the entities.

The preprocessing record is an optional part of the precompiled header
that is disabled by default (enabled with
-detailed-preprocessing-record). When the preprocessor given to the
PCH writer has a preprocessing record, that record is written into the
PCH file. When the PCH reader is given a PCH file that contains a
preprocessing record, it will be lazily loaded (which, effectively,
implicitly adds -detailed-preprocessing-record). This is the first
case where we have sections of the precompiled header that are
added/removed based on a compilation flag, which is
unfortunate. However, this data consumes ~550k in the PCH file for
Cocoa.h (out of ~9.9MB), and there is a non-trivial cost to gathering
this detailed preprocessing information, so it's too expensive to turn
on by default. In the future, we should investigate a better encoding
of this information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99002 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
4ddafccd046e2cf7ccc9b46aab21c6ac57b54edb 19-Mar-2010 Daniel Dunbar <daniel@zuster.org> clang -cc1: Kill off -empty-input only, and replace with -init-only which is an
actual action.
- This is easier to use, and more reliable for timing the thing this was
actually meant to be useful for.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98978 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
rontendActions.cpp
2758595023c5c7c0495f19260089f975022c50dc 19-Mar-2010 Daniel Dunbar <daniel@zuster.org> clang -cc1: Kill off -empty-input only, and replace with -init-only which is an
actual action.
- This is easier to use, and more reliable for timing the thing this was
actually meant to be useful for.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98978 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
rontendActions.cpp
05a9da2a3af572e6976705528bf15dce9814b440 19-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Optionally store a PreprocessingRecord in the preprocessor itself, and
tie its creation to a CC1 flag -detailed-preprocessing-record.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98963 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
94dc8f640ebea52241412512ed48601626edbc58 19-Mar-2010 Douglas Gregor <dgregor@apple.com> Optionally store a PreprocessingRecord in the preprocessor itself, and
tie its creation to a CC1 flag -detailed-preprocessing-record.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98963 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ompilerInvocation.cpp
46107079c6a804893c0df71c7aec049b1a4c70f4 18-Mar-2010 Ted Kremenek <kremenek@apple.com> Add bounds check in PCHReader. when reading source file entry record

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98873 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
1857f628cb3acc4df2cd368b8fbd7d984486a06c 18-Mar-2010 Ted Kremenek <kremenek@apple.com> Add bounds check in PCHReader. when reading source file entry record

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98873 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
d8b10596e1b3ea7346c465b19afc59f18bf00a24 18-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce the notion of a "preprocessing record", which keeps track of
the macro definitions and macro instantiations that are found
during preprocessing. Preprocessing records are *not* generated by
default; rather, we provide a PPCallbacks subclass that hooks into the
existing callback mechanism to record this activity.

The only client of preprocessing records is CIndex, which keeps track
of macro definitions and instantations so that they can be exposed via
cursors. At present, only token annotation uses these facilities, and
only for macro instantiations; both will change in the near
future. However, with this change, token annotation properly annotates
macro instantiations that do not produce any tokens and instantiations
of macros that are later undef'd, improving our consistency.

Preprocessing directives that are not macro definitions are still
handled by clang_annotateTokens() via re-lexing, so that we don't have
to track every preprocessing directive in the preprocessing record.

Performance impact of preprocessing records is still TBD, although it
is limited to CIndex and therefore out of the path of the main compiler.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98836 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
4ae8f298b1ea51b4c2234f9148e2e4349c9bdd23 18-Mar-2010 Douglas Gregor <dgregor@apple.com> Introduce the notion of a "preprocessing record", which keeps track of
the macro definitions and macro instantiations that are found
during preprocessing. Preprocessing records are *not* generated by
default; rather, we provide a PPCallbacks subclass that hooks into the
existing callback mechanism to record this activity.

The only client of preprocessing records is CIndex, which keeps track
of macro definitions and instantations so that they can be exposed via
cursors. At present, only token annotation uses these facilities, and
only for macro instantiations; both will change in the near
future. However, with this change, token annotation properly annotates
macro instantiations that do not produce any tokens and instantiations
of macros that are later undef'd, improving our consistency.

Preprocessing directives that are not macro definitions are still
handled by clang_annotateTokens() via re-lexing, so that we don't have
to track every preprocessing directive in the preprocessing record.

Performance impact of preprocessing records is still TBD, although it
is limited to CIndex and therefore out of the path of the main compiler.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98836 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
d6aa95c988048e87a0b69ab6ba7c22f4f958e8cd 18-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Make some typedefs private

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98817 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
622ab50adc847564d62dd88694166a7466a6136a 18-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Make some typedefs private

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98817 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
c97640fba22da9d3d10a9ad1b340e8d8a6bcd917 18-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Rename variable to indicate what it is being used for

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98816 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
8f0d270c7db1ccee7b56c895a1de9b8bc4599355 18-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Rename variable to indicate what it is being used for

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98816 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
df0c21f52b544a4d7ba1119a0ccef51ca17227f9 18-Mar-2010 Ted Kremenek <kremenek@apple.com> Turn several PCH reader assertions into compiler errors, thus making
the PCHReader more robust to corrupt or invalid PCH files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98788 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
d5d7b3f61f82b0fed9d6f02839bc72e528332911 18-Mar-2010 Ted Kremenek <kremenek@apple.com> Turn several PCH reader assertions into compiler errors, thus making
the PCHReader more robust to corrupt or invalid PCH files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98788 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
7be95146135fbf8399324f631f0115f74c62ae19 17-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Entering the main source file in the preprocessor can fail if the
source file has been changed. Handle that failure more gracefully.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98727 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
rontendActions.cpp
rintPreprocessedOutput.cpp
ewriteMacros.cpp
dbf8ee630e4c86e5150492eaf8dbceea3c718ee1 17-Mar-2010 Douglas Gregor <dgregor@apple.com> Entering the main source file in the preprocessor can fail if the
source file has been changed. Handle that failure more gracefully.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98727 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
rontendActions.cpp
rintPreprocessedOutput.cpp
ewriteMacros.cpp
f30c18fc88610d545486078265516b893f2d5314 17-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Simplify error path using OwningPtr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98722 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
69247139f5ce3edf46c48344129792b3a05d090a 17-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Simplify error path using OwningPtr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98722 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
523b4cb03581c20983589e520b1461853aa022d2 17-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Simplify ProcessWarningOptions since it can't fail

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98721 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
arnings.cpp
5bf932bd0d5db98273938675dbf81cbb2f5ffff7 17-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Simplify ProcessWarningOptions since it can't fail

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98721 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
arnings.cpp
b21cedc32e3bcb010ab2d0f3e095fd863db38b5f 17-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Issue a proper diagnostic if we couldn't open dump file

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98719 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
3d67b1e25847319a5a271f9d5a8d607ef18d804a 17-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Issue a proper diagnostic if we couldn't open dump file

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98719 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
b06a921ba2a847493b0e1bec7b4b90598e3f89fc 17-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Don't "take" the file manager and source manager when
ASTUnit::LoadFromCompilerInvocation() fails to create target
information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98697 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
19b43e1ba9324cb08b730fa38d9be865e63771a2 17-Mar-2010 Douglas Gregor <dgregor@apple.com> Don't "take" the file manager and source manager when
ASTUnit::LoadFromCompilerInvocation() fails to create target
information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98697 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5c5fda70548e133a6f9189adf71e685118a81281 16-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Make sure we actually override ReadHeaderFileInfo when we meant to

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98655 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ec1afbfd8e880d0169aab0ececa2e7e1611f4955 16-Mar-2010 Douglas Gregor <dgregor@apple.com> Make sure we actually override ReadHeaderFileInfo when we meant to

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98655 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a4b6668060ff348c352839427da6cb7b3b6f808f 16-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Fix header-search problems with precompiled headers, where the
presence or absence of header map arguments when using the precompiled
header would cause Clang to get confused about which headers had
already been included/imported, along with their controlling
macros. The fundamental problem is that the serialization of the
header search information was relying on the UIDs of FileEntry objects
at PCH generation time and PCH load time to be equivalent, which
effectively means that we had to probe the same files in the same
order. Differing header map arguments caused an extra FileEntry
lookup, but it's easy to imagine other minor command-line arguments
triggering this problem.

Header-search information is now encoded along with the
source-location entry for a file, so that we register information
about a file's properties as a header at the same time we create the
FileEntry for that file.

Fixes <rdar://problem/7743243>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98636 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
12fab31aa5868b1a6b52246b5a87daa48a338fe2 16-Mar-2010 Douglas Gregor <dgregor@apple.com> Fix header-search problems with precompiled headers, where the
presence or absence of header map arguments when using the precompiled
header would cause Clang to get confused about which headers had
already been included/imported, along with their controlling
macros. The fundamental problem is that the serialization of the
header search information was relying on the UIDs of FileEntry objects
at PCH generation time and PCH load time to be equivalent, which
effectively means that we had to probe the same files in the same
order. Differing header map arguments caused an extra FileEntry
lookup, but it's easy to imagine other minor command-line arguments
triggering this problem.

Header-search information is now encoded along with the
source-location entry for a file, so that we register information
about a file's properties as a header at the same time we create the
FileEntry for that file.

Fixes <rdar://problem/7743243>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98636 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
12f7326e2cbd006859816b79326e9e665f902213 16-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Switch another function to StringRef instead of char pointer pairs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98631 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
ceafc4b63599d14f0b5b10ff92e22bf242682dce 16-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Switch another function to StringRef instead of char pointer pairs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98631 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
5fb9b355e182d1ec046cdc061855d3ffb691e967 16-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Let SourceManager::getBufferData return StringRef instead of a pair of two const char*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98630 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
extDiagnosticPrinter.cpp
f6ac97b101c8840efa92bf29166077ce4049e293 16-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Let SourceManager::getBufferData return StringRef instead of a pair of two const char*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98630 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
extDiagnosticPrinter.cpp
25460408052b508d9d60153a4d29ba881758a1d5 16-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Don't consume tokens past the end-of-file in an @interface. Fixes
<rdar://problem/7735566>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98613 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
c3d43b783dfb1a1502aa8b31ab1985cf237b1f77 16-Mar-2010 Douglas Gregor <dgregor@apple.com> Don't consume tokens past the end-of-file in an @interface. Fixes
<rdar://problem/7735566>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98613 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
331eb3639454b3470a666553cd798f32a42a9c2e 16-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Use SourceManager's Diagnostic object for all file-reading errors,
simplifying the SourceManager interfaces somewhat.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98598 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
CHWriter.cpp
36c35ba0aca641e60e5dbee8efbc620c08b9bd61 16-Mar-2010 Douglas Gregor <dgregor@apple.com> Use SourceManager's Diagnostic object for all file-reading errors,
simplifying the SourceManager interfaces somewhat.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98598 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
CHWriter.cpp
40e0148c249727d064c9aef48aca7c896c8d21c1 16-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Give SourceManager a Diagnostic object with which to report errors,
and start simplifying the interfaces in SourceManager that can fail.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98594 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ewriteObjC.cpp
extDiagnosticPrinter.cpp
f715ca12bfc9fddfde75f98a197424434428b821 16-Mar-2010 Douglas Gregor <dgregor@apple.com> Give SourceManager a Diagnostic object with which to report errors,
and start simplifying the interfaces in SourceManager that can fail.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98594 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ewriteObjC.cpp
extDiagnosticPrinter.cpp
72898076bbfe83ff42f2c478fb10e5391948123b 15-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a new BufferResult class to act as the return type of
SourceManager's getBuffer() (and similar) operations. This abstract
can be used to force callers to cope with errors in getBuffer(), such
as missing files and changed files. Fix a bunch of callers to use the
new interface.

Add some very basic checks for file consistency (file size,
modification time) into ContentCache::getBuffer(), although these
checks don't help much until we've updated the main callers (e.g.,
SourceManager::getSpelling()).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98585 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
extDiagnosticPrinter.cpp
aea67dbd653a2dd6dd5cc2159279e81e855b2482 15-Mar-2010 Douglas Gregor <dgregor@apple.com> Introduce a new BufferResult class to act as the return type of
SourceManager's getBuffer() (and similar) operations. This abstract
can be used to force callers to cope with errors in getBuffer(), such
as missing files and changed files. Fix a bunch of callers to use the
new interface.

Add some very basic checks for file consistency (file size,
modification time) into ContentCache::getBuffer(), although these
checks don't help much until we've updated the main callers (e.g.,
SourceManager::getSpelling()).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98585 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
extDiagnosticPrinter.cpp
3dace0b21f73ddaca879ac59890b33a12cfa509e 15-Mar-2010 John McCall <rjmccall@apple.com> Add support for -Wwrite-strings. Patch by Mike M! Fixes PR 4804.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98541 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
4b7a834e0fecddd9eaf1f4567867c718e4eebf50 15-Mar-2010 John McCall <rjmccall@apple.com> Add support for -Wwrite-strings. Patch by Mike M! Fixes PR 4804.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98541 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e88b6e3c31125b4bb55d60aa3b982735d308c792 15-Mar-2010 John McCall <rjmccall@apple.com> Remember declaration scope qualifiers in the AST. Imposes no memory overhead
on unqualified declarations.

Patch by Enea Zaffanella! Minimal adjustments: allocate the ExtInfo nodes
with the ASTContext and delete them during Destroy(). I audited a bunch of
Destroy methods at the same time, to ensure that the correct teardown was
being done.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98540 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
b6217665c6a987f2d6c8665fd70365d7719ac4df 15-Mar-2010 John McCall <rjmccall@apple.com> Remember declaration scope qualifiers in the AST. Imposes no memory overhead
on unqualified declarations.

Patch by Enea Zaffanella! Minimal adjustments: allocate the ExtInfo nodes
with the ASTContext and delete them during Destroy(). I audited a bunch of
Destroy methods at the same time, to ensure that the correct teardown was
being done.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98540 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
ae9115a4f02a70ee5b2c85ae0ec1a6cdd157e41d 14-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Add EmitString helper method

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98488 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
c3cde071b41ca83e43de8dc2abe9a99f77a9ebb8 14-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Add EmitString helper method

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98488 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
738555ca3005c529b4725e72ebd54ca58ec1c93f 14-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Unbreak last commit. This should have been part of r98478.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98480 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
2e6051ad0149c0e7b626558c110fba29bfc754cd 14-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Unbreak last commit. This should have been part of r98478.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98480 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
68a89bdbb677942ac529f2d6ec27392e5dbae6d8 14-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Pass file string by reference

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98478 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
74e485e74e82ad2eefc546fbd32cb0a0274b0d1e 14-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Pass file string by reference

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98478 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
7ab6a0223ed68a576b77012cfade9b7c041c8f7a 14-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Path related cleanup. Remove unnecessary variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98473 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
aba54a95e9d5e4dc9056abec6bb70ea777c4a7bc 14-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Path related cleanup. Remove unnecessary variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98473 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
3a9aacf9092d478daf02df45b834ac92c1c06911 14-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Use makeAbsolute()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98472 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
CHWriter.cpp
11a18f115e8974ef24e8d5bb549ed3289871efa4 14-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Use makeAbsolute()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98472 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
CHWriter.cpp
ed8d285915a1d74cdb284529e471c84d61322f90 14-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Move to anonymous namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98469 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
48673e68832e9fb508401d53a63cf46481cd7f7c 14-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Move to anonymous namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98469 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
f1d81aa33c9118954f4d3de771db18dc9fa26005 13-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Simplify code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98437 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
92d6cd2eb7594a0cfc9a14364eb2b1a6feca0417 13-Mar-2010 Benjamin Kramer <benny.kra@googlemail.com> Simplify code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98437 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
6dbd14d0949144ebc64cd964b74c1b872e62b019 13-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Use SmallString instead of SmallVector

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98436 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
rintPreprocessedOutput.cpp
extDiagnosticPrinter.cpp
193575455e00eca03fd7177f60e3f2e6263cb661 13-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Use SmallString instead of SmallVector

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98436 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
rintPreprocessedOutput.cpp
extDiagnosticPrinter.cpp
b25d92a0c3fb49d7ce25ddb2092dd066555f7afb 13-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> No need to call setIdentifierInfo() after LookUpIdentifierInfo() which LookUpIdentifierInfo() will automatically do

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98435 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
ewriteMacros.cpp
65cc1e889c0c2c617a81a0ae032fa4fb24760f38 13-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> No need to call setIdentifierInfo() after LookUpIdentifierInfo() which LookUpIdentifierInfo() will automatically do

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98435 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
ewriteMacros.cpp
27c4182d9c44e33a144944a4123b5bc6d6d7a854 12-Mar-2010 Jeffrey Yasskin <jyasskin@google.com> Allow users to set CPPFLAGS and CXXFLAGS on the make command line.

Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98399 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
3352406820d133c78161e8d710f95b8ac152a1e7 12-Mar-2010 Jeffrey Yasskin <jyasskin@google.com> Allow users to set CPPFLAGS and CXXFLAGS on the make command line.

Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98399 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
5570021146ec9ed50c891a0af626fec316db896f 12-Mar-2010 John McCall <rjmccall@apple.com> Remember whether a ParmVarDecl was spelled with a default argument or
whether it inherited one from a previous declaration.

Patch by Enea Zaffanella!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98362 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
bf73b352acb7a2d041ce8b50171dd7f8e2b2c1bb 12-Mar-2010 John McCall <rjmccall@apple.com> Remember whether a ParmVarDecl was spelled with a default argument or
whether it inherited one from a previous declaration.

Patch by Enea Zaffanella!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98362 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
a77101d10a81e558346c1a7b9ed5b6f6ecc06c07 12-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Add IdentifierTable::get() overload and start using it

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98343 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
811f4267aa1ebd727c31594b8ed94048e2c10ad6 12-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Add IdentifierTable::get() overload and start using it

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98343 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
8d766796bdcdde4476d8b2c618a1bde8b3d7f058 11-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Add tentative support for accessing local variables with
external linkage (static, extern, etc.) in blocks in
rewriter. wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98265 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
6cb6eb4c792b504ad652d9230640656852e18ee9 11-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Add tentative support for accessing local variables with
external linkage (static, extern, etc.) in blocks in
rewriter. wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98265 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
2120dada22768f405b73913c55a2c18983e4a60d 10-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Change the 'super' messaging API in the rewriter.
Fixes radar 7738452.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98190 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
d314e9e12326c2fd8f140adc4c769d13b483b3f6 10-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Change the 'super' messaging API in the rewriter.
Fixes radar 7738452.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98190 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
55851d6d117e79db3a891bcb821acd19592b2178 10-Mar-2010 John McCall <rjmccall@apple.com> Create a new InjectedClassNameType to represent bare-word references to the
injected class name of a class template or class template partial specialization.
This is a non-canonical type; the canonical type is still a template
specialization type. This becomes the TypeForDecl of the pattern declaration,
which cleans up some amount of code (and complicates some other parts, but
whatever).

Fixes PR6326 and probably a few others, primarily by re-establishing a few
invariants about TypeLoc sizes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98134 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
3cb0ebd5f76abcb776f7cb4062bd79e3268c0dc4 10-Mar-2010 John McCall <rjmccall@apple.com> Create a new InjectedClassNameType to represent bare-word references to the
injected class name of a class template or class template partial specialization.
This is a non-canonical type; the canonical type is still a template
specialization type. This becomes the TypeForDecl of the pattern declaration,
which cleans up some amount of code (and complicates some other parts, but
whatever).

Fixes PR6326 and probably a few others, primarily by re-establishing a few
invariants about TypeLoc sizes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98134 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
f632112b74a7bf5cf966420526faaa6f299ca6e5 08-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Improve XML output for C++ classes, from Olaf Krzikalla!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97954 91177308-0d34-0410-b5e6-96231b3b80d8
eclXML.cpp
07425c9ae12e62572eebc541522c70a73a819c2b 08-Mar-2010 Douglas Gregor <dgregor@apple.com> Improve XML output for C++ classes, from Olaf Krzikalla!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97954 91177308-0d34-0410-b5e6-96231b3b80d8
eclXML.cpp
f03f5f6c50378476d7fd10edfa0ed8f4c01e38da 08-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Extend ObjCMessageExpr for class method sends with the source location
of the class name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97943 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
c2350e553b853ad00914faf23fa731e5fc4a8a5c 08-Mar-2010 Douglas Gregor <dgregor@apple.com> Extend ObjCMessageExpr for class method sends with the source location
of the class name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97943 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
44032ab343048030bd4332b3e5ccb59974908918 08-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Keep track of type source information in the return type of an
Objective-C method declaration, e.g., for

- (Foo *)myMethod;

we now have TypeSourceInfo for the Foo*.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97942 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
4bc1cb6aa635a5bf8fae99bf69c56c724c1e786c 08-Mar-2010 Douglas Gregor <dgregor@apple.com> Keep track of type source information in the return type of an
Objective-C method declaration, e.g., for

- (Foo *)myMethod;

we now have TypeSourceInfo for the Foo*.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97942 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
1dfbacec5aecc089fbe19b3898d92b94863cb571 07-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Undefine correct macro

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97920 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
6b82f642ba3530b6201a6632ae8d317f836af7e2 07-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Undefine correct macro

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97920 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
d6b88d8f8285aaac66bae281e87e4331b0ed3e7f 07-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Don't rely on implicit conversion

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97916 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
c8e5eacaaf8174cc5cd2168ae7bede54bea83787 07-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Don't rely on implicit conversion

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97916 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
43c2d99f703df1da9b6fd52e46f9c53990250ca4 07-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Rename to addPPCallbacks since we're effectively adding a callback and maybe chaining it to an existing one

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97913 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
rintPreprocessedOutput.cpp
a5d10c4df435964600e104ebef6a96b106e416b7 07-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Rename to addPPCallbacks since we're effectively adding a callback and maybe chaining it to an existing one

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97913 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
rintPreprocessedOutput.cpp
8f36186da187ea55dc2f5151632f5ab66bf52ed6 07-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Don't assert if PP already contains a valid PP callback. The PP can handle multiple callbacks (using PPChainedCallbacks)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97910 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
92e4443fcc4a349f061b651a1aa7a5862268cbf9 07-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Don't assert if PP already contains a valid PP callback. The PP can handle multiple callbacks (using PPChainedCallbacks)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97910 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
a35307ef30271214da9a076522e665833e70ffe1 06-Mar-2010 Chris Lattner <sabre@nondot.org> on both the mac and linux, /usr/local/include is treated
as a "C++ Friendly" system header directory. This fixes
PR6523.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97885 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
fc904d5b8bfa8fccca0ead0051e3f9e4374f6e7a 06-Mar-2010 Chris Lattner <sabre@nondot.org> on both the mac and linux, /usr/local/include is treated
as a "C++ Friendly" system header directory. This fixes
PR6523.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97885 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
29a293a8c5e1679cfdfdbd598d989ede5720eff5 06-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Lowercase for consistency

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97878 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendAction.cpp
e51dd7be67808d52c80c09b832d875e9655ce6e0 06-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Lowercase for consistency

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97878 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendAction.cpp
cbc507a3f3660cfa5f3e5e745411b7a4efcf6183 05-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> The Windows build is just too weird; there's no real cost to doing the concurrency checks for ASTUnit in all builds

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97840 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
667514d92afd1485765cb4e2bbe452883adc989b 05-Mar-2010 Douglas Gregor <dgregor@apple.com> The Windows build is just too weird; there's no real cost to doing the concurrency checks for ASTUnit in all builds

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97840 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
4ae8f6b1ae99f3c56057508e840a8d00dcc0e755 05-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> Switch from NDEBUG to _DEBUG, since our Windows build is funny

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97835 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
12312b807e7c00504c2e5b3b5e2d11bfbca4b8d8 05-Mar-2010 Douglas Gregor <dgregor@apple.com> Switch from NDEBUG to _DEBUG, since our Windows build is funny

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97835 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
827cd390c1e7909937b6c1354a5f6befa1e132ce 05-Mar-2010 Douglas Gregor <doug.gregor@gmail.com> A little hack to identify unwanted concurrency in CIndex

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97831 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
bdf6062bc10aa3b73b16402b440b8073310acd06 05-Mar-2010 Douglas Gregor <dgregor@apple.com> A little hack to identify unwanted concurrency in CIndex

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97831 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c52b146d9401911691be694b7495ab7d899dae35 05-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Use clang::io::Emit8

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97810 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
fbcc071d63d82cbe4f197843ce369b70c2fc1c1d 05-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Use clang::io::Emit8

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97810 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
6ca15ed9e605f663bc13432a2cb572eca4b6a7e5 04-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to get around a rewriter bug rewriting storage class
on a block API struct definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97754 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
8611eb02e8296bd31ffa31b6eafefd76dd1e299c 04-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to get around a rewriter bug rewriting storage class
on a block API struct definition.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97754 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
adc83b04882581471c09c149802e23abd6d77b9c 04-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a bug whereby static const block var has static
moved incorrectly. (radar 7714443).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97734 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
61b82e3ed67d9c02d8cc0a8c5976e5fb7fad12a8 04-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a bug whereby static const block var has static
moved incorrectly. (radar 7714443).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97734 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
f889e52574b00be87e112ae29e2bc57db24f78e7 04-Mar-2010 John McCall <rjmccall@apple.com> Revert changes r97693, r97700, and r97718.

Our testing framework can't deal with disabled targets yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97719 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
468ec6c0266e48fccb26ce50d5b915c645bb3c7b 04-Mar-2010 John McCall <rjmccall@apple.com> Revert changes r97693, r97700, and r97718.

Our testing framework can't deal with disabled targets yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97719 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
bbdb752100cfd5649ea5e1264e5be51950bdac25 04-Mar-2010 John McCall <rjmccall@apple.com> Create a TargetMachine whenever we create a CodeGenAction. The codegen of
some builtins will rely on target knowledge.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97693 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
c9fe644675503894e9e76e8ecd8e6519426548de 04-Mar-2010 John McCall <rjmccall@apple.com> Create a TargetMachine whenever we create a CodeGenAction. The codegen of
some builtins will rely on target knowledge.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97693 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
74abf65ab609dc6a480b6c2147a40e1f3b1f4b3d 04-Mar-2010 Eric Christopher <echristo@apple.com> Remove the linux c includes part of my last patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97679 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
8383c554cde943ffcf678e5394a1a616d150b84d 04-Mar-2010 Eric Christopher <echristo@apple.com> Remove the linux c includes part of my last patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97679 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
3d0c86549de3b416504db398517d199e88abf0ca 03-Mar-2010 Eric Christopher <echristo@apple.com> Add in more c++ header paths for later gccs under gentoo linux.
Add in c header path for various linuxes as well.

Partial patch from Christian Adåker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97666 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
70d9d4196e6531926ca18b2ca850eb218041488d 03-Mar-2010 Eric Christopher <echristo@apple.com> Add in more c++ header paths for later gccs under gentoo linux.
Add in c header path for various linuxes as well.

Partial patch from Christian Adåker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97666 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
4eb288f0e3e0faefaad0df73ab5cfba8fa260d28 02-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Move Emit24 to clang::io

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97569 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
be08ac7afbb2aca5f6718687787658a928599b21 02-Mar-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Move Emit24 to clang::io

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97569 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
c571039bb9322f8e5b1424913f7c1223ceee9dc6 02-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Cast a pointer to 'long long' to satisfy all compilation models.
Satisfies radar 7703202.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97532 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
df496529b7009d6e58f335926884200b38d27687 02-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> Cast a pointer to 'long long' to satisfy all compilation models.
Satisfies radar 7703202.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97532 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
6868159826b0744f34af0970025ab04ab61a47d6 02-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> More rewriter of nested blocks fun stuff.
Radar 7696893.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97520 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
72952fc11f80c975492a2a1e0f6e3601c5252e0a 02-Mar-2010 Fariborz Jahanian <fjahanian@apple.com> More rewriter of nested blocks fun stuff.
Radar 7696893.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97520 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
08b3ab0beb24ff8122288df69e777dd46f8cd2af 28-Feb-2010 Dan Gohman <gohman@apple.com> Opt into the Verifier now that it's an opt-in feature of
addPassesToEmitFile.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97358 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
d68fc055e17e8b01ac824d8ab749bc169fc4b93d 28-Feb-2010 Dan Gohman <gohman@apple.com> Opt into the Verifier now that it's an opt-in feature of
addPassesToEmitFile.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97358 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
185752bda44ea81980f2fa357c7a7d4a8dce6bce 27-Feb-2010 Nick Lewycky <nicholas@mxc.ca> Debian sid moved these headers into /4.4 and left /4.4.3 as a symlink. Update.
Also, add support for 32-bit x86 Debian sid.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97347 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
e69f047a6c882ce36bd260a8fed0ae31114a5a7e 27-Feb-2010 Nick Lewycky <nicholas@mxc.ca> Debian sid moved these headers into /4.4 and left /4.4.3 as a symlink. Update.
Also, add support for 32-bit x86 Debian sid.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97347 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
fd8b445e618c372011a73529219b5a2b5f6963b4 27-Feb-2010 Benjamin Kramer <benny.kra@googlemail.com> Revert 97324. Chris says this cleanup could hurt -E performance.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97331 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
e396007efa010568d7ac7dff15762aec7653fc63 27-Feb-2010 Benjamin Kramer <benny.kra@googlemail.com> Revert 97324. Chris says this cleanup could hurt -E performance.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97331 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
d6bcf2eac7239476fe2167614cf9ebf2e168756a 27-Feb-2010 Benjamin Kramer <benny.kra@googlemail.com> Simplify code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97324 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
8caa6c56b1c0047deb690f764265a35800572d50 27-Feb-2010 Benjamin Kramer <benny.kra@googlemail.com> Simplify code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97324 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
62755a5da7e2f51f0d1794024f58bd3797457dd6 27-Feb-2010 Benjamin Kramer <benny.kra@googlemail.com> Add an overload of Preprocessor::getSpelling which takes a SmallVector and
returns a StringRef. Use it to simplify some repetitive code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97322 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
ddeea5644367c9c153c9fee9e51bdea85ce43cbd 27-Feb-2010 Benjamin Kramer <benny.kra@googlemail.com> Add an overload of Preprocessor::getSpelling which takes a SmallVector and
returns a StringRef. Use it to simplify some repetitive code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97322 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
062b3674fbc078a2612c77ea07b2670cfdac3477 27-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> When given unsaved files in clang_createTranslationUnitFromSourceFile,
copy the source buffers provided rather than referencing them
directly, so that the caller can free those buffers immediately after
calling clang_createTranslationUnitFromSourceFile(). Otherwise, we
risk hitting those buffers later (when building source ranges, forming
diagnostics, etc.).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97296 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
nitPreprocessor.cpp
c8dfe5ece04e683106eb96c58a2999f70b53ac21 27-Feb-2010 Douglas Gregor <dgregor@apple.com> When given unsaved files in clang_createTranslationUnitFromSourceFile,
copy the source buffers provided rather than referencing them
directly, so that the caller can free those buffers immediately after
calling clang_createTranslationUnitFromSourceFile(). Otherwise, we
risk hitting those buffers later (when building source ranges, forming
diagnostics, etc.).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97296 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
nitPreprocessor.cpp
61ff493ed6408cdbc78d12b3829870682bbe4fa2 26-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Prevent rewriter crash when variable type is missing.
Fixes radar 7692183.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97281 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
d64a4f4798907495091daf2b081c3d62d729dca9 26-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Prevent rewriter crash when variable type is missing.
Fixes radar 7692183.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97281 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
241d509a3326be42b89a7566d0e51ae33a266ffa 26-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Minor cleanup of the rewriter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97280 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
1276bfe0cec18a8b07226797f410b7506005269d 26-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Minor cleanup of the rewriter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97280 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
800fa4832ac05eb4b27656e9bf32fb62858ada77 26-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Removed some unused code in rewriter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97274 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
5b011b050e764fe1c2a38bd81b386fc6e66eeb93 26-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Removed some unused code in rewriter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97274 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
98bf59bb6c63361a85b721b4e961dd8e2277df2b 26-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix rewriting of byref variables in nested blocks.
Fixes radar 7692350.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97254 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
f89c4270c94ddd966819fe6b8306aa572d1e5d83 26-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix rewriting of byref variables in nested blocks.
Fixes radar 7692350.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97254 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
b45ebc5e3282fc56f1a3fb6335d0e9e01217e6a8 26-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Rewriting of imported variable from outer
blocks's argument in the inner block requires special treatment.
Fixes radar 7692419.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97244 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
e7c5c93e37ad2db5d1bc0b11a3d67c346c02de8a 26-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Rewriting of imported variable from outer
blocks's argument in the inner block requires special treatment.
Fixes radar 7692419.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97244 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
99f8cf758725613dc470b4931dcd287bf6de587b 26-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Support rewriting of property synthesis with retain/copy
attributes. Fixes radar 7214439.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97203 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
7c63fddad600e710042fa018768807bd04eaa233 26-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Support rewriting of property synthesis with retain/copy
attributes. Fixes radar 7214439.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97203 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
c82b30d60137ab0f87ac75a1078c8f3285f7b630 25-Feb-2010 Daniel Dunbar <daniel@zuster.org> Move ~CodeGenAction out-of-line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97166 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
9ad1c0205ec478d64b3ed6d3dde5efaa9c9932c5 25-Feb-2010 Daniel Dunbar <daniel@zuster.org> Move ~CodeGenAction out-of-line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97166 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
83ffe9aa9cdbaaccf08a0907544015278b7d0d16 25-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Update CMake makefiles

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97113 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
cdfe268463ed743a5c258ed33490371b798733a1 25-Feb-2010 Douglas Gregor <dgregor@apple.com> Update CMake makefiles

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97113 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
2a0f7e6f0d52ccefe975e742e1f5cbc12d326c84 25-Feb-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Add CodeGenAction::takeModule().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97111 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
b954e98893505d401acddac42650a81b83d8dc39 25-Feb-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Add CodeGenAction::takeModule().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97111 91177308-0d34-0410-b5e6-96231b3b80d8
odeGenAction.cpp
862caa4ea60245bec0c4355ad0ada4ef99248b56 25-Feb-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Pull CodeGenAction out more, and eliminate CreateBackendConsumer.

This is the way I would like to move the frontend function towards -- distinct
pieces of functionality should be exposed only via FrontendAction
implementations which have clean and relatively-stable APIs.

This also isolates the surface area in clang which depends on LLVM CodeGen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97110 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
odeGenAction.cpp
rontendActions.cpp
4ee34616c6fa7700e27c0a5311718d844cbb7d2c 25-Feb-2010 Daniel Dunbar <daniel@zuster.org> Frontend: Pull CodeGenAction out more, and eliminate CreateBackendConsumer.

This is the way I would like to move the frontend function towards -- distinct
pieces of functionality should be exposed only via FrontendAction
implementations which have clean and relatively-stable APIs.

This also isolates the surface area in clang which depends on LLVM CodeGen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97110 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
odeGenAction.cpp
rontendActions.cpp
2d70af2a2e753b67f986c7ed8611d7bc25344040 25-Feb-2010 Daniel Dunbar <daniel@zuster.org> Add TextDiagnosticPrinter::setPrefix, for adding a string to prefix diagnostic
messages with.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97101 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
b96b6709fbf5044ab06223ebfefccd58d7aaa88b 25-Feb-2010 Daniel Dunbar <daniel@zuster.org> Add TextDiagnosticPrinter::setPrefix, for adding a string to prefix diagnostic
messages with.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97101 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
e498459ff332eb2dab8e61758cb1e5a3370ae613 24-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Implement nasty rewriting of nested blocks when inner
blocks use variables not used in any of the outer blocks.
(Fixes radar 7682149).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97073 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
5e49b2f3e0bbc583076fe8af00dff06bcba06daf 24-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Implement nasty rewriting of nested blocks when inner
blocks use variables not used in any of the outer blocks.
(Fixes radar 7682149).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97073 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
c3ed122ddf5bec2b0f341fcf9b238b5e87a72834 24-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix rewriting of a method when return type is
a block pointer type. Fixes radar 7682149.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97008 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
86aa9fdbb542300059977348518eaf3067c508fd 24-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix rewriting of a method when return type is
a block pointer type. Fixes radar 7682149.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97008 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
76741ab2cc358fa7b9287607d06b171ae9691d6b 23-Feb-2010 Rafael Espindola <rafael.espindola@gmail.com> Add support for the weakref attribute. We still produce "alias weak" as llvm-gcc does, but are more strict on what uses of weakref we accept.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96992 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
11e8ce7380856abee188b237c2600272df2ed09d 23-Feb-2010 Rafael Espindola <rafael.espindola@gmail.com> Add support for the weakref attribute. We still produce "alias weak" as llvm-gcc does, but are more strict on what uses of weakref we accept.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96992 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
cd160464e8dac43b7cd0c64dc068c8fb617a5eae 23-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a rewriting of qualified-id type which exposed a bigger
rewriting problem. Fixes radar 7680953.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96987 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
5f1c45f7c8422bd80bdc76b743fd7516f2126d83 23-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a rewriting of qualified-id type which exposed a bigger
rewriting problem. Fixes radar 7680953.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96987 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
46ce8391575899b087cb1060f5ac7c3d79a34fee 22-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a rewriting of byref variable when its initializer is
itself rewritten. Radar 7669784.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96798 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
1d35b168348a308696d1fce29a18c14143f61d6a 22-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a rewriting of byref variable when its initializer is
itself rewritten. Radar 7669784.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96798 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
e08f580e7d5f1a9f88448d269395f7a51971d729 21-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Eliminate the default arguments to ASTContext::getFunctionType(),
fixing up a few callers that thought they were propagating NoReturn
information but were in fact saying something about exception
specifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96766 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
ce056bcaa1c97b89a4b2de2112c62d060863be2b 21-Feb-2010 Douglas Gregor <dgregor@apple.com> Eliminate the default arguments to ASTContext::getFunctionType(),
fixing up a few callers that thought they were propagating NoReturn
information but were in fact saying something about exception
specifications.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96766 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
4906ddb118727fae0bfce803eb4c6cdcacce3070 21-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement PCH support for C++ namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96738 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
0cef483f3b9d6a7f9fdbc5910d0a3ed64130e8e1 21-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement PCH support for C++ namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96738 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
38e9420d42304844bf68550a9270d00408b976f8 19-Feb-2010 Ted Kremenek <kremenek@apple.com> Revert: "Change InitListExpr to allocate the array for holding references"

This was causing buildbot breakage.

This reverts commit d46e952cc8cb8d9eed8657d9a0b267910a0f745a.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96652 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
ewriteObjC.cpp
ba7bc5584b8d46f4e8deb3a9d363256908fa86ea 19-Feb-2010 Ted Kremenek <kremenek@apple.com> Revert: "Change InitListExpr to allocate the array for holding references"

This was causing buildbot breakage.

This reverts commit d46e952cc8cb8d9eed8657d9a0b267910a0f745a.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96652 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
ewriteObjC.cpp
107572e5f29b64120958bb208e76754099cc4dab 19-Feb-2010 John McCall <rjmccall@apple.com> Re-introduce the ctor/dtor alias optimization, this time hidden behind a
command-line option which defaults off.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96649 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d46f98573ba104eda102dd3224b2dca69f1c6336 19-Feb-2010 John McCall <rjmccall@apple.com> Re-introduce the ctor/dtor alias optimization, this time hidden behind a
command-line option which defaults off.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96649 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
b17fe9006135d1e6b6d7b545a772b9042c671c0b 19-Feb-2010 Ted Kremenek <kremenek@apple.com> Change InitListExpr to allocate the array for holding references
to initializer expressions in an array allocated using ASTContext.

This plugs a memory leak when ASTContext uses a BumpPtrAllocator to
allocate memory for AST nodes.

In my mind this isn't an ideal solution; it would be nice to have
a general "vector"-like class that allocates memory using ASTContext,
but whose guts could be separated from the methods of InitListExpr
itself. I haven't gone and taken this approach yet because it isn't
clear yet if we'll eventually want an alternate solution for recylcing
memory using by InitListExprs as we are constructing the ASTs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96642 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
ewriteObjC.cpp
9f9269e810bfe9aea0a57b09250be215808fc1a2 19-Feb-2010 Ted Kremenek <kremenek@apple.com> Change InitListExpr to allocate the array for holding references
to initializer expressions in an array allocated using ASTContext.

This plugs a memory leak when ASTContext uses a BumpPtrAllocator to
allocate memory for AST nodes.

In my mind this isn't an ideal solution; it would be nice to have
a general "vector"-like class that allocates memory using ASTContext,
but whose guts could be separated from the methods of InitListExpr
itself. I haven't gone and taken this approach yet because it isn't
clear yet if we'll eventually want an alternate solution for recylcing
memory using by InitListExprs as we are constructing the ASTs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96642 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
ewriteObjC.cpp
292f520b74b449be401d37c8da567d631dbb8b96 19-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Patch removes IVars list from ObjCInterfaceDecl and
instead relies on their DeclContext for iteration, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96638 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
ewriteObjC.cpp
11062e11236b7bc689dad150e8b490fd6b063ec3 19-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Patch removes IVars list from ObjCInterfaceDecl and
instead relies on their DeclContext for iteration, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96638 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
ewriteObjC.cpp
732a7dec07e5869f6b1de0faabc899e1a2449a6d 19-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Teach ASTUnit to keep track of temporary files, then delete them when
the ASTUnit itself is destroyed. Fixes <rdar://problem/7649385>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96628 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
313e26c4e81f0e467490a530548450f4c824a6c4 19-Feb-2010 Douglas Gregor <dgregor@apple.com> Teach ASTUnit to keep track of temporary files, then delete them when
the ASTUnit itself is destroyed. Fixes <rdar://problem/7649385>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96628 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
8a981127d8f98521c9275a059fee3461e3be0f92 18-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Rework how CIndex handles diagnostics. Rather than using a callback,
we attach diagnostics to translation units and code-completion
results, so they can be queried at any time.

To facilitate this, the new StoredDiagnostic class stores a diagnostic
in a serializable/deserializable form, and ASTUnit knows how to
capture diagnostics in this stored form. CIndex's CXDiagnostic is a
thin wrapper around StoredDiagnostic, providing a C interface to
stored or de-serialized diagnostics.

I've XFAIL'd one test case temporarily, because currently we end up
storing diagnostics in an ASTUnit that's never returned to the user
(because it contains errors). I'll introduce a temporary fix for this
soon; the real fix will be to allow us to return and query invalid ASTs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96592 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
a88084b78fd4ca5d3d858c14b02414f8cc399f02 18-Feb-2010 Douglas Gregor <dgregor@apple.com> Rework how CIndex handles diagnostics. Rather than using a callback,
we attach diagnostics to translation units and code-completion
results, so they can be queried at any time.

To facilitate this, the new StoredDiagnostic class stores a diagnostic
in a serializable/deserializable form, and ASTUnit knows how to
capture diagnostics in this stored form. CIndex's CXDiagnostic is a
thin wrapper around StoredDiagnostic, providing a C interface to
stored or de-serialized diagnostics.

I've XFAIL'd one test case temporarily, because currently we end up
storing diagnostics in an ASTUnit that's never returned to the user
(because it contains errors). I'll introduce a temporary fix for this
soon; the real fix will be to allow us to return and query invalid ASTs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96592 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInstance.cpp
ab152c2c1a38bb2eb1bc17a34ac1efb6e395e7f3 18-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> __typeof should be able to handle block pointer types when
rewriting. Fixes radar 7659483.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96549 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
afad76f6134e635c3cb240ec725d3b7989e7a625 18-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> __typeof should be able to handle block pointer types when
rewriting. Fixes radar 7659483.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96549 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
665f1154120338e214dcc68f29363073388b6acc 18-Feb-2010 Ted Kremenek <kremenek@apple.com> Sort cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96536 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
47e69901552aad2eb394e145e0c169aace0f0ea7 18-Feb-2010 Ted Kremenek <kremenek@apple.com> Sort cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96536 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
121f3eb1c120089a920ba7e7c0188a07fad59022 18-Feb-2010 Ted Kremenek <kremenek@apple.com> Add 'ns_returns_not_retained' and 'cf_returns_not_retained' attributes to
match 'ns_returns_retained' and 'cf_returns_retained' respectively. These
are not yet hooked up to the static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96535 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
31c780d95a830f0187cfcbb1016ce88f50a7dfe1 18-Feb-2010 Ted Kremenek <kremenek@apple.com> Add 'ns_returns_not_retained' and 'cf_returns_not_retained' attributes to
match 'ns_returns_retained' and 'cf_returns_retained' respectively. These
are not yet hooked up to the static analyzer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96535 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
3cf68a9d706d41b069a57d75b0995562df4565c8 17-Feb-2010 Ted Kremenek <kremenek@apple.com> Add IBAction attribute to keep the IBOutlet attribute company.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96447 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
efbddd23173ea5633cc8a004f1014c68c3ac6593 17-Feb-2010 Ted Kremenek <kremenek@apple.com> Add IBAction attribute to keep the IBOutlet attribute company.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96447 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
66153c130031c5de0f7954a9a56ce0bf9e102493 16-Feb-2010 Chris Lattner <sabre@nondot.org> when a diagnostic is an extension and has no other -W flag,
indicate that it was enabled with -pedantic so people know
why they're getting them:

$ printf "int x;" | clang -xc - -pedantic
<stdin>:1:7: warning: no newline at end of file [-pedantic]
int x;
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96365 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
8d2ea4ea7b28ee4eed97182bf7866ef918d20813 16-Feb-2010 Chris Lattner <sabre@nondot.org> when a diagnostic is an extension and has no other -W flag,
indicate that it was enabled with -pedantic so people know
why they're getting them:

$ printf "int x;" | clang -xc - -pedantic
<stdin>:1:7: warning: no newline at end of file [-pedantic]
int x;
^



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96365 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
a66451efea0b1450f0507cfea93ff7ed0a1790a3 16-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Minor rewriter cleanup and a test for a block rewriting bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96361 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
210c248449788d9ef910c8222267029653f83a2f 16-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Minor rewriter cleanup and a test for a block rewriting bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96361 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
43dcbf3449da2d82372713a1958d3baacaa84631 16-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix rewriter bug when function call inside block with block parameter
causes C++ compile error (radar 7651312).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96352 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
e8c28dffce846b1783fd11cc130b4be4f9894301 16-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix rewriter bug when function call inside block with block parameter
causes C++ compile error (radar 7651312).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96352 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
b39503abb6911b792d4a91ed504b173ecf1676a5 16-Feb-2010 Daniel Dunbar <daniel@zuster.org> ASTUnit: Constant fold UseBumpAllocator to true, we don't care to support this as an argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96316 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
b26d483a9f7fdc815e87bbbac4af916307b4c07d 16-Feb-2010 Daniel Dunbar <daniel@zuster.org> ASTUnit: Constant fold UseBumpAllocator to true, we don't care to support this as an argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96316 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
STUnit.cpp
5fbc4f48be96f5a8722318721cbe4c0562e0a165 16-Feb-2010 Daniel Dunbar <daniel@zuster.org> ASTUnit::LoadFromCompilerInvocation - Take ownership of the provided invocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96315 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f7acc37450d59ef751df73acb91de73850cc6517 16-Feb-2010 Daniel Dunbar <daniel@zuster.org> ASTUnit::LoadFromCompilerInvocation - Take ownership of the provided invocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96315 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
2d237305f070e8b4916802ef300ce94c3a89395e 16-Feb-2010 Daniel Dunbar <daniel@zuster.org> CompilerInstance: Move LLVMContext member out of constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96314 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
42e9f8e4983d50f896ec716207817b9d96e7e79c 16-Feb-2010 Daniel Dunbar <daniel@zuster.org> CompilerInstance: Move LLVMContext member out of constructor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96314 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
10ab70839bfcbf91802ce6ae9402b04172cafad3 16-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Don't import __va_list_tag or __builtin_va_list when merging

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96299 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
9a945853ca0c2b4cac07056542b19f25a83f1288 16-Feb-2010 Douglas Gregor <dgregor@apple.com> Don't import __va_list_tag or __builtin_va_list when merging

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96299 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
2538dfb28830178a83a0f86aff0d43d912d4f178 15-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Tell ASTMerge to merge every declaration it sees, rather than cherry-picking those declarations that we know will work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96280 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
44703f59ed2ae7854a08cf67cb2474c31e0698ec 15-Feb-2010 Douglas Gregor <dgregor@apple.com> Tell ASTMerge to merge every declaration it sees, rather than cherry-picking those declarations that we know will work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96280 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
8d3011e3964f4e4c7f2358aa2fb9f7a5ba761aad 15-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a broken rewritin of @implementation keyword.
(fixes radar 7649577).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96270 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
a135216595c00ddb5ce5f5b853a3d1f4037a13b7 15-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a broken rewritin of @implementation keyword.
(fixes radar 7649577).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96270 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
b1737c48f138035ff97921511a0980508a775d30 14-Feb-2010 Ted Kremenek <kremenek@apple.com> Change LLVMConventionsChecker to accept an entire translation unit instead
of operating on each code decl. This exposes two flaws in AnalysisConsumer
that should eventually be fixed:

(1) It is not possible to associate multiple "actions" with a single
command line argument. This will require the notion of an
"analysis" group, and possibly tablegen support. (although eventually
we want to support dynamically loading analyses as well)

(2) AnalysisConsumer may not actually be scanning the declarations in namespaces.
We'll experiment first in LLVMConventionsChecker before changing the
behavior in AnalysisConsumer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96183 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
676ca153e04b1c6be477bc8a10f1e06256850cee 14-Feb-2010 Ted Kremenek <kremenek@apple.com> Change LLVMConventionsChecker to accept an entire translation unit instead
of operating on each code decl. This exposes two flaws in AnalysisConsumer
that should eventually be fixed:

(1) It is not possible to associate multiple "actions" with a single
command line argument. This will require the notion of an
"analysis" group, and possibly tablegen support. (although eventually
we want to support dynamically loading analyses as well)

(2) AnalysisConsumer may not actually be scanning the declarations in namespaces.
We'll experiment first in LLVMConventionsChecker before changing the
behavior in AnalysisConsumer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96183 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
425afba8374ac2a47ed564b67ffbca0c784d5e8d 14-Feb-2010 Ted Kremenek <kremenek@apple.com> Rework translation unit actions to actually take an entire translation unit
as imput.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96182 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
f6eafcca7734274d277afa121f2c4fb025a54218 14-Feb-2010 Ted Kremenek <kremenek@apple.com> Rework translation unit actions to actually take an entire translation unit
as imput.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96182 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
3da1c0ab886a536d914794ce31a753dedb12b87e 14-Feb-2010 Benjamin Kramer <benny.kra@googlemail.com> Pass StringRefs to InsertText/ReplaceText in RewriteObjC and remove a ton of unnecessary length arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96164 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
d999b3736ce2646ae0711416b421d906298764db 14-Feb-2010 Benjamin Kramer <benny.kra@googlemail.com> Pass StringRefs to InsertText/ReplaceText in RewriteObjC and remove a ton of unnecessary length arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96164 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
6e2e54e98ee9092f275d18ea40ba1ee28afbebb0 14-Feb-2010 Ted Kremenek <kremenek@apple.com> Add new static analyzer for checking LLVM coding conventions: -analyzer-check-llvm-conventions

Currently these checks are intended to be largely syntactical, but may get more
sophisticated over time.

As an initial foray into this brave new world, emit a static analyzer warning
when binding a temporary 'std::string' to an 'llvm::StringRef' where the
lifetime of the 'std::string' does not outlive the 'llvm::StringRef'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96147 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
6dd66ed959b7f60749dd0040507b3f304183a1b6 14-Feb-2010 Ted Kremenek <kremenek@apple.com> Add new static analyzer for checking LLVM coding conventions: -analyzer-check-llvm-conventions

Currently these checks are intended to be largely syntactical, but may get more
sophisticated over time.

As an initial foray into this brave new world, emit a static analyzer warning
when binding a temporary 'std::string' to an 'llvm::StringRef' where the
lifetime of the 'std::string' does not outlive the 'llvm::StringRef'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96147 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
9a175a67f7717eb22bb30cf4bd9816898fbd49f8 14-Feb-2010 Ted Kremenek <kremenek@apple.com> Two changes to AnalysisConsumer::HandleTopLevelSingleDecl():

(1) Since CXXMethodDecl subclasses FunctionDecl (and CXXDestructorDecl
and CXXConversion subclass CXXMethodDecl), refactor switch statement
to handle them all in one spot.

(2) Use 'DeclarationName::getAsString()' to handle all functions that
don't have simple identifiers (fixing a null dereference when scanning
for specific functions).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96146 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
280cfd70c7a536311656fbd2082cb54d59cf3a2e 14-Feb-2010 Ted Kremenek <kremenek@apple.com> Two changes to AnalysisConsumer::HandleTopLevelSingleDecl():

(1) Since CXXMethodDecl subclasses FunctionDecl (and CXXDestructorDecl
and CXXConversion subclass CXXMethodDecl), refactor switch statement
to handle them all in one spot.

(2) Use 'DeclarationName::getAsString()' to handle all functions that
don't have simple identifiers (fixing a null dereference when scanning
for specific functions).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96146 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
1d49627b8757c4a190dd4bdb3794d3e649c67cbc 13-Feb-2010 Chris Lattner <sabre@nondot.org> add support for t Fedora 12 (February 2010), patch by
Dyachenko Dmitry. Our system is "not so elegant" here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96111 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
0edeca592f71e520d00dc09e74b829e8f7805d0b 13-Feb-2010 Chris Lattner <sabre@nondot.org> add support for t Fedora 12 (February 2010), patch by
Dyachenko Dmitry. Our system is "not so elegant" here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96111 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
7d63b43c93a2db474e9f6f05dcb8771ba08226f7 13-Feb-2010 John McCall <rjmccall@apple.com> Raise the responsibility for passing -disable-llvm-verifier in NDEBUG builds
to the driver, and support it in CodeGenOptsToArgs(). Note that this changes
the default behavior of clang -cc1 to always run the verifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96077 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
b689afb75049012a431d483432114ad5e75d4a92 13-Feb-2010 John McCall <rjmccall@apple.com> Raise the responsibility for passing -disable-llvm-verifier in NDEBUG builds
to the driver, and support it in CodeGenOptsToArgs(). Note that this changes
the default behavior of clang -cc1 to always run the verifier.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96077 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
409059701c80c4e60a02207fbf231b27c65d5333 13-Feb-2010 John McCall <rjmccall@apple.com> Add an option to disable the LLVM verifier pass (which is still always
disabled in NDEBUG builds). The option applies only to -cc1 invocations and is:
-disable_llvm_verifier



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96046 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
824e19ed926d7aa1296a007d0607ac4437e3c4a9 13-Feb-2010 John McCall <rjmccall@apple.com> Add an option to disable the LLVM verifier pass (which is still always
disabled in NDEBUG builds). The option applies only to -cc1 invocations and is:
-disable_llvm_verifier



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96046 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
0574c3f56f2693b324c70abaa8dcb22623d4fa32 13-Feb-2010 Ted Kremenek <kremenek@apple.com> Fix bug I introduced with assinging a temporary to a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96041 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
974be4d50a95317a85b111855946f5aa4bd15887 13-Feb-2010 Ted Kremenek <kremenek@apple.com> Fix bug I introduced with assinging a temporary to a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96041 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
5c80800ec3e361328fdff5c9e8a1e75345ae430a 12-Feb-2010 Chris Lattner <sabre@nondot.org> restructure code a bit: there are two potential issues
worth asserting about in this code: 1) if the source range
is bogus (begin loc after end loc), and 2) if the client
is trying to highlight a range that is purely whitespace.

It is possible to just silently ignore #2, but it seems like
it is always a bug, so lets keep asserting on this condition,
but with a better assert message.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95998 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
41e79e2912e3765170bb74c9ecf514d01aebffff 12-Feb-2010 Chris Lattner <sabre@nondot.org> restructure code a bit: there are two potential issues
worth asserting about in this code: 1) if the source range
is bogus (begin loc after end loc), and 2) if the client
is trying to highlight a range that is purely whitespace.

It is possible to just silently ignore #2, but it seems like
it is always a bug, so lets keep asserting on this condition,
but with a better assert message.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95998 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
cd8e26ecb9912bbc23d4d5795cc36d8f7576e407 12-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a rewriter bug rewriting function decl.
with block-pointer-type as one or more of its
arguments. Fixes radar 7638400.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95992 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
52b2e1e0775a7a50616b02be4af92295c61e37f5 12-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a rewriter bug rewriting function decl.
with block-pointer-type as one or more of its
arguments. Fixes radar 7638400.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95992 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
95e20014f3cf65a7e7717849772e52c105fb7da3 12-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Improve representation of tag declarations first declared or defined
within the declarator of another declaration, from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95991 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
b37b648b3f2bba4c557a1604ced19b526b25a372 12-Feb-2010 Douglas Gregor <dgregor@apple.com> Improve representation of tag declarations first declared or defined
within the declarator of another declaration, from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95991 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
522a9fadbbb012a147c5a9977af9a895e270fe36 12-Feb-2010 Tanya Lattner <tonic@nondot.org> Implementing unused function warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95940 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
e6bbc01d1c4ec5241df36042e0a4a12a6711934b 12-Feb-2010 Tanya Lattner <tonic@nondot.org> Implementing unused function warning.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95940 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
37220ab1b69143f4ee4b6991ebf82d79a7e46d5a 12-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a rewriting bug where order of constructor expression arguments did not match
order of constructor arguments (all block API specific). This was exposed only in
a large block literal expression in a large file where PtrSet container size
execceded its limit and required reallocation. Fixes radar 7638294



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95936 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
bab71685568085b635f077ee5720d22dffab84be 12-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a rewriting bug where order of constructor expression arguments did not match
order of constructor arguments (all block API specific). This was exposed only in
a large block literal expression in a large file where PtrSet container size
execceded its limit and required reallocation. Fixes radar 7638294



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95936 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
e6d8816efc582dc04cf793e78dc9be2d4b81cf3d 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Allocate the SubExprs array in ObjCMessageExpr using the allocator associated with ASTContext. This fixes yet another leak (<rdar://problem/7639260>).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95930 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
eb3b324800598cc3d5385fbad95ae5cff2c79113 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Allocate the SubExprs array in ObjCMessageExpr using the allocator associated with ASTContext. This fixes yet another leak (<rdar://problem/7639260>).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95930 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
984a375f11d74480963146861d78b2396ca7ed9a 11-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> When AST merging for record declarations fails, warn about the
incompatibility and show where the structural differences are. For
example:

struct1.c:36:8: warning: type 'struct S7' has incompatible definitions
in different translation units
struct S7 { int i : 8; unsigned j : 8; } x7;
^
struct1.c:36:33: note: bit-field 'j' with type 'unsigned int' and length 8 here
struct S7 { int i : 8; unsigned j : 8; } x7;
^
struct2.c:33:33: note: bit-field 'j' with type 'unsigned int' and length 16 here
struct S7 { int i : 8; unsigned j : 16; } x7;
^

There are a few changes to make this work:
- ASTImporter now has only a single Diagnostic object, not multiple
diagnostic objects. Otherwise, having a warning/error printed via
one Diagnostic and its note printed on the other Diagnostic could
cause the note to be suppressed.
- Implemented import functionality for IntegerLiteral (along with
general support for statements and expressions)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95900 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
4800d95d28b20eca5d57c108ae3d2e6e312c1182 11-Feb-2010 Douglas Gregor <dgregor@apple.com> When AST merging for record declarations fails, warn about the
incompatibility and show where the structural differences are. For
example:

struct1.c:36:8: warning: type 'struct S7' has incompatible definitions
in different translation units
struct S7 { int i : 8; unsigned j : 8; } x7;
^
struct1.c:36:33: note: bit-field 'j' with type 'unsigned int' and length 8 here
struct S7 { int i : 8; unsigned j : 8; } x7;
^
struct2.c:33:33: note: bit-field 'j' with type 'unsigned int' and length 16 here
struct S7 { int i : 8; unsigned j : 16; } x7;
^

There are a few changes to make this work:
- ASTImporter now has only a single Diagnostic object, not multiple
diagnostic objects. Otherwise, having a warning/error printed via
one Diagnostic and its note printed on the other Diagnostic could
cause the note to be suppressed.
- Implemented import functionality for IntegerLiteral (along with
general support for statements and expressions)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95900 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
bbc87477d3d15d12a75e1cf717bcd0631732d259 11-Feb-2010 Anders Carlsson <andersca@mac.com> Check in the beginnings of my new vtable layout builder idea.

Right now, it's off by default but can be tested by passing -fdump-vtable-layouts to clang -cc1. This option will cause all vtables that will normally be emitted as part of codegen to also be dumped using the new layout code.

I've also added a very simple new vtable layout test case.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95865 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
824d7ea07a4e9208925daa6ae9289fb2b39bce9f 11-Feb-2010 Anders Carlsson <andersca@mac.com> Check in the beginnings of my new vtable layout builder idea.

Right now, it's off by default but can be tested by passing -fdump-vtable-layouts to clang -cc1. This option will cause all vtables that will normally be emitted as part of codegen to also be dumped using the new layout code.

I've also added a very simple new vtable layout test case.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95865 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
64474f20248057f0c7cd6e2332811ce32e502d5a 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Use the allocator associated with ASTContext to allocate the args
array associated with NonNullAttr. This fixes yet another leak when
ASTContext uses a BumpPtrAllocator.

Fixes: <rdar://problem/7637150>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95863 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
5961611172f1c210fbbaa55b3c692e13b1fc7be4 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Use the allocator associated with ASTContext to allocate the args
array associated with NonNullAttr. This fixes yet another leak when
ASTContext uses a BumpPtrAllocator.

Fixes: <rdar://problem/7637150>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95863 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
222ea5b36692d59f7feab62ea52b4c698514a27f 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Remove use of 'std::string' from Attr objects, using instead a byte
array allocated using the allocator in ASTContext. This addresses
these strings getting leaked when using a BumpPtrAllocator (in
ASTContext).

Fixes: <rdar://problem/7636765>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95853 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
3d2c43e9a7ca55f5ddc1f0c77d8f5e5ea7c1b573 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Remove use of 'std::string' from Attr objects, using instead a byte
array allocated using the allocator in ASTContext. This addresses
these strings getting leaked when using a BumpPtrAllocator (in
ASTContext).

Fixes: <rdar://problem/7636765>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95853 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
47bedd03ccebfcf7f6156aed64ef45a9e6318145 11-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Eliminate a bunch of unnecessary ASTContexts from members functions of
Decl subclasses. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95841 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
ewriteObjC.cpp
838db383b69b9fb55f55c8e9546477df198a4faa 11-Feb-2010 Douglas Gregor <dgregor@apple.com> Eliminate a bunch of unnecessary ASTContexts from members functions of
Decl subclasses. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95841 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
ewriteObjC.cpp
0953831bd17a3ec879d4ddbbf33cbb2c67560fb0 11-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Eliminate the ASTContext parameter from RecordDecl::getDefinition()
and CXXRecordDecl::getDefinition(); it's totally unnecessary. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95836 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
952b017601f9c82b51119c3a1600f1312a833db9 11-Feb-2010 Douglas Gregor <dgregor@apple.com> Eliminate the ASTContext parameter from RecordDecl::getDefinition()
and CXXRecordDecl::getDefinition(); it's totally unnecessary. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95836 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
3a87420aac27d9355f33469edd2116c9ecfc8a50 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Allocate 'ObjCMethodList' objects (owned by Sema) using Sema's BumpPtrAllocator. Previously they were not getting freed. Fixes <rdar://problem/7635663>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95834 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
298ed870c7d8edf243edf14d624e577d4a3a8800 11-Feb-2010 Ted Kremenek <kremenek@apple.com> Allocate 'ObjCMethodList' objects (owned by Sema) using Sema's BumpPtrAllocator. Previously they were not getting freed. Fixes <rdar://problem/7635663>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95834 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
7ea1e2a1b23b719c67f3aff971374303fda26a84 10-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to rewrite blocks into unique api names.
Fixes radar 7630551



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95796 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
e61a1d4c57bbce3dfaa191a4b4de48ad79ac0b83 10-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to rewrite blocks into unique api names.
Fixes radar 7630551



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95796 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
52e5cd68aae0ef2f85da925e5e3f49a3641ea997 10-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement basic support for merging function declarations across
translation units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95794 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
a404ea673cbee5e74af710a5f1ab571e71580b67 10-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement basic support for merging function declarations across
translation units.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95794 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
2f6c684b4627ad38387c0ee59a66c863ad285a3b 10-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Provide rewriting suppport for use of __typeof__
in a declaration statement. Fixes radar 7628153.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95788 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
4c863ef92c2b74572090da245c87e1487b0b596c 10-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Provide rewriting suppport for use of __typeof__
in a declaration statement. Fixes radar 7628153.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95788 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
21f7bcaa607ffc73866f7b0c2141f449c2943bbf 10-Feb-2010 Daniel Dunbar <daniel@zuster.org> Switch to using -fsjlj-exceptions instead of hard-coding it. Notably, this fixes
calls to the UnwindResumeOrRethrow function for C++/Obj-C exception handling,
for Darwin ARM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95787 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
b2987d159a88ab0ee2e40c884eb4d77b42ab89b6 10-Feb-2010 Daniel Dunbar <daniel@zuster.org> Switch to using -fsjlj-exceptions instead of hard-coding it. Notably, this fixes
calls to the UnwindResumeOrRethrow function for C++/Obj-C exception handling,
for Darwin ARM.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95787 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
1b898e999f1f26dc1634f2f2ebaafbd5e69e9a13 10-Feb-2010 Daniel Dunbar <daniel@zuster.org> clang -cc1: Add -fsjlj-exceptions, which requires far too much button pushing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95785 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
CHReader.cpp
CHWriter.cpp
73482884560be041d86eccbd7dd5a6918677393b 10-Feb-2010 Daniel Dunbar <daniel@zuster.org> clang -cc1: Add -fsjlj-exceptions, which requires far too much button pushing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95785 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
CHReader.cpp
CHWriter.cpp
30b9d7de0c5c0a25bbb051022f3e296d5692c82e 10-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Teach AST merging that variables with incomplete array types can be
merged with variables of constant array types. Also, make sure that we
call DiagnosticClient's BeginSourceFile/EndSourceFile, so that it has
a LangOptions to work with.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95782 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
0f962a8e61e1c094a89df17f9d3ad947d31c4e5c 10-Feb-2010 Douglas Gregor <dgregor@apple.com> Teach AST merging that variables with incomplete array types can be
merged with variables of constant array types. Also, make sure that we
call DiagnosticClient's BeginSourceFile/EndSourceFile, so that it has
a LangOptions to work with.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95782 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
95ac7de43fb8a0d617b46f2df7813c8df9af70f4 10-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Comment out category's property decls. in rewrite.
Fixes radar 7630636.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95744 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
13751e3edc7fe50b0ab4e0f5fe7501e81c83c795 10-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Comment out category's property decls. in rewrite.
Fixes radar 7630636.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95744 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
f9646bbcd669c6afc2c2b0a630793d39a2c896f6 10-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Implement basic support for importing source locations from one AST
into another AST, including their include history. Here's an example
error that involves a conflict merging a variable with different types
in two translation units (diagnosed in the third AST context into
which everything is merged).

/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var2.c:3:5:
error: external variable 'x2' declared with incompatible types in
different translation units ('int' vs. 'double')
int x2;
^
In file included from
/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var1.c:3:
/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var1.h:1:8:
note: declared here with type 'double'
double x2;
^

Although we maintain include history, we do not maintain macro
instantiation history across a merge. Instead, we map down to the
spelling location (for now!).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95732 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
885237354fd902998c6ae9d7cc3dc8de96b123dc 10-Feb-2010 Douglas Gregor <dgregor@apple.com> Implement basic support for importing source locations from one AST
into another AST, including their include history. Here's an example
error that involves a conflict merging a variable with different types
in two translation units (diagnosed in the third AST context into
which everything is merged).

/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var2.c:3:5:
error: external variable 'x2' declared with incompatible types in
different translation units ('int' vs. 'double')
int x2;
^
In file included from
/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var1.c:3:
/Volumes/Data/dgregor/Projects/llvm/tools/clang/test/ASTMerge/Inputs/var1.h:1:8:
note: declared here with type 'double'
double x2;
^

Although we maintain include history, we do not maintain macro
instantiation history across a merge. Instead, we map down to the
spelling location (for now!).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95732 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
88a511c8a46eb5f56ba50aaa9a8b818778d8eb08 09-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Hook up the diagnostics-argument printer when merging AST files, so
that we get readable diagnostics such as:

error: external variable 'x1' declared with incompatible types in
different translation units ('double *' vs. 'float **')

However, there is no translation of source locations, yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95704 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
d343ff623eb11e277f1e70bca16073e424d8a30d 09-Feb-2010 Douglas Gregor <dgregor@apple.com> Hook up the diagnostics-argument printer when merging AST files, so
that we get readable diagnostics such as:

error: external variable 'x1' declared with incompatible types in
different translation units ('double *' vs. 'float **')

However, there is no translation of source locations, yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95704 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
d9fd7f081668e0f457eb4e9182eec0ddd7cecf9a 09-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Implement synthesizing properties by default.
This is a non-fragile-abi feature only. Since it
breaks existing code, it is currently placed under
-fobjc-nonfragile-abi2 option for test purposes only
until further notice. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95685 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
CHReader.cpp
CHWriter.cpp
412e798941ca64e2e6b084323915fa9aa5f6bdf3 09-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Implement synthesizing properties by default.
This is a non-fragile-abi feature only. Since it
breaks existing code, it is currently placed under
-fobjc-nonfragile-abi2 option for test purposes only
until further notice. WIP.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95685 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
CHReader.cpp
CHWriter.cpp
49216b909765ac03a39829b9e60b1e3c601f3342 09-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce a testbed for merging multiple ASTs into a single AST
context with the AST importer. WIP, still useless but at least it has
a test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95683 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
MakeLists.txt
ompilerInvocation.cpp
9bed8798964d9f07599c2c9199701f86fbc70e20 09-Feb-2010 Douglas Gregor <dgregor@apple.com> Introduce a testbed for merging multiple ASTs into a single AST
context with the AST importer. WIP, still useless but at least it has
a test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95683 91177308-0d34-0410-b5e6-96231b3b80d8
STMerge.cpp
MakeLists.txt
ompilerInvocation.cpp
6d24cd5aba5ccff206cfd191fea8b2553c7dee56 08-Feb-2010 Douglas Gregor <doug.gregor@gmail.com> Keep track of whether a tag was defined in a declarator vs. being
defined by itself, from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95586 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
591bd3cb605f1f0229b4b1d8a4b8183377064ec5 08-Feb-2010 Douglas Gregor <dgregor@apple.com> Keep track of whether a tag was defined in a declarator vs. being
defined by itself, from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95586 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
548e9ea5aa883368715bf3af889213a0109d22e1 07-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Roll r95513 back in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95515 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriter.cpp
CHWriterStmt.cpp
eb7f96141f754150a92433286fa385910a22f494 07-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Roll r95513 back in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95515 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriter.cpp
CHWriterStmt.cpp
8ba488ce817e898a6c6fadf62f91f908f7053b5c 07-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Roll out r95513, it seems to have broken self hosting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95514 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriter.cpp
CHWriterStmt.cpp
a8ad5d4975aea17c0e7868f83c25083a0eb2040d 07-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Roll out r95513, it seems to have broken self hosting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95514 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriter.cpp
CHWriterStmt.cpp
b82b35f9cd18aabea0144d413f29c1f5c08f72cc 07-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Add PCH support for CXXBoolLiteralExpr and CXXNullPtrLiteralExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95513 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriter.cpp
CHWriterStmt.cpp
1eb1113b139503a3895714d94ec9c037ae62d3b1 07-Feb-2010 Sam Weinig <sam.weinig@gmail.com> Add PCH support for CXXBoolLiteralExpr and CXXNullPtrLiteralExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95513 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriter.cpp
CHWriterStmt.cpp
c6ad9b5808bc6d716a3a26f61c2e23e49a29ebfa 07-Feb-2010 Anders Carlsson <andersca@mac.com> Add attributes to namespace decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95510 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
2a3503d85374ecc2b8e862a8ed9cec8f10f72e84 07-Feb-2010 Anders Carlsson <andersca@mac.com> Add attributes to namespace decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95510 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
05326029789a06dbdbf8b3feaada84a7556e8ff7 07-Feb-2010 Anders Carlsson <andersca@mac.com> Add support for threadsafe statics, and make them the default (matching gcc).

Daniel, I'd appreciate a review of the driver/cc1 parts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95508 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
a508b7de6c5246ab04ed69d0ab4e9977ec1fb4d4 07-Feb-2010 Anders Carlsson <andersca@mac.com> Add support for threadsafe statics, and make them the default (matching gcc).

Daniel, I'd appreciate a review of the driver/cc1 parts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95508 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
30d70130e01467ee46a13186ce3cc469cb679a61 05-Feb-2010 Ted Kremenek <kremenek@apple.com> Add guard in RewriteObjC::HandleTopLevelSingleDecl() to not do
anything when Sema has issued an error. This matches the behavior in
RewriteObjC::HandleTranslationUnit().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95434 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
e50187a987dadb6a3b6f673125617c8f42ff3560 05-Feb-2010 Ted Kremenek <kremenek@apple.com> Add guard in RewriteObjC::HandleTopLevelSingleDecl() to not do
anything when Sema has issued an error. This matches the behavior in
RewriteObjC::HandleTranslationUnit().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95434 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
c7e52cb7713e5b1e1459c4c1c8693b13c5d2a6de 05-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a minor rewriter bug messaging inside a function call.
Fixes radar 7617047.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95392 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
376338a68d467f076c2ae5fa614ec0286ea74d7c 05-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a minor rewriter bug messaging inside a function call.
Fixes radar 7617047.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95392 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
08938e3746e96c4de85fc623a879b8a3bbff08fb 05-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Some clean up of replacement text API no longer needed by
my recent changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95391 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
88906cddbb1d5b3a868eeeec6cb170befc829c2f 05-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Some clean up of replacement text API no longer needed by
my recent changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95391 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
9c930e17e2a4dc745bc1da0c8c8e56555992540c 05-Feb-2010 Daniel Dunbar <daniel@zuster.org> Tweak inliner thresholds to match llvm-gcc, see r95321.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95379 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
9da559868fcdd26ac0448a2943cc27af74923eb3 05-Feb-2010 Daniel Dunbar <daniel@zuster.org> Tweak inliner thresholds to match llvm-gcc, see r95321.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95379 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
bd9e9c41f75c55177d083502ada1e805aacadc35 05-Feb-2010 Ted Kremenek <kremenek@apple.com> Rename -cc1 option '-checker-cfref' to '-analyzer-check-objc-mem'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95348 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
565e465c6d0093f1bf8414b2cabdc842022385a9 05-Feb-2010 Ted Kremenek <kremenek@apple.com> Rename -cc1 option '-checker-cfref' to '-analyzer-check-objc-mem'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95348 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
aa3998fd0b895858d38cb491b734bc1050ad941b 05-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a nested ivar reference rewriting bug.
(Fixes radar 7607605).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95341 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
2b9b0b2c9a7137f46b7cc6a02ca9608f2fcc868d 05-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a nested ivar reference rewriting bug.
(Fixes radar 7607605).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95341 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
438d00a23413bb5e63afa12a975fd2f2e6216293 05-Feb-2010 John Thompson <john.thompson.jtsoftware@gmail.com> First stage of adding AltiVec support

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95335 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
82287d19ded35248c4ce6a425ce74116a13ce44e 05-Feb-2010 John Thompson <John.Thompson.JTSoftware@gmail.com> First stage of adding AltiVec support

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95335 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
f3a89728808084d8cbc1a2599014eeba9592097b 04-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix rewriting of 'const' __block variables in
the rewriter. (Fixes radar 7607781).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95267 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
2663f527c2717295fbaed4715945b879ad68f4cf 04-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix rewriting of 'const' __block variables in
the rewriter. (Fixes radar 7607781).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95267 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
0da5e5eed4d6f02520ceaea99381f05f7b7cb4e0 03-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix more rewriting of protocol-quialified 'id' type.
(Fixes radar 7607413).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95257 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
32132a08c0aecc316728d81e1d93726707fde14b 03-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix more rewriting of protocol-quialified 'id' type.
(Fixes radar 7607413).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95257 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
1f0d429163a1b02ec6d860dd98c37fdaff87e0d3 03-Feb-2010 Chris Lattner <sabre@nondot.org> update for llvm api change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95203 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
cd0507cb3468edf1103af25f0da3f62bf78e5e0a 03-Feb-2010 Chris Lattner <sabre@nondot.org> update for llvm api change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95203 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
7b1c919b68d31964e1ac663900da719058e010f5 03-Feb-2010 Daniel Dunbar <daniel@zuster.org> clang -cc1: Wire up -emit-obj, for emitting object files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95182 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
ompilerInvocation.cpp
rontendActions.cpp
da1573f95902a42aa4d11e8f45ab98ec7e27bc28 03-Feb-2010 Daniel Dunbar <daniel@zuster.org> clang -cc1: Wire up -emit-obj, for emitting object files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95182 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
ompilerInvocation.cpp
rontendActions.cpp
4cbf971146c9dbf8c81389d2e1f8df34776721c0 02-Feb-2010 Chris Lattner <sabre@nondot.org> update for llvm api changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95125 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
13c5c23d3e84ecfd37944a2773f72e4840225f90 02-Feb-2010 Chris Lattner <sabre@nondot.org> update for llvm api changes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95125 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
ee282115bc31d30d6171117b2a6d1fb6811849e6 02-Feb-2010 Chris Lattner <sabre@nondot.org> update for llvm api change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95110 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
0dd0dcccb422aee0be230c0c2c3082ec6cc20d50 02-Feb-2010 Chris Lattner <sabre@nondot.org> update for llvm api change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95110 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
e7cb977873d1b9a2f10b95e8a109c65470a9eab0 02-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix up rewriting of protocol qualified types in objc rewriter.
Fixes radar 7589414.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95097 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
84aa9464a4542b7b63d3b1f9953f9169ce536527 02-Feb-2010 Fariborz Jahanian <fjahanian@apple.com> Fix up rewriting of protocol qualified types in objc rewriter.
Fixes radar 7589414.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95097 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
3bb930e44f1e367ef617a1b6a168589c42bd8e35 01-Feb-2010 Daniel Dunbar <daniel@zuster.org> Driver/Frontend: Add support for -fobjc-legacy-dispatch, not yet used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95004 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
984eb8611d9ee46fc6351dee43609f2deed99f3c 01-Feb-2010 Daniel Dunbar <daniel@zuster.org> Driver/Frontend: Add support for -fobjc-legacy-dispatch, not yet used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@95004 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
08fbf08fc4fc3816971556bad895d9c9d88966b7 31-Jan-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add VarDecl::isThisDeclarationADefinition(), which properly encapsulates the logic for when a variable declaration is a (possibly tentativ) definition. Add a few functions building on this, and shift C tentative definition handling over to this new functionality. This shift also kills the Sema::TentativeDefinitions map and instead simply stores all declarations in the renamed list. The correct handling for multiple tentative definitions is instead shifted to the final walk of the list.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94968 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
e9d12b6c50c1e9b05443db099e21026c5991a93b 31-Jan-2010 Sebastian Redl <sebastian.redl@getdesigned.at> Add VarDecl::isThisDeclarationADefinition(), which properly encapsulates the logic for when a variable declaration is a (possibly tentativ) definition. Add a few functions building on this, and shift C tentative definition handling over to this new functionality. This shift also kills the Sema::TentativeDefinitions map and instead simply stores all declarations in the renamed list. The correct handling for multiple tentative definitions is instead shifted to the final walk of the list.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94968 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
5f72946a2b22f3f6bb161381089af01377e811bd 30-Jan-2010 Anders Carlsson <andersca@mac.com> Use IdentifierInfo * instead of std::string for the AsmStmt names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94925 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
rintParserCallbacks.cpp
ff93dbd887e40588ed55d135037bb9287488b285 30-Jan-2010 Anders Carlsson <andersca@mac.com> Use IdentifierInfo * instead of std::string for the AsmStmt names.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94925 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
rintParserCallbacks.cpp
4cc4433e4f8df9a5863b5bf66727a8494eaf5c63 30-Jan-2010 Daniel Dunbar <daniel@zuster.org> ASTUnit: Ensure the CompilerInvocation object used in LoadFromCommandLine is
live as long as the ASTUnit. This is useful for clients which want to maintain
pointers to the LangOptions object which ultimately lives in the
CompilerInvocation, although it would be nice to make all of this ownership
stuff more explicit and obvious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94924 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
807b06157a1a5c050520fc194d32f16d22d423a8 30-Jan-2010 Daniel Dunbar <daniel@zuster.org> ASTUnit: Ensure the CompilerInvocation object used in LoadFromCommandLine is
live as long as the ASTUnit. This is useful for clients which want to maintain
pointers to the LangOptions object which ultimately lives in the
CompilerInvocation, although it would be nice to make all of this ownership
stuff more explicit and obvious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94924 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
562df31360d44201349bc516538d30c0099f5506 30-Jan-2010 Daniel Dunbar <daniel@zuster.org> CompilerInstance: Change to not contain the CompilerInvocation object.

This allows clients to install their own CompilerInvocation object, which is
important for clients that may wish to create references to things like
LangOptions whose lifetime will extend past that of the CompilerInstance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94923 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
6228ca00121669ec06a19df4fad87d5049c097cf 30-Jan-2010 Daniel Dunbar <daniel@zuster.org> CompilerInstance: Change to not contain the CompilerInvocation object.

This allows clients to install their own CompilerInvocation object, which is
important for clients that may wish to create references to things like
LangOptions whose lifetime will extend past that of the CompilerInstance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94923 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
f34045cd1957b33432ae2dfa2758ef4320f2ab9a 30-Jan-2010 Anders Carlsson <andersca@mac.com> Even more AsmStmt cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94921 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
acb6bcb442936f3c14126fdd473307c17647cb84 30-Jan-2010 Anders Carlsson <andersca@mac.com> Even more AsmStmt cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94921 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
3c0139ea8b51400424c97b36cd0413f0808eb2ad 30-Jan-2010 Anders Carlsson <andersca@mac.com> Combine AsmStmt::setOutputsAndInputs and AsmStmt::setClobbers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94918 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
fdba9c069023f686e2608affde02c82131ee1cf8 30-Jan-2010 Anders Carlsson <andersca@mac.com> Combine AsmStmt::setOutputsAndInputs and AsmStmt::setClobbers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94918 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
18fb54e8f436741eab645ebd52939b7e6e9dc956 30-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> PCHReader doesn't implement classof so dyn_casting it will do really weird stuff. Use a static_cast instead.

I don't know if this hack is the right fix. Doug, please take a look.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94895 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
7297c18c843138625a61e01a137664a176739683 30-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> PCHReader doesn't implement classof so dyn_casting it will do really weird stuff. Use a static_cast instead.

I don't know if this hack is the right fix. Doug, please take a look.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94895 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
6df6ec11a0e37405a7908fc002de437a2814574c 29-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes rewriter bug rewriting byref related API where a struct
definition comes after where it is needed. Fixes radar 7589385.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94788 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
0e1c99a1a9068020daa7d85fcafb18490ea6a475 29-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes rewriter bug rewriting byref related API where a struct
definition comes after where it is needed. Fixes radar 7589385.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94788 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
ca5a30b4e4cf7676dee95764d774ec9700f42825 28-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Introduce serialization and deserialization of diagnostic information
so that CIndex can report diagnostics through the normal mechanisms
even when executing Clang in a separate process. This applies both
when performing code completion and when using ASTs as an intermediary
for clang_createTranslationUnitFromSourceFile().

The serialized format is not perfect at the moment, because it does
not encapsulate macro-instantiation information. Instead, it maps all
source locations back to the instantiation location. However, it does
maintain source-range and fix-it information. To get perfect fidelity
from the serialized format would require serializing a large chunk of
the source manager; at present, it isn't clear if this code will live
long enough for that to matter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94740 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
d93256e55673a17d18543397ec462416acb13792 28-Jan-2010 Douglas Gregor <dgregor@apple.com> Introduce serialization and deserialization of diagnostic information
so that CIndex can report diagnostics through the normal mechanisms
even when executing Clang in a separate process. This applies both
when performing code completion and when using ASTs as an intermediary
for clang_createTranslationUnitFromSourceFile().

The serialized format is not perfect at the moment, because it does
not encapsulate macro-instantiation information. Instead, it maps all
source locations back to the instantiation location. However, it does
maintain source-range and fix-it information. To get perfect fidelity
from the serialized format would require serializing a large chunk of
the source manager; at present, it isn't clear if this code will live
long enough for that to matter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94740 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ompilerInvocation.cpp
9e455bbcc8ee1efc7019849fcf1d2ef74a201b38 28-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a rewrite bug rewriting nested ivars reference.
(Radar 7583971).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94724 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
7e20ffe322866f6a2e820e054da9bd0f6e9b0af4 28-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a rewrite bug rewriting nested ivars reference.
(Radar 7583971).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94724 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
8e28e36c44f5c0647deb595f7ae2dac5c90712f7 27-Jan-2010 Jeffrey Yasskin <jyasskin@google.com> Remove ModuleProviders from clang after r94686 removed them from LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94688 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
802080652857744ba2bb53254a1a623fe7486e8c 27-Jan-2010 Jeffrey Yasskin <jyasskin@google.com> Remove ModuleProviders from clang after r94686 removed them from LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94688 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
72db0a7dddc5b48e75b3da1944866c0ae1880659 26-Jan-2010 Ted Kremenek <kremenek@apple.com> Move 'LocalCheckers.h' to the 'Checkers' subdirectory.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94609 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
97053091c0e4df12ffb662b284b6ab329ca1c40f 26-Jan-2010 Ted Kremenek <kremenek@apple.com> Move 'LocalCheckers.h' to the 'Checkers' subdirectory.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94609 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
789eccb03f90e9bf473a1f0104da511b9003d85a 26-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Added assert to the rewrite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94584 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
ffbdead156eb0bc94d1cc7e28eadcca52dfb8194 26-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Added assert to the rewrite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94584 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
2027dbb3bba6240733da914c1fe3f73e9ac71c78 26-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Refix rewriting of an ivar access when it is
type-cast to its sub-class (radar 7575882).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94559 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
8f0954309eb885891908ecdfbb06d720c63128ed 26-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Refix rewriting of an ivar access when it is
type-cast to its sub-class (radar 7575882).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94559 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
0a9f0d333f10747ff4f997089ee36b3d943f77a4 26-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a regression caused by my rewriting of cast of ivar
access (was radar 7575882).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94481 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
a5d5fbcb440e097ba4855881c02a34dfe80d11c9 26-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a regression caused by my rewriting of cast of ivar
access (was radar 7575882).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94481 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
60359c48f2df37524328ee60441c7ee9a4d13067 25-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a rewriting bug of access ivar of a variable cast
to subclass. (Fixes radar 7575882).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94444 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
5bfc5364405370c388450ede09e15e3e5aef819b 25-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a rewriting bug of access ivar of a variable cast
to subclass. (Fixes radar 7575882).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94444 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
f59d2ca2b85aecef18b8f94269da51637dc3efe7 25-Jan-2010 Ted Kremenek <kremenek@apple.com> Move BugReporter.h, PathDiagnostic.h, and BugType.h to 'include/Checker/BugReporter'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94428 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
TMLDiagnostics.cpp
listDiagnostics.cpp
6b67630d5df195f4fe0e4273061c016901d69681 25-Jan-2010 Ted Kremenek <kremenek@apple.com> Move BugReporter.h, PathDiagnostic.h, and BugType.h to 'include/Checker/BugReporter'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94428 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
TMLDiagnostics.cpp
listDiagnostics.cpp
175ced71864bd99d5191725cbbabb69dd7b26f96 25-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Update C++ include paths for Exherbo, by Ingmar Vanhassel.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94420 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
0db3d725ece8c0796905843d5392c8667d3706c1 25-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Update C++ include paths for Exherbo, by Ingmar Vanhassel.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94420 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
e6d261e31fcc2204d4117ca753e843bc2c1164f4 25-Jan-2010 Ted Kremenek <kremenek@apple.com> Split libAnalysis into two libraries: libAnalysis and libChecker.

(1) libAnalysis is a generic analysis library that can be used by
Sema. It defines the CFG, basic dataflow analysis primitives, and
inexpensive flow-sensitive analyses (e.g. LiveVariables).

(2) libChecker contains the guts of the static analyzer, incuding the
path-sensitive analysis engine and domain-specific checks.

Now any clients that want to use the frontend to build their own tools
don't need to link in the entire static analyzer.

This change exposes various obvious cleanups that can be made to the
layout of files and headers in libChecker. More changes pending. :)

This change also exposed a layering violation between AnalysisContext
and MemRegion. BlockInvocationContext shouldn't explicitly know about
BlockDataRegions. For now I've removed the BlockDataRegion* from
BlockInvocationContext (removing context-sensitivity; although this
wasn't used yet). We need to have a better way to extend
BlockInvocationContext (and any LocationContext) to add
context-sensitivty.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94406 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
TMLDiagnostics.cpp
listDiagnostics.cpp
1309f9a3b225ea846e5822691c39a77423125505 25-Jan-2010 Ted Kremenek <kremenek@apple.com> Split libAnalysis into two libraries: libAnalysis and libChecker.

(1) libAnalysis is a generic analysis library that can be used by
Sema. It defines the CFG, basic dataflow analysis primitives, and
inexpensive flow-sensitive analyses (e.g. LiveVariables).

(2) libChecker contains the guts of the static analyzer, incuding the
path-sensitive analysis engine and domain-specific checks.

Now any clients that want to use the frontend to build their own tools
don't need to link in the entire static analyzer.

This change exposes various obvious cleanups that can be made to the
layout of files and headers in libChecker. More changes pending. :)

This change also exposed a layering violation between AnalysisContext
and MemRegion. BlockInvocationContext shouldn't explicitly know about
BlockDataRegions. For now I've removed the BlockDataRegion* from
BlockInvocationContext (removing context-sensitivity; although this
wasn't used yet). We need to have a better way to extend
BlockInvocationContext (and any LocationContext) to add
context-sensitivty.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94406 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
TMLDiagnostics.cpp
listDiagnostics.cpp
cb94ade2e7569f3f9917e9eae9d046f08e444c1e 25-Jan-2010 Daniel Dunbar <daniel@zuster.org> ASTUnit: Don't check that input files exist when parsing ASTs from the command
line -- they may be remapped (fake) files. This is useful for testing parsing
entirely from memory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94395 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
3bd54cc56276c386f4d50940a9fbfcad7a69cb75 25-Jan-2010 Daniel Dunbar <daniel@zuster.org> ASTUnit: Don't check that input files exist when parsing ASTs from the command
line -- they may be remapped (fake) files. This is useful for testing parsing
entirely from memory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94395 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f4b34a030729fff07d8a6501bfabbbd097c15045 24-Jan-2010 Chris Lattner <sabre@nondot.org> -fno-rtti is now the default.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94379 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
0bb46d285cb2bb0f582d0935f58f57a9be8bf2cd 24-Jan-2010 Chris Lattner <sabre@nondot.org> -fno-rtti is now the default.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94379 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
de344bdcfd849680f534721f8029e6afc58f869c 24-Jan-2010 Anders Carlsson <andersca@mac.com> Implement instantiation of AsmStmts (Crazy, I know)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94361 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
703e39486689d6660e75f6b6de0068db031a51c7 24-Jan-2010 Anders Carlsson <andersca@mac.com> Implement instantiation of AsmStmts (Crazy, I know)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94361 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
919d2779960bc603723c9850b419106f6c4dd3df 23-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Extend clang_createTranslationUnitFromSourceFile() to support creating
translation units that include unsaved files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94258 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
nitPreprocessor.cpp
4db64a461cb3442934afe43c83ed3f17f7c11c1d 23-Jan-2010 Douglas Gregor <dgregor@apple.com> Extend clang_createTranslationUnitFromSourceFile() to support creating
translation units that include unsaved files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94258 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
nitPreprocessor.cpp
fe942e746bf1b4448c7aec9c8a611d5ecd31db4d 22-Jan-2010 Ted Kremenek <kremenek@apple.com> (1) Rename getClangSubversionRevision() to getClangRevision(), and
have it return a StringRef instead of an integer (to be more VCS
agnostic).

(2) Add getClangFullRepositoryVersion(), which contains an
amalgamation of the repository name and the revision.

(3) Change PCH to only emit the string returned by
getClangFullRepositoryVersion() instead of also emitting the value
of getClangSubversionRevision() (which has been removed). This is
functionally equivalent.

More cleanup to version string generation pending...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94231 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
f7a96a39958b3f919f26764777eec948b43d74bc 22-Jan-2010 Ted Kremenek <kremenek@apple.com> (1) Rename getClangSubversionRevision() to getClangRevision(), and
have it return a StringRef instead of an integer (to be more VCS
agnostic).

(2) Add getClangFullRepositoryVersion(), which contains an
amalgamation of the repository name and the revision.

(3) Change PCH to only emit the string returned by
getClangFullRepositoryVersion() instead of also emitting the value
of getClangSubversionRevision() (which has been removed). This is
functionally equivalent.

More cleanup to version string generation pending...



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94231 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
92c1e7dec5bfeed3bae63e3abcbbf359d9a3c7e3 22-Jan-2010 Ted Kremenek <kremenek@apple.com> Rename pch::SVN_BRANCH_REVISION to pch::VERSION_CONTROL_BRANCH_REVISION.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94214 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
5b4ec636637c9d876102240127cc0dca9280e83a 22-Jan-2010 Ted Kremenek <kremenek@apple.com> Rename pch::SVN_BRANCH_REVISION to pch::VERSION_CONTROL_BRANCH_REVISION.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94214 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ec04e5806acd9ea1fd9daea82595938db0813a2f 22-Jan-2010 Ted Kremenek <kremenek@apple.com> Rename getClangSubversionPath() -> getClangRepositoryPath() and have it return a StringRef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94213 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
517e676b9e1524e39beeb47718822f2647801d1a 22-Jan-2010 Ted Kremenek <kremenek@apple.com> Rename getClangSubversionPath() -> getClangRepositoryPath() and have it return a StringRef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94213 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
bf430198a91b6f352db12499d423464278fdb660 21-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to implement rewriting of properties.
Fixes radar 7562952.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94087 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
ewriteObjC.cpp
d0502407c1b41b2ace326f355d7b7a6876246223 21-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to implement rewriting of properties.
Fixes radar 7562952.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94087 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
ewriteObjC.cpp
7bb2a23fb119b483e570a9dec3e753353fda1146 20-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Make some helper functions static.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94004 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
6cd5216bb61e6165d8f6e8fb781d45c035bd4e00 20-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Make some helper functions static.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94004 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
9727231169c93f636afdedcd0c199da5deead2aa 20-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Don't store a Twine temporary, it's unsafe.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94003 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ab8ae19ea4285a15ca43123e8e218e401dc5cb5a 20-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Don't store a Twine temporary, it's unsafe.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94003 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
a088d5bd3141d05e8a9c4517c0d6f0cc1a0a3692 20-Jan-2010 Chandler Carruth <chandlerc@gmail.com> Move the MacroBuilder utilitiy to its own header. Update references.

Comments and/or improvements to the documentation are welcome.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93982 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
103b71c37a3c3a3da7128c1d0232a89b1e8d0d90 20-Jan-2010 Chandler Carruth <chandlerc@gmail.com> Move the MacroBuilder utilitiy to its own header. Update references.

Comments and/or improvements to the documentation are welcome.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93982 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
cad22ea7d55007299c2778563df76b63388b3437 20-Jan-2010 Daniel Dunbar <daniel@zuster.org> Fix an invalid Twine use spotty by abbeyj, it isn't safe to use Twine
temporaries (this is one reason I'm nervous about propagating their use beyond
particularly performance critical places).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93981 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
066515feea9af5319c138ff4db99081c7686c5b1 20-Jan-2010 Daniel Dunbar <daniel@zuster.org> Fix an invalid Twine use spotty by abbeyj, it isn't safe to use Twine
temporaries (this is one reason I'm nervous about propagating their use beyond
particularly performance critical places).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93981 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
c387b7abe623d6743bd3be03bd882c3862b1f648 20-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Add a missing case for DeclContext printer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93973 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
2f3cd9cb830aba522ad5d6884c0dab23770609a2 20-Jan-2010 Zhongxing Xu <xuzhongxing@gmail.com> Add a missing case for DeclContext printer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93973 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
8e292afac954043a2ef2d41a852bc901f94e9411 20-Jan-2010 Mike Stump <mrs@apple.com> Also handle CXXConstructor, CXXDestructor and CXXConversion in CFG
printing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93968 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
d4e50d807ea06c5e5f553e79b4be0ccc12055bce 20-Jan-2010 Mike Stump <mrs@apple.com> Also handle CXXConstructor, CXXDestructor and CXXConversion in CFG
printing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93968 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
be2989ab6d9c5a30f988f8fa534b72107124b588 20-Jan-2010 Mike Stump <mrs@apple.com> Use the llvm coding convention for indentation for switch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93966 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
acheTokens.cpp
eclXML.cpp
TMLDiagnostics.cpp
CHWriter.cpp
listDiagnostics.cpp
ewriteObjC.cpp
tmtXML.cpp
ypeXML.cpp
b7166334d897e1e4e6a5b428fe2d0ec752ef187f 20-Jan-2010 Mike Stump <mrs@apple.com> Use the llvm coding convention for indentation for switch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93966 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
acheTokens.cpp
eclXML.cpp
TMLDiagnostics.cpp
CHWriter.cpp
listDiagnostics.cpp
ewriteObjC.cpp
tmtXML.cpp
ypeXML.cpp
4e85eacc34a5d94c5c03a715cb278079e2d7236b 20-Jan-2010 Chris Lattner <sabre@nondot.org> add support for Fedora 10 x86_64, there really should be a better way to handle this.
patch by Dmitry


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93948 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
0720b5159010479c08f8264a8a209037ecf55922 20-Jan-2010 Chris Lattner <sabre@nondot.org> add support for Fedora 10 x86_64, there really should be a better way to handle this.
patch by Dmitry


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93948 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
349f08701b41fd9991d80ab14dabccb4897c3eac 19-Jan-2010 John McCall <rjmccall@apple.com> The type of a compound literal expression is not necessarily the same as the
type which was syntactically written. Fixes PR 6080.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93933 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
1d7d8d66eff7ed0f3e957d330930cc9ab8047add 19-Jan-2010 John McCall <rjmccall@apple.com> The type of a compound literal expression is not necessarily the same as the
type which was syntactically written. Fixes PR 6080.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93933 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
a41e2ce0217bf2a526132793ef007cd2e8b0100a 19-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Rewriteing of gnu extension __typeof in objective-c rewriter.
Fixes radar 6358225.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93917 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
1d4fca2e42da8506cc1042a1ea93815a8e9ae0f0 19-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Rewriteing of gnu extension __typeof in objective-c rewriter.
Fixes radar 6358225.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93917 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
6510ad84f237de6967f91aadbb3df3e382ad93f9 19-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Avoid an instantiation of std::sort.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93882 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
3ff2a4b861082f271bb769755ea6d1da4b3e6b8d 19-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Avoid an instantiation of std::sort.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93882 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
c1beadbbdca275e932d68978944b8feefbf51941 18-Jan-2010 John McCall <rjmccall@apple.com> Preserve type source information in compound literal expressions.
Patch by Enea Zaffanella!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93752 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
42f56b50062cd3b3c6b23fdb9053578ae9145664 18-Jan-2010 John McCall <rjmccall@apple.com> Preserve type source information in compound literal expressions.
Patch by Enea Zaffanella!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93752 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
bcf7ab9d8b1c9264deaa9963c4cc63130218e0ef 18-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Print fix-it hints properly around tabs, from Christian Adåker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93750 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
e44433c29e59a57ef1fac9cd252a2a98a0afb2e7 18-Jan-2010 Douglas Gregor <dgregor@apple.com> Print fix-it hints properly around tabs, from Christian Adåker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93750 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
bc6fcc7a405e5d9caf60f0485f374446300bc3cf 18-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Improve source-location information for builtin TypeLocs, from Enea
Zaffanella (with a couple of my tweaks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93733 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ddf889a2ad2888f1dea573987bbe952d9912c1a0 18-Jan-2010 Douglas Gregor <dgregor@apple.com> Improve source-location information for builtin TypeLocs, from Enea
Zaffanella (with a couple of my tweaks).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93733 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
31cc550280fe5c50d7f6ff57978ec083d284b53b 18-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Encoding calling conventions in the type system, from Charles Davis!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93726 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ab8bbf4ebd3e3e6eab913cb044772a62b7581941 18-Jan-2010 Douglas Gregor <dgregor@apple.com> Encoding calling conventions in the type system, from Charles Davis!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93726 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
8ca96186dbbf94680ced25450fd078331ff6cd77 17-Jan-2010 Nuno Lopes <nunoplopes@sapo.pt> PR6055: fix FreeBSD c++ include path. patch by Roman Divacky

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93668 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
afe859a9a6217f177daf42ebab294a90bfe8a6ab 17-Jan-2010 Nuno Lopes <nunoplopes@sapo.pt> PR6055: fix FreeBSD c++ include path. patch by Roman Divacky

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93668 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
c5f3e9f42a6befec845017ba12a6ec5407c2c8b2 16-Jan-2010 Sam Weinig <sam.weinig@gmail.com> Add PCH support for CXXStaticCastExpr, CXXDynamicCastExpr, CXXReinterpretCastExpr, CXXConstCastExpr and CXXFunctionalCastExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93658 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ce757a7a1ee905f87551996a69da3e95e8afeeb7 16-Jan-2010 Sam Weinig <sam.weinig@gmail.com> Add PCH support for CXXStaticCastExpr, CXXDynamicCastExpr, CXXReinterpretCastExpr, CXXConstCastExpr and CXXFunctionalCastExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93658 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
9a59dc064115d85c0905261d7c7f79d1b53c8b08 16-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a rewriting crash and correct rewriting of __block
declaration where its initializer has a type-cast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93650 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
dfa4fa0fc5b78a91c74db84fce305771c2038229 16-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a rewriting crash and correct rewriting of __block
declaration where its initializer has a type-cast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93650 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
efae5800004586a05ac2f6153e71771d6e7187fd 16-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Improve location information for Objective-C category declarations. We
previously only had a single location (the @ in @interface); now we
know where the @ is (for the start of the declaration), where the
class name is (that's the normal "location" now for diagnostics), and
where the category name is. Also, eliminated the redundant "end"
location, since ObjCContainerDecl already has better @end information.

The only XFAIL'd test is temporary; will un-XFAIL-it once I've taught
CIndex how to use the new locations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93639 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
3db211b617c5073aa70eb25d37ed44ae0dca17c4 16-Jan-2010 Douglas Gregor <dgregor@apple.com> Improve location information for Objective-C category declarations. We
previously only had a single location (the @ in @interface); now we
know where the @ is (for the start of the declaration), where the
class name is (that's the normal "location" now for diagnostics), and
where the category name is. Also, eliminated the redundant "end"
location, since ObjCContainerDecl already has better @end information.

The only XFAIL'd test is temporary; will un-XFAIL-it once I've taught
CIndex how to use the new locations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93639 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
7158dd960d2b47b2f2ab7bf94fa1702ca2778cdd 16-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Keep track of the source locations for each protocol reference in
Objective-C classes, protocol definitions, forward protocol
declarations, and categories. This information isn't actually used
yet; that's coming next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93636 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
rintParserCallbacks.cpp
18df52bbb5d28ca082064d31ae7558dbdae52377 16-Jan-2010 Douglas Gregor <dgregor@apple.com> Keep track of the source locations for each protocol reference in
Objective-C classes, protocol definitions, forward protocol
declarations, and categories. This information isn't actually used
yet; that's coming next.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93636 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
rintParserCallbacks.cpp
c013432bb5c46fafcc70f7a0eaf55c8bc5fdd745 15-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> define __weak to null in rewritten source for
-fms-extensions as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93569 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
34204195de802e9d3cc8d54355b2ad4b3c27f188 15-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> define __weak to null in rewritten source for
-fms-extensions as well.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93569 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
d5ecc399aa8985536852b0af8c2c63d5650f6857 15-Jan-2010 John McCall <rjmccall@apple.com> Preserve type source information in explicit cast expressions.
Patch by Enea Zaffanella.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93522 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
9d125033a9853f3b572a4c9e2f9e2d4e5e346973 15-Jan-2010 John McCall <rjmccall@apple.com> Preserve type source information in explicit cast expressions.
Patch by Enea Zaffanella.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93522 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
47e02fc863b8387b5deaae997e8ef82e0c4e4a83 15-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Do not do the block-specific rewrite when there is no block literals.
Fixes radar 7546096.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93519 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
bf07012cf92253380ce427924870288a34230d1b 15-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Do not do the block-specific rewrite when there is no block literals.
Fixes radar 7546096.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93519 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
d1ecdea598f5a99784bd51213a74b72506b3ef5d 15-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to avoid duplicate declaration of byref structs
for __block variables of same name declared in multiple scopes.
Fixes radar 7540194


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93474 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
a73165e47aefbea60312d284343660c9c962c9c3 15-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Patch to avoid duplicate declaration of byref structs
for __block variables of same name declared in multiple scopes.
Fixes radar 7540194


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93474 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
dd94188ddb0906b5c5af687783fbb5ed18f19f83 14-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a bug in rewrite whereby functions using blocks put extern "C" in wrong place.
Fixes radar 7284618.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93382 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
abfd83e74ca8a7553e375dd4631d2570f33648b4 14-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fix a bug in rewrite whereby functions using blocks put extern "C" in wrong place.
Fixes radar 7284618.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93382 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
6469dffc68a0b6fb195096b473763f3e1476b954 13-Jan-2010 John McCall <rjmccall@apple.com> Add type source information for both kinds of typeof types.
Patch by Enea Zaffanella.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93344 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
cfb708c354e2f30ccc5cba9d644650f408a1ec3e 13-Jan-2010 John McCall <rjmccall@apple.com> Add type source information for both kinds of typeof types.
Patch by Enea Zaffanella.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93344 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
bd51dca82ccb6b91a6e3bdf691a46e641d6a5e85 13-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Predefine __weak attribute when doing objective-c
rewriting for any target. (refixes radar 7530235).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93331 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
nitPreprocessor.cpp
7d957472ef9a09048c03d8a11028536f908c18b9 13-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Predefine __weak attribute when doing objective-c
rewriting for any target. (refixes radar 7530235).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93331 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
nitPreprocessor.cpp
56e6c573af74698691c61e649b5153bcca795781 13-Jan-2010 Chris Lattner <sabre@nondot.org> diagnose invalid values of -ftabstop, patch by Christian Adaker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93288 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnosticPrinter.cpp
52388f9aefba585475a38081272ce582d033c883 13-Jan-2010 Chris Lattner <sabre@nondot.org> diagnose invalid values of -ftabstop, patch by Christian Adaker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93288 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnosticPrinter.cpp
9f5bb69061be3e1edc3dc0dbda45516c714a55d5 13-Jan-2010 Daniel Dunbar <daniel@zuster.org> cc1: Factor out CompilerInstance::ExecuteAction which has the majority of the
clang -cc1 logic for running an action against a set of options.
- This should make it easier to build tools that have a clang -cc1 like
interface, but aren't actually part of clang -cc1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93282 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
0397af277e3bba16da1fd125ddba07415686b429 13-Jan-2010 Daniel Dunbar <daniel@zuster.org> cc1: Factor out CompilerInstance::ExecuteAction which has the majority of the
clang -cc1 logic for running an action against a set of options.
- This should make it easier to build tools that have a clang -cc1 like
interface, but aren't actually part of clang -cc1.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93282 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
dd4497ab6db9b6b6f9994a608787741b0102c430 12-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Improve on objective-c pointer recognition
during rewrite. No functionality chang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93241 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
26337b2f6d4b8dc7458a6e24dca05cb021a21861 12-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Improve on objective-c pointer recognition
during rewrite. No functionality chang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93241 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
4f22d7090efcaf87925c7adbe7030402a9fb826e 12-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fix rewriting of MacOS sjlj based eh.
Fixes radar 7522880.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93219 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
66867c526ce9ae5402bb3d0caf1458ccd8576a5e 12-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fix rewriting of MacOS sjlj based eh.
Fixes radar 7522880.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93219 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
f47bc1f379fdc281c6e1ddac0208ee0487d73e27 11-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fix rewriting for forward class declaration.
(fixes radar 6969189).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93201 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
91fbd12d8b6e60b72883ff4c42e2a0993087f876 11-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fix rewriting for forward class declaration.
(fixes radar 6969189).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93201 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
24c77c34c6d498386e918a9d4d663b8ff2f54baa 11-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixup rewrite of ivars accessed via an explicit object
in a function. Fixes radar 7522803.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93159 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
c374cd978abdeb289d360426129886f6e354a459 11-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixup rewrite of ivars accessed via an explicit object
in a function. Fixes radar 7522803.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93159 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
a2abcd4dcb47cd3671772524a111467f7e57163c 10-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Silence MSVC warning.

RewriteObjC.cpp(4419) : warning C4804: '>' : unsafe use of type 'bool' in operation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93124 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
1211a71912f263f6991eebfc27a8421a8800b9ec 10-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Silence MSVC warning.

RewriteObjC.cpp(4419) : warning C4804: '>' : unsafe use of type 'bool' in operation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93124 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
698d8f3d012663fd816aece0570f291926fb35d0 10-Jan-2010 Anton Korobeynikov <asl@math.spbu.ru> Generalize target weirdness handling having proper layering in mind:
1. Add helper class for sema checks for target attributes
2. Add helper class for codegen of target attributes

As a proof-of-concept - implement msp430's 'interrupt' attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93118 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
82d0a418c8699fc6f4a9417457ffe93d43bba1c1 10-Jan-2010 Anton Korobeynikov <asl@math.spbu.ru> Generalize target weirdness handling having proper layering in mind:
1. Add helper class for sema checks for target attributes
2. Add helper class for codegen of target attributes

As a proof-of-concept - implement msp430's 'interrupt' attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93118 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
0714c3b193368ead24131b55eee2d4f828f9d2cf 10-Jan-2010 Daniel Dunbar <daniel@zuster.org> Fix PR5982, a refacto in checking for '=' in a -D argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93088 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
1ee4b9e6d2d0d031708e2e6dd52aa9e32b83f1c3 10-Jan-2010 Daniel Dunbar <daniel@zuster.org> Fix PR5982, a refacto in checking for '=' in a -D argument.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93088 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
ba62ebd010101759f34b7b41e73cb1f3650d623d 09-Jan-2010 Chris Lattner <sabre@nondot.org> implement -ftabstop=width, patch by Christian Adåker


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93078 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnosticPrinter.cpp
124fca533d9fef2e3f6359283909bd342b5f5f26 09-Jan-2010 Chris Lattner <sabre@nondot.org> implement -ftabstop=width, patch by Christian Adåker


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93078 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
extDiagnosticPrinter.cpp
b8b10726163b6d84a7f64e5129f894b9d4b7ed95 09-Jan-2010 Chris Lattner <sabre@nondot.org> revert 91891, a workaround for PR5514.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93077 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
4824fcdf37139efa57466a2a5753dd6e5e792ef8 09-Jan-2010 Chris Lattner <sabre@nondot.org> revert 91891, a workaround for PR5514.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93077 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
9ffb1043390ed6ce9772df75ccf2362285d1672c 09-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Use MacroBuilder for TargetDefines instead of std::vector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93058 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
a99927774d07af9c6f0e1945531eadc910592945 09-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Use MacroBuilder for TargetDefines instead of std::vector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93058 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
0c12b3b01dd46b9401ba86e54aa2639c447fa18c 09-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Move MacroBuilder into Frontend/Utils.h and clean it up a bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93057 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
b1b5b901ca229ce05dc40abbec8bebe7b1096e42 09-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Move MacroBuilder into Frontend/Utils.h and clean it up a bit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93057 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
f2004ad85de26143c4b0f7cdef6a94a67a55e1c5 09-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Rework InitPreprocessor to use a MacroBuilder class instead of pushing around
std::vectors.

- MacroBuilder wraps a raw_ostream so it can easily write to any buffer
supported by raw_ostream.
- MacroBuilder's method take Twines for easy string concatenation (this was done
with sprintf and temporary buffers before).
- Targets still use std::vector as they don't have access to the builder.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93051 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
a3d8ced7f022cdbd09891f190342a08f22d80772 09-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Rework InitPreprocessor to use a MacroBuilder class instead of pushing around
std::vectors.

- MacroBuilder wraps a raw_ostream so it can easily write to any buffer
supported by raw_ostream.
- MacroBuilder's method take Twines for easy string concatenation (this was done
with sprintf and temporary buffers before).
- Targets still use std::vector as they don't have access to the builder.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93051 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
652e9cfab8e8b6c138cf3ef3cfc2f443c628ace5 09-Jan-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Switch UndefineBuiltinMacro() over to using StringRef

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93049 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
3e82f8ac70887905caf5e95efab53fd73f9364e1 09-Jan-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Switch UndefineBuiltinMacro() over to using StringRef

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93049 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
45f7d461074a89dcf794cd98e7a5816f515f01e3 09-Jan-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Switch DefineBuiltinMacro() over to using StringRef

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93048 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
8746e4e3810ffa54a3a0fa74ed95d8112defb6fe 09-Jan-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Switch DefineBuiltinMacro() over to using StringRef

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93048 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
1eac081def1152b43873db3c3d6e5127787c5d14 09-Jan-2010 Chris Lattner <sabre@nondot.org> improve support for dragonfly, patch by Sascha Wildner!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93044 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
7a7ca281bcf50b34de1ce067d3c55879b81722ae 09-Jan-2010 Chris Lattner <sabre@nondot.org> improve support for dragonfly, patch by Sascha Wildner!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@93044 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
54d54b5a7bae186b56b606382ce36c5724335f13 08-Jan-2010 Dan Gohman <gohman@apple.com> Use -fno-math-errno by default, and remove the IsMathErrnoDefault
targethook, which is no longer being used. This fixes PR5971.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92987 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c31176d5ebbcd407aa512bbd5f717e35da629e7d 08-Jan-2010 Dan Gohman <gohman@apple.com> Use -fno-math-errno by default, and remove the IsMathErrnoDefault
targethook, which is no longer being used. This fixes PR5971.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92987 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
fdcf3b67b9a57bfff03a7e4bb07fdfc7528a65b0 08-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> clang ObjC rewriter: generated code used in "for (x in y)" loop uses
incorrect cast, causing compile error (fixes radar 7342867).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92986 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
65b0aa5d3973e07c8c4449ef2b81c389fd48229a 08-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> clang ObjC rewriter: generated code used in "for (x in y)" loop uses
incorrect cast, causing compile error (fixes radar 7342867).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92986 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
43577b5238b1e91c0a620888e3b8c4957e2e9694 07-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a bug where we were rewriting two definitions of
_objc_method (part of radar 7490408).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92957 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
f292fcf6bd5118499a830e0950429effeb373c28 07-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a bug where we were rewriting two definitions of
_objc_method (part of radar 7490408).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92957 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
fea8455386f95e5ba5e53ed75ff1191f0a33974f 07-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a bug in my last patch (related to radar 7490331).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92952 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
d83658d45484df6e209d207e750a28b6424f9c56 07-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixes a bug in my last patch (related to radar 7490331).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92952 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
550f28a74c11503d9cc4adf34c5a0639606b8361 07-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Avoid error when convering a pointer to integer in
rewriting.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92925 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
c98cbb4a4acb48b09694108761af3c8ba8f7caf2 07-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Avoid error when convering a pointer to integer in
rewriting.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92925 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
fcc212346382730c9d289bd96d2c27dc9c213a2f 07-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fix rewriting of ivars. Fixes radar 7490331.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92924 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
84ed600154d48d75f204795410aae808d7e4b7bd 07-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fix rewriting of ivars. Fixes radar 7490331.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92924 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
3bdd5a692844a1273321fc3eca79a836a90bf2c7 07-Jan-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Convert from char pointer to char array

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92923 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
7d0eed6ed767afc5d849144915ef42a3108d473c 07-Jan-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Convert from char pointer to char array

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92923 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
4816e3f43cb95c35202db24eeb8673aa35f17c6e 07-Jan-2010 Ted Kremenek <kremenek@apple.com> Fix typo: rename Rewriter::getRewritenText() -> Rewriter::getRewrittenText().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92922 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
6a12a14a529a79524e17889046c7098b80a73c49 07-Jan-2010 Ted Kremenek <kremenek@apple.com> Fix typo: rename Rewriter::getRewritenText() -> Rewriter::getRewrittenText().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92922 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
ac8a10218de45c312efb24248d71b0c7d160a1d2 07-Jan-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Tigthen scope of local char array

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92917 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
a66a31940a459a16160d318ed1767f5c1c1e013e 07-Jan-2010 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Tigthen scope of local char array

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92917 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
42c0c4c4c5a06ed3bca2f21b65d3f42827dcfd57 07-Jan-2010 Ted Kremenek <kremenek@apple.com> Change ObjCContainerDecl to contain the entire range for the '@end'
piece of the declaration. The '@' and the 'end' are separate tokens,
and require two SourceLocations to accurately track.

This change was motivated because ObjCContainerDecl::getSourceRange()
would previously not return the entire range of the declaration (the
'end' would be left off).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92891 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
ewriteObjC.cpp
782f2f52b78d8ca785110398a7f7b56b830b9ac7 07-Jan-2010 Ted Kremenek <kremenek@apple.com> Change ObjCContainerDecl to contain the entire range for the '@end'
piece of the declaration. The '@' and the 'end' are separate tokens,
and require two SourceLocations to accurately track.

This change was motivated because ObjCContainerDecl::getSourceRange()
would previously not return the entire range of the declaration (the
'end' would be left off).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92891 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
ewriteObjC.cpp
e3ccb20710d1d4903d600a2b08e55f7b4d375c6c 07-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> When suggesting a typo correction for an @implementation without a
corresponding @interface, provide a note showing which interface we're
referring to. This note has the fix-it hint on it.

Also, don't automatically apply fix-it hints for notes. They're meant
to express fix-its that would change semantics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92870 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
a6f26387355c9a9e61a33c480e28f1a9a15f9b62 07-Jan-2010 Douglas Gregor <dgregor@apple.com> When suggesting a typo correction for an @implementation without a
corresponding @interface, provide a note showing which interface we're
referring to. This note has the fix-it hint on it.

Also, don't automatically apply fix-it hints for notes. They're meant
to express fix-its that would change semantics.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92870 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
8ca761bc62a3749d80becb3e49dd54098c9079d3 07-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Move the allocation of designators in DesignatedInitExpr to the
ASTContext. Fixes <rdar://problem/7495428>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92867 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
319d57f21600dd2c4d52ccc27bd12ce260b174e7 07-Jan-2010 Douglas Gregor <dgregor@apple.com> Move the allocation of designators in DesignatedInitExpr to the
ASTContext. Fixes <rdar://problem/7495428>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92867 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
ddd399c8bf904dc9c29908d618c1d3cecb045db2 06-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixed a bug where initializer is a macro in rewrite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92801 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
791b10d03570ca8c5d3e344cc09900d1a8313999 06-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Fixed a bug where initializer is a macro in rewrite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92801 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
d8208f35c14ee1493ff51103b66254aa8e71f375 05-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> API support for __block variables which are also __weak.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92755 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
2086d544d38f2611f2fba034e25833a47c81fb21 05-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> API support for __block variables which are also __weak.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92755 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
75102c5be174bb96924cf0a91bb0047dff06a04b 05-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Minor clean up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92746 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
e1f84f8e4cd02347ab0e74eb8f328b3bcacb369c 05-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> Minor clean up.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92746 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
72a18e8f62ff693b08a212a2abcd3fc1de22937c 05-Jan-2010 Steve Naroff <snaroff@apple.com> Remove bogus "C" from preamble block decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92744 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
cd826370bb146a25bddea48399953dd3077710cf 05-Jan-2010 Steve Naroff <snaroff@apple.com> Remove bogus "C" from preamble block decls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92744 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
d31f2a836d87867ec5daafd89dbffb75a9113d46 05-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> More rewriting of __block APIs. wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92742 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
ab10b2ebad09c283ccab0ef043118b3cf0166b56 05-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> More rewriting of __block APIs. wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92742 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
77a2901ea8aa85632980175fd672076c11ab013a 05-Jan-2010 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/7490212> clang rewriter: return of the mixed line endings, which is
related to <rdar://problem/6596843> clang ObjC rewriter: Line endings still mixed in rewrite output

This fix was dropped when I integrated the 'objective-rewrite' branch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92737 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
d57d7c090468712dca447af901eac377711394e5 05-Jan-2010 Steve Naroff <snaroff@apple.com> Fix <rdar://problem/7490212> clang rewriter: return of the mixed line endings, which is
related to <rdar://problem/6596843> clang ObjC rewriter: Line endings still mixed in rewrite output

This fix was dropped when I integrated the 'objective-rewrite' branch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92737 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
ca64326c6ecbcb02206dbb46ff928bd41f678c29 05-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> More rewriting of __block objective-c pointer variables. wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92558 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
d2eb1fdb1cfd37a6b93b46161826a23740d185e7 05-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> More rewriting of __block objective-c pointer variables. wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92558 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
be1482b3d18a4d30e6d85d0a2079f98a151cc0ff 05-Jan-2010 Mike Stump <mrs@apple.com> Fix warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92551 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
c9a82a7085584dc20d43401322da2f41132c3229 05-Jan-2010 Mike Stump <mrs@apple.com> Fix warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92551 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
be1f166f974c24a0b945cddf82e448d1b7d189ef 05-Jan-2010 Ted Kremenek <kremenek@apple.com> Remove references to 'Checker' and 'GRTransferFuncs' from
GRStateManager. Having these references was an abstraction violation,
as they really should only be known about GRExprEngine.

This change required adding a new 'ProcessAssume' callback in
GRSubEngine. GRExprEngine implements this callback by calling
'EvalAssume' on all registered Checker objects as well as the
registered GRTransferFunc object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92549 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
32a58084a4c53e6938dd81bfce224db25a5976d1 05-Jan-2010 Ted Kremenek <kremenek@apple.com> Remove references to 'Checker' and 'GRTransferFuncs' from
GRStateManager. Having these references was an abstraction violation,
as they really should only be known about GRExprEngine.

This change required adding a new 'ProcessAssume' callback in
GRSubEngine. GRExprEngine implements this callback by calling
'EvalAssume' on all registered Checker objects as well as the
registered GRTransferFunc object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92549 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
bf8cc88a863ad503648b9fc01ace1c1f8812c196 04-Jan-2010 Mike Stump <mrs@apple.com> Remember if the AsmStmt came from Microsoft-style inline assembly code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92526 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
3b11fd3b52e7b88233c602407c151d07cb093e75 04-Jan-2010 Mike Stump <mrs@apple.com> Remember if the AsmStmt came from Microsoft-style inline assembly code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92526 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
736c7be0cb06e78b3277a526eca6b30927009106 04-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> More rewriting of __block declared objective-c/block pointers.
This is wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92501 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
f381cc90d6cfa0966ddf791db57a6ed6c2462b5d 04-Jan-2010 Fariborz Jahanian <fjahanian@apple.com> More rewriting of __block declared objective-c/block pointers.
This is wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92501 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
b5e7bb7dbd6ea02a30f18cd5e637dd231e8486e5 04-Jan-2010 Douglas Gregor <doug.gregor@gmail.com> Teach Preprocessor::macro_begin/macro_end to lazily load all macro
definitions from a precompiled header. This ensures that
code-completion with macro names behaves the same with or without
precompiled headers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92497 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
88a35862fbe473f2a4f0c19f24dbe536937e1dc6 04-Jan-2010 Douglas Gregor <dgregor@apple.com> Teach Preprocessor::macro_begin/macro_end to lazily load all macro
definitions from a precompiled header. This ensures that
code-completion with macro names behaves the same with or without
precompiled headers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92497 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
4731e3abf5543e9dcf4cf3c39e562e8c5c12fdba 03-Jan-2010 Eli Friedman <eli.friedman@gmail.com> Better coverage for -dump-record-layouts and -print-decl-contexts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92441 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
368a55d3ce5d66c6d0502c6f8bf061c06961042c 03-Jan-2010 Eli Friedman <eli.friedman@gmail.com> Better coverage for -dump-record-layouts and -print-decl-contexts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92441 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
d0fd8bfa0dac7de50d82b5ef2d896fc723e1d17a 31-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Let constraint manager inform checkers that some assumption logic has happend.
Add new states for symbolic regions tracked by malloc checker. This enables us
to do malloc checking more accurately. See test case.

Based on Lei Zhang's patch and discussion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92342 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
b94b81a9ab46c99b00c7ad28c5e1e212c63fc9ac 31-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Let constraint manager inform checkers that some assumption logic has happend.
Add new states for symbolic regions tracked by malloc checker. This enables us
to do malloc checking more accurately. See test case.

Based on Lei Zhang's patch and discussion.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92342 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
d54073c7057d0bd765765bec29b72a4bce131803 30-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> When rewriting a __block declaration, use a suitable API to get location of
the declaration in the presence of an initializer macro.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92312 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
6f0a0a9d2068c2ee9f399c72bf550c307bb76f9a 30-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> When rewriting a __block declaration, use a suitable API to get location of
the declaration in the presence of an initializer macro.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92312 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
4fa3f39aff48d8ad685dfb85646191490d2a58ad 30-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Remove an duplicated #include.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92306 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
b07587dde613e2cff13d51633d7e16b14596644b 30-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Remove an duplicated #include.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92306 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
79f414435ef406f9fb3dc7733b93715ac6313425 29-Dec-2009 Anders Carlsson <andersca@mac.com> Get rid of FixedWidthIntType, as suggested by Chris and Eli.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92246 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
f5f7d864f5067d1ea4bff7fcf41b53a43b7b48ba 29-Dec-2009 Anders Carlsson <andersca@mac.com> Get rid of FixedWidthIntType, as suggested by Chris and Eli.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92246 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
1b1ac192b6b6ea28048507eec27a4a1fce1b797f 23-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> More cleanup/refactoring of the rewrite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92062 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
ff1278809e62d1da22da171752cc5f07734bcf0c 23-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> More cleanup/refactoring of the rewrite.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92062 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
e6e56be2518d96c1c7ba21e5e2dfd7f438ad8d71 23-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Some cleanup and refactoring of rewriter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92049 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
73e437bbe7e9631ad9055b1d50f4ae8564efbdf3 23-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Some cleanup and refactoring of rewriter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92049 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
44315cf84494c85f23e043b6fba80239a12fa7ed 23-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> This patch concludes rewriteing of __block variables to allow
a small test case using Block_copy(...) API to pass.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92038 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
d25d1b53f098a4dc52469d9956bdd248ea29b38e 23-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> This patch concludes rewriteing of __block variables to allow
a small test case using Block_copy(...) API to pass.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92038 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
1c10f436ff83b0fc0ea0f7711f9f4321a9e79074 23-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Removed a FIXME comment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92028 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
bbf37e232b10793b9ec91f4ea01ec168123d5026 23-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Removed a FIXME comment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92028 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
a3c8a5161137633f82ecc16a2629779a68ecc3c3 23-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> More rewriting of __block variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92027 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
ec878f2726e00e6dc0c432f462dab099e3f4a717 23-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> More rewriting of __block variables.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92027 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
9aa086ec7df90f7c4b5427aecb6455de6448dc7d 23-Dec-2009 Chris Lattner <sabre@nondot.org> switch -Werror/-Wfatal-errors error conditions to use diagnostics instead
of printf, patch by Christian Adaker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92019 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
a3b089e062133bdc0e5c39ea03f8b78230953f6c 23-Dec-2009 Chris Lattner <sabre@nondot.org> switch -Werror/-Wfatal-errors error conditions to use diagnostics instead
of printf, patch by Christian Adaker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92019 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
5928e6d3037bf9dbc1716ebc8344413858d2795f 23-Dec-2009 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Remove RewriteBlocks. It has been superseded by RewriteObjC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92014 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInvocation.cpp
rontendActions.cpp
ewriteBlocks.cpp
49ac8e63a0622ce049e58decab9e844b1e8c7ecd 23-Dec-2009 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Remove RewriteBlocks. It has been superseded by RewriteObjC

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92014 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInvocation.cpp
rontendActions.cpp
ewriteBlocks.cpp
fe0981ec5a44e02823a548bbfd5c48a71e0f50bc 23-Dec-2009 Steve Naroff <snaroff@apple.com> Add support for handling initializers in RewriteObjC::RewriteByRefVar().

As the FIXME indicates, RewriteByRefVar() won't work for multiple declarators (in general). I've discussed this with Fariborz and he is aware of the limitation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92007 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
c5143c538783a2834cfdc3d29db0ff76e857818f 23-Dec-2009 Steve Naroff <snaroff@apple.com> Add support for handling initializers in RewriteObjC::RewriteByRefVar().

As the FIXME indicates, RewriteByRefVar() won't work for multiple declarators (in general). I've discussed this with Fariborz and he is aware of the limitation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@92007 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
6a81dade41ff995e312a70a4c4d1238e83458105 23-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Register call inliner as the last checker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91992 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
60fd3db910aaae0885a01d39ac5814e8eae2efc6 23-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Register call inliner as the last checker.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91992 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
a48a9f6d615af246eb18b93ccfd11aa087bc1403 23-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Migrate the call inliner to the Checker interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91991 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
3ff8481f4be3f30e1082488238d83f78342303e1 23-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Migrate the call inliner to the Checker interface.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91991 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
03447577fcd6d74c7806334953f5dc5551bef364 23-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to do more rewrite of __block variables.
Still WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91977 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
52b08f2c8a65c059cb2123fa0fd6317b829416de 23-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Patch to do more rewrite of __block variables.
Still WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91977 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
93e4192cb38df5789b0a531c916d6a5cd5d09ca9 23-Dec-2009 Chris Lattner <sabre@nondot.org> implement -W[no-]fatal-errors, patch by Christian Adåker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91938 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
e663c720063fc9ff9f75bcbe38cd070c73c78b0e 23-Dec-2009 Chris Lattner <sabre@nondot.org> implement -W[no-]fatal-errors, patch by Christian Adåker!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91938 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
a9a28711d3d10a0de053f4573a9a969028226736 22-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Serialize the NoReturn bit on FunctionTypes for precompiled headers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91911 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
9123666ed4ab82182b92f8d978a2801516dcd63d 22-Dec-2009 Douglas Gregor <dgregor@apple.com> Serialize the NoReturn bit on FunctionTypes for precompiled headers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91911 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
595d552ed62976bd2fff05a0568af37f4de3fef5 22-Dec-2009 Anders Carlsson <andersca@mac.com> Work around PR5514.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91891 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
fc4020a4fac183c47a2eadaf2aa62a4fb77447ca 22-Dec-2009 Anders Carlsson <andersca@mac.com> Work around PR5514.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91891 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
44be4f69e99a97bcd907357d5eb389465715bf97 22-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Template code for rewrite of __block variables - wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91865 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
1be6b460d5aa4dda4274a15eeba824dfd4ad10d0 22-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Template code for rewrite of __block variables - wip.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91865 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
2bf3a4b72a8e49b5e83efac565a8998512c1febf 22-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Providing support for rewriting of block copy/dispose of
imported block variables. WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91856 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
4fcc4fd1adf272450bdecab7f9133ae2f0b8aa19 22-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Providing support for rewriting of block copy/dispose of
imported block variables. WIP.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91856 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
26cda1c17aff55dc626f894cd101319742a7eba7 18-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix a few MSVC warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91714 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
b0b84385f0cb0ea4036579f5f384f1c19b917c7e 18-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix a few MSVC warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91714 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
bab9be497c4a0745f55fa3579735c0749508e4a0 18-Dec-2009 Edwin Török <edwintorok@gmail.com> Debian has x86_64-linux-gnu, not x86_64-pc-linux-gnu, so add it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91698 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
331e8010aed1c2175328ed470aea75e93ff70b32 18-Dec-2009 Torok Edwin <edwintorok@gmail.com> Debian has x86_64-linux-gnu, not x86_64-pc-linux-gnu, so add it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91698 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
147b144ea350f2c759c245f98f2c7efb4dd6fc75 18-Dec-2009 Edwin Török <edwintorok@gmail.com> Move the 4.4.2 c++ include search to the top, otherwise it was picking the 4.1.3
dirs on my system. Which is wrong, since it was missing the x86_64-pc-linux-gnu
suffix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91694 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
fc4b899563f70b2b1fc45948ebf7451f16ccfc09 18-Dec-2009 Torok Edwin <edwintorok@gmail.com> Move the 4.4.2 c++ include search to the top, otherwise it was picking the 4.1.3
dirs on my system. Which is wrong, since it was missing the x86_64-pc-linux-gnu
suffix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91694 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
e17d54c995fd5e43e7639ad9a3edb44b30579c30 18-Dec-2009 Daniel Dunbar <daniel@zuster.org> clang -cc1: Rename -mcpu to -target-cpu to match other target options and not alias driver/backend option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91671 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
38b48afd338d494099697d2611e1f45e558e469e 18-Dec-2009 Daniel Dunbar <daniel@zuster.org> clang -cc1: Rename -mcpu to -target-cpu to match other target options and not alias driver/backend option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91671 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e9756514b410b0ac5afa00cdb4569e1f62f4a7f4 18-Dec-2009 Daniel Dunbar <daniel@zuster.org> Add -dwarf-debug-flags, which provides a way to embed the cc1 level options used
to compile a translation unit into the debug info for that file.
- Used by parts of Darwin build process to check compiler flags, etc.
- <rdar://problem/7256886> clang does not emit AT_APPLE_flags

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91661 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f2d8b9f967a1ab53ee9fdbcc3ac0a4ee0a83a26e 18-Dec-2009 Daniel Dunbar <daniel@zuster.org> Add -dwarf-debug-flags, which provides a way to embed the cc1 level options used
to compile a translation unit into the debug info for that file.
- Used by parts of Darwin build process to check compiler flags, etc.
- <rdar://problem/7256886> clang does not emit AT_APPLE_flags

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91661 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
68bc9223f8524636b4b24c99130c733cbbafe0b1 18-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Implemented rewriting of invocation of a block ivar.
(radar 7482224).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91652 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
e24b22bb58e38253da0bda26da51da7663ca743b 18-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Implemented rewriting of invocation of a block ivar.
(radar 7482224).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91652 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
f33eac538f44f01d3462bf6fb7c0891c80b42311 16-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix -fdollars-in-identifiers Clang translation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91562 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
8663b180085e9bc7a0a87c80cc3f722efef99e79 16-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix -fdollars-in-identifiers Clang translation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91562 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
158df1c7b4604fbde219753ec23cd931ca1612f7 16-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> When value-initializing a class with no user-defined constructors but
with a non-trivial default constructor, zero-initialize the storage
and then call the default constructor. Fixes PR5800.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91548 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
16006c901315fa12a108b4e571f187f4b676e426 16-Dec-2009 Douglas Gregor <dgregor@apple.com> When value-initializing a class with no user-defined constructors but
with a non-trivial default constructor, zero-initialize the storage
and then call the default constructor. Fixes PR5800.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91548 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
2186f97cb2706eb3bf26b0f5c943e228e4055593 16-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> implement PR5654: add -fassume-sane-operator-new, which is enabled by default, and adds the malloc attribute to the global function new() and to the overloaded new operators.

feel free to chage the name to this lengthy argument

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91543 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
fc2844846e91398205fddc71196fe9dda04e105f 16-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> implement PR5654: add -fassume-sane-operator-new, which is enabled by default, and adds the malloc attribute to the global function new() and to the overloaded new operators.

feel free to chage the name to this lengthy argument

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91543 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
4c0d4954c05e49efb222121fd34c7885f6695d3a 16-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Expose C++ methods to GRExprEngine.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91506 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
802be99a6817aba6edb166b93c133da4358aa783 16-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Expose C++ methods to GRExprEngine.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91506 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
afe90ebd9ce0079385245d72f893d2da32c3692b 16-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Switch the C++ new expression over to InitializationSequence, rather
than using its own partial implementation of initialization.

Switched CheckInitializerTypes over to
InitializedEntity/InitializationKind, to help move us closer to
InitializationSequence.

Added InitializedEntity::getName() to retrieve the name of the entity,
for diagnostics that care about such things.

Implemented support for default initialization in
InitializationSequence.

Clean up the determination of the "source expressions" for an
initialization sequence in InitializationSequence::Perform.

Taught CXXConstructExpr to store more location information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91492 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
99a2e600f9e2e51d3ce10fb6f27191677ac65b2a 16-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch the C++ new expression over to InitializationSequence, rather
than using its own partial implementation of initialization.

Switched CheckInitializerTypes over to
InitializedEntity/InitializationKind, to help move us closer to
InitializationSequence.

Added InitializedEntity::getName() to retrieve the name of the entity,
for diagnostics that care about such things.

Implemented support for default initialization in
InitializationSequence.

Clean up the determination of the "source expressions" for an
initialization sequence in InitializationSequence::Perform.

Taught CXXConstructExpr to store more location information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91492 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
035b42b2fe21cdc11eae5b521276ff1429115143 15-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Implement conditional block invocation rewrite
and some clean up and a block rewriter test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91435 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
8a9e170efd32855377bc7fc5f7ea431ec4f8802e 15-Dec-2009 Fariborz Jahanian <fjahanian@apple.com> Implement conditional block invocation rewrite
and some clean up and a block rewriter test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91435 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
cc95b731d4117c78c220231bbf568605fd39ff0c 15-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Add comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91430 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
da17fd50ad485fd2a1fc5c2f055caacf532992da 15-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Add comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91430 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
48f7fd7894cc17bf9498cbe1ee273d06f8fc2a84 15-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Remove displayProgress parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91429 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
8d09bafdcf870b72e8781279378e7e264499b230 15-Dec-2009 Zhongxing Xu <xuzhongxing@gmail.com> Remove displayProgress parameter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91429 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
b6f0a584301007695651b29834500f971d93e929 15-Dec-2009 Daniel Dunbar <daniel@zuster.org> Add -resource-dir to clang -cc1, this allows the base directory for compiler
resources (e.g., /usr/lib/clang/1.1) to be passed on the command line instead of
computed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91370 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
nitHeaderSearch.cpp
8b9adfea5e834eaee0f45d8cc7fb052d68df4a46 15-Dec-2009 Daniel Dunbar <daniel@zuster.org> Add -resource-dir to clang -cc1, this allows the base directory for compiler
resources (e.g., /usr/lib/clang/1.1) to be passed on the command line instead of
computed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91370 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
nitHeaderSearch.cpp
a510eb928204e0db46c3d5597f98db5057885c02 13-Dec-2009 Daniel Dunbar <daniel@zuster.org> Lift builtin-include-path logic out of ASTUnit::LoadFromCommandLine and fix CIndex to pass in the right directory (previously it was using the path to the main executable, which generally is wrong).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91238 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
869824e87940f97b87064db2df2861e82e08a8c6 13-Dec-2009 Daniel Dunbar <daniel@zuster.org> Lift builtin-include-path logic out of ASTUnit::LoadFromCommandLine and fix CIndex to pass in the right directory (previously it was using the path to the main executable, which generally is wrong).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91238 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c1737ae61e47af3fee9f1c9c4912545b064a2213 13-Dec-2009 Daniel Dunbar <daniel@zuster.org> CompilerInvocation: Move builtin-include-path logic out of CompilerInvocation::CreateFromArgs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91237 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
nitHeaderSearch.cpp
1e69fe3a9f0a42b32a3000bda51677d51416564e 13-Dec-2009 Daniel Dunbar <daniel@zuster.org> CompilerInvocation: Move builtin-include-path logic out of CompilerInvocation::CreateFromArgs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91237 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ompilerInvocation.cpp
nitHeaderSearch.cpp
d3dfdc5c9eb71b0fb2e802aafb3b84cd556d01f0 13-Dec-2009 Daniel Dunbar <daniel@zuster.org> Backend: Switch to using TargetOptions or TargetMachine to set some options instead of llvm::cl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91229 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
821e2eb026f7e2b915d198cc453174dca8277b41 13-Dec-2009 Daniel Dunbar <daniel@zuster.org> Backend: Switch to using TargetOptions or TargetMachine to set some options instead of llvm::cl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91229 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
9d02e7c5fa4e30ceb52a2956c0018ec41a5b6da0 12-Dec-2009 Jeffrey Yasskin <jyasskin@google.com> Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
no extra safety anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91207 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendAction.cpp
angStandards.cpp
CHReader.cpp
9f61aa9e280adea9fbf3365f0e4f6ed568c9885a 12-Dec-2009 Jeffrey Yasskin <jyasskin@google.com> Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gave
no extra safety anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91207 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
rontendAction.cpp
angStandards.cpp
CHReader.cpp
f07256841e4f39428b5086c10c531a63b753c8bf 12-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4642: move work in HTMLPrinter out of the destructor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91205 91177308-0d34-0410-b5e6-96231b3b80d8
TMLPrint.cpp
de2baa7576f6638c31168960557d30eac1766eb9 12-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4642: move work in HTMLPrinter out of the destructor.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91205 91177308-0d34-0410-b5e6-96231b3b80d8
TMLPrint.cpp
669046aad17057d6778610a835f59bc311942f49 12-Dec-2009 Mike Stump <mrs@apple.com> Implement runtime checks for undefined behavior. WIP.

This implements a new flag -fcatch-undefined-behavior. The flag turns
on additional runtime checks for:

T a[I];

a[i] abort when i < 0 or i >= I.

Future stuff includes shifts by >= bitwidth amounts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91198 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
CHReader.cpp
CHWriter.cpp
9c276ae0f24d4cee8f7954069d4b8eae45d0447d 12-Dec-2009 Mike Stump <mrs@apple.com> Implement runtime checks for undefined behavior. WIP.

This implements a new flag -fcatch-undefined-behavior. The flag turns
on additional runtime checks for:

T a[I];

a[i] abort when i < 0 or i >= I.

Future stuff includes shifts by >= bitwidth amounts.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91198 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
CHReader.cpp
CHWriter.cpp
a35794cff0b7a6a09dc4f64870aa47f5aa6251c9 12-Dec-2009 Ted Kremenek <kremenek@apple.com> We should only scan for nested blocks if we are analyzing the body of a function/method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91196 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
130d5ffbb2bb67f7fd59c1e7e5ca99b83f6312c4 12-Dec-2009 Ted Kremenek <kremenek@apple.com> We should only scan for nested blocks if we are analyzing the body of a function/method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91196 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
45331ad5d7bec63a995a5ecd7e27fdc3f3aee6ff 12-Dec-2009 Daniel Dunbar <daniel@zuster.org> Update docs/comments/utils/examples to refer to clang -cc1 instead of clang-cc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91176 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
dd63b28107f21692b5065588f0e90b4534946f93 12-Dec-2009 Daniel Dunbar <daniel@zuster.org> Update docs/comments/utils/examples to refer to clang -cc1 instead of clang-cc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91176 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
fd665d27b26a1d6e0549b79df0bb433a0d356e76 10-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> spread 'const' love to some variables. this considerably reduces the amount of dirty data around.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91002 91177308-0d34-0410-b5e6-96231b3b80d8
angStandards.cpp
68f7a2426227476bcfa33ada70b708c82419dfdc 10-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> spread 'const' love to some variables. this considerably reduces the amount of dirty data around.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91002 91177308-0d34-0410-b5e6-96231b3b80d8
angStandards.cpp
472f89244393933f55431259174d6e7ca14d44a6 09-Dec-2009 John McCall <rjmccall@apple.com> First pass at implementing C++ enum semantics: calculate (and store) an
"integer promotion" type associated with an enum decl, and use this type to
determine which type to promote to. This type obeys C++ [conv.prom]p2 and
is therefore generally signed unless the range of the enumerators forces
it to be unsigned.

Kills off a lot of false positives from -Wsign-compare in C++, addressing
rdar://7455616




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90965 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
842aef8d942a880eeb9535d40de31a86838264cb 09-Dec-2009 John McCall <rjmccall@apple.com> First pass at implementing C++ enum semantics: calculate (and store) an
"integer promotion" type associated with an enum decl, and use this type to
determine which type to promote to. This type obeys C++ [conv.prom]p2 and
is therefore generally signed unless the range of the enumerators forces
it to be unsigned.

Kills off a lot of false positives from -Wsign-compare in C++, addressing
rdar://7455616




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90965 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
a20723e0b2c0854964b89815be030263f0507c43 09-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix crash in DisplayFunction(). ObjCInterfaceDecls can also get passed to this function, but we don't want to display them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90944 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
029a14ae819fab05b1ce0b3612cb6e34f1110754 09-Dec-2009 Ted Kremenek <kremenek@apple.com> Fix crash in DisplayFunction(). ObjCInterfaceDecls can also get passed to this function, but we don't want to display them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90944 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
23e26cd7bef2628cea5f3e89af85ae8df7be054c 09-Dec-2009 Chris Lattner <sabre@nondot.org> Neil points out that this could be simplified, do it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90927 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
13d555859cd643d657000401ebc88ca404d23bba 09-Dec-2009 Chris Lattner <sabre@nondot.org> Neil points out that this could be simplified, do it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90927 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
d3f6ebfec76376d74e4609bcd85a8200966c9886 09-Dec-2009 Daniel Dunbar <daniel@zuster.org> Increase inlining threshold at -O3, to match llvm-gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90897 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
90de51f1fc58e2cca28fb1e6c01b1e43f000f006 09-Dec-2009 Daniel Dunbar <daniel@zuster.org> Increase inlining threshold at -O3, to match llvm-gcc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90897 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
455fe3c9dc1cd5457e3e99c2381199f6aa748dee 08-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Twinify InitHeaderSearch::AddPath and use it in C++ include path generation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90853 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
e89ba59005479529f5567f12b436617a2ca73ec2 08-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Twinify InitHeaderSearch::AddPath and use it in C++ include path generation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90853 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
a62a6d1baa352379029a98c16f80503c1f531a8f 08-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Use StringRefs in InitHeaderSearch::AddDelimitedPaths.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90852 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
9e9ddf6100fd50ca2f9f9d0106b856e20b43300f 08-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Use StringRefs in InitHeaderSearch::AddDelimitedPaths.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90852 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
b85c1556de06cc741c9465e669cbe8c2c559ffde 08-Dec-2009 John McCall <rjmccall@apple.com> DeclRefExpr stores a ValueDecl internally.

Template instantiation can re-use DeclRefExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90848 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
dbd872f273a8dbf22e089b3def6c09f0a460965d 08-Dec-2009 John McCall <rjmccall@apple.com> DeclRefExpr stores a ValueDecl internally.

Template instantiation can re-use DeclRefExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90848 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
b7c2395ad5ca71d011ff7feebb4bc05edfca488a 08-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Small compatibility fix for -print-decl-contexts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90838 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
7ac1c9ef0bd250da82ddf3f5213182278e351753 08-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Small compatibility fix for -print-decl-contexts.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90838 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
2ab887915142c46b8c6d5dae98f1e6ec7cb07fbe 08-Dec-2009 Jeffrey Yasskin <jyasskin@google.com> Remove several .c_str() to be forward-compatible with StringRef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90822 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
e3fdca2ee0346a41d9cc5ee417a75e66274216f5 08-Dec-2009 Jeffrey Yasskin <jyasskin@google.com> Remove several .c_str() to be forward-compatible with StringRef.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90822 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a8e641996bb71bd6d4b999c408567390cbcceead 07-Dec-2009 Ted Kremenek <kremenek@apple.com> Add clang-cc option '-analyzer-opt-analyze-nested-blocks' to treat block literals as an entry point for analyzer checks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90810 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ompilerInvocation.cpp
fc576514d06c46a7cac49500169411d82f38d04b 07-Dec-2009 Ted Kremenek <kremenek@apple.com> Add clang-cc option '-analyzer-opt-analyze-nested-blocks' to treat block literals as an entry point for analyzer checks.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90810 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ompilerInvocation.cpp
bb34e32b0e625b29b008e1753a9b7f4042aca570 07-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> add fedora 12 include path

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90772 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
33cc2437ae3a609cdc44179931a2909eb48a8200 07-Dec-2009 Nuno Lopes <nunoplopes@sapo.pt> add fedora 12 include path

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90772 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
7755c88dcbfa1d4273fd97bdd3415c5c2aa19039 07-Dec-2009 John McCall <rjmccall@apple.com> DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated variables,
but the results are imperfect.

For posterity, I did:

cat <<EOF > $cmdfile
s/DeclaratorInfo/TypeSourceInfo/g
s/DInfo/TInfo/g
s/TypeTypeSourceInfo/TypeSourceInfo/g
s/SourceTypeSourceInfo/TypeSourceInfo/g
EOF

find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \;
find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \;
find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90743 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
a93c934af4fbf97cbe8e649d82e68ccacfe57c95 07-Dec-2009 John McCall <rjmccall@apple.com> DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated variables,
but the results are imperfect.

For posterity, I did:

cat <<EOF > $cmdfile
s/DeclaratorInfo/TypeSourceInfo/g
s/DInfo/TInfo/g
s/TypeTypeSourceInfo/TypeSourceInfo/g
s/SourceTypeSourceInfo/TypeSourceInfo/g
EOF

find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \;
find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \;
find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90743 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
8bf120c01587e720feecda26f5cb46452a0bb85e 07-Dec-2009 Chris Lattner <sabre@nondot.org> fix -dM with variadic macros, PR5699


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90735 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
807b93ee6ae2806b53131abc779d2b146d853aed 07-Dec-2009 Chris Lattner <sabre@nondot.org> fix -dM with variadic macros, PR5699


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90735 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
d8cd96e11a3c63b3238f6a4001dfc746c532fd21 07-Dec-2009 Chris Lattner <sabre@nondot.org> some code cleanup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90732 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
f7449346006d6b94b14a303eb82cad52c8e75413 07-Dec-2009 Chris Lattner <sabre@nondot.org> some code cleanup.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90732 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
04e10b6da70d86392a7c3dc431d1656937a07ccf 06-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=81871
http://llvm.org/viewvc/llvm-project?view=rev&revision=81936
http://llvm.org/viewvc/llvm-project?view=rev&revision=81945



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90718 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
01aec11c8cace2b9b22531627970d8bbdbac0c1c 06-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=81871
http://llvm.org/viewvc/llvm-project?view=rev&revision=81936
http://llvm.org/viewvc/llvm-project?view=rev&revision=81945



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90718 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
5cdf41d00afae1911e94676d7aac599b0a63eba9 06-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix an off by one in findEndOfWord, which could scan past the end of the string in a corner case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90703 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
eae18f89ede182c686e8ee47014fdb3cd3ed496c 06-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix an off by one in findEndOfWord, which could scan past the end of the string in a corner case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90703 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
2bfc59cff4612566d6c86034b01f96adc734db32 06-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=86026

Note: The 'improved debugging' changes weren't integrated (since they were later reverted, since they didn't improve debugging).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90693 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
c9c1e9c4b513e83146eff1728142683980df26a7 06-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=86026

Note: The 'improved debugging' changes weren't integrated (since they were later reverted, since they didn't improve debugging).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90693 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
905c7fab46b38fcd68a680805bec24e696867c53 06-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=82174



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90692 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
fd5b76fe99a123630321b45667a78f1a15be7241 06-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=82174



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90692 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
33708dbb44270ca513b1f45eaccdc9711dd96f52 06-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=72893



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90690 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
a851e60b7eb1d51549222ac838b8b602f23ec701 06-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=72893



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90690 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
293b54458c0b81c31a3bd5c4a0172d8d95a3894f 06-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=71473



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90688 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
d76fbda5da19c34752aa582e690a4dbd1cae39cd 06-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=71473



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90688 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
58101cba4b612d3365277bdb0d4222c46a8b684c 05-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Don't call back() on an empty vector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90678 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
b2041de2eb3e44d04cb8c62c4369314af4fd6a90 05-Dec-2009 Benjamin Kramer <benny.kra@googlemail.com> Don't call back() on an empty vector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90678 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
0cdb3794db8269ffb420009a56dce86be00c368e 05-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=71225
http://llvm.org/viewvc/llvm-project?view=rev&revision=73207
http://llvm.org/viewvc/llvm-project?view=rev&revision=73414



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90677 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
b85e77af052ea495aa47edcce3b1ec8887e53873 05-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=71225
http://llvm.org/viewvc/llvm-project?view=rev&revision=73207
http://llvm.org/viewvc/llvm-project?view=rev&revision=73414



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90677 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
9369b4641e01980208549c38a3701f9e2c55a841 05-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=71086
http://llvm.org/viewvc/llvm-project?view=rev&revision=71107

Note: This fixes <rdar://problem/6845623> from protocol to template.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90665 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
3d7e7865bd0863fcf36aee14d8911b785dde57dd 05-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=71086
http://llvm.org/viewvc/llvm-project?view=rev&revision=71107

Note: This fixes <rdar://problem/6845623> from protocol to template.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90665 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
486e9845f0f2f6b73f45e5015a202201ac2fd489 05-Dec-2009 Steve Naroff <snaroff@apple.com> Remove 'LangOpts' from Diagnostic (added in http://llvm.org/viewvc/llvm-project?view=rev&revision=90642).

Simply use the 'LangOpts' member already present in TextDiagnosticPrinter.

Sorry for the confusion!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90664 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
0304c6cb7fd3b2137213858b1e5ae85ef3f4f8e2 05-Dec-2009 Steve Naroff <snaroff@apple.com> Remove 'LangOpts' from Diagnostic (added in http://llvm.org/viewvc/llvm-project?view=rev&revision=90642).

Simply use the 'LangOpts' member already present in TextDiagnosticPrinter.

Sorry for the confusion!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90664 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
ae427a94f20d49c5e8a73b6458ed06b422813ab8 05-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=71086

Note - This commit only includes the fix for:

<rdar://problem/6309338> slightly different error message format for Visual Studio.

The fix for <rdar://problem/6845623> from protocol to template. is separate/forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90642 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
e0c4d895ffe4320aa4e29485711ad7d154f2cc2b 05-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=71086

Note - This commit only includes the fix for:

<rdar://problem/6309338> slightly different error message format for Visual Studio.

The fix for <rdar://problem/6845623> from protocol to template. is separate/forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90642 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
caf383ae337966d67380b6b161fab17ec2b53d04 04-Dec-2009 John McCall <rjmccall@apple.com> Fix "using typename" and the instantiation of non-dependent using declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90614 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ed97649e9574b9d854fa4d6109c9333ae0993554 04-Dec-2009 John McCall <rjmccall@apple.com> Fix "using typename" and the instantiation of non-dependent using declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90614 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
6d264348e2236668b46991f8084b8a54c7c07dfc 04-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=70978



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90597 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
17c8778db98d531aa4cf704a0a3d97d68e791f0c 04-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=70978



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90597 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
7eafe7e81daa8f79d511829e0c00ed361f51f96a 04-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=70926



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90596 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
fdd6aaf16279c6141da929c1207c15be9b2551ee 04-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=70926



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90596 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
20a9f28af711acc5778ed3ac2692029547260cc9 04-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=70922



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90595 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
e89b8e7946155db1a3bbb1e22addd5d9d2a904df 04-Dec-2009 Steve Naroff <snaroff@apple.com> Integrate the following from the 'objective-rewrite' branch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=70922



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90595 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
b2130f00bef1badd6c766f42d14c0180e0179c75 04-Dec-2009 Daniel Dunbar <daniel@zuster.org> PR5684: Fix refacto, the backend consumer was copying the Diagnostic object,
which meant that hasErrorOccurred() checks to prevent codegen-on-invalid weren't
working.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90560 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
125bbbe648cca39a415a8052cd36b6bd1936d679 04-Dec-2009 Daniel Dunbar <daniel@zuster.org> PR5684: Fix refacto, the backend consumer was copying the Diagnostic object,
which meant that hasErrorOccurred() checks to prevent codegen-on-invalid weren't
working.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90560 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
277ecd35a01920a03f319779c039d676ea2ecaf2 04-Dec-2009 Daniel Dunbar <daniel@zuster.org> ASTUnit/CIndex: Explicitly track the top-level decls when using an ASTUnit made
from a source file.
- This allows CIndex to avoid iterating over all the top-level decls when using
a PCH, which means we deserialize far fewer decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90559 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f772d1e2a5688572d07f42896a50ac57a4a41fe8 04-Dec-2009 Daniel Dunbar <daniel@zuster.org> ASTUnit/CIndex: Explicitly track the top-level decls when using an ASTUnit made
from a source file.
- This allows CIndex to avoid iterating over all the top-level decls when using
a PCH, which means we deserialize far fewer decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90559 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
2ea16d67781aab9757ead93c21aedce5f62b711f 04-Dec-2009 Chris Lattner <sabre@nondot.org> Use PresumedLoc when emitting the 'included from' diagnostics. For a malformed
test like this:

#line 4 "foo"

#define XX ?

#if XX
#endif

We now emit:

In file included from t.c:7:
foo:7:5: error: invalid token at start of a preprocessor expression
#if XX
^
foo:5:12: note: instantiated from:
#define XX ?
^

instead of:

In file included from t.c:7:
foo:7:5: error: invalid token at start of a preprocessor expression
#if XX
^
./t.h:6:12: note: instantiated from:
#define XX ?
^

(where the note doesn't obey #line or print the include stack when needed).

This fixes PR5617



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90554 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
2e77aa1c2a596b66d436d27b8ec2ea695cf9a748 04-Dec-2009 Chris Lattner <sabre@nondot.org> Use PresumedLoc when emitting the 'included from' diagnostics. For a malformed
test like this:

#line 4 "foo"

#define XX ?

#if XX
#endif

We now emit:

In file included from t.c:7:
foo:7:5: error: invalid token at start of a preprocessor expression
#if XX
^
foo:5:12: note: instantiated from:
#define XX ?
^

instead of:

In file included from t.c:7:
foo:7:5: error: invalid token at start of a preprocessor expression
#if XX
^
./t.h:6:12: note: instantiated from:
#define XX ?
^

(where the note doesn't obey #line or print the include stack when needed).

This fixes PR5617



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90554 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
95dd9e9ce0d67b20290812b4db5723ec95ea8a35 04-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Missed change from last commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90550 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
dd27a2d390ec04357a17506df140a79dc447ce2b 04-Dec-2009 Eli Friedman <eli.friedman@gmail.com> Missed change from last commit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90550 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
92322c5f014d13ab44706165c4e26a3bcb6d5d48 03-Dec-2009 Ted Kremenek <kremenek@apple.com> Try to make the output of PlistDiagnostics more deterministic by sorting PathDiagnostics before they are emitted. Fixes <rdar://problem/7439668>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90478 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
f7227709522ad70773467ffb2d620db0d43318d9 03-Dec-2009 Ted Kremenek <kremenek@apple.com> Try to make the output of PlistDiagnostics more deterministic by sorting PathDiagnostics before they are emitted. Fixes <rdar://problem/7439668>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90478 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
537c3461818cf88a8ab483e05d7228991456cd18 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix two more diagnostic-on-stderr instances that thought they could hide from me -- they thought wrong.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90442 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
baac10380c8b8597a9e5f1beb96c439c3bf02baa 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix two more diagnostic-on-stderr instances that thought they could hide from me -- they thought wrong.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90442 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
2b50918fa2304555963214b21b551289fad889c9 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Kill a few more random stderr uses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90441 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
iagChecker.cpp
ixItRewriter.cpp
nitHeaderSearch.cpp
e7cb7e4570842297f698bd7fd8d85520fc008acd 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Kill a few more random stderr uses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90441 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
iagChecker.cpp
ixItRewriter.cpp
nitHeaderSearch.cpp
480d0f0de8d0903a7de64ce0948153d83188ab66 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Use llvm_report_error instead of fprintf + assert + exit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90438 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
33671988f1dd9335ddc2badd4abe001f7319c48f 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Use llvm_report_error instead of fprintf + assert + exit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90438 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
ff484446f9cabe0e9c1737bfee761528ab019cc9 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix CompilerInstance::createOutputFile to use proper diagnostics, and (try to) update all clients to be able to handle failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90437 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendActions.cpp
360435908c9b90429cfe192fab22854af1d4497c 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix CompilerInstance::createOutputFile to use proper diagnostics, and (try to) update all clients to be able to handle failure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90437 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendActions.cpp
338ebe1ccf84cb8deae476ae3262f4461049588c 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Remove an unnecessary (I believe) exit() on error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90436 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
43adb7e9e9bc906210e265c637738b9a962fb6b6 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Remove an unnecessary (I believe) exit() on error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90436 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
5f0565da5a8963b22f1d108c614e240ec7f96c9c 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Switch PCHReader::getOriginalSourceFile to use proper diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90434 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
CHReader.cpp
93ebb1ba9f35ab5e7bff37c471baeb360eeb0b04 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Switch PCHReader::getOriginalSourceFile to use proper diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90434 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
CHReader.cpp
93b0536a7d9a798d87c8772353d1f50f9e6c8895 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix BackendConsumer to use proper diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90433 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
3be0d19503f8291b1581a39a8f6ca01d74bf5cb1 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix BackendConsumer to use proper diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90433 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
9d49f63815d6e6119d346337523e1e07c9b642e5 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> clang-cc: Honor -help and -version when using new style option parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90422 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
9b5e9ae08defd14441acca1d7d4502b933bf6c5a 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> clang-cc: Honor -help and -version when using new style option parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90422 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
9b7e42db3f7fb9f10576dd2251f3c691c7704a49 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 support for -remap-file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90414 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e14b5f5237d0740c2b21c50b2eb41a06e778d820 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 support for -remap-file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90414 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
67af496b731c7571ee529879be16acd6ecdc7bf0 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 -load option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90413 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
efba227cc5459554eca466aafe786b5132dcb68c 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 -load option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90413 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
0e63e4cef5eb977474ebcc44ccb06335626f876c 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix ASTUnit to allows require a (persistent) Diagnostic object be provided; propogate and simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90379 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
rontendAction.cpp
5262fda30b876c8aae95f2eb92e349418d6b14bb 03-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix ASTUnit to allows require a (persistent) Diagnostic object be provided; propogate and simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90379 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
rontendAction.cpp
c0d05c5b347d88964866f598b04900edb8d33f54 02-Dec-2009 Daniel Dunbar <daniel@zuster.org> ASTUnit: Explicitly track whether the ASTUnit came from an actual AST or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90349 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
c7822dbf3c01a2a5f837cff82ba7889ea755daca 02-Dec-2009 Daniel Dunbar <daniel@zuster.org> ASTUnit: Explicitly track whether the ASTUnit came from an actual AST or not.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90349 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ab3dcdb26025c611f1f04a6433d76361fbfc27de 02-Dec-2009 Daniel Dunbar <daniel@zuster.org> ASTUnit: Fix initialization of OnlyLocalDecls variable, and honor UseBumpAllocator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90348 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
68ea2ac7fd98a5a44c7a5b04c54076cf794531cb 02-Dec-2009 Daniel Dunbar <daniel@zuster.org> ASTUnit: Fix initialization of OnlyLocalDecls variable, and honor UseBumpAllocator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90348 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
d60cad99e4fdac287de5e3cc192b6a7231d582b1 02-Dec-2009 Mike Stump <mrs@apple.com> Change rtti/Rtti to RTTI, as it is an acronym.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90334 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
de05057932cebc3f43911f87d75869cb7b705a19 02-Dec-2009 Mike Stump <mrs@apple.com> Change rtti/Rtti to RTTI, as it is an acronym.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90334 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
bd4cbba67a2cb7047c6f82e9b7a1e6f96748904e 02-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Extend -remap-file=from;to to permit mapping from a non-existent
file. This is accomplished by introducing the notion of a "virtual"
file into the file manager, which provides a FileEntry* for a named
file whose size and modification time are known but which may not
exist on disk.

Added a cute little test that remaps both a .c file and a .h file it
includes to alternative files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90329 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
057e567f1b375190779e5341f42861896cdee442 02-Dec-2009 Douglas Gregor <dgregor@apple.com> Extend -remap-file=from;to to permit mapping from a non-existent
file. This is accomplished by introducing the notion of a "virtual"
file into the file manager, which provides a FileEntry* for a named
file whose size and modification time are known but which may not
exist on disk.

Added a cute little test that remaps both a .c file and a .h file it
includes to alternative files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90329 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
c39b3079a8b2d69091a368c5f2f7aa2a6a5845ce 02-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Move file-remapping logic into InitPreprocesor. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90322 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
nitPreprocessor.cpp
2973c0eff437e57541735c9bb9561358715440e6 02-Dec-2009 Douglas Gregor <dgregor@apple.com> Move file-remapping logic into InitPreprocesor. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90322 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
nitPreprocessor.cpp
5a21f1b51d958d4d1e1926e439b5dd66074f3121 02-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix ASTUnit::getOriginalSourceFileName() when using ASTUnit's derived from
source files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90311 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
68d40e2d16b9fadba386853d6bbb60089291fdc5 02-Dec-2009 Daniel Dunbar <daniel@zuster.org> Fix ASTUnit::getOriginalSourceFileName() when using ASTUnit's derived from
source files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90311 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
7cea6e7452920d4cc87c04bebf1b8b78f13fec84 02-Dec-2009 Daniel Dunbar <daniel@zuster.org> ASTUnit: Don't create an LLVMContext, it shouldn't be needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90310 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
cb6dda1a7abe2fe30b0345bfbbf872cc73446678 02-Dec-2009 Daniel Dunbar <daniel@zuster.org> ASTUnit: Don't create an LLVMContext, it shouldn't be needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90310 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
b433a70277eab84ec3221781aba642e9da8bc53d 02-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce a new clang-cc option

-remap-file=from;to

which takes the file "from" and transparently replaces its contents
with the contents of the file "to" from the source manager's
perspective. This is the moral equivalent of

cp from saved
cp to from
<call clang>
cp saved from
rm saved

without all of the pesky file copying.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90307 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
716f0b3e2e36f362b64a2ce0a40a9ad915103255 02-Dec-2009 Douglas Gregor <dgregor@apple.com> Introduce a new clang-cc option

-remap-file=from;to

which takes the file "from" and transparently replaces its contents
with the contents of the file "to" from the source manager's
perspective. This is the moral equivalent of

cp from saved
cp to from
<call clang>
cp saved from
rm saved

without all of the pesky file copying.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90307 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
d01fc222cedc08537c9d74e86ac69b4fb684f1a8 02-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Extend the source manager with the ability to override the contents of
files with the contents of an arbitrary memory buffer. Use this new
functionality to drastically clean up the way in which we handle file
truncation for code-completion: all of the truncation/completion logic
is now encapsulated in the preprocessor where it belongs
(<rdar://problem/7434737>).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90300 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
2968442603b029949246467253eeac8139a5b6d8 02-Dec-2009 Douglas Gregor <dgregor@apple.com> Extend the source manager with the ability to override the contents of
files with the contents of an arbitrary memory buffer. Use this new
functionality to drastically clean up the way in which we handle file
truncation for code-completion: all of the truncation/completion logic
is now encapsulated in the preprocessor where it belongs
(<rdar://problem/7434737>).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90300 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
5f037ba770a202ddbf79b2df98ee45514bd659f6 02-Dec-2009 Daniel Dunbar <daniel@zuster.org> Add ASTUnit::LoadFromCommandLine, which creates an ASTUnit out of a list of
(clang/driver) command line arguments (including the source file).
- The arguments are expected to include the source file.

- The idea is that even though this is a somewhat odd API, its the form which
many tools can most easily use (for example, by interposing with the compiler).

Also, switch index-test's -ast-from-source to use this entry point, and provide
a -arg command line argument which can be used to test that the command line
arguments are handled correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90288 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
7b55668db7618334cc40011d3c1e128524d89462 02-Dec-2009 Daniel Dunbar <daniel@zuster.org> Add ASTUnit::LoadFromCommandLine, which creates an ASTUnit out of a list of
(clang/driver) command line arguments (including the source file).
- The arguments are expected to include the source file.

- The idea is that even though this is a somewhat odd API, its the form which
many tools can most easily use (for example, by interposing with the compiler).

Also, switch index-test's -ast-from-source to use this entry point, and provide
a -arg command line argument which can be used to test that the command line
arguments are handled correctly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90288 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
4ddef923cf2d3b5512068c70621c326e15987dc1 01-Dec-2009 Daniel Dunbar <daniel@zuster.org> ASTUnit: Make sure to preserve the TargetInfo for later use.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90263 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
64a32baec6fdc7e5fbcba417a2754f78ab876245 01-Dec-2009 Daniel Dunbar <daniel@zuster.org> ASTUnit: Make sure to preserve the TargetInfo for later use.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90263 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
f095177082b6c6f7be6aaa566ffe0f1c01b8ce76 01-Dec-2009 Rafael Espindola <rafael.espindola@gmail.com> Exit the command line into <built-in> instead of going directly from the command line to the input file.

We passed <built-in> on the way in, so we should pass it again on the way out.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90250 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
0259d20ba1a188acb8770f4b5fab9fc947080be1 01-Dec-2009 Rafael Espindola <rafael.espindola@gmail.com> Exit the command line into <built-in> instead of going directly from the command line to the input file.

We passed <built-in> on the way in, so we should pass it again on the way out.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90250 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
1b95569b560abb0427aa76a597e09e13c21bc290 01-Dec-2009 Daniel Dunbar <daniel@zuster.org> Add ASTUnit::LoadFromCompilerInvocation, which does what it says.

Also, add an -ast-from-source option to index-test which allows index-test to
run on source files directly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90223 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
521bf9c529e653ab28896d027352d3e16e2672d5 01-Dec-2009 Daniel Dunbar <daniel@zuster.org> Add ASTUnit::LoadFromCompilerInvocation, which does what it says.

Also, add an -ast-from-source option to index-test which allows index-test to
run on source files directly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90223 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
63b2bd2961598da03211cbd9c5851d7a54363d47 01-Dec-2009 Douglas Gregor <doug.gregor@gmail.com> Switch the clang-to-CIndex interface for code-completion to a binary format, for a massive speedup

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90209 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
2b4074f1d3919e77cb33ca49c960521dea27afab 01-Dec-2009 Douglas Gregor <dgregor@apple.com> Switch the clang-to-CIndex interface for code-completion to a binary format, for a massive speedup

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90209 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
5042795243266b33fef08663983912de6dff125c 01-Dec-2009 Daniel Dunbar <daniel@zuster.org> clang -cc1: Move CompilerInvocation deserialization into CompilerInvocation.cpp,
where it belongs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90198 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
56ac85c4fd18ee4af27c81b0ce11b2191461a0a5 01-Dec-2009 Daniel Dunbar <daniel@zuster.org> clang -cc1: Move CompilerInvocation deserialization into CompilerInvocation.cpp,
where it belongs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90198 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
a3f4eeff4aec1306447707c73f70a5657357422c 30-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add CodeGenOptions::{SoftFloat,FloatABI}, and update the all the (far too many) places to use this instead of using the backend -soft-float and -float-abi= options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90127 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
ompilerInvocation.cpp
3b315264d1a6fa303e20fe0caec306ccafc090de 30-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add CodeGenOptions::{SoftFloat,FloatABI}, and update the all the (far too many) places to use this instead of using the backend -soft-float and -float-abi= options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90127 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
ompilerInvocation.cpp
507561c5d5f7e06f6f3fe07b394c44f4ff9ca392 30-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add TextDiagnosticBuffer::FlushDiagnostics, for forwarding the buffered diagnostics to a different diagnostics engine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90125 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticBuffer.cpp
c238955f09f3bce9386e6553d5d12f79e8cc2b08 30-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add TextDiagnosticBuffer::FlushDiagnostics, for forwarding the buffered diagnostics to a different diagnostics engine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90125 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticBuffer.cpp
8d9cacb67dd4f30fc20b2f1e2773390ea5c58d77 30-Nov-2009 Daniel Dunbar <daniel@zuster.org> Eliminate CodeGenOptions::TimePasses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90118 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
rontendActions.cpp
b33fbaa5f14452b6dc2442e89266acb0810616fd 30-Nov-2009 Daniel Dunbar <daniel@zuster.org> Eliminate CodeGenOptions::TimePasses.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90118 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
rontendActions.cpp
eeef8220155ad20d50065b5315ea30a83c05a64f 30-Nov-2009 Daniel Dunbar <daniel@zuster.org> Eliminate CodeGenOptions::SimplifyLibCalls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90117 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
3636e1d784aedb37052aa235966e4fdbe7ed9082 30-Nov-2009 Daniel Dunbar <daniel@zuster.org> Eliminate CodeGenOptions::SimplifyLibCalls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90117 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
4d4df61e3badbc9196c12aafd135e8ed6f3686ee 30-Nov-2009 Chris Lattner <sabre@nondot.org> Fix PR5633 by making the preprocessor handle the case where we can
stat a file but where mmaping it fails. In this case, we emit an
error like:
t.c:1:10: fatal error: error opening file '../../foo.h'

instead of "cannot find file".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90110 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
iagChecker.cpp
rontendActions.cpp
ewriteMacros.cpp
erifyDiagnosticsClient.cpp
6e2901407bff59aeb4cc301cc58b034723d0eb49 30-Nov-2009 Chris Lattner <sabre@nondot.org> Fix PR5633 by making the preprocessor handle the case where we can
stat a file but where mmaping it fails. In this case, we emit an
error like:
t.c:1:10: fatal error: error opening file '../../foo.h'

instead of "cannot find file".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90110 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
iagChecker.cpp
rontendActions.cpp
ewriteMacros.cpp
erifyDiagnosticsClient.cpp
4bd2e145168bf379f6753b2de7d8ffa562198599 29-Nov-2009 Daniel Dunbar <daniel@zuster.org> Simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90091 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticBuffer.cpp
4cbe3b64be7b1b312e4e555e8c93ef8e5bd3a820 29-Nov-2009 Daniel Dunbar <daniel@zuster.org> Simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90091 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticBuffer.cpp
75bf1a79fdabced1ccce906c7d86523023c88067 29-Nov-2009 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> This patch moves the frontend timer from clang-cc into CompilerInstance.
CompilerInstance already contains various objects that are used
throughout the entire run.

Also addresses Daniels review comments in:

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20091123/024508.html



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90073 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendAction.cpp
f79bafa608a5d7c49ec40ad199af5e32f3038b47 29-Nov-2009 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> This patch moves the frontend timer from clang-cc into CompilerInstance.
CompilerInstance already contains various objects that are used
throughout the entire run.

Also addresses Daniels review comments in:

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20091123/024508.html



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90073 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendAction.cpp
c481191979b4ca7f2c5511ce9cc4d0fe65fd1d46 29-Nov-2009 Sean Hunt <rideau3@gmail.com> Add DeclarationName support for C++0x operator literals. They should now work as
function names outside of templates - they'll probably cause some damage there as
they're largely untested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90064 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
3e518bda00d710754ca077cf9be8dd821e16a854 29-Nov-2009 Sean Hunt <rideau3@gmail.com> Add DeclarationName support for C++0x operator literals. They should now work as
function names outside of templates - they'll probably cause some damage there as
they're largely untested.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90064 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
e8dd73706cf9c9a2b7b9dce818a7637ef3fa24de 29-Nov-2009 Daniel Dunbar <daniel@zuster.org> Move LLVM backend options to explicit clang-cc / clang -cc1 options, which we then manually pass to the command line library; eventually the latter grossness should be fixed by a real API when creating the target machine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90063 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
ompilerInvocation.cpp
f219e7c1529fac29e34483667f740b452e5ef9cc 29-Nov-2009 Daniel Dunbar <daniel@zuster.org> Move LLVM backend options to explicit clang-cc / clang -cc1 options, which we then manually pass to the command line library; eventually the latter grossness should be fixed by a real API when creating the target machine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90063 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
ompilerInvocation.cpp
5b8c7f0e66b4d802d850430aca5baadc43f811ba 29-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 parsing for LangOptions.
- This is the last major parsing piece, main FIXMEs remain.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90059 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e50c16773bed0a53c0df397186256606375e8722 29-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 parsing for LangOptions.
- This is the last major parsing piece, main FIXMEs remain.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90059 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
97306e57626414a11dbaeda3f03069d16a8ec46d 29-Nov-2009 Daniel Dunbar <daniel@zuster.org> Change LangOptions::ObjCConstantStringClass to an std::string to avoid worrying about the lifetime.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90052 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1b0969590e712d7d52fc9c0d43d3ab85c36d07a6 29-Nov-2009 Daniel Dunbar <daniel@zuster.org> Change LangOptions::ObjCConstantStringClass to an std::string to avoid worrying about the lifetime.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90052 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
42c06b5340576b23978aaea160013c7edbb2b27f 29-Nov-2009 Daniel Dunbar <daniel@zuster.org> Move MainFileName option variable into CodeGenOptions instead of LangOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90051 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7d065d0f21b35f445cee13730398bc2bec6edff2 29-Nov-2009 Daniel Dunbar <daniel@zuster.org> Move MainFileName option variable into CodeGenOptions instead of LangOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90051 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
330e039173497af1526487c3fc4b4135f33874ff 28-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove VISIBILITY_HIDDEN from anonymous namespaces in libFrontend.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90033 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
nalysisConsumer.cpp
ackend.cpp
acheTokens.cpp
ependencyFile.cpp
eneratePCH.cpp
TMLDiagnostics.cpp
CHReader.cpp
CHWriter.cpp
listDiagnostics.cpp
tmtXML.cpp
bd21828179a61bd0954b082825cfb8a93345f602 28-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Remove VISIBILITY_HIDDEN from anonymous namespaces in libFrontend.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90033 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
nalysisConsumer.cpp
ackend.cpp
acheTokens.cpp
ependencyFile.cpp
eneratePCH.cpp
TMLDiagnostics.cpp
CHReader.cpp
CHWriter.cpp
listDiagnostics.cpp
tmtXML.cpp
eb65a1afe645ce039f168ec4627d1f2a287daa86 28-Nov-2009 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Don't call exit(). llvm::llvm_report_error() will do just that

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90031 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
1a9724b697598f754279559ffd16341c36c7f7e1 28-Nov-2009 Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Don't call exit(). llvm::llvm_report_error() will do just that

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90031 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
64eb94ecf6d5b320eb5b1c87019e8ff5111d20f5 26-Nov-2009 Gabor Greif <ggreif@gmail.com> typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89949 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
56e47136201271230251b013c14ece8e0a1d891e 26-Nov-2009 Gabor Greif <ggreif@gmail.com> typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89949 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
a1c754e731ac17fe0d2742365ad3d70630f30b6a 26-Nov-2009 Gabor Greif <ggreif@gmail.com> issue a friendlier error if someone tries to send precompiled header to '-' (stdout)
this brings the error on
clang -c foo.h -o -
closer to
clang -c foo.h -o /dev/null

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89948 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
a4e476d388b975eb07144427b474601ff4e5214c 26-Nov-2009 Gabor Greif <ggreif@gmail.com> issue a friendlier error if someone tries to send precompiled header to '-' (stdout)
this brings the error on
clang -c foo.h -o -
closer to
clang -c foo.h -o /dev/null

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89948 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
0d4c012da45097c5884741e1fefdc2f96254f608 26-Nov-2009 Daniel Dunbar <daniel@zuster.org> Factor out a LangStandard class and coalesce the information about the standards into LangStandards.def
- I'd appreciate another pair of eyeballs to double check this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89919 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
angStandards.cpp
f51ac1b3d0fd39853ba6c04e81149acbca6eead4 26-Nov-2009 Daniel Dunbar <daniel@zuster.org> Factor out a LangStandard class and coalesce the information about the standards into LangStandards.def
- I'd appreciate another pair of eyeballs to double check this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89919 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
angStandards.cpp
72dfa8de67f5b374caf4cd72908285d46aef052a 26-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 parsing for preprocessor options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89917 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
0ff679f5ddd24a4acbeffc9757a9b2a6e4673c14 26-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 parsing for preprocessor options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89917 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
aa0b635db9b7c09031e2f116ccfa00fec5051674 26-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 parsing for header search options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89916 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
d8c780612f33efb2fdc53234129f1df195aacbb1 26-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 parsing for header search options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89916 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
96c4d512d3ce2f9c900de3ae50623583959bf5a4 26-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Allow user re-definition of SEL as well as accessing its fields.
This fixes pr5611.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89895 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
369a3bd9979cf529eed529aa037de713c213e47d 26-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> Allow user re-definition of SEL as well as accessing its fields.
This fixes pr5611.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89895 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
07bdb73e1dd2bdea1306d5babc346ee379e0d623 25-Nov-2009 Ted Kremenek <kremenek@apple.com> Call GRExprEngine::setTransferFunctions() after registering all Checkers. This allows GRTransferFuncs::RegisterChecks() to always be called after all checkers have been registered.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89887 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
eb149ee8f223f328476712e2db444d906be37ecc 25-Nov-2009 Ted Kremenek <kremenek@apple.com> Call GRExprEngine::setTransferFunctions() after registering all Checkers. This allows GRTransferFuncs::RegisterChecks() to always be called after all checkers have been registered.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89887 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
255151bc228dd4c4ca9ba6c66b127f4157c58f7f 25-Nov-2009 Ted Kremenek <kremenek@apple.com> Consolidate logic in ActionInlineCall by having it call ActionGRExprEngine instead of replicating most of its logic (and missing pieces).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89886 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
763bd3bba0318e97b3f7974e666c669141c8b532 25-Nov-2009 Ted Kremenek <kremenek@apple.com> Consolidate logic in ActionInlineCall by having it call ActionGRExprEngine instead of replicating most of its logic (and missing pieces).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89886 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
31983e68d3c9338e7b6e723eb72ef5c995b80f4a 25-Nov-2009 Ted Kremenek <kremenek@apple.com> Make RegisterInternalChecks() part of GRExprEngine's private implementation by making it a static function within GRExprEngine.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89884 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
32c4995826c76f282fc05fbbc3241d2dded4fb57 25-Nov-2009 Ted Kremenek <kremenek@apple.com> Make RegisterInternalChecks() part of GRExprEngine's private implementation by making it a static function within GRExprEngine.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89884 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
2665ec996e717f3f25bcead51f14a4bb366dc71d 25-Nov-2009 Ted Kremenek <kremenek@apple.com> Register internal checks with GRExprEngine when it is constructed, not manually in AnalysisConsumer.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89883 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
c80135ba857da48173578b9c528fce6777e18168 25-Nov-2009 Ted Kremenek <kremenek@apple.com> Register internal checks with GRExprEngine when it is constructed, not manually in AnalysisConsumer.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89883 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
69d26dd880388d2421d59d79f3cf72c85390b254 25-Nov-2009 Daniel Dunbar <daniel@zuster.org> Fix some uses of fprintf/stderr without a prototype.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89858 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
33f57f88f01b791882f8c68ac89fe2fa5e12a393 25-Nov-2009 Daniel Dunbar <daniel@zuster.org> Fix some uses of fprintf/stderr without a prototype.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89858 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
e750d4a82645109039df1a34e999e4d03a9cc6d5 25-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 parsing for frontend options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89856 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
eb01ac82901a9fd8f64d387395af42165556b767 25-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 parsing for frontend options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89856 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
fcbd31311a686139f05764c16e267a537ec879b9 25-Nov-2009 Sean Hunt <rideau3@gmail.com> Parse C++ member check attributes - base_check, hiding, and override.
The attributes are currently ignored.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89837 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
7725e67639fa2fe74f8775b7ed884a076ffdbffc 25-Nov-2009 Sean Hunt <rideau3@gmail.com> Parse C++ member check attributes - base_check, hiding, and override.
The attributes are currently ignored.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89837 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
e16949907574662cb76b58caf13b1a4601276bc5 25-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate CXXConditionDeclExpr with extreme prejudice.

All statements that involve conditions can now hold on to a separate
condition declaration (a VarDecl), and will use a DeclRefExpr
referring to that VarDecl for the condition expression. ForStmts now
have such a VarDecl (I'd missed those in previous commits).

Also, since this change reworks the Action interface for
if/while/switch/for, use FullExprArg for the full expressions in those
expressions, to ensure that we're emitting

Note that we are (still) not generating the right cleanups for
condition variables in for statements. That will be a follow-on
commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89817 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
rintParserCallbacks.cpp
tmtXML.cpp
99e9b4d172f6877e6ba5ebe75bb8238721f5e01c 25-Nov-2009 Douglas Gregor <dgregor@apple.com> Eliminate CXXConditionDeclExpr with extreme prejudice.

All statements that involve conditions can now hold on to a separate
condition declaration (a VarDecl), and will use a DeclRefExpr
referring to that VarDecl for the condition expression. ForStmts now
have such a VarDecl (I'd missed those in previous commits).

Also, since this change reworks the Action interface for
if/while/switch/for, use FullExprArg for the full expressions in those
expressions, to ensure that we're emitting

Note that we are (still) not generating the right cleanups for
condition variables in for statements. That will be a follow-on
commit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89817 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
rintParserCallbacks.cpp
tmtXML.cpp
64ba265d4b05c2621add63b6d5959ac321bd5dc3 24-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Clean up the AST for while loops and fix several problems with
cleanups for while loops:

1) Make sure that we destroy the condition variable of a while statement each time through the loop for, e.g.,

while (shared_ptr<WorkInt> p = getWorkItem()) {
// ...
}

2) Make sure that we always enter a new cleanup scope for the body of the while loop, even when there is no compound expression, e.g.,

while (blah)
RAIIObject raii(blah+1);



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89800 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
5656e14d91405417182171a705ed3e3d2d6d7aa3 24-Nov-2009 Douglas Gregor <dgregor@apple.com> Clean up the AST for while loops and fix several problems with
cleanups for while loops:

1) Make sure that we destroy the condition variable of a while statement each time through the loop for, e.g.,

while (shared_ptr<WorkInt> p = getWorkItem()) {
// ...
}

2) Make sure that we always enter a new cleanup scope for the body of the while loop, even when there is no compound expression, e.g.,

while (blah)
RAIIObject raii(blah+1);



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89800 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
a4b8172b40e73af01884d28c0e832ab117951eb6 24-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Explicitly store the condition variable within switch statements, and
make sure that this variable is destroyed when we exit the switch
statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89776 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
d3d5301c44138b92bf01286183f5bf310cdd37cf 24-Nov-2009 Douglas Gregor <dgregor@apple.com> Explicitly store the condition variable within switch statements, and
make sure that this variable is destroyed when we exit the switch
statement.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89776 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ccb5a3248dbe899ccd0081c0b4e62e2842956496 24-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Explicitly track the condition variable within an "if" statement,
rather than burying it in a CXXConditionDeclExpr (that occassionally
hides behind implicit conversions). Similar changes for
switch, while, and do-while will follow, then the removal of
CXXConditionDeclExpr. This commit is the canary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89717 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
8cfe5a784133d90bf329fd20801824a6f71bb8ca 24-Nov-2009 Douglas Gregor <dgregor@apple.com> Explicitly track the condition variable within an "if" statement,
rather than burying it in a CXXConditionDeclExpr (that occassionally
hides behind implicit conversions). Similar changes for
switch, while, and do-while will follow, then the removal of
CXXConditionDeclExpr. This commit is the canary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89717 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
27d0014be2d42ace977745f5d232ea1359f1847c 24-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 parsing of diagnostic options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89716 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
21affc089773edc30be43ecb0022a48acdac7093 24-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 parsing of diagnostic options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89716 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f092ed6df35668bdbb7c6eca14d0a471523142dc 23-Nov-2009 John Thompson <john.thompson.jtsoftware@gmail.com> Put back hard-coded paths for win32 until I figure out what happened to failed tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89677 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
9319f02dea2449caf5c7a0d07c596ca324e43574 23-Nov-2009 John Thompson <John.Thompson.JTSoftware@gmail.com> Put back hard-coded paths for win32 until I figure out what happened to failed tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89677 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
8d9165b7b24ac4563a56a692e716a1ddbdbb1af0 23-Nov-2009 Rafael Espindola <rafael.espindola@gmail.com> Reorder the header search a bit so that it matches gcc exactly:

*) the ../backward dir is the last in libstdc++ to be searched
*) If compiling c++, the c++ headers are searched first



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89661 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
6ec18a3f86c702004af66cce6ff979999a736898 23-Nov-2009 Rafael Espindola <rafael.espindola@gmail.com> Reorder the header search a bit so that it matches gcc exactly:

*) the ../backward dir is the last in libstdc++ to be searched
*) If compiling c++, the c++ headers are searched first



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89661 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
39e1291cdbae6ce02b7642b12dd39af8762cfa93 23-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Centralize and complete the computation of value- and type-dependence for DeclRefExprs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89649 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
0da76df9218d7c27b471b0a4d83a5b29fe24e5b4 23-Nov-2009 Douglas Gregor <dgregor@apple.com> Centralize and complete the computation of value- and type-dependence for DeclRefExprs

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89649 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteObjC.cpp
0fd696eb70d53f5135a62fbec67bbf1ada621293 22-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 parsing of analyzer options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89629 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e2814d89025b847ad7363b21e3e053bbae180b54 22-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 parsing of analyzer options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89629 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
f3523b67f0a34bc42fa02690c2ebb945fb882ad9 22-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Define __SIG_ATOMIC_WIDTH__ for use in stdint.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89597 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
3e945c8cd8519d0973f14088d938fbc8eee9dc3c 22-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Define __SIG_ATOMIC_WIDTH__ for use in stdint.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89597 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
a238d6daa15f845738a8b15a3bc9f5b84617744b 21-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> This patch implements objective-c's 'SEL' type as a built-in
type and fixes a long-standing code gen. crash reported in
at least two PRs and a radar. (radar 7405040 and pr5025).
There are couple of remaining issues that I would like for
Ted. and Doug to look at:

Ted, please look at failure in Analysis/MissingDealloc.m.
I have temporarily added an expected-warning to make the
test pass. This tests has a declaration of 'SEL' type which
may not co-exist with the new changes.

Doug, please look at a FIXME in PCHWriter.cpp/PCHReader.cpp.
I think the changes which I have ifdef'ed out are correct. They
need be considered for in a few Indexer/PCH test cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89561 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
13dcd00615de5c4279d97bdf63cd5f0a14fd9dcc 21-Nov-2009 Fariborz Jahanian <fjahanian@apple.com> This patch implements objective-c's 'SEL' type as a built-in
type and fixes a long-standing code gen. crash reported in
at least two PRs and a radar. (radar 7405040 and pr5025).
There are couple of remaining issues that I would like for
Ted. and Doug to look at:

Ted, please look at failure in Analysis/MissingDealloc.m.
I have temporarily added an expected-warning to make the
test pass. This tests has a declaration of 'SEL' type which
may not co-exist with the new changes.

Doug, please look at a FIXME in PCHWriter.cpp/PCHReader.cpp.
I think the changes which I have ifdef'ed out are correct. They
need be considered for in a few Indexer/PCH test cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89561 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
53529e8c71aa94b2ea008510a577d59ba8afe3f6 21-Nov-2009 Sean Hunt <rideau3@gmail.com> Added rudimentary C++0x attribute support.
The following attributes are currently supported in C++0x attribute
lists (and in GNU ones as well):
- align() - semantics believed to be conformant to n3000, except for
redeclarations and what entities it may apply to
- final - semantics believed to be conformant to CWG issue 817's proposed
wording, except for redeclarations
- noreturn - semantics believed to be conformant to n3000, except for
redeclarations
- carries_dependency - currently ignored (this is an optimization hint)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89543 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
bbd37c62e34db3f5a95c899723484a76c71d7757 21-Nov-2009 Sean Hunt <rideau3@gmail.com> Added rudimentary C++0x attribute support.
The following attributes are currently supported in C++0x attribute
lists (and in GNU ones as well):
- align() - semantics believed to be conformant to n3000, except for
redeclarations and what entities it may apply to
- final - semantics believed to be conformant to CWG issue 817's proposed
wording, except for redeclarations
- noreturn - semantics believed to be conformant to n3000, except for
redeclarations
- carries_dependency - currently ignored (this is an optimization hint)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89543 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
b7c72ce86aa00b8ed08d7b52102fb381ef6fa41f 21-Nov-2009 John Thompson <john.thompson.jtsoftware@gmail.com> Revised Win32 include path to search highest version in registry, plus platform SDK path

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89517 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
75ee3bd6e7ed2b4286d5e717ae7b94411f90b3b9 21-Nov-2009 John Thompson <John.Thompson.JTSoftware@gmail.com> Revised Win32 include path to search highest version in registry, plus platform SDK path

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89517 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f9703ad0bd7bbdf12a29b3761ea9c8a684d4f92e 20-Nov-2009 Daniel Dunbar <daniel@zuster.org> Fix refactoro, clang-cc wasn't properly reporting errors when opening an output file failed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89502 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
fc97102a80bfe0afaa25883a2aa6b5e1d7307d0a 20-Nov-2009 Daniel Dunbar <daniel@zuster.org> Fix refactoro, clang-cc wasn't properly reporting errors when opening an output file failed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89502 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
a1a1086a21b5126cb786905bc1c8dfd6d5599d72 20-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 parsing of CodeGenOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89464 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
50a4487683a7e09fb93e8b506181e034241a0ffe 20-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add clang -cc1 parsing of CodeGenOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89464 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
61985cf402d2ab2347c1d103ccc07c25e2935ff5 19-Nov-2009 Daniel Dunbar <daniel@zuster.org> Fix some default in the option classes, and some CompilerInvocation argification
errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89388 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
1be3b3bd5c983e3fc5b78db155632d2d2d6aa968 19-Nov-2009 Daniel Dunbar <daniel@zuster.org> Fix some default in the option classes, and some CompilerInvocation argification
errors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89388 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
677c6c7dabf7aecd4d8732b9a759f597bd029c3f 19-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Define __WCHAR_WIDTH__ for use in stdint.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89353 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
63e6561343b6bacf6509399a6d8fcce1c039d987 19-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Define __WCHAR_WIDTH__ for use in stdint.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89353 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
361c51b936cd907ddb9c0480bce41ad92d767a10 19-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Add __WINT_WIDTH__ to paramaterize the limits of WINT_MIN and WINT_MAX in
stdint.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89348 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
7635d2151d6045f8106bf947a8e536c1497a7c4e 19-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Add __WINT_WIDTH__ to paramaterize the limits of WINT_MIN and WINT_MAX in
stdint.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89348 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
b0813f592dcaa82b9d1aa873adec9efe578e0b88 19-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Add __SIZE_WIDTH__ to eventually replace __SIZE_TYPE__ in stdint.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89346 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
7484e5d8e2f2d79750b712c749d6dbfd741b14d5 19-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Add __SIZE_WIDTH__ to eventually replace __SIZE_TYPE__ in stdint.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89346 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
e433de9ae0f50f8d89f5b435e07736f3547665ea 19-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Restore __INTMAX_TYPE__, __UINTMAX_TYPE__, __PTRDIFF_TYPE__, and
__INTPTR_TYPE__ as the last is used in the test/CodeGen/const-init.c and all
could potentially be in use in the wild. My apologies.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89345 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
8241d73c6415a2f5ab4c041c5501a95d7ee32663 19-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Restore __INTMAX_TYPE__, __UINTMAX_TYPE__, __PTRDIFF_TYPE__, and
__INTPTR_TYPE__ as the last is used in the test/CodeGen/const-init.c and all
could potentially be in use in the wild. My apologies.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89345 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
878620468be258da0b098501a507a687bcf596eb 19-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Remove __PTRDIFF_TYPE__ as it is no longer needed by stdint.h. It has been
replaced with __PTRDIFF_WIDTH__.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89344 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
cf2f71f91d6a619772a6fcba63684f28ca7bc72d 19-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Remove __PTRDIFF_TYPE__ as it is no longer needed by stdint.h. It has been
replaced with __PTRDIFF_WIDTH__.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89344 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
3776e37d34c54f8a26470c9a7492f4a0fc7ca61a 19-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Add __PTRDIFF_WIDTH__ macro to eventually replace __PTRDIFF_TYPE__ in stdint.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89342 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
d00c75179c8c0b38e7bcd6365547ca5ba64bf491 19-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Add __PTRDIFF_WIDTH__ macro to eventually replace __PTRDIFF_TYPE__ in stdint.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89342 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
eda3a5104f5611a59e25bde92de5af9fe24a3858 19-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Remove __INTPTR_TYPE__ as it is no longer needed by stdint.h, which uses
__INTPTR_WIDTH__ instead.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89340 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
ed116e95bc01f002918343d6003b573bd17e26a3 19-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Remove __INTPTR_TYPE__ as it is no longer needed by stdint.h, which uses
__INTPTR_WIDTH__ instead.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89340 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
f2db826d4a6a234cf96c805df3c8fc289c1dab91 19-Nov-2009 Daniel Dunbar <daniel@zuster.org> Sketch some 'clang -cc1' support, for testing parts of CompilerInvocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89333 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
217acbfa3524d5805fda7900b26c1e779443588d 19-Nov-2009 Daniel Dunbar <daniel@zuster.org> Sketch some 'clang -cc1' support, for testing parts of CompilerInvocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89333 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
3974c2db5492c532a8d144200c37e3f5f487a071 19-Nov-2009 Daniel Dunbar <daniel@zuster.org> clang-cc: Remove some more llvm::cl::init arguments, by only setting values when
the argument is given.

Also, tweak Opt.Sysroot defaulting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89318 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c59dc9274612f318d43910a3b5de19997a8eb656 19-Nov-2009 Daniel Dunbar <daniel@zuster.org> clang-cc: Remove some more llvm::cl::init arguments, by only setting values when
the argument is given.

Also, tweak Opt.Sysroot defaulting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89318 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
7d02c877c9e0480249422e989f34455fd6256c51 19-Nov-2009 Daniel Dunbar <daniel@zuster.org> Change -code-completion-debug-printer to -no-code-completion-debug-printer.

Also, tweak a few help strings and update CompilerInvocation serialization for prev change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89317 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
4db166b723495fbfa475b50c44f38a4c1bc0bc34 19-Nov-2009 Daniel Dunbar <daniel@zuster.org> Change -code-completion-debug-printer to -no-code-completion-debug-printer.

Also, tweak a few help strings and update CompilerInvocation serialization for prev change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89317 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
fd703aa536f77b380a864351596881c335a2dd1e 18-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Predefine __INTPTR_WIDTH__ for future use in stdint.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89231 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
d896e1ad8634ba84f2f2b2e9e35257b3845fc40b 18-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Predefine __INTPTR_WIDTH__ for future use in stdint.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89231 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
e40e17db7119beedccf33987f1a095a132c4944c 18-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Remove the __INTMAX_TYPE__ and __UINTMAX_TYPE__ built-in macros as they are no
longer used by stdint.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89230 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
eec59a7364cfb4ce409afb2074038dd315bbce96 18-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Remove the __INTMAX_TYPE__ and __UINTMAX_TYPE__ built-in macros as they are no
longer used by stdint.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89230 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
d4d2e6cc8bb638fff486f23ef82dc6b000f346ea 18-Nov-2009 Daniel Dunbar <daniel@zuster.org> Use llvm::sys::Path to check isAbsolute, instead of hard coding. Also, remove random FIXME (?).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89229 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
d5b219706a89f807d0b626b8afd21926ddd95f3e 18-Nov-2009 Daniel Dunbar <daniel@zuster.org> Use llvm::sys::Path to check isAbsolute, instead of hard coding. Also, remove random FIXME (?).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89229 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
d67ad8d26cff81ae48f4e910171a596e1876d3a2 18-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Predefine __INTMAX_WIDTH__ for the future parameterization of INTMAX macros in
stdint.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89203 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
186696bee3b3544d942bb43041595e210de577c6 18-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Predefine __INTMAX_WIDTH__ for the future parameterization of INTMAX macros in
stdint.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89203 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
d1448cac120e790d85643475f88a02ede2fb53fa 18-Nov-2009 Ted Kremenek <kremenek@apple.com> Add SourceLocations to ObjCClassDecl for the class identifiers referenced by @class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89170 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
ewriteObjC.cpp
321c22f1c4271c3d9a3d4d3fc18847f948ab595b 18-Nov-2009 Ted Kremenek <kremenek@apple.com> Add SourceLocations to ObjCClassDecl for the class identifiers referenced by @class.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89170 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
ewriteObjC.cpp
47c04774d0e646160cb4cbc2ae1ea9f2e5df04d7 18-Nov-2009 Ted Kremenek <kremenek@apple.com> Pass source locations of identifiers referenced by @class through Action::ActOnForwardClassDeclaration().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89162 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
c09cba67d0ad01e53e0fed07322e95dd281bcfd9 18-Nov-2009 Ted Kremenek <kremenek@apple.com> Pass source locations of identifiers referenced by @class through Action::ActOnForwardClassDeclaration().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89162 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
da3c0e965155eb3193c36584d3571c38678592da 17-Nov-2009 Nuno Lopes <nunoplopes@sapo.pt> recognize .hpp as c++ (needed for ./configure'ing boost)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89100 91177308-0d34-0410-b5e6-96231b3b80d8
rontendOptions.cpp
2059d992cf87caaa6e1790afacdfdf6a26eb57e1 17-Nov-2009 Nuno Lopes <nunoplopes@sapo.pt> recognize .hpp as c++ (needed for ./configure'ing boost)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89100 91177308-0d34-0410-b5e6-96231b3b80d8
rontendOptions.cpp
392b60e53bf5be7cbeca8d58cc575bcafb40ff9c 17-Nov-2009 Nuno Lopes <nunoplopes@sapo.pt> add Fedora 11 include path. what a crap..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89098 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
189a14869a36ecf8bd5edc94255a34061044efe2 17-Nov-2009 Nuno Lopes <nunoplopes@sapo.pt> add Fedora 11 include path. what a crap..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89098 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f94a175cd8c92730ea545a0607cb48ad412285af 17-Nov-2009 Daniel Dunbar <daniel@zuster.org> Simplify CompilerInvocation::toArgs, now that LangOptions handling is more predictable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89074 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
a51ca5221235325ac420954a357db19290b8f93a 17-Nov-2009 Daniel Dunbar <daniel@zuster.org> Simplify CompilerInvocation::toArgs, now that LangOptions handling is more predictable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89074 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
e6c9f54d16b0af0c3962d456dbc37699d0ccde08 17-Nov-2009 Daniel Dunbar <daniel@zuster.org> Move -fnext-runtime defaulting to driver (and change clang-cc default to
-fnext-runtime), instead of using getDefaultLangOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89058 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
c5a97ec19408c3dca4b6a6385f11d8c783b94d0b 17-Nov-2009 Daniel Dunbar <daniel@zuster.org> Move -fnext-runtime defaulting to driver (and change clang-cc default to
-fnext-runtime), instead of using getDefaultLangOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89058 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInvocation.cpp
660f0a0ecd56cfda36aa921a6c68b065e2e4988f 17-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Silence some warnings produced by Clang, and add a missing header

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89051 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
6490ae5003226cae28f980648948bea8b21a8638 17-Nov-2009 Douglas Gregor <dgregor@apple.com> Silence some warnings produced by Clang, and add a missing header

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89051 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
636e79c53a7a358829b95d8f40e0a658c2d2ef36 17-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add initial cut at CompilerInvocation::toArgs, which "serializes" the CompilerInvocation into a list of arguments which can be passed to clang-cc (eventually, clang -cc1).
- Unfortunately, this is currently a tedious and manual translation. Eventually it would be nice to automatically generate this code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89049 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInvocation.cpp
b3375cba7938e01895bb504e7e48ad94a2e07dd1 17-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add initial cut at CompilerInvocation::toArgs, which "serializes" the CompilerInvocation into a list of arguments which can be passed to clang-cc (eventually, clang -cc1).
- Unfortunately, this is currently a tedious and manual translation. Eventually it would be nice to automatically generate this code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89049 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInvocation.cpp
62515faf2aaec4565171d15e7ae40480ed92731d 17-Nov-2009 Daniel Dunbar <daniel@zuster.org> Simplify PreprocessorOptions, it doesn't need abstracted field access.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89047 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendAction.cpp
nitPreprocessor.cpp
049d3a06ea9f8fc03582488a2b7f24512565a335 17-Nov-2009 Daniel Dunbar <daniel@zuster.org> Simplify PreprocessorOptions, it doesn't need abstracted field access.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89047 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
rontendAction.cpp
nitPreprocessor.cpp
dcaa7786383f799f3ebdc4fbe2bd6ea817e4642a 17-Nov-2009 Daniel Dunbar <daniel@zuster.org> Remove unused IsCXXAware and IgnoreSysRoots option from HeaderSearchOptions::Entry.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89035 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
1b483e70ad3f670f6dd0bc62dbe0921a28195f24 17-Nov-2009 Daniel Dunbar <daniel@zuster.org> Remove unused IsCXXAware and IgnoreSysRoots option from HeaderSearchOptions::Entry.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89035 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
d7e73b50ce836808c23a20ecd10b316a604e9585 16-Nov-2009 Daniel Dunbar <daniel@zuster.org> Store more information in HeaderSearchOptions so that its initialization is not
language dependent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88981 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
c363cb1929c7908c8c8c4b77d025c2ccb09284ae 16-Nov-2009 Daniel Dunbar <daniel@zuster.org> Store more information in HeaderSearchOptions so that its initialization is not
language dependent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88981 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
c79209789205c9de5fcc7aedfd6308057d40b618 16-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> First part of changes to eliminate problems with cv-qualifiers and
sugared types. The basic problem is that our qualifier accessors
(getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at
the current QualType and not at any qualifiers that come from sugared
types, meaning that we won't see these qualifiers through, e.g.,
typedefs:

typedef const int CInt;
typedef CInt Self;

Self.isConstQualified() currently returns false!

Various bugs (e.g., PR5383) have cropped up all over the front end due
to such problems. I'm addressing this problem by splitting each
qualifier accessor into two versions:

- the "local" version only returns qualifiers on this particular
QualType instance
- the "normal" version that will eventually combine qualifiers from this
QualType instance with the qualifiers on the canonical type to
produce the full set of qualifiers.

This commit adds the local versions and switches a few callers from
the "normal" version (e.g., isConstQualified) over to the "local"
version (e.g., isLocalConstQualified) when that is the right thing to
do, e.g., because we're printing or serializing the qualifiers. Also,
switch a bunch of

Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType()

expressions over to

Context.hasSameUnqualifiedType(T1, T2)




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88969 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
CHWriter.cpp
a4923eb7c4b04d360cb2747641a5e92818edf804 16-Nov-2009 Douglas Gregor <dgregor@apple.com> First part of changes to eliminate problems with cv-qualifiers and
sugared types. The basic problem is that our qualifier accessors
(getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at
the current QualType and not at any qualifiers that come from sugared
types, meaning that we won't see these qualifiers through, e.g.,
typedefs:

typedef const int CInt;
typedef CInt Self;

Self.isConstQualified() currently returns false!

Various bugs (e.g., PR5383) have cropped up all over the front end due
to such problems. I'm addressing this problem by splitting each
qualifier accessor into two versions:

- the "local" version only returns qualifiers on this particular
QualType instance
- the "normal" version that will eventually combine qualifiers from this
QualType instance with the qualifiers on the canonical type to
produce the full set of qualifiers.

This commit adds the local versions and switches a few callers from
the "normal" version (e.g., isConstQualified) over to the "local"
version (e.g., isLocalConstQualified) when that is the right thing to
do, e.g., because we're printing or serializing the qualifiers. Also,
switch a bunch of

Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType()

expressions over to

Context.hasSameUnqualifiedType(T1, T2)




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88969 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
CHWriter.cpp
33d838a153f6340ffad044e4fd865289d9fd71f2 16-Nov-2009 Rafael Espindola <rafael.espindola@gmail.com> Use configure options for searching for libstdc++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88945 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ab7ae95c46f288ac52974aa60334a9575f9a850c 16-Nov-2009 Rafael Espindola <rafael.espindola@gmail.com> Use configure options for searching for libstdc++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88945 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f5e348ff64a29d13163240ae13e9b9bc06f857da 16-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Parameterize the constant-generating macros in stdint.h with new built-in
__INTn_C_SUFFIX__ macros that are defined for types with corresponding
constant suffixes (i.e. long and long long).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88914 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
eef22efce8dd9d0ba9adb8f4746b96b584f2521d 16-Nov-2009 Ken Dyck <ken.dyck@onsemi.com> Parameterize the constant-generating macros in stdint.h with new built-in
__INTn_C_SUFFIX__ macros that are defined for types with corresponding
constant suffixes (i.e. long and long long).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88914 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
ca3e991c52d516df8069e9e64261cc5b821f3ecc 15-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add TargetOptions and use it when constructing targets.
- This ended up being hard to factor, sorry for the large diff.

- Some post-commit cleanup to come.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88833 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ackend.cpp
rontendActions.cpp
d58c03f42ebb4e548c2b53fa25b1cfe02ebb9ac0 15-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add TargetOptions and use it when constructing targets.
- This ended up being hard to factor, sorry for the large diff.

- Some post-commit cleanup to come.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88833 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
ackend.cpp
rontendActions.cpp
62ead0154844abdfc0ba63e1ecbb6a5386421454 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add FrontendActions for all preprocessor based clang-cc actions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88774 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
5f3b997e28899972e2ba23ec25e830d4066fa59a 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add FrontendActions for all preprocessor based clang-cc actions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88774 91177308-0d34-0410-b5e6-96231b3b80d8
rontendActions.cpp
7377399fbd7de555def64a5a9c64c71b11792528 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add FrontendActions, which provides a FrontendAction interface to all the existing AST consumer based clang-cc actions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88773 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
rontendActions.cpp
8305d01a1de4bfbfdd501b83074a1e80fada752d 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add FrontendActions, which provides a FrontendAction interface to all the existing AST consumer based clang-cc actions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88773 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
rontendActions.cpp
76ff871fb09e69f01153dfcd396f13cc8d0f67e1 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add FrontendAction interface, for encapsulating a "clang-cc" style action.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88772 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
rontendAction.cpp
4ee24097a8050b885c1d75ca4ee9f6d534c3f20b 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add FrontendAction interface, for encapsulating a "clang-cc" style action.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88772 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
rontendAction.cpp
ef786d1f85f7c524cdec74becf939ee4170f5718 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Shuffle VerifyDiagnosticsClient API to be less fragile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88765 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
erifyDiagnosticsClient.cpp
221c7211c507482a91e97ede1bf6cf65a456ff67 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Shuffle VerifyDiagnosticsClient API to be less fragile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88765 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
erifyDiagnosticsClient.cpp
8feaabf13088d427f1c391e6ef81c09c9f949de2 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add CompilerInstance::InitializeSourceManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88764 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
ccb6cb6fd9e48697564d536b07397b95dfc28d5b 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add CompilerInstance::InitializeSourceManager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88764 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
182223002c5b9a88fe97fa7aaf9dd3f134c1a71f 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Switch -verify implementation to use VerifyDiagnosticClient.
- Not tested, but -verify with multiple inputs should work now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88750 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
f79dced038c63572965c016b969cfa870670d16e 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Switch -verify implementation to use VerifyDiagnosticClient.
- Not tested, but -verify with multiple inputs should work now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88750 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
52a3f666f09dc4ef7869856f1168a0e62f8fca9a 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add VerifyDiagnosticsClient, to replace old -verify.
- This reimplements -verify as just another DiagnosticClient, which buffers the diagnostics and checks them when the source file is complete. There are some hacks to make this work, but they are all internal, and this exposes a better external interface.

- This also tweaks a few things:
o Errors are now just regular diagnostics.
o Frontend diagnostics are now caught (for example, errors in command line arguments), although there isn't yet a way to specify that they are expected. That would be nice though.

- Not yet used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88748 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
erifyDiagnosticsClient.cpp
81f5a1e699b2eefa4a5e50b5dfc06df600748f59 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add VerifyDiagnosticsClient, to replace old -verify.
- This reimplements -verify as just another DiagnosticClient, which buffers the diagnostics and checks them when the source file is complete. There are some hacks to make this work, but they are all internal, and this exposes a better external interface.

- This also tweaks a few things:
o Errors are now just regular diagnostics.
o Frontend diagnostics are now caught (for example, errors in command line arguments), although there isn't yet a way to specify that they are expected. That would be nice though.

- Not yet used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88748 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
erifyDiagnosticsClient.cpp
194f7af8c1df30254c2258122cc83690ebb2f46d 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add ASTConsumer to CompilerInstance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88743 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
12ce6943aae499225708ecf364c5a8b0a3269c87 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add ASTConsumer to CompilerInstance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88743 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
b109794893842ef35d2483d1c2665407c22d0879 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Move CompilerInstance::set* methods out-of-line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88731 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
8a9f569262860b8d03203327afd6047be2a9b5a6 14-Nov-2009 Daniel Dunbar <daniel@zuster.org> Move CompilerInstance::set* methods out-of-line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88731 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
cc9161aa3fd5f78211190fcd996ed34932da8a49 13-Nov-2009 Ted Kremenek <kremenek@apple.com> Add clang-cc option "--analyzer-experimental-internal-checks". This
option enables new "internal" checks that will eventually be turned on
by default but still require broader testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88671 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
8382cf57b722f130f1a6b45380639871c07271c1 13-Nov-2009 Ted Kremenek <kremenek@apple.com> Add clang-cc option "--analyzer-experimental-internal-checks". This
option enables new "internal" checks that will eventually be turned on
by default but still require broader testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88671 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
795a09872e52ee42e17b33e907f7f93354ad1672 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add CompilerInstance utility functions for creating output files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88667 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
f482d59386dbc70716f7a5f65adb37ff86b501e6 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add CompilerInstance utility functions for creating output files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88667 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
3872ecefea53bf3620b0aad01f468b9cbfd48ae9 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Remove local splitLines reimplementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88661 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
e675049aa302bf07472ae6e76ff66e6f5427eff9 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Remove local splitLines reimplementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88661 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
644714d2905c1a553e81731004b7d6fbd87b937d 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add output file list to CompilerInstance, so that it can track them instead of
forcing all clients to do it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87103 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
a9204831639e31474b927681b97c46781b758a1a 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add output file list to CompilerInstance, so that it can track them instead of
forcing all clients to do it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87103 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
247484eab554c849f2f804494e95abb0d07ee597 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add CodeCompletion consumer to CompilerInvocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87100 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
c2f484f1f05216a9a427ac84b5773789a4661111 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add CodeCompletion consumer to CompilerInvocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87100 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
b86e2e801d5b291cc40bc0136f2c211b8ca668a6 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add CompilerInstance::createPCHExternalASTSource.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87097 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
0f800391ffbfe3820e1c60246a09a97e5f065179 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add CompilerInstance::createPCHExternalASTSource.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87097 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
785b5a106991fb92e0b88121e43e4497e50b7923 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add ASTContext to CompilerInstance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87095 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
5eb810024dc8a1d12d5f066c02c978f07c4fcb00 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add ASTContext to CompilerInstance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87095 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
93e4adfac6b648b4c79731109071c09459edec0a 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add CompilerInstance::createDiagnostics, and move clang-cc to it.

clang-cc.cpp is now under 1k lines, if anyone is counting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87090 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
0fbb3d9a9cdd2201848be9eb017c54cd78538122 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add CompilerInstance::createDiagnostics, and move clang-cc to it.

clang-cc.cpp is now under 1k lines, if anyone is counting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87090 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
261eec309cf92775155a5c69de1010421bafad19 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add Preprocessor to CompilerInstance, and move clang-cc CreatePreprocessor to
CompilerInstance::createPreprocessor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87088 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
22dacfacacf5559028550ba6ddfbaa4ea6cb3944 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add Preprocessor to CompilerInstance, and move clang-cc CreatePreprocessor to
CompilerInstance::createPreprocessor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87088 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
4b1279f2e9a494dd41bc9a80e5579aaec3e723a3 13-Nov-2009 Rafael Espindola <rafael.espindola@gmail.com> Use StringRef::split instead of SplitString.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87085 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
aadd7a48453b4f58bd8e1e9eb670918ee7d6a711 13-Nov-2009 Rafael Espindola <rafael.espindola@gmail.com> Use StringRef::split instead of SplitString.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87085 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
98e19d3f0d2d9cf32b9c578b7b777f782f945bd5 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add {File,Source}Manager to CompilerInstance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87079 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
16b7449d86b843d0926b04f87104cf3fff7149fe 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add {File,Source}Manager to CompilerInstance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87079 91177308-0d34-0410-b5e6-96231b3b80d8
ompilerInstance.cpp
a8a0f59ccc6535a55e0589c6d6242133618d6ab6 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add CompilerInstance, and starting moving clang-cc to it.
- The design philosophy is in the CompilerInstance doxyment, if you don't agree
with it now would be a good time to speak up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87078 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInstance.cpp
2a79e162a3fde25c1941151a67966830d873f2db 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add CompilerInstance, and starting moving clang-cc to it.
- The design philosophy is in the CompilerInstance doxyment, if you don't agree
with it now would be a good time to speak up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87078 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ompilerInstance.cpp
b86ab2e7ff02a0d8f471ff32377c9e4667b41b92 13-Nov-2009 Ted Kremenek <kremenek@apple.com> Only flush plist diagnostics once.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87073 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
179ce89c6058688a0accec9ac53dbdf7fc50b78b 13-Nov-2009 Ted Kremenek <kremenek@apple.com> Only flush plist diagnostics once.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87073 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
b01c69780585ba8bb5984d7826a355dde810b962 13-Nov-2009 Ted Kremenek <kremenek@apple.com> Fix recently introduced use-after-free error reported in <rdar://problem/7387478>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87072 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
listDiagnostics.cpp
cca5e1ea18e40dd17e25c0fa9d64a5bc6f34a36a 13-Nov-2009 Ted Kremenek <kremenek@apple.com> Fix recently introduced use-after-free error reported in <rdar://problem/7387478>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87072 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
listDiagnostics.cpp
b2635f59e4d6751728f0c7843c177b36666f210b 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Move input kind identification (-x) into FrontendOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87066 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
rontendOptions.cpp
fbe2fafe317a757031e4f24026a77dd305607d32 13-Nov-2009 Daniel Dunbar <daniel@zuster.org> Move input kind identification (-x) into FrontendOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87066 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
rontendOptions.cpp
fc26eec00ec10996922ddce55ef2f77703b733e4 13-Nov-2009 Ted Kremenek <kremenek@apple.com> Add clang-cc option "-analyzer-experimental-checks" to enable experimental path-sensitive checks. The idea is to separate "barely working" or "skunkworks" checks from ones that should always run. Later we need more fine-grain checker control.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87053 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
eb94113be0ee5f4d38408b413d92464a0bc16b55 13-Nov-2009 Ted Kremenek <kremenek@apple.com> Add clang-cc option "-analyzer-experimental-checks" to enable experimental path-sensitive checks. The idea is to separate "barely working" or "skunkworks" checks from ones that should always run. Later we need more fine-grain checker control.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@87053 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
2fcfe27c7e9115b8246d90510cbe079af13b7a16 12-Nov-2009 Chandler Carruth <chandlerc@gmail.com> Move CompileOptions -> CodeGenOptions, and sink it into the CodeGen library.
This resolves the layering violation where CodeGen depended on Frontend.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86998 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
2811ccf48d6d898c42cc4cfad37abedb36236d20 12-Nov-2009 Chandler Carruth <chandlerc@gmail.com> Move CompileOptions -> CodeGenOptions, and sink it into the CodeGen library.
This resolves the layering violation where CodeGen depended on Frontend.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86998 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
258631574761f621f312cdea0f6b436b53e02474 12-Nov-2009 Chris Lattner <sabre@nondot.org> Generalize stdint.h for non-8-bit-multiple types, patch by
Ken Dyck!

"This adds definitions for types of 8-bit multiples
from 8 to 64 to stdint.h and rationalizes the selection of types
for the exact-width definitions in InitPreprocessor.cpp."



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86977 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
dcdd2a064a6d3ea7712169629328ef80d6cb28ec 12-Nov-2009 Chris Lattner <sabre@nondot.org> Generalize stdint.h for non-8-bit-multiple types, patch by
Ken Dyck!

"This adds definitions for types of 8-bit multiples
from 8 to 64 to stdint.h and rationalizes the selection of types
for the exact-width definitions in InitPreprocessor.cpp."



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86977 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
d01de3a57d667e9a241d5117caecfd91252fcdcd 12-Nov-2009 Chris Lattner <sabre@nondot.org> do not store wchar/char16/char32/intmax width/alignment info
into TargetInfo, just derive this based on the underlying type.
This prevents them from getting out of synch, patch by Ken Dyck!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86976 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
9184646509d015ea66e796113a8c68598681374b 12-Nov-2009 Chris Lattner <sabre@nondot.org> do not store wchar/char16/char32/intmax width/alignment info
into TargetInfo, just derive this based on the underlying type.
This prevents them from getting out of synch, patch by Ken Dyck!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86976 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
223f6e4b8e9dfad13113d65afb6fbcb5f1458e07 12-Nov-2009 Daniel Dunbar <daniel@zuster.org> Move warning options into DiagnosticOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86968 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
6907943901e0aae5be7618c36c0f8275634e6ab5 12-Nov-2009 Daniel Dunbar <daniel@zuster.org> Move warning options into DiagnosticOptions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86968 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
746a4e88aa387a47fbc70ed99431205555784902 12-Nov-2009 Daniel Dunbar <daniel@zuster.org> Avoid comparing string literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86967 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
c706468b1e00bab49ca92eb500a39657f530f828 12-Nov-2009 Daniel Dunbar <daniel@zuster.org> Avoid comparing string literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86967 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
b90b6206cf1d3c338d2f783a28317130088c5ea0 12-Nov-2009 Rafael Espindola <rafael.espindola@gmail.com> Use the --with-c-include-dirs configure option.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86956 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f0a2f51be576089e1a84cd677c09156dae067b6a 12-Nov-2009 Rafael Espindola <rafael.espindola@gmail.com> Use the --with-c-include-dirs configure option.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86956 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ac6f92fb12fad4d2c11735ec93810e0f52e991ce 12-Nov-2009 Daniel Dunbar <daniel@zuster.org> Tweak PCH -include handling to make sure it matches the name as would be present
in the predefines buffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86903 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
CHReader.cpp
c7162937a4ccd044a0df67eed4a73ee828c49162 12-Nov-2009 Daniel Dunbar <daniel@zuster.org> Tweak PCH -include handling to make sure it matches the name as would be present
in the predefines buffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86903 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
CHReader.cpp
d1c72c0552298cdff5ceefc3d92e8f842301c8eb 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Always initialize the header search object as part of InitializePreprocessor;
not doing this has little to no utility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86883 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
961c76ea8d5089293e448e5d538570653e28080c 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Always initialize the header search object as part of InitializePreprocessor;
not doing this has little to no utility.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86883 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
6ce3b4c5d6525ee44f2193baf24c3e5c5e6154a1 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Allow Preprocessor to take ownership of the HeaderSearch object. I think it should probably always own the header search object, but I'm not sure...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86882 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
5814e657c9ad9ef6049a2a4af0d2aad248a8a15c 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Allow Preprocessor to take ownership of the HeaderSearch object. I think it should probably always own the header search object, but I'm not sure...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86882 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
d505c1c7f10a0c7753756d8d3b6684d9d9d744cf 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Sink AttachDependencyFileGen into CreatePreprocessor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86881 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
ca11f61233b2acc266f371816e48290af4e10528 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Sink AttachDependencyFileGen into CreatePreprocessor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86881 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
266dbdc05284f893f870dc5f71a19bd6f63e001f 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add DependencyOutputOptions to wrap -M... options, and propogate to
CompilerInvocation and clang-cc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86880 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
0e0bae8139e25de81f18b6a519783a06f7ba1e25 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add DependencyOutputOptions to wrap -M... options, and propogate to
CompilerInvocation and clang-cc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86880 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
d451f25a0cf6dc510f7a4e23f095b46aceef0251 11-Nov-2009 Chandler Carruth <chandlerc@gmail.com> Move the ManagerRegistry to the Analysis library to resolve the layering violation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86863 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
MakeLists.txt
anagerRegistry.cpp
f465e85fd8744fce8769f18f0dbfec51dbc6d4af 11-Nov-2009 Chandler Carruth <chandlerc@gmail.com> Move the ManagerRegistry to the Analysis library to resolve the layering violation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86863 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
MakeLists.txt
anagerRegistry.cpp
531508de8693babe861d3f3faa46260dd1a6e37a 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add PreprocessorOutputOptions to CompilerInvocation, and move initialization to
clang-cc/Options.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86828 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
29cf746aef63b1984c013448e843a290b2badf7b 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add PreprocessorOutputOptions to CompilerInvocation, and move initialization to
clang-cc/Options.cpp

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86828 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
3ce2bf2f10b7e29948011f3af4af7389a22c0dd7 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add PreprocessorOutputOptions, for things like -dM, -C, -CC which control -E
mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86827 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
775bee71ad21c84bc130af22ac47c1c8e0f9e72f 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add PreprocessorOutputOptions, for things like -dM, -C, -CC which control -E
mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86827 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
f641d19345322d2609ff5190f247c851353194f0 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Allow TextDiagnosticPrinter to have optional ownership of its output stream.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86823 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
aea364195b81f933515e8968b5254a1195eb0337 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Allow TextDiagnosticPrinter to have optional ownership of its output stream.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86823 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
ef02c9fa5e74a42ad6dde92894018f19c3e73646 11-Nov-2009 Ted Kremenek <kremenek@apple.com> Fix display of "ANALYZE" statements in AnalysisConsumer by correctly resetting the flag indicating that the current Decl* has not yet been displayed. Also move this out of AnalysisManager, since AnalysisManager should not handle text output to the user.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86812 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
1d9cbeb76cf4c36acf5545028e2b2ac207086442 11-Nov-2009 Ted Kremenek <kremenek@apple.com> Fix display of "ANALYZE" statements in AnalysisConsumer by correctly resetting the flag indicating that the current Decl* has not yet been displayed. Also move this out of AnalysisManager, since AnalysisManager should not handle text output to the user.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86812 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
fb1edf1663f6becf70605fc470cfc52f62c88364 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Redo how PCH handles its implicit include. Instead of treating this specially in
the front-end (as far as the preprocessor goes), follow the usual logic of
inserting the (original include path) name into the predefines buffer. This
pushes the responsibility for handling this to PCH instead of the front-end. In
PCH this requires being a little more clever when we diff the predefines
buffers.

Neither of these solutions are particularly great, I think what we eventually
should do is something like gcc where we insert a special marker to indicate the
PCH file, but then run the preprocessor as usual. This would be clearer and
would allow us to drop the overly clever predefines handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86806 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
CHReader.cpp
7b5a1210d93ca62ecd61800f245c87259b1f8f79 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Redo how PCH handles its implicit include. Instead of treating this specially in
the front-end (as far as the preprocessor goes), follow the usual logic of
inserting the (original include path) name into the predefines buffer. This
pushes the responsibility for handling this to PCH instead of the front-end. In
PCH this requires being a little more clever when we diff the predefines
buffers.

Neither of these solutions are particularly great, I think what we eventually
should do is something like gcc where we insert a special marker to indicate the
PCH file, but then run the preprocessor as usual. This would be clearer and
would allow us to drop the overly clever predefines handling.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86806 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
CHReader.cpp
4272cfe3335b7e65d61dd18dba9cd8cf86c054c6 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> More StringRef simplification to PCHValidator::ReadPredefinesBuffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86805 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
4d5936aaa4e4e2d41fe79101ac9c09444951448f 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> More StringRef simplification to PCHValidator::ReadPredefinesBuffer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86805 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
ff82ae24ba7637f38662cc7e527c60eef83ae240 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Rewrite splitLines using StringRef; this is much simpler, and also now avoids
tons of std::string trashing. I plan to move this and other fun string munging
utilities to a StringRefExtras.h at some point if no one beats me to it.

On a synthetic benchmark on x86_64, llvm-gcc actually generates code thats 10%
faster using the StringRef version. gcc miscompiles the synthetic benchmark,
which I'm crossing my fingers and hoping won't happen here. clang compiles the
sythetic benchmark correctly (wootness), but the StringRef version is
slower. Silly clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86799 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
10014aa55cf58b971dd6f33767322549551ee07a 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Rewrite splitLines using StringRef; this is much simpler, and also now avoids
tons of std::string trashing. I plan to move this and other fun string munging
utilities to a StringRefExtras.h at some point if no one beats me to it.

On a synthetic benchmark on x86_64, llvm-gcc actually generates code thats 10%
faster using the StringRef version. gcc miscompiles the synthetic benchmark,
which I'm crossing my fingers and hoping won't happen here. clang compiles the
sythetic benchmark correctly (wootness), but the StringRef version is
slower. Silly clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86799 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
63c8e75e3df30caab2d7251514a0d7ddc9cb39a2 11-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce a new representation for template template
parameters. Rather than storing them as either declarations (for the
non-dependent case) or expressions (for the dependent case), we now
(always) store them as TemplateNames.

The primary change here is to add a new kind of TemplateArgument,
which stores a TemplateName. However, making that change ripples to
every switch on a TemplateArgument's kind, also affecting
TemplateArgumentLocInfo/TemplateArgumentLoc, default template
arguments for template template parameters, type-checking of template
template arguments, etc.

This change is light on testing. It should fix several pre-existing
problems with template template parameters, such as:
- the inability to use dependent template names as template template
arguments
- template template parameter default arguments cannot be
instantiation

However, there are enough pieces missing that more implementation is
required before we can adequately test template template parameters.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86777 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
788cd06cf8e868a67158aafec5de3a1f408d14f3 11-Nov-2009 Douglas Gregor <dgregor@apple.com> Introduce a new representation for template template
parameters. Rather than storing them as either declarations (for the
non-dependent case) or expressions (for the dependent case), we now
(always) store them as TemplateNames.

The primary change here is to add a new kind of TemplateArgument,
which stores a TemplateName. However, making that change ripples to
every switch on a TemplateArgument's kind, also affecting
TemplateArgumentLocInfo/TemplateArgumentLoc, default template
arguments for template template parameters, type-checking of template
template arguments, etc.

This change is light on testing. It should fix several pre-existing
problems with template template parameters, such as:
- the inability to use dependent template names as template template
arguments
- template template parameter default arguments cannot be
instantiation

However, there are enough pieces missing that more implementation is
required before we can adequately test template template parameters.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86777 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
edecc7154650000514f021ad5c5303128a801577 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> StringRefify some PCH interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86775 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
CHReader.cpp
dc3c0d20375bda7775b2fade05b20e315798b9fe 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> StringRefify some PCH interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86775 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
CHReader.cpp
b1e0a30436a1e84573f601ae71bdf3328616705e 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Replace startsWith functions with StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86774 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
4fda42eb963ad93f57fa18a511004b4bfc7332de 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Replace startsWith functions with StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86774 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
9e6f870b68c0f139c3ea9acf9c2dc759e912cd73 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add Diagnostic::Report method for reporting diagnostics without a location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86760 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
0f9fed70cea107b3f79df554e38bd8e98d48fe47 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add Diagnostic::Report method for reporting diagnostics without a location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86760 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
4dae925caba4a4e6708f0d777f6854877ffc1359 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> PreprocessorOptions: Get rid of unnecessary 'isPTH' flag for include entries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86757 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
b6d1cc84d1a7e314f7a7a02fbe092adc4caf67e8 11-Nov-2009 Daniel Dunbar <daniel@zuster.org> PreprocessorOptions: Get rid of unnecessary 'isPTH' flag for include entries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86757 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
9a26d359d35a4a4ade8c9486b4d7af4ede219ad5 10-Nov-2009 Daniel Dunbar <daniel@zuster.org> Localize -disable-llvm-optzns handling to BackendConsumer::CreatePasses.
- This is conceptually better since the only thing we want this option to do is
preserve the internal module as constructed by IRgen, before running any
passes.

- This also fixes bugs in -disable-llvm-optzns handling with regards to debug
info.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86691 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
8d35314401047092eb97b989ed930967ed9e8ccc 10-Nov-2009 Daniel Dunbar <daniel@zuster.org> Localize -disable-llvm-optzns handling to BackendConsumer::CreatePasses.
- This is conceptually better since the only thing we want this option to do is
preserve the internal module as constructed by IRgen, before running any
passes.

- This also fixes bugs in -disable-llvm-optzns handling with regards to debug
info.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86691 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
e149718b58652aa45d9318819f8045cd7b188bbd 10-Nov-2009 Daniel Dunbar <daniel@zuster.org> Switch to getFileOrSTDIN().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86632 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
731ad8f94846d2eb62bfbfbe9cabc1c9c2d93325 10-Nov-2009 Daniel Dunbar <daniel@zuster.org> Switch to getFileOrSTDIN().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86632 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
2805608e3043e0a580926fbff6a41bb8b64762c9 10-Nov-2009 Daniel Dunbar <daniel@zuster.org> Privatize InitHeaderSearch, this functionality is only exposed via
ApplyHeaderSearchOptions now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86617 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
2cdafa8001ee69b75d2906cbb36f16cf8e1dc60a 10-Nov-2009 Daniel Dunbar <daniel@zuster.org> Privatize InitHeaderSearch, this functionality is only exposed via
ApplyHeaderSearchOptions now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86617 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
2c20fd833cd2e6a75e25e1203ebc80fe23a802ed 09-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Add support for cdecl attribute. (As far as I know, it doesn't affect CodeGen
unless we start implementing command-line switches which override the default
calling convention, so the effect is mostly to silence unknown attribute
warnings.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86571 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
8f4c59e912f08919bd051fbca3d0dd2b90382ab3 09-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Add support for cdecl attribute. (As far as I know, it doesn't affect CodeGen
unless we start implementing command-line switches which override the default
calling convention, so the effect is mostly to silence unknown attribute
warnings.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86571 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
50c1fbac3d55d10e88375970668d583b23147e22 08-Nov-2009 Zhongxing Xu <xuzhongxing@gmail.com> Add a checker for CWE-467: Use of sizeof() on a Pointer Type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86464 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
28a109f63506d8c96e3fbf1b959b603ccec2f586 08-Nov-2009 Zhongxing Xu <xuzhongxing@gmail.com> Add a checker for CWE-467: Use of sizeof() on a Pointer Type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86464 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
0255f8ec6079f80dd030550ce5da4a8f497ed186 07-Nov-2009 Daniel Dunbar <daniel@zuster.org> Switch clang-cc to use ApplyHeaderSearchOptions, and fix a thinko.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86341 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
dd35ce9a783dea7e6660f9cb1d973742f3b3c73f 07-Nov-2009 Daniel Dunbar <daniel@zuster.org> Switch clang-cc to use ApplyHeaderSearchOptions, and fix a thinko.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86341 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
870278bbbab94d3bc38fdd9487aae3829df314be 07-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add HeaderSearchOptions class, for packaging the information needed to
initialize HeaderSearch. Not used yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86338 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
63c8b77334f90472260d2f48df2742ed5067261e 07-Nov-2009 Daniel Dunbar <daniel@zuster.org> Add HeaderSearchOptions class, for packaging the information needed to
initialize HeaderSearch. Not used yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86338 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
0df9906d1eddee1dbeec1a5b6c097ec3d9ca48e0 07-Nov-2009 Daniel Dunbar <daniel@zuster.org> Lift InitHeaderSearch::AddEnvVarPaths logic higher.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86337 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
e166582f8f36f4db8f4ea157538fab7fe6bf2658 07-Nov-2009 Daniel Dunbar <daniel@zuster.org> Lift InitHeaderSearch::AddEnvVarPaths logic higher.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86337 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
4791e04b59ae973456144bb98cab1ff228ae678b 07-Nov-2009 Daniel Dunbar <daniel@zuster.org> Formatting fixes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86336 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
5c5758bb0a4ec0f572cd20249277736da5715003 07-Nov-2009 Daniel Dunbar <daniel@zuster.org> Formatting fixes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86336 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
b795a5daff072412abe32fbe3ead662a11534527 07-Nov-2009 Daniel Dunbar <daniel@zuster.org> Rename PreprocessorInitOptions to PreprocessorOptions for consistency, and fix
filenames.

Also, move InitializePreprocessor to Utils.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86335 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
8863b985f1cf78a2fb62913e184dc45162853cf9 07-Nov-2009 Daniel Dunbar <daniel@zuster.org> Rename PreprocessorInitOptions to PreprocessorOptions for consistency, and fix
filenames.

Also, move InitializePreprocessor to Utils.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86335 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
4176705b836ea3720fcec92428c688fb0a9fc9b1 05-Nov-2009 John Thompson <john.thompson.jtsoftware@gmail.com> Eliminate tabls

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86183 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
40d1bb6383c14d5f8249d0640e8088a91b694c66 05-Nov-2009 John Thompson <John.Thompson.JTSoftware@gmail.com> Eliminate tabls

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86183 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
cffa5b706a6ccbc5c2f96e6778d0e1b33b666144 05-Nov-2009 Chris Lattner <sabre@nondot.org> clean up integer preprocessor type definitions, patch by Ken Dyck!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86177 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
9099e7bcda3922cee0cffcdf21332ac4aa193cea 05-Nov-2009 Chris Lattner <sabre@nondot.org> clean up integer preprocessor type definitions, patch by Ken Dyck!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86177 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
e65800a6496207b51379f92540789206b990781e 05-Nov-2009 John Thompson <john.thompson.jtsoftware@gmail.com> Adding -fshort-wchar option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86167 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
a6fda124bf380479529d6a80b84b62cacd3cb707 05-Nov-2009 John Thompson <John.Thompson.JTSoftware@gmail.com> Adding -fshort-wchar option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86167 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
17740668c2ca6dcaa08dcd9e30d99d7515af4191 05-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Add Ubuntu 9.10 libstdc++ install location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86142 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
5114ecab149ab91d13d3f7fd165dbe0839c1f2e8 05-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Add Ubuntu 9.10 libstdc++ install location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86142 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
815ef4694cfca2e39767546be78d92d1fd9f8bfc 05-Nov-2009 Daniel Dunbar <daniel@zuster.org> Replace DiagnosticClient::setLangOptions with {Begin,End}SourceFile, and clarify
invariants (diagnostics with source informations must occur between
{Begin,End}SourceFile).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86113 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
efcbe9475348ecab6b85153baa21d0e894e39607 05-Nov-2009 Daniel Dunbar <daniel@zuster.org> Replace DiagnosticClient::setLangOptions with {Begin,End}SourceFile, and clarify
invariants (diagnostics with source informations must occur between
{Begin,End}SourceFile).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86113 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
a93f338bc8bebdafc6fe241e87312ad312a1fe6b 05-Nov-2009 Daniel Dunbar <daniel@zuster.org> Convert CreateAnalysisConsumer and friends to just take a const Preprocessor&, and simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86112 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
TMLDiagnostics.cpp
listDiagnostics.cpp
efceabd2380f49306bc0229583458e93b062094b 05-Nov-2009 Daniel Dunbar <daniel@zuster.org> Convert CreateAnalysisConsumer and friends to just take a const Preprocessor&, and simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86112 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
TMLDiagnostics.cpp
listDiagnostics.cpp
fe5ab32a071721c7fabc0729b8dc4daca567e70c 05-Nov-2009 Daniel Dunbar <daniel@zuster.org> Remove unused SetPreprocessor method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86111 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
eb6aeb51977b6755481213a1f31512538648e24b 05-Nov-2009 Daniel Dunbar <daniel@zuster.org> Remove unused SetPreprocessor method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86111 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
a8f606dbba86bc18edad2956887a276f466b60be 05-Nov-2009 Ted Kremenek <kremenek@apple.com> Acting on Daniel's nagging, remove PathDiagnosticClientFactory() and
migrate work in the destructors of PathDiagnosticClients from their
destructors to FlushReports(). The destructors now currently call
FlushReports(); this will be fixed in a subsequent patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86108 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
TMLDiagnostics.cpp
listDiagnostics.cpp
b697a4e4118d2d59dc0f38463c8417ddaf58a11f 05-Nov-2009 Ted Kremenek <kremenek@apple.com> Acting on Daniel's nagging, remove PathDiagnosticClientFactory() and
migrate work in the destructors of PathDiagnosticClients from their
destructors to FlushReports(). The destructors now currently call
FlushReports(); this will be fixed in a subsequent patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86108 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
TMLDiagnostics.cpp
listDiagnostics.cpp
8d321195358ca63f30a5eb83ef8b8c3a4f74ba41 05-Nov-2009 Daniel Dunbar <daniel@zuster.org> Kill PreprocessorFactory, which was both morally repugnant and totally unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86076 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
TMLDiagnostics.cpp
TMLPrint.cpp
listDiagnostics.cpp
90b1827c1c1cf075266b96b416eefcf37924333b 05-Nov-2009 Daniel Dunbar <daniel@zuster.org> Kill PreprocessorFactory, which was both morally repugnant and totally unused.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86076 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
TMLDiagnostics.cpp
TMLPrint.cpp
listDiagnostics.cpp
cdf4f468399c6598b2238772c09c12208365069d 04-Nov-2009 Daniel Dunbar <daniel@zuster.org> InitializePreprocessor cannot fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86048 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
938963f076418aa61b570e5317240f66642af2df 04-Nov-2009 Daniel Dunbar <daniel@zuster.org> InitializePreprocessor cannot fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86048 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
053eb03fc0dd1c3038f653859ca0e83b49648734 04-Nov-2009 Daniel Dunbar <daniel@zuster.org> Move -undef flag into PreprocessorInitOptions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86047 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
468fe246192c3683360d1a6b1b333d85b8794f77 04-Nov-2009 Daniel Dunbar <daniel@zuster.org> Move -undef flag into PreprocessorInitOptions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86047 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
000f59548655c6a0f9dc69521406506de022f5c8 04-Nov-2009 John McCall <rjmccall@apple.com> Preserve type source information in sizeof/alignof expressions, and pass it
through to indexing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86018 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
5ab75172051a6d2ea71a80a79e81c65519fd3462 04-Nov-2009 John McCall <rjmccall@apple.com> Preserve type source information in sizeof/alignof expressions, and pass it
through to indexing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86018 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
542defb262afbdac5a09bb02dd8ce7de2818f0fa 04-Nov-2009 Daniel Dunbar <daniel@zuster.org> Factor out a diagnostic options class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86010 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
eace8743030d2979251a0c5ae247371cfd9056e5 04-Nov-2009 Daniel Dunbar <daniel@zuster.org> Factor out a diagnostic options class.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86010 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
a054adf6f7e7edcd096f57b8e21d54c79574dc89 03-Nov-2009 Chris Lattner <sabre@nondot.org> Implement support for the -undef command line option, patch by
Roman Divacky! PR5363


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85932 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
e6113de52df132b89c3a5a6141f17d37e83322ae 03-Nov-2009 Chris Lattner <sabre@nondot.org> Implement support for the -undef command line option, patch by
Roman Divacky! PR5363


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85932 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
245c22f96bc35c7118dbc12b4f56564fd5f5f886 03-Nov-2009 Ted Kremenek <kremenek@apple.com> Fix buffer overflow in PrintMacroDefinition() by inverting the check to see if the target buffer needs to be resized. Fixes <rdar://problem/7255377>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85872 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
3e27c01eb48c189723b263796d0dbe008b9c95c1 03-Nov-2009 Ted Kremenek <kremenek@apple.com> Fix buffer overflow in PrintMacroDefinition() by inverting the check to see if the target buffer needs to be resized. Fixes <rdar://problem/7255377>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85872 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
73dc5e00bbce542e5b7441891aafd7f2ae14c85a 02-Nov-2009 Daniel Dunbar <daniel@zuster.org> Remove unused header.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85828 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ecf003e3961967ee5d4668bc25f2ecde80e43c19 02-Nov-2009 Daniel Dunbar <daniel@zuster.org> Remove unused header.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85828 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
cc40ee4f72f2bea8964888ac5e35d2b242188831 02-Nov-2009 Chris Lattner <sabre@nondot.org> clean up namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85826 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
47c06eea60873fe87adc2b5c985f0a3173e1d266 02-Nov-2009 Chris Lattner <sabre@nondot.org> clean up namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85826 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
eee961525a3f2439380b58461501224f2f245288 30-Oct-2009 Benjamin Kramer <benny.kra@googlemail.com> Add C++ include paths for Exherbo. Patch by Daniel Mierswa!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85588 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
5d7a188cbc66d0af5aa3c135942a9e4aa7cb69f9 30-Oct-2009 Benjamin Kramer <benny.kra@googlemail.com> Add C++ include paths for Exherbo. Patch by Daniel Mierswa!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85588 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
588613178e3a10e2b840c8f4db9e058f2fec0005 29-Oct-2009 John McCall <rjmccall@apple.com> Track source information for template arguments and template specialization
types. Preserve it through template instantiation. Preserve it through PCH,
although TSTs themselves aren't serializable, so that's pretty much meaningless.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85500 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
833ca991c1bfc967f0995974ca86f66ba1f666b5 29-Oct-2009 John McCall <rjmccall@apple.com> Track source information for template arguments and template specialization
types. Preserve it through template instantiation. Preserve it through PCH,
although TSTs themselves aren't serializable, so that's pretty much meaningless.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85500 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
7fc47321003ff07c030c85e37e495089dd2c095b 29-Oct-2009 Chris Lattner <sabre@nondot.org> simplify intmax setup, patch by Ken Dyck!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85481 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
c8837706654df1ecdfb1e6c6a164301ca8bf076e 29-Oct-2009 Chris Lattner <sabre@nondot.org> simplify intmax setup, patch by Ken Dyck!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85481 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
21c878fe794911621478ec927e03d3c44866ca9b 27-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Rename FunctionDecl::isInline/setInline to
FunctionDecl::isInlineSpecified/setInlineSpecified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85305 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
0130f3cc4ccd5f46361c48d5fe94133d74619424 27-Oct-2009 Douglas Gregor <dgregor@apple.com> Rename FunctionDecl::isInline/setInline to
FunctionDecl::isInlineSpecified/setInlineSpecified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85305 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
29806f1ea6f6b496f20425f5a9b675a4f6cecce6 27-Oct-2009 Rafael Espindola <rafael.espindola@gmail.com> Split AddDefaultSystemIncludePaths into C, C++ and framework specific functions.

The user visible changes are:

*) Frameworks are only searched on OS X
*) The Cygwin c++ headers are now marked as c++ aware. I am almost
sure that not marking them was a bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85240 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
e4b255c80a786c6f16d3f0362ecb7e1b1e959f63 27-Oct-2009 Rafael Espindola <rafael.espindola@gmail.com> Split AddDefaultSystemIncludePaths into C, C++ and framework specific functions.

The user visible changes are:

*) Frameworks are only searched on OS X
*) The Cygwin c++ headers are now marked as c++ aware. I am almost
sure that not marking them was a bug.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85240 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
11cb5fb202107a6beb7c86ff7e94ecb04e0ed423 25-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Audit the code for places where it is assumed that every base specifier refers to a RecordType. Add assertions or conditions as appropriate. This fixes another crash in the Apache stdlib vector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85055 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
9994a34f6cf842721ba7723edc0b9036229fe387 25-Oct-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Audit the code for places where it is assumed that every base specifier refers to a RecordType. Add assertions or conditions as appropriate. This fixes another crash in the Apache stdlib vector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85055 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
7f96d1fe90385d6477dbff418408a5563c3022e3 24-Oct-2009 John McCall <rjmccall@apple.com> Preserve type source information in TypedefDecls. Preserve it across
template instantiation. Preserve it through PCH. Show it off to the indexer.

I'm healthily ignoring the vector type cases because we don't have a sensible
TypeLoc implementation for them anyway.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84994 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
ewriteObjC.cpp
ba6a9bd384df475780be636ca45bcef5c5bbd19f 24-Oct-2009 John McCall <rjmccall@apple.com> Preserve type source information in TypedefDecls. Preserve it across
template instantiation. Preserve it through PCH. Show it off to the indexer.

I'm healthily ignoring the vector type cases because we don't have a sensible
TypeLoc implementation for them anyway.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84994 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
ewriteObjC.cpp
54d2596d47cc4ae9067d3b05f533d2176ef8492a 23-Oct-2009 John McCall <rjmccall@apple.com> Remove OriginalTypeParmDecl; the original type is the one specified
in the DeclaratorInfo, if one is present.

Preserve source information through template instantiation. This is made
more complicated by the possibility that ParmVarDecls don't have DIs, which
is possibly worth fixing in the future.

Also preserve source information for function parameters in ObjC method
declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84971 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
58e4677a948e80c92deeebbcd3bdd9266adda798 23-Oct-2009 John McCall <rjmccall@apple.com> Remove OriginalTypeParmDecl; the original type is the one specified
in the DeclaratorInfo, if one is present.

Preserve source information through template instantiation. This is made
more complicated by the possibility that ParmVarDecls don't have DIs, which
is possibly worth fixing in the future.

Also preserve source information for function parameters in ObjC method
declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84971 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
1d5d81452d1e5f93f0fd6537a5909b1fcf94bb73 23-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate QualifiedDeclRefExpr, which captured the notion of a
qualified reference to a declaration that is not a non-static data
member or non-static member function, e.g.,

namespace N { int i; }
int j = N::i;

Instead, extend DeclRefExpr to optionally store the qualifier. Most
clients won't see or care about the difference (since
QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the
number of top-level expression types that clients need to cope with,
brings the implementation of DeclRefExpr into line with MemberExpr,
and simplifies and unifies our handling of declaration references.

Extended DeclRefExpr to (optionally) store explicitly-specified
template arguments. This occurs when naming a declaration via a
template-id (which will be stored in a TemplateIdRefExpr) that,
following template argument deduction and (possibly) overload
resolution, is replaced with a DeclRefExpr that refers to a template
specialization but maintains the template arguments as written.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84962 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
a2813cec2605ce7878d1b13471d685f689b251af 23-Oct-2009 Douglas Gregor <dgregor@apple.com> Eliminate QualifiedDeclRefExpr, which captured the notion of a
qualified reference to a declaration that is not a non-static data
member or non-static member function, e.g.,

namespace N { int i; }
int j = N::i;

Instead, extend DeclRefExpr to optionally store the qualifier. Most
clients won't see or care about the difference (since
QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the
number of top-level expression types that clients need to cope with,
brings the implementation of DeclRefExpr into line with MemberExpr,
and simplifies and unifies our handling of declaration references.

Extended DeclRefExpr to (optionally) store explicitly-specified
template arguments. This occurs when naming a declaration via a
template-id (which will be stored in a TemplateIdRefExpr) that,
following template argument deduction and (possibly) overload
resolution, is replaced with a DeclRefExpr that refers to a template
specialization but maintains the template arguments as written.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84962 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
8be97018ebfe2c79c69772286d0ea7d67f9e9922 23-Oct-2009 Ted Kremenek <kremenek@apple.com> Add comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84930 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
231bc0b7a7f53ce0d1af85602232486bc92c5a34 23-Oct-2009 Ted Kremenek <kremenek@apple.com> Add comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84930 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
7da466e4d9497cd3dc6ff3a370fbdfc834746ef7 23-Oct-2009 Ted Kremenek <kremenek@apple.com> Fix integer overflow in PCHReader when reading the length of an
identifier. This caused a crash when reading PCH files that contained
long identifier names.

The issue is that 'StrLenPtr' was previously a 'const char *', meaning
the byte loaded from it would be interpretted as a signed integer. If
the topmost bit was set, conversion to 'unsigned' would extend that
bit, causing an overflow.

The solution is to make 'StrLenPtr' an 'unsigned char *', always
treating the value as an unsigned integer.

This fixes: <rdar://problem/7328900>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84925 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
ff1ea462bf6f079a786c600d5fc3716235ad9f22 23-Oct-2009 Ted Kremenek <kremenek@apple.com> Fix integer overflow in PCHReader when reading the length of an
identifier. This caused a crash when reading PCH files that contained
long identifier names.

The issue is that 'StrLenPtr' was previously a 'const char *', meaning
the byte loaded from it would be interpretted as a signed integer. If
the topmost bit was set, conversion to 'unsigned' would extend that
bit, causing an overflow.

The solution is to make 'StrLenPtr' an 'unsigned char *', always
treating the value as an unsigned integer.

This fixes: <rdar://problem/7328900>


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84925 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
53255b22b1974ffe9e84a4f7bb134aad6f82c88e 23-Oct-2009 John McCall <rjmccall@apple.com> FunctionTypeLocs don't necessarily provide ParmVarDecls, so don't crash if
one was PCH'ed without any.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84920 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
86acc2a0ea327bce89b024b23ee071708da98d2f 23-Oct-2009 John McCall <rjmccall@apple.com> FunctionTypeLocs don't necessarily provide ParmVarDecls, so don't crash if
one was PCH'ed without any.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84920 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
4ea8425c9601895fa137f877bc784f75f20adac6 23-Oct-2009 John McCall <rjmccall@apple.com> When building types from declarators, instead of building two types (one for
the DeclaratorInfo, one for semantic analysis), just build a single type whose
canonical type will reflect the semantic analysis (assuming the type is
well-formed, of course).

To make that work, make a few changes to the type system:
* allow the nominal pointee type of a reference type to be a (possibly sugared)
reference type. Also, preserve the original spelling of the reference type.
Both of these can be ignored on canonical reference types.
* Remove ObjCProtocolListType and preserve the associated source information on
the various ObjC TypeLocs. Preserve the spelling of protocol lists except in
the canonical form.
* Preserve some level of source type structure on parameter types, but
canonicalize on the canonical function type. This is still a WIP.

Drops code size, makes strides towards accurate source location representation,
slight (~1.7%) progression on Cocoa.h because of complexity drop.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84907 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
54e14c4db764c0636160d26c5bbf491637c83a76 23-Oct-2009 John McCall <rjmccall@apple.com> When building types from declarators, instead of building two types (one for
the DeclaratorInfo, one for semantic analysis), just build a single type whose
canonical type will reflect the semantic analysis (assuming the type is
well-formed, of course).

To make that work, make a few changes to the type system:
* allow the nominal pointee type of a reference type to be a (possibly sugared)
reference type. Also, preserve the original spelling of the reference type.
Both of these can be ignored on canonical reference types.
* Remove ObjCProtocolListType and preserve the associated source information on
the various ObjC TypeLocs. Preserve the spelling of protocol lists except in
the canonical form.
* Preserve some level of source type structure on parameter types, but
canonicalize on the canonical function type. This is still a WIP.

Drops code size, makes strides towards accurate source location representation,
slight (~1.7%) progression on Cocoa.h because of complexity drop.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84907 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
1722951a44aeac688e05d9f9310097ef6fa233d5 22-Oct-2009 Mike Stump <mrs@apple.com> Extend out the block descriptor structure for debug information with
the copy/dispose helpers as appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84817 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
083c25eea14bb4cc4ecc3ec763c60e2e609e22bd 22-Oct-2009 Mike Stump <mrs@apple.com> Extend out the block descriptor structure for debug information with
the copy/dispose helpers as appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84817 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
72f4aae0cff32005612e3d53ad20f9a2db7971de 21-Oct-2009 Chris Lattner <sabre@nondot.org> hookize wint_t's definition, patch by Edward O'Callaghan (from PR5233).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84740 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
e64ef80363c84f4f431e26b61db554c89beeddb6 21-Oct-2009 Chris Lattner <sabre@nondot.org> hookize wint_t's definition, patch by Edward O'Callaghan (from PR5233).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84740 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
e2a2319d9367c21590d5b47fb3cf5f7328e8b436 20-Oct-2009 Ted Kremenek <kremenek@apple.com> Add destructor and cleanup code to LocationContext (fixing some leaks). Along the way, have
AnalysisManager periodically cleanup its AnalysisContextManager and LocationContextManager objects,
as they don't need to forever retain all the CFGs ever created when analyzing a file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84684 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
58f5ec7d56b1ebf5f90ee11226ebe7663f2821ea 20-Oct-2009 Ted Kremenek <kremenek@apple.com> Add destructor and cleanup code to LocationContext (fixing some leaks). Along the way, have
AnalysisManager periodically cleanup its AnalysisContextManager and LocationContextManager objects,
as they don't need to forever retain all the CFGs ever created when analyzing a file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84684 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
7ec499ecbdabd1c77acc30026ca9e576be629b75 20-Oct-2009 Mike Stump <mrs@apple.com> Refine the type of the first parameter to block invoke functions.
WIP. I have yet to find the magic incantation to get the structure
type to be defined. If someone has a pointer, love to hear it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84590 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
adaaad3715c9c26cdcfdfe3401a13d7b4423ddcf 20-Oct-2009 Mike Stump <mrs@apple.com> Refine the type of the first parameter to block invoke functions.
WIP. I have yet to find the magic incantation to get the structure
type to be defined. If someone has a pointer, love to hear it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84590 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
dc7a434ec19113f620727291e77990b762f76cbb 19-Oct-2009 Ted Kremenek <kremenek@apple.com> The constructor for ASTUnit now takes a DiagnosticClient*, allowing uses of ASTUnit to specify
alternate DiagnosticClients. To match this API, ASTUnit::LoadFromPCHFile() now takes a corresponding
DiagnosticClient* argument as well. The DiagnosticClient object is destroyed when the ASTUnit object
is destroyed.

The CIndex library now uses this API to create a 'IgnoreDiagnosticsClient' that simply silences
diagnostics when using the clang_createTranslationUnitFromSourceFile() function. This fixes
<rdar://problem/7312058>. This API can change in the future as we add more flexibility for clients.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84539 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
fc0622155fa61349698a8fd0053773c37d9f7ac4 19-Oct-2009 Ted Kremenek <kremenek@apple.com> The constructor for ASTUnit now takes a DiagnosticClient*, allowing uses of ASTUnit to specify
alternate DiagnosticClients. To match this API, ASTUnit::LoadFromPCHFile() now takes a corresponding
DiagnosticClient* argument as well. The DiagnosticClient object is destroyed when the ASTUnit object
is destroyed.

The CIndex library now uses this API to create a 'IgnoreDiagnosticsClient' that simply silences
diagnostics when using the clang_createTranslationUnitFromSourceFile() function. This fixes
<rdar://problem/7312058>. This API can change in the future as we add more flexibility for clients.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84539 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
d95dfb8afce8a119d0afc95bd83cf08b52092a19 19-Oct-2009 Steve Naroff <snaroff@apple.com> Move Diagnostic/DiagClient/FileManager from Indexer => ASTUnit.

Removing this shared data should enable clang_createTranslationUnit/clang_createTranslationUnitFromSourceFile to be run from multiple threads (related to <rdar://problem/7303432>).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84499 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
36c4464ba6cfc2a63dc67c493ef2f5ab2aea09cc 19-Oct-2009 Steve Naroff <snaroff@apple.com> Move Diagnostic/DiagClient/FileManager from Indexer => ASTUnit.

Removing this shared data should enable clang_createTranslationUnit/clang_createTranslationUnitFromSourceFile to be run from multiple threads (related to <rdar://problem/7303432>).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84499 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
8e63931545ee800f44bb9288befc928c31667ff3 19-Oct-2009 Daniel Dunbar <daniel@zuster.org> Workaround a bug exposed by the FileCheckify of message-length.c, the caret end
column computation isn't correct and could exceed the line length, which
resulted in a buffer overflow later.
- Chris, is there a better way for this code to compute the final column used
by the caret?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84475 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
06d10728b86ebb2bd73b593146e95e0c1688acc4 19-Oct-2009 Daniel Dunbar <daniel@zuster.org> Workaround a bug exposed by the FileCheckify of message-length.c, the caret end
column computation isn't correct and could exceed the line length, which
resulted in a buffer overflow later.
- Chris, is there a better way for this code to compute the final column used
by the caret?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84475 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
1ed2bb804102b54d62426d8aa4f60bcd6f2a6cb0 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> PR5218: Replace IdentifierInfo::getName with StringRef version, now that clients
are updated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84447 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
acheTokens.cpp
rintPreprocessedOutput.cpp
ewriteMacros.cpp
ewriteObjC.cpp
01eb9b9683535d8a65c704ad2c545903409e2d36 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> PR5218: Replace IdentifierInfo::getName with StringRef version, now that clients
are updated.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84447 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
acheTokens.cpp
rintPreprocessedOutput.cpp
ewriteMacros.cpp
ewriteObjC.cpp
b816548812c8dcfe9080b86b900ec94396fdcdc8 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Move misc clients to IdentifierInfo StringRef API.
- strcmp -> ==
- OS.write(II->getName() ...) -> OS << II->getNameStr()
- Avoid std::string concatenation
- Use getNameStr().str() when an std::string is really needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84437 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
ewriteMacros.cpp
ewriteObjC.cpp
5ffe14ca96bd662de7820f6875d3f04789a640c1 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Move misc clients to IdentifierInfo StringRef API.
- strcmp -> ==
- OS.write(II->getName() ...) -> OS << II->getNameStr()
- Avoid std::string concatenation
- Use getNameStr().str() when an std::string is really needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84437 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
ewriteMacros.cpp
ewriteObjC.cpp
03b6887fba9685a66992650252b2af29759de4cf 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Move clients to use IdentifierInfo::getNameStart() instead of getName()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84436 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
CHReader.cpp
CHWriter.cpp
ewriteObjC.cpp
e013d685c6689ac7ae103ee88acf573422d1ed6a 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Move clients to use IdentifierInfo::getNameStart() instead of getName()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84436 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
CHReader.cpp
CHWriter.cpp
ewriteObjC.cpp
c466863c380d1b84679bcd263ea8cdd82679dddd 18-Oct-2009 Benjamin Kramer <benny.kra@googlemail.com> Use sys::Path::eraseFromDisk instead of unlink as suggested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84415 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
4a630d30cd8ee9c8f46b8d3c9ad7e7e00d393f32 18-Oct-2009 Benjamin Kramer <benny.kra@googlemail.com> Use sys::Path::eraseFromDisk instead of unlink as suggested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84415 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5cc4b067c9a94ff7a98c34b4a8b14f2643980c79 18-Oct-2009 John McCall <rjmccall@apple.com> When performing template-substitution into a type, don't just replace the
TemplateTypeParmType with the substituted type directly; instead, replace it
with a SubstTemplateTypeParmType which will note that the type was originally
written as a template type parameter. This makes it reasonable to preserve
source information even through template substitution.

Also define the new SubstTemplateTypeParmType class, obviously.

For consistency with current behavior, we stringize these types as if they
were the underlying type. I'm not sure this is the right thing to do.
At any rate, I paled at adding yet another clause to the don't-desugar 'if'
statement, so I extracted a function to do it. The new function also does
The Right Thing more often, I think: e.g. if we have a chain of typedefs
leading to a vector type, we will now desugar all but the last one.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84412 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
49a832bd499d6f61c23655f1fac99f0dd229756e 18-Oct-2009 John McCall <rjmccall@apple.com> When performing template-substitution into a type, don't just replace the
TemplateTypeParmType with the substituted type directly; instead, replace it
with a SubstTemplateTypeParmType which will note that the type was originally
written as a template type parameter. This makes it reasonable to preserve
source information even through template substitution.

Also define the new SubstTemplateTypeParmType class, obviously.

For consistency with current behavior, we stringize these types as if they
were the underlying type. I'm not sure this is the right thing to do.
At any rate, I paled at adding yet another clause to the don't-desugar 'if'
statement, so I extracted a function to do it. The new function also does
The Right Thing more often, I think: e.g. if we have a chain of typedefs
leading to a vector type, we will now desugar all but the last one.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84412 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
14c3221c184cd7305ee9c7d4514caa5c13265b78 18-Oct-2009 John McCall <rjmccall@apple.com> Clone the full Type hierarchy into the TypeLoc hierarchy. Normalize
TypeLoc class names to be $(Type classname)Loc. Rewrite the visitor.
Provide skeleton implementations for all the new TypeLocs.

Handle all cases in PCH. Handle a few more cases when inserting
location information in SemaType.

It should be extremely straightforward to add new location information
to existing TypeLoc objects now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84386 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
51bd803fbdade51d674598ed45da3d54190a656c 18-Oct-2009 John McCall <rjmccall@apple.com> Clone the full Type hierarchy into the TypeLoc hierarchy. Normalize
TypeLoc class names to be $(Type classname)Loc. Rewrite the visitor.
Provide skeleton implementations for all the new TypeLocs.

Handle all cases in PCH. Handle a few more cases when inserting
location information in SemaType.

It should be extremely straightforward to add new location information
to existing TypeLoc objects now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84386 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
85caec1cefed9142ab7705db13b05ee57b7b68ad 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Switch to llvm::HashString.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84375 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2596e429a61602312bdd149786045b8a90cd2d10 18-Oct-2009 Daniel Dunbar <daniel@zuster.org> Switch to llvm::HashString.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84375 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
553b5ccdd39c3a4f7fdb1a14bede1865727dac69 18-Oct-2009 Nuno Lopes <nunoplopes@sapo.pt> add gentoo x86 2009.1 (gcc 4.3.4) include paths

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84371 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
aa546e2d1111cf3ff2cf4db721f587f3a9d3f5e1 18-Oct-2009 Nuno Lopes <nunoplopes@sapo.pt> add gentoo x86 2009.1 (gcc 4.3.4) include paths

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84371 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
daf1a7f26564c682fa1afc45fc64d03cbbc4fee9 17-Oct-2009 Daniel Dunbar <daniel@zuster.org> Use StringExtra's HashString instead of BernsteinHash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84360 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
df5a237b69b5ca74dcbcf9e6306b0f86476f6b32 17-Oct-2009 Daniel Dunbar <daniel@zuster.org> Use StringExtra's HashString instead of BernsteinHash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84360 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
824b995ee50b6d679a52f5d9e0efd910f5b37143 17-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Write the preprocessor block after we write out types + declarations,
so that we catch any macros used within the declarations and types.

Also, properly store a NULL selector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84334 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
813a97b3eee957eac3ac1fb111b8892fb9afd0d4 17-Oct-2009 Douglas Gregor <dgregor@apple.com> Write the preprocessor block after we write out types + declarations,
so that we catch any macros used within the declarations and types.

Also, properly store a NULL selector.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84334 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
115d5923acb549678e09ede01b6ada72873bbf12 17-Oct-2009 Daniel Dunbar <daniel@zuster.org> Add Ubuntu 9.04 C++ search path.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84301 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f6dc5aca85ccd4557c3b62b6a59e26ce3b45205f 17-Oct-2009 Daniel Dunbar <daniel@zuster.org> Add Ubuntu 9.04 C++ search path.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84301 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
b65681662aa7c3431805505a0964a391d06e0fa8 17-Oct-2009 Ted Kremenek <kremenek@apple.com> Add 'UseBumpPtrAllocator' flag to ASTUnit::LoadFromPCHFile() to cause the created ASTContext to use
its own BumpPtrAllocator to allocate ASTs.

Change clang_createTranslationUnit (CIndex) to pass 'UseBumpPtrAllocator = true' to
ASTUnit::LoadFromPCHFile().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84296 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5cf48766d626ff6b223acc9d4b7e415ca8480836 17-Oct-2009 Ted Kremenek <kremenek@apple.com> Add 'UseBumpPtrAllocator' flag to ASTUnit::LoadFromPCHFile() to cause the created ASTContext to use
its own BumpPtrAllocator to allocate ASTs.

Change clang_createTranslationUnit (CIndex) to pass 'UseBumpPtrAllocator = true' to
ASTUnit::LoadFromPCHFile().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84296 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5cd1f9a47e3900fc6e005d78a1b6fc791fe8df72 17-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Merge the "types" and "declarations" blocks in the precompiled header
format, so that we don't end up with multiple declaration and types
blocks. Also, fix a few obscure bugs with PCH loading and generation:

- If the DeclIDs DenseMap reallocates while we are writing a
declaration (due to recursively writing other declarations), we
could end up writing a bad ID to ExternalDefinitions.
- When loading an ArrayLoc (part of DeclaratorInfo), we need to set
the size expression to NULL if no size expression was provided.

PCH -> AST rewriting is still partly broken, unfortunately.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84293 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
CHWriterDecl.cpp
61d60ee6aa0a5ded0ddcf48679673b37506a1895 17-Oct-2009 Douglas Gregor <dgregor@apple.com> Merge the "types" and "declarations" blocks in the precompiled header
format, so that we don't end up with multiple declaration and types
blocks. Also, fix a few obscure bugs with PCH loading and generation:

- If the DeclIDs DenseMap reallocates while we are writing a
declaration (due to recursively writing other declarations), we
could end up writing a bad ID to ExternalDefinitions.
- When loading an ArrayLoc (part of DeclaratorInfo), we need to set
the size expression to NULL if no size expression was provided.

PCH -> AST rewriting is still partly broken, unfortunately.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84293 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
CHWriterDecl.cpp
04b3dcd8226f569d6ff85bebdd47406fb4945cca 17-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> While writing source-location entries to a PCH file, go through an
interface that can load those source-location entries on demand (from
another PCH file).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84287 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
bdfe48ac80573e026595af91e541474dbf02565f 17-Oct-2009 Douglas Gregor <dgregor@apple.com> While writing source-location entries to a PCH file, go through an
interface that can load those source-location entries on demand (from
another PCH file).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84287 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
01b64b35df896f5607325b20c4d4e0e4c914bcab 16-Oct-2009 John McCall <rjmccall@apple.com> Factor out routines to encode/decode DeclaratorInfos and move them into the
core PCH reader/writer implementation files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84278 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
a1ee0c548b8aa4aaf93d1917e304e3da13171a08 16-Oct-2009 John McCall <rjmccall@apple.com> Factor out routines to encode/decode DeclaratorInfos and move them into the
core PCH reader/writer implementation files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84278 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHWriter.cpp
CHWriterDecl.cpp
e6f70046cc9acf8b51952211f6d2aa98998e73df 16-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Keep track of whether declararions were loaded from a precompiled
header or not via a new "PCHLevel" field in Decl. We currently use
this information to help CIndex filter out declarations that came from
a precompiled header (rather than from an AST file). Further down the
road, it can be used to help implement multi-level precompiled
headers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84267 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
CHReaderDecl.cpp
CHWriterDecl.cpp
7d1d49d2971b20a97b3c2a301470b9eaaa130137 16-Oct-2009 Douglas Gregor <dgregor@apple.com> Keep track of whether declararions were loaded from a precompiled
header or not via a new "PCHLevel" field in Decl. We currently use
this information to help CIndex filter out declarations that came from
a precompiled header (rather than from an AST file). Further down the
road, it can be used to help implement multi-level precompiled
headers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84267 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
CHReaderDecl.cpp
CHWriterDecl.cpp
f0281ef6cb826acaf5090ea65d69164fe28e9352 16-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Add support for a chain of stat caches in the FileManager, rather than
only supporting a single stat cache. The immediate benefit of this
change is that we can now generate a PCH/AST file when including
another PCH file; in the future, the chain of stat caches will likely
be useful with multiple levels of PCH files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84263 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
eneratePCH.cpp
CHReader.cpp
52e7108f51a4a9f4d6e84f33fb594d06e1d79560 16-Oct-2009 Douglas Gregor <dgregor@apple.com> Add support for a chain of stat caches in the FileManager, rather than
only supporting a single stat cache. The immediate benefit of this
change is that we can now generate a PCH/AST file when including
another PCH file; in the future, the chain of stat caches will likely
be useful with multiple levels of PCH files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84263 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
eneratePCH.cpp
CHReader.cpp
325ac2bd865a4c5a2108971fe3c47c274a8a13e1 16-Oct-2009 John Thompson <john.thompson.jtsoftware@gmail.com> Work-around wchar_t and __pragma problem in VC headers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84227 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
24ee804962ecef23eb040083eb668f9fa202e4c0 16-Oct-2009 John Thompson <John.Thompson.JTSoftware@gmail.com> Work-around wchar_t and __pragma problem in VC headers

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84227 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
32b25ab7d4b3355b804e367c90f5cd55f4c9187e 16-Oct-2009 John McCall <rjmccall@apple.com> Remove the ConstantArrayType subtypes. This information is preserved in the
TypeLoc records for declarations; it should not be necessary to represent it
directly in the type system.

Please complain if you were using these classes and feel you can't replicate
previous functionality using the TypeLoc API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84222 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
46a617a792bfab0d9b1e057371ea3b9540802226 16-Oct-2009 John McCall <rjmccall@apple.com> Remove the ConstantArrayType subtypes. This information is preserved in the
TypeLoc records for declarations; it should not be necessary to represent it
directly in the type system.

Please complain if you were using these classes and feel you can't replicate
previous functionality using the TypeLoc API.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84222 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ca55f6feb4c1785fa35fd9e69494df0912ccc3c5 16-Oct-2009 Steve Naroff <snaroff@apple.com> Make sure temporary files get unlinked.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84208 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
e19944c93961b7618f4f3f3185f698f46369ea54 16-Oct-2009 Steve Naroff <snaroff@apple.com> Make sure temporary files get unlinked.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84208 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
a194695df4e2812e0ceb8f92f52902bb534bbcde 15-Oct-2009 Edward O'Callaghan <eocallaghan@auroraux.org> AuroraUX toolchain fixes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84176 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
7adf94906e23eae295a006659c55eab9ffcf8b37 15-Oct-2009 Edward O'Callaghan <eocallaghan@auroraux.org> AuroraUX toolchain fixes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84176 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
6816472475db68c155dc71a0a4402b5a0f2cfb0c 15-Oct-2009 John McCall <rjmccall@apple.com> Better living through metaprogramming. Create a base class which abstracts
most of the unsafe boilerplate out of TypeLoc. Create a QualifiedLoc class
to represent the idea that we *might* start representing source locations
of qualifiers. Dealing with qualifiers explicitly like this also lets us
efficiently ignore them in all the concrete cases.

This should make it obvious and easy to add new TypeLoc subclasses.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84168 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
34a0447b8072e0da14c0980597da9d03a1495662 15-Oct-2009 John McCall <rjmccall@apple.com> Better living through metaprogramming. Create a base class which abstracts
most of the unsafe boilerplate out of TypeLoc. Create a QualifiedLoc class
to represent the idea that we *might* start representing source locations
of qualifiers. Dealing with qualifiers explicitly like this also lets us
efficiently ignore them in all the concrete cases.

This should make it obvious and easy to add new TypeLoc subclasses.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84168 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
850c3e7b448a03033d430acea9273dd405fb2316 14-Oct-2009 Rafael Espindola <rafael.espindola@gmail.com> Add support for having different c++ search dirs with -m32 and -m64. So far
this is only used in darwin10, 64 bit ubuntu 9.10 and 64 bit openSUSE 11.1.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84115 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
31b63beefa058aa42a12a1c2b72b43a4ba21f7f1 14-Oct-2009 Rafael Espindola <rafael.espindola@gmail.com> Add support for having different c++ search dirs with -m32 and -m64. So far
this is only used in darwin10, 64 bit ubuntu 9.10 and 64 bit openSUSE 11.1.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84115 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
354e5fd60921fac8faacea2af276b0c13b77465d 13-Oct-2009 John Thompson <john.thompson.jtsoftware@gmail.com> Fixes pth.c on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84007 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
d3f88343af2dec3459493fafa22532317321eaf0 13-Oct-2009 John Thompson <John.Thompson.JTSoftware@gmail.com> Fixes pth.c on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84007 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
fa64ec0971d80624416a6af735808aa7db59994e 12-Oct-2009 Mike Stump <mrs@apple.com> Fixup windows include paths. Patch by John Thompson.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83898 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
nitHeaderSearch.cpp
620d57a293143e3f07d6e4f5ba50020a80f45564 12-Oct-2009 Mike Stump <mrs@apple.com> Fixup windows include paths. Patch by John Thompson.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83898 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
nitHeaderSearch.cpp
1e62fc07b21846fd0050e857ac2baf6697907317 12-Oct-2009 Edward O'Callaghan <eocallaghan@auroraux.org> Typo in AddGnuCPlusPlusIncludePaths.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83847 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ff267205cd6b0114a5e48bd2ae2a65555db5158a 12-Oct-2009 Edward O'Callaghan <eocallaghan@auroraux.org> Typo in AddGnuCPlusPlusIncludePaths.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83847 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
de9af1f057b3ea9005e629384f1af9859716227c 09-Oct-2009 Mike Stump <mrs@apple.com> Efficiency refinements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83666 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ec05766fe525a8f81c7dc96ddbdc874814a14b2c 09-Oct-2009 Mike Stump <mrs@apple.com> Efficiency refinements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83666 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
af79ba6dab479b4f6c40e7dc10ced0a613592d1b 09-Oct-2009 Mike Stump <mrs@apple.com> Push all the way out to 80.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83664 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
e85c74d52cdc3210f6d9c6f8ba0cc3d8060f0bba 09-Oct-2009 Mike Stump <mrs@apple.com> Push all the way out to 80.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83664 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
2835511b72c361fa346767a65bd2df7b79f9b9f4 09-Oct-2009 Axel Naumann <Axel.Naumann@cern.ch> Passing const Triple& is sufficient for AddDefaultSystemIncludePaths()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83663 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
38ee4e07633f1548f6b703e74ac7ad2208059d39 09-Oct-2009 Axel Naumann <Axel.Naumann@cern.ch> Passing const Triple& is sufficient for AddDefaultSystemIncludePaths()

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83663 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
8bcb62db4972cdf2cdcffcc9e1099abf1dad0c1f 09-Oct-2009 Mike Stump <mrs@apple.com> Add a refactor pointer...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83599 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
fb16c0a6d164faa697e57ce399034dd4cea2f490 09-Oct-2009 Mike Stump <mrs@apple.com> Add a refactor pointer...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83599 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
030f8967a3a687dce7196f9268731ef8eeb7080a 09-Oct-2009 Mike Stump <mrs@apple.com> Set up include paths for VC++ and Cygwin headers, along with the
existing MinGW headers, plus the newer 4.4.0 version. Patch by John
Thompson.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83594 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
43d8176d2e8e304b2d419fb0fe139cc07af80dea 09-Oct-2009 Mike Stump <mrs@apple.com> Set up include paths for VC++ and Cygwin headers, along with the
existing MinGW headers, plus the newer 4.4.0 version. Patch by John
Thompson.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83594 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ec0240c63cbf1e94db49fc2dd03c33988925ba53 09-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Installation of Clang libraries and headers, from Axel Naumann!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83582 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
14ea5696417a8e8d244a07091284cdeba57c6d4d 09-Oct-2009 Douglas Gregor <dgregor@apple.com> Installation of Clang libraries and headers, from Axel Naumann!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83582 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
973ab07d1810692de840be2ed1033565f3869e00 08-Oct-2009 Ted Kremenek <kremenek@apple.com> Remove use of std::ofstream in HTMLDiagnostics.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83560 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
b8fc325f00a85a4101958e6df873cf7eb5a5f84d 08-Oct-2009 Ted Kremenek <kremenek@apple.com> Remove use of std::ofstream in HTMLDiagnostics.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83560 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
23ad4eb7d6a8a45f17531a75f7bc3bd8f5ca01e4 06-Oct-2009 Rafael Espindola <rafael.espindola@gmail.com> Refactor the c++ include path a bit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83357 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
2e9f652d53346bf7e64c8a12a9ff06b004a3e489 06-Oct-2009 Rafael Espindola <rafael.espindola@gmail.com> Refactor the c++ include path a bit.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83357 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
eeca8bc32b7825c78c67bb5d09353edd0f715fb1 05-Oct-2009 Douglas Gregor <doug.gregor@gmail.com> Encode the Clang branch and Subversion revision into a PCH file, and
assume that PCH files from different Clang revisions are not
compatible. Addresses <rdar://problem/7266572>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83323 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
445e23e9b909ec8e21303c7dd82c90b72fc09ac4 05-Oct-2009 Douglas Gregor <dgregor@apple.com> Encode the Clang branch and Subversion revision into a PCH file, and
assume that PCH files from different Clang revisions are not
compatible. Addresses <rdar://problem/7266572>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83323 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
0ec79cd78ccdcb79d5bc4d6889481aad091d8f6d 01-Oct-2009 Rafael Espindola <rafael.espindola@gmail.com> Move the "needs exception support" logic to clang. This also fixes
-fno-exceptions in C++ code. We used to always define __EXCEPTIONS in
C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83199 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
f759df06d997050559fd925758bcd2cdef24db05 01-Oct-2009 Rafael Espindola <rafael.espindola@gmail.com> Move the "needs exception support" logic to clang. This also fixes
-fno-exceptions in C++ code. We used to always define __EXCEPTIONS in
C++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83199 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
7c10e9e6304a7ab7175c9bdadf5c75b39db1b856 29-Sep-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Pull TypeLocVisitor into its own header file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83112 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
0c411806d540f7158bf12fee5c10f7de2647de76 29-Sep-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Pull TypeLocVisitor into its own header file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83112 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
96eac694184d88ab34e621e7d44f3dc526927398 29-Sep-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce ObjCInterfaceLoc which provides type source information for ObjC interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83097 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
eb66759e9a1d7c041354d132a14674b2d948059b 29-Sep-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ObjCInterfaceLoc which provides type source information for ObjC interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83097 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
225d6ca735de81dfb9bdc95645e30c6ba9514f43 29-Sep-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce ObjCProtocolListLoc for keeping source location information for protocol references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83094 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
f352bddf015e537350416c296dd2963524f554f9 29-Sep-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ObjCProtocolListLoc for keeping source location information for protocol references.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83094 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
3921aa9c84f6876fdf2b7feb596ccb94fb83989e 29-Sep-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce ObjCProtocolListType type subclass.

This is used only for keeping detailed type source information for protocol references,
it should not participate in the semantics of the type system.

Its protocol list is not canonicalized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83093 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
24fab41057e4b67ed69a6b4027d5ae0f2f6934dc 29-Sep-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce ObjCProtocolListType type subclass.

This is used only for keeping detailed type source information for protocol references,
it should not participate in the semantics of the type system.

Its protocol list is not canonicalized.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83093 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ad013fe4faca8bdee9b92d19d34726b278122673 26-Sep-2009 Dan Gohman <gohman@apple.com> Pass the formatted_raw_ostream to createPrintModulePass and
createBitcodeWriterPass instead of the underlying raw_ostream. This
avoids trouble with formatted_raw_ostream's behavior of setting the
underlying stream to be unbuffered, which resulted in
clang -emit-llvm -S using unbuffered output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82857 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
b8d42397aaac8cf4d8fe9d1b081a7b0440fc33d6 26-Sep-2009 Dan Gohman <gohman@apple.com> Pass the formatted_raw_ostream to createPrintModulePass and
createBitcodeWriterPass instead of the underlying raw_ostream. This
avoids trouble with formatted_raw_ostream's behavior of setting the
underlying stream to be unbuffered, which resulted in
clang -emit-llvm -S using unbuffered output.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82857 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
2a4dbc4c358c64ab18e03d97225170f57c93f389 26-Sep-2009 Ted Kremenek <kremenek@apple.com> Hoist some branches in AnalysisManager::HandleTranslationUnit so we
avoid scanning for an "entry point" FunctionDecl if we (a) have no
translation unit actions and (b) no entry point function has been
specified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82846 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
74e3c92aa3eb1750ac2eb89994046eb69db39100 26-Sep-2009 Ted Kremenek <kremenek@apple.com> Hoist some branches in AnalysisManager::HandleTranslationUnit so we
avoid scanning for an "entry point" FunctionDecl if we (a) have no
translation unit actions and (b) no entry point function has been
specified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82846 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
5275c207a3642dea0abcc20b5ba34871451b6715 26-Sep-2009 Anders Carlsson <andersca@mac.com> Don't try to dump invalid decls or forward decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82827 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
4f5bf3b095f3454eb0da2de9f44639f8fa9948fb 26-Sep-2009 Anders Carlsson <andersca@mac.com> Don't try to dump invalid decls or forward decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82827 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
a61dc35f27f61c97297121f7c6eca4678d4ee9a6 25-Sep-2009 Anders Carlsson <andersca@mac.com> Who would have thought that empty classes were so tricky? Handle cases where an empty virtual base class needs to be moved aside because it conflicts with the first field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82746 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
a4c6081abd5582515b110bdcb576b4b85536467b 25-Sep-2009 Anders Carlsson <andersca@mac.com> Who would have thought that empty classes were so tricky? Handle cases where an empty virtual base class needs to be moved aside because it conflicts with the first field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82746 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
b47b1f4a6bb49d3512916492eaec51fe89f63088 25-Sep-2009 Anders Carlsson <andersca@mac.com> Improve the record layout dumper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82733 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
8fdccd95fcc98956cddd9f10b4d72b0c01bf3eac 25-Sep-2009 Anders Carlsson <andersca@mac.com> Improve the record layout dumper.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82733 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
3ddc81456e4ee7e1017f17860053f3eec505a50e 24-Sep-2009 John McCall <rjmccall@apple.com> Refactor the representation of qualifiers to bring ExtQualType out of the
Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our
use of qualifiers and fix a few places that weren't dealing with qualifiers
quite right; many more remain.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82705 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
CHReader.cpp
CHWriter.cpp
ewriteObjC.cpp
0953e767ff7817f97b3ab20896b229891eeff45b 24-Sep-2009 John McCall <rjmccall@apple.com> Refactor the representation of qualifiers to bring ExtQualType out of the
Type hierarchy. Demote 'volatile' to extended-qualifier status. Audit our
use of qualifiers and fix a few places that weren't dealing with qualifiers
quite right; many more remain.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82705 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
CHReader.cpp
CHWriter.cpp
ewriteObjC.cpp
51287e77727c6ad39e7654ff77949700389c46bf 24-Sep-2009 Anders Carlsson <andersca@mac.com> Add a -dump-record-layouts argument to clang-cc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82703 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
78762ebb9ad71d681110d4bada4b0575eaadfebe 24-Sep-2009 Anders Carlsson <andersca@mac.com> Add a -dump-record-layouts argument to clang-cc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82703 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
c662955a522a39e07ec1f2a1f8f96e9a3cbc7063 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Update PCH serialization of FunctionDecl flags.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82526 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
7f8b57aa3558ed079358637a2a48db7d2fefb4b2 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Update PCH serialization of FunctionDecl flags.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82526 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
cdcf45e872056a691bddf8dac152282d6e742857 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Allow PCH files to be read from stdin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82525 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
f3c740eb2c29c6767e3e06e1f84f7c3e40e12a5f 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Allow PCH files to be read from stdin.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82525 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
0700c31e43f6d1805de0e8a34420b5eecec92690 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Add StringLiteral::getString -> StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82514 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
b648023da23e8b227cdda57a241db4c6f368726b 22-Sep-2009 Daniel Dunbar <daniel@zuster.org> Add StringLiteral::getString -> StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82514 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
cac0eaf6caa1035b6a971b32adeea895ba14715c 22-Sep-2009 John McCall <rjmccall@apple.com> Change all the Type::getAsFoo() methods to specializations of Type::getAs().
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely. Several more 'leaf'
optimizations were introduced.

The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82501 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
CHReader.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
183700f494ec9b6701b6efe82bcb25f4c79ba561 22-Sep-2009 John McCall <rjmccall@apple.com> Change all the Type::getAsFoo() methods to specializations of Type::getAs().
Several of the existing methods were identical to their respective
specializations, and so have been removed entirely. Several more 'leaf'
optimizations were introduced.

The getAsFoo() methods which imposed extra conditions, like
getAsObjCInterfacePointerType(), have been left in place.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82501 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
CHReader.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
a740be9bd9a01fd70bd25db2481d16af868dc670 21-Sep-2009 Daniel Dunbar <daniel@zuster.org> Add missing PCH support for -fstack-protector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82435 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ab8e281b32a3d3b9b18257d26844362bf806ecdc 21-Sep-2009 Daniel Dunbar <daniel@zuster.org> Add missing PCH support for -fstack-protector.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82435 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
62f1137dd7a0dc84ec39adf5f89126e3ee57b093 21-Sep-2009 Daniel Dunbar <daniel@zuster.org> Change ASTUnit to only initialize the predefines buffer to the suggested predefines.
- It isn't really clear what to do with the preprocessor here, but this is more sensible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82431 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
d5b6126389e1e2fd89e498fe17da4bb44ece0302 21-Sep-2009 Daniel Dunbar <daniel@zuster.org> Change ASTUnit to only initialize the predefines buffer to the suggested predefines.
- It isn't really clear what to do with the preprocessor here, but this is more sensible.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82431 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
5d8871d4a40dbf5618062638e110f1d7bb03ca7b 21-Sep-2009 Daniel Dunbar <daniel@zuster.org> Change ASTUnit to take the Diagnostic as an argument, the client should have control of this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82430 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
31b87d8006d4863dd9b17e515ac720941efc38e3 21-Sep-2009 Daniel Dunbar <daniel@zuster.org> Change ASTUnit to take the Diagnostic as an argument, the client should have control of this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82430 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
eefc14527fc5debf0207e8553b828af733a8d3cd 19-Sep-2009 Ted Kremenek <kremenek@apple.com> Fix regression introduced by r82198 that caused functions/methods with invalid CFGs to get analyzed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82297 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
75d03cffe20b5c945ef04eba208efb0437339997 19-Sep-2009 Ted Kremenek <kremenek@apple.com> Fix regression introduced by r82198 that caused functions/methods with invalid CFGs to get analyzed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82297 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
6902706ff2be3b90f376e735dacc0a955e4e3ccd 18-Sep-2009 Ted Kremenek <kremenek@apple.com> Introduce caching of diagnostics in BugReporter. This provides extra
pruning of diagnostics that may be emitted multiple times. This is
accomplished by adding FoldingSet profiling support to PathDiagnostic,
and then having BugReporter record what diagnostics have been issued.

This was motived to a serious bug introduced by moving the
'divide-by-zero' checking outside of GRExprEngine into a separate
'Checker' class. When analyzing code using the '-fobjc-gc' option, a
given function would be analyzed twice, but the second time various
"internal checks" would be disabled to avoid emitting multiple
diagnostics (e.g., "null dereference") for the same issue. The
problem is that such checks also effect path pruning and don't just
emit diagnostics. This resulted in an assertion failure involving a
real divide-by-zero in some analyzed code where we would get an
assertion failure in APInt because the 'DivZero' check was disabled
and didn't prune the logic that resulted in the divide-by-zero in the
analyzer.

The implemented solution is somewhat of a hack, and may not perform
extremely well. This will need to be cleaned up over time.

As a regression test, 'misc-ps.m' has been modified so that its tests
are run using -fobjc-gc to test this diagnostic pruning behavior.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82198 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
6a19832d08f00ac78c0a69c4fbe38b04a55b75cc 18-Sep-2009 Ted Kremenek <kremenek@apple.com> Introduce caching of diagnostics in BugReporter. This provides extra
pruning of diagnostics that may be emitted multiple times. This is
accomplished by adding FoldingSet profiling support to PathDiagnostic,
and then having BugReporter record what diagnostics have been issued.

This was motived to a serious bug introduced by moving the
'divide-by-zero' checking outside of GRExprEngine into a separate
'Checker' class. When analyzing code using the '-fobjc-gc' option, a
given function would be analyzed twice, but the second time various
"internal checks" would be disabled to avoid emitting multiple
diagnostics (e.g., "null dereference") for the same issue. The
problem is that such checks also effect path pruning and don't just
emit diagnostics. This resulted in an assertion failure involving a
real divide-by-zero in some analyzed code where we would get an
assertion failure in APInt because the 'DivZero' check was disabled
and didn't prune the logic that resulted in the divide-by-zero in the
analyzer.

The implemented solution is somewhat of a hack, and may not perform
extremely well. This will need to be cleaned up over time.

As a regression test, 'misc-ps.m' has been modified so that its tests
are run using -fobjc-gc to test this diagnostic pruning behavior.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82198 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
75d4bb184de09d13ae4ce2604fdfee958ee20c60 17-Sep-2009 Daniel Dunbar <daniel@zuster.org> PCH: When writing PCH files, tweak the predicate function deciding whether to mark a decl as "external" to be closer to reality.

This still isn't perfect, but I believe it is conservatively accurate at marking decls which IRgen needs to see, while still keeping the "deserialization footprint" on Cocoa.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82112 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
e24d38f6924c5a212b05bcebd87f29f17e2343f5 17-Sep-2009 Daniel Dunbar <daniel@zuster.org> PCH: When writing PCH files, tweak the predicate function deciding whether to mark a decl as "external" to be closer to reality.

This still isn't perfect, but I believe it is conservatively accurate at marking decls which IRgen needs to see, while still keeping the "deserialization footprint" on Cocoa.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82112 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
1b260c7470f6a1e66aba1e43cbc5d554c7fe8ec3 17-Sep-2009 Daniel Dunbar <daniel@zuster.org> PCH: When deserializing an explicit "external definition", don't pass it to HandleTopLevelDecl -- this is already being done inside the reader.

This is something of a hack, since whether the reader actually did this depends on the "isConsumerInterestedIn" predicate. I think we need to rework how this works, but I need to discuss with Doug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82111 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
04a0b50e19a5598330a4b42c5de2583e244df22f 17-Sep-2009 Daniel Dunbar <daniel@zuster.org> PCH: When deserializing an explicit "external definition", don't pass it to HandleTopLevelDecl -- this is already being done inside the reader.

This is something of a hack, since whether the reader actually did this depends on the "isConsumerInterestedIn" predicate. I think we need to rework how this works, but I need to discuss with Doug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82111 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
0e2f5a163f6c98d2bc8837202749964257f0c40c 16-Sep-2009 Mike Stump <mrs@apple.com> Fix spelling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82078 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
197c8d9ef0186d92aaaee2a72c6a09f139d6914e 16-Sep-2009 Mike Stump <mrs@apple.com> Fix spelling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@82078 91177308-0d34-0410-b5e6-96231b3b80d8
ocumentXML.cpp
d7e072a022193d8fab49a31e5875025661e8c4fa 13-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Rework the way we determine whether an externally visible symbol is
generated for an inline function definition, taking into account C99
and GNU inline/extern inline semantics. This solution is simpler,
cleaner, and fixes PR4536.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81670 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
1fc09a92d0bffda20e06fa882388c01e192e2069 13-Sep-2009 Douglas Gregor <dgregor@apple.com> Rework the way we determine whether an externally visible symbol is
generated for an inline function definition, taking into account C99
and GNU inline/extern inline semantics. This solution is simpler,
cleaner, and fixes PR4536.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81670 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
d3693926e6834c657d1b64b68f790f36daf5f8c2 12-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate FunctionDecl::getBodyIfAvailable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81588 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
af3280fadbdab6305581955c973e1229970958eb 12-Sep-2009 Douglas Gregor <dgregor@apple.com> Eliminate FunctionDecl::getBodyIfAvailable

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81588 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
5d9a8659fbb8a9bea5d1de96a96e6ea612ceec76 11-Sep-2009 Daniel Dunbar <daniel@zuster.org> Update prototype.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81510 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
a4d3282683b22608b05a3d4566c96af269d99c5c 11-Sep-2009 Daniel Dunbar <daniel@zuster.org> Update prototype.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81510 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
59b2cf88fd200aa96f385a0c2834f3e9abd36f2c 11-Sep-2009 Zhongxing Xu <xuzhongxing@gmail.com> Start to add a new transfer function that inlines callee. To be continued.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81501 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
66847a2826c97b8e09aec304a0a7b4fe1dc35969 11-Sep-2009 Zhongxing Xu <xuzhongxing@gmail.com> Start to add a new transfer function that inlines callee. To be continued.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81501 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
9c73aa02c1e3dc693ae66b223ab2e3105f50007c 10-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Non fragile ABI for GNU runtime. Patch bu David Chisnall.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81462 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
d9a1db3a4ded1c8f0daa43c0d6167576e2766453 10-Sep-2009 Fariborz Jahanian <fjahanian@apple.com> Non fragile ABI for GNU runtime. Patch bu David Chisnall.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81462 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
3f37ee9a48a7ab02a95bf21f0ec19004825419ea 10-Sep-2009 Zhongxing Xu <xuzhongxing@gmail.com> Make AnalysisManager stateless. Now other analyzer components only depends on
local node information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81433 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
b317f8f5ca8737a5bbad97a3f7566a2dbd2ed61b 10-Sep-2009 Zhongxing Xu <xuzhongxing@gmail.com> Make AnalysisManager stateless. Now other analyzer components only depends on
local node information.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81433 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
343aad6b139537dc285f667a406ccdf63da7a8d4 10-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Improve handling of initialization by constructor, by ensuring that
such initializations properly convert constructor arguments and fill
in default arguments where necessary. This also makes the ownership
model more clear.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81394 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
39da0b8145eaec7da7004f9b3645c5c9f4f63b1d 10-Sep-2009 Douglas Gregor <dgregor@apple.com> Improve handling of initialization by constructor, by ensuring that
such initializations properly convert constructor arguments and fill
in default arguments where necessary. This also makes the ownership
model more clear.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81394 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
25cf760b54d3b88633827501013bc51a29b28aba 09-Sep-2009 Mike Stump <mrs@apple.com> Remove tabs, and whitespace cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
STUnit.cpp
nalysisConsumer.cpp
ackend.cpp
acheTokens.cpp
eclXML.cpp
ependencyFile.cpp
iagChecker.cpp
ocumentXML.cpp
ixItRewriter.cpp
eneratePCH.cpp
TMLDiagnostics.cpp
TMLPrint.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
listDiagnostics.cpp
rintParserCallbacks.cpp
rintPreprocessedOutput.cpp
ewriteBlocks.cpp
ewriteMacros.cpp
ewriteObjC.cpp
ewriteTest.cpp
tmtXML.cpp
extDiagnosticBuffer.cpp
extDiagnosticPrinter.cpp
ypeXML.cpp
arnings.cpp
1eb4433ac451dc16f4133a88af2d002ac26c58ef 09-Sep-2009 Mike Stump <mrs@apple.com> Remove tabs, and whitespace cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
STUnit.cpp
nalysisConsumer.cpp
ackend.cpp
acheTokens.cpp
eclXML.cpp
ependencyFile.cpp
iagChecker.cpp
ocumentXML.cpp
ixItRewriter.cpp
eneratePCH.cpp
TMLDiagnostics.cpp
TMLPrint.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
CHWriter.cpp
CHWriterDecl.cpp
CHWriterStmt.cpp
listDiagnostics.cpp
rintParserCallbacks.cpp
rintPreprocessedOutput.cpp
ewriteBlocks.cpp
ewriteMacros.cpp
ewriteObjC.cpp
ewriteTest.cpp
tmtXML.cpp
extDiagnosticBuffer.cpp
extDiagnosticPrinter.cpp
ypeXML.cpp
arnings.cpp
814b425c612032e4484084bc879f9d8cf821efea 08-Sep-2009 Chris Lattner <sabre@nondot.org> Fix PR4922, where Sema would complete tentative definitions in nondeterminstic
order because it was doing so while iterating over a densemap.

There are still similar problems in other places, for example
WeakUndeclaredIdentifiers is still written to the PCH file in a nondeterminstic
order, and we emit warnings about #pragma weak in nondeterminstic order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81236 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
63d65f873fdfcb04b216ea9c648d1df5992aed1c 08-Sep-2009 Chris Lattner <sabre@nondot.org> Fix PR4922, where Sema would complete tentative definitions in nondeterminstic
order because it was doing so while iterating over a densemap.

There are still similar problems in other places, for example
WeakUndeclaredIdentifiers is still written to the PCH file in a nondeterminstic
order, and we emit warnings about #pragma weak in nondeterminstic order.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81236 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2307a88c3e025dde2f876470d12dfe1bdb328340 08-Sep-2009 Daniel Dunbar <daniel@zuster.org> Remove trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81169 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
cbff0dc7fefe37bcef9044ec89e9f1131f3c76a9 08-Sep-2009 Daniel Dunbar <daniel@zuster.org> Remove trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81169 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
1c1c520be520e9b8ef21e3f9aee761d973032792 07-Sep-2009 Benjamin Kramer <benny.kra@googlemail.com> More <sstream> removal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81150 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteBlocks.cpp
05c73c5f28eac0cacc263238e8ce3f86b9e17d8e 07-Sep-2009 Benjamin Kramer <benny.kra@googlemail.com> More <sstream> removal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81150 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteBlocks.cpp
6ba693c29fa2d99ba4b6a8f24f785fadfa825c25 05-Sep-2009 Benjamin Kramer <benny.kra@googlemail.com> Replace some instances of std::string with StringRefs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81079 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
458fb10ef5ba2d7b375c6c64095c1458af0a5be3 05-Sep-2009 Benjamin Kramer <benny.kra@googlemail.com> Replace some instances of std::string with StringRefs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81079 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
379448fc7bc91bba33e3d2df073f6cf011960b96 05-Sep-2009 John McCall <rjmccall@apple.com> Basic support for representing elaborated type specifiers
directly in the AST. The current thinking is to create these
only in C++ mode for efficiency. But for now, they're not being
created at all; patch to follow.

This will let us do things like verify that tags match during
template instantation, as well as signal that an elaborated type
specifier was used for clients that actually care.

Optimally, the TypeLoc hierarchy should be adjusted to carry tag
location information as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81057 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
7da2431c23ef1ee8acb114e39692246e1801afc2 05-Sep-2009 John McCall <rjmccall@apple.com> Basic support for representing elaborated type specifiers
directly in the AST. The current thinking is to create these
only in C++ mode for efficiency. But for now, they're not being
created at all; patch to follow.

This will let us do things like verify that tags match during
template instantation, as well as signal that an elaborated type
specifier was used for clients that actually care.

Optimally, the TypeLoc hierarchy should be adjusted to carry tag
location information as well.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81057 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
e39087aff486958d7736015153344e13c8ebf7ad 04-Sep-2009 Steve Naroff <snaroff@apple.com> Implement accessors clang_getCursorKind(), clang_getCursorDecl().
Implement clang_getCursor() - wired up to Argiris's work.
Implement callbacks for CXCursor_ObjCProtocolRef.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81004 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
9efa767be8e9f2dae509d3a0be93ade01bfa1560 04-Sep-2009 Steve Naroff <snaroff@apple.com> Implement accessors clang_getCursorKind(), clang_getCursorDecl().
Implement clang_getCursor() - wired up to Argiris's work.
Implement callbacks for CXCursor_ObjCProtocolRef.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81004 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
454b9e606afd874d69ca633a9e6b2acea9649014 03-Sep-2009 Daniel Dunbar <daniel@zuster.org> Don't use '%ll', this doesn't workin on Win32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80933 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
b8b844b92586031cf17684d5d1a37a2dc5cecc45 03-Sep-2009 Daniel Dunbar <daniel@zuster.org> Don't use '%ll', this doesn't workin on Win32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80933 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
5bfadbe7135ab3b9c796c142b986337941f51426 03-Sep-2009 Steve Naroff <snaroff@apple.com> Add ASTUnit::getOriginalSourceFileName() and use in clang_getTranslationUnitSpelling().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80932 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
77accc11f04ed4ff9afd4e27d430144d4714be56 03-Sep-2009 Steve Naroff <snaroff@apple.com> Add ASTUnit::getOriginalSourceFileName() and use in clang_getTranslationUnitSpelling().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80932 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
78a63db2961761262e9bcdcf9d7a01774457ba6b 03-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Save/load POSIXThreads flag for PCH

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80916 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
972d954bd216c86a961bb7f81c53af85de17c2f0 03-Sep-2009 Douglas Gregor <dgregor@apple.com> Save/load POSIXThreads flag for PCH

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80916 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
172cb43b46e0deccbe4113bf65e278ce76ab5b18 03-Sep-2009 Daniel Dunbar <daniel@zuster.org> Revert "Visit function/method bodies and issue callback for parameters and local
variables.", this is breaking x86_64-apple-darwin10 and Linux tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80896 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
bce6f62ae7d2c15992617f64e30067803fb5b47f 03-Sep-2009 Daniel Dunbar <daniel@zuster.org> Revert "Visit function/method bodies and issue callback for parameters and local
variables.", this is breaking x86_64-apple-darwin10 and Linux tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80896 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
7e9854e58d3a892e2a25d1b5cfcadb20a352a5b0 03-Sep-2009 Daniel Dunbar <daniel@zuster.org> Revert "Remove redundant local variable (use newly created instance data).", the
previous commit this depends on is breaking x86_64-apple-darwin10 and Linux tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80895 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
cc318939daaa50fc07f7d431caec3c8679893e9c 03-Sep-2009 Daniel Dunbar <daniel@zuster.org> Revert "Remove redundant local variable (use newly created instance data).", the
previous commit this depends on is breaking x86_64-apple-darwin10 and Linux tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80895 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
62a7cbc34a427d95d86fb35c69ac073c252465a9 03-Sep-2009 Daniel Dunbar <daniel@zuster.org> Add basic support for -pthread.
- Patch by David Chisnall, with PCH and Darwin support mixed in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80883 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
5345c391c65d1780a0d7b0102b7f735cc3f82732 03-Sep-2009 Daniel Dunbar <daniel@zuster.org> Add basic support for -pthread.
- Patch by David Chisnall, with PCH and Darwin support mixed in.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80883 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
419ff5684173e7290a4e192adea6974b525c7265 03-Sep-2009 Steve Naroff <snaroff@apple.com> Remove redundant local variable (use newly created instance data).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80861 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
bbff6990ac96c1767cdbe66d439fc6ba5d3fa693 03-Sep-2009 Steve Naroff <snaroff@apple.com> Remove redundant local variable (use newly created instance data).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80861 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
6b0576bf7b3751de35b77061fcd18bf3cb402d2f 03-Sep-2009 Steve Naroff <snaroff@apple.com> Visit function/method bodies and issue callback for parameters and local variables.
Add clang_getTranslationUnitSpelling().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80859 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
23d8bea7056e7f474ce7f42042021a148feee8f7 03-Sep-2009 Steve Naroff <snaroff@apple.com> Visit function/method bodies and issue callback for parameters and local variables.
Add clang_getTranslationUnitSpelling().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80859 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
d33e328e84080d75879182f882b578ffa7db52ab 01-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Preliminary AST representation and semantic analysis for
explicitly-specified template argument lists in member reference
expressions, e.g.,

x->f<int>()



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80646 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterStmt.cpp
c4bf26fbdff42967d660f505a83f75a4df2cc752 01-Sep-2009 Douglas Gregor <dgregor@apple.com> Preliminary AST representation and semantic analysis for
explicitly-specified template argument lists in member reference
expressions, e.g.,

x->f<int>()



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80646 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterStmt.cpp
c5e2ea91bf5d6d95ffd0e94c07ddf5d2a470b78e 01-Sep-2009 Douglas Gregor <doug.gregor@gmail.com> Remember to write the qualifier of a MemberExpr to the PCH file when we get to C++ PCH

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80643 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterStmt.cpp
303e6d7554badb1c42844080eebb9594c27e5373 01-Sep-2009 Douglas Gregor <dgregor@apple.com> Remember to write the qualifier of a MemberExpr to the PCH file when we get to C++ PCH

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80643 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterStmt.cpp
16b12f0d3b4697666d8a00f0cc86dd3ebf162225 28-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Define _GNU_SOURCE in C++ mode so that clang works with GNU libstdc++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80289 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
666479b24b1ab5ca0239779a502899b70beee700 28-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Define _GNU_SOURCE in C++ mode so that clang works with GNU libstdc++.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80289 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
9c71db1d83b6c08e92f0dd69fd0e23bc0aeaf6d2 27-Aug-2009 Mike Stump <mrs@apple.com> Regularize the case and sort.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80163 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
1feade8e520be483293dbf55eb57a51720899589 27-Aug-2009 Mike Stump <mrs@apple.com> Regularize the case and sort.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80163 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
346198721c8f96f8ab2f0fcf1fe129170ad2394f 26-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Source location information for ? and : in a ConditionalOperator, from Enea Zaffanella

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80097 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
47e1f7c68bf375cac470fdb2b599ddbb395aeb52 26-Aug-2009 Douglas Gregor <dgregor@apple.com> Source location information for ? and : in a ConditionalOperator, from Enea Zaffanella

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80097 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
27eca86795675caa21a642efa54118644f7c4575 25-Aug-2009 Dan Gohman <gohman@apple.com> Update clang for raw_fd_ostream no longer requiring F_Force.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79991 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ixItRewriter.cpp
listDiagnostics.cpp
b044c473a155b7e827680635c1699cb2b5b6c0ee 25-Aug-2009 Dan Gohman <gohman@apple.com> Update clang for raw_fd_ostream no longer requiring F_Force.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79991 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ixItRewriter.cpp
listDiagnostics.cpp
b4fa87b8e064c6b104c5e918e7df0587c8d9bc27 25-Aug-2009 Zhongxing Xu <xuzhongxing@gmail.com> Remove CodeDecl and CFG from GRExprEngine and GRStateManager.
Now AnalysisManager is the only place we can get CodeDecl.
This leads to an API change: GRState::bindExpr() now takes the CFG argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79980 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
5032ffe4259e7d436f2eb19e5a29fdae559e7c12 25-Aug-2009 Zhongxing Xu <xuzhongxing@gmail.com> Remove CodeDecl and CFG from GRExprEngine and GRStateManager.
Now AnalysisManager is the only place we can get CodeDecl.
This leads to an API change: GRState::bindExpr() now takes the CFG argument.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79980 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
d5afcd799493200dfe8fca7f33311c34d27a3b0b 24-Aug-2009 Chris Lattner <sabre@nondot.org> normalize the CharacterLiteral::getLocation method name, patch
by Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79924 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterStmt.cpp
018d8e0596dd57401eeddcf11ac84ff0a065fbbe 24-Aug-2009 Chris Lattner <sabre@nondot.org> normalize the CharacterLiteral::getLocation method name, patch
by Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79924 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterStmt.cpp
0fbc71c858f622540711ca91a6cc58bc96b2935f 24-Aug-2009 Edwin Török <edwintorok@gmail.com> Fix build of clang with gcc-4.4: #include <cstdio> was missing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79916 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ixItRewriter.cpp
CHWriterDecl.cpp
ewriteMacros.cpp
f42e4a6e089e8413247400fe58ad299193371f9c 24-Aug-2009 Torok Edwin <edwintorok@gmail.com> Fix build of clang with gcc-4.4: #include <cstdio> was missing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79916 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ixItRewriter.cpp
CHWriterDecl.cpp
ewriteMacros.cpp
01cc32ce92c51c9034efba15b9b42bbcb1ad2136 24-Aug-2009 Daniel Dunbar <daniel@zuster.org> Switch to StringRef based BitstreamWriter APIs, where appropriate.
- There is lots of non-endian safe code in here... :/

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79905 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
ec312a1f0557b1d27f3eb6cf49acbf7e72696422 24-Aug-2009 Daniel Dunbar <daniel@zuster.org> Switch to StringRef based BitstreamWriter APIs, where appropriate.
- There is lots of non-endian safe code in here... :/

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79905 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
608b388b563b5ccf7eeac5da78b539ea8f7ae4cd 24-Aug-2009 Daniel Dunbar <daniel@zuster.org> Switch TargetInfo to store an llvm::Triple.
- Primarily to discourage clients form making decisions based on the string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79901 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
1752ee4849f4c37f5e03193e658be92650b0e65a 24-Aug-2009 Daniel Dunbar <daniel@zuster.org> Switch TargetInfo to store an llvm::Triple.
- Primarily to discourage clients form making decisions based on the string.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79901 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
4eff2865ac5f8dc5fce65a523e27dba02d56547f 24-Aug-2009 Chris Lattner <sabre@nondot.org> prune #includes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79889 91177308-0d34-0410-b5e6-96231b3b80d8
TMLPrint.cpp
0fa0daafdfc631681cc42a26a99618e9f9e63f97 24-Aug-2009 Chris Lattner <sabre@nondot.org> prune #includes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79889 91177308-0d34-0410-b5e6-96231b3b80d8
TMLPrint.cpp
31bc304905ece1072f5029eb821e309aecaf88f4 24-Aug-2009 Chris Lattner <sabre@nondot.org> API changes to match llvm ToT.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79868 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
acheTokens.cpp
ixItRewriter.cpp
TMLDiagnostics.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
CHWriter.cpp
d57a7ef9252964bc6c8471451d7bd395b0520cb8 24-Aug-2009 Chris Lattner <sabre@nondot.org> API changes to match llvm ToT.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79868 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
acheTokens.cpp
ixItRewriter.cpp
TMLDiagnostics.cpp
nitHeaderSearch.cpp
nitPreprocessor.cpp
CHWriter.cpp
2ec1729793a77b86a31abd65da4b93cacbdf6b34 23-Aug-2009 Benjamin Kramer <benny.kra@googlemail.com> Replace cerr with errs().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79854 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
nalysisConsumer.cpp
acheTokens.cpp
ixItRewriter.cpp
eneratePCH.cpp
TMLDiagnostics.cpp
ewriteMacros.cpp
ewriteObjC.cpp
6cb7c1a43b0c8f739d1f54b7fdae5ede86033496 23-Aug-2009 Benjamin Kramer <benny.kra@googlemail.com> Replace cerr with errs().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79854 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
nalysisConsumer.cpp
acheTokens.cpp
ixItRewriter.cpp
eneratePCH.cpp
TMLDiagnostics.cpp
ewriteMacros.cpp
ewriteObjC.cpp
3dfbbdff0e9d8bca20111a41c3bbb815563d3542 23-Aug-2009 Chris Lattner <sabre@nondot.org> use errs() instead of cerr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79829 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
a85b3521f5ff430954d8e3c61320e31b3aa25ef0 23-Aug-2009 Chris Lattner <sabre@nondot.org> use errs() instead of cerr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79829 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
50353f11e6421455826f76023b745df8284938c9 23-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Don't install Clang libraries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79824 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
7ebe97166a4d720a187ab08ba927027e0d32274c 23-Aug-2009 Douglas Gregor <dgregor@apple.com> Don't install Clang libraries.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79824 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
24e9f340da71711f2d6c5ce842018772170616af 23-Aug-2009 Chris Lattner <sabre@nondot.org> adjust for raw_fd_ostream api change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79809 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ixItRewriter.cpp
listDiagnostics.cpp
92bcc27ada5788c5f5057fa051b2600ec27c7e17 23-Aug-2009 Chris Lattner <sabre@nondot.org> adjust for raw_fd_ostream api change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79809 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ixItRewriter.cpp
listDiagnostics.cpp
9a0c2a528cab3391cc1c8635155a12fc1d4240b1 23-Aug-2009 Anders Carlsson <andersca@mac.com> Add a -fno-elide-constructors option to clang-cc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79782 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
92f5822df6a0d7571df44b5d279ed4f017fbb0e6 23-Aug-2009 Anders Carlsson <andersca@mac.com> Add a -fno-elide-constructors option to clang-cc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79782 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ab7c0725f67a6b862607cd0bc124a8b0167ea0d0 21-Aug-2009 Zhongxing Xu <xuzhongxing@gmail.com> Tie the local check NSErrorCheck to a Decl to pave the way
to untie the ExplodedGraph from a specific Decl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79588 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
5ab128b02d3b10413fb30738ec9f401dcfb47252 21-Aug-2009 Zhongxing Xu <xuzhongxing@gmail.com> Tie the local check NSErrorCheck to a Decl to pave the way
to untie the ExplodedGraph from a specific Decl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79588 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
42556e426eaf5b19971c2dd15c0564657fcdd235 21-Aug-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Remove TypeSpecStartLocation from VarDecl/FunctionDecl/FieldDecl, and use DeclaratorInfo to get this information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79584 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
a5d82000f7b173a0a5ce34dc8c09a03f98d9e439 21-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove TypeSpecStartLocation from VarDecl/FunctionDecl/FieldDecl, and use DeclaratorInfo to get this information.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79584 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
90107998c89fe5f17d3d48b57c8bcd2deaa51d00 21-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Make the new Objective-C "id" and "Class" redefinition types special
types that are preloaded by the PCH file. Fixes PCH breakage
introduced in r79248.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79583 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
d1571acc700b652a52c766e36a6c688d9bf6f3a1 21-Aug-2009 Douglas Gregor <dgregor@apple.com> Make the new Objective-C "id" and "Class" redefinition types special
types that are preloaded by the PCH file. Fixes PCH breakage
introduced in r79248.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79583 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
128cdc592c93af458ae89032d83dc75242eac52d 20-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Using "ObjCImplicitSetterGetterRefExpr" instead of "ObjCImplctSetterGetterRefExpr".
A field rename and more comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79537 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
tmtXML.cpp
09105f52b1f28cbb1374c27c3c70f5517e2c465d 20-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Using "ObjCImplicitSetterGetterRefExpr" instead of "ObjCImplctSetterGetterRefExpr".
A field rename and more comments.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79537 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
tmtXML.cpp
274d336c68ad8d36d8859370578dba9b97ec7f5f 19-Aug-2009 Daniel Dunbar <daniel@zuster.org> Remove now unnecessary helper methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79460 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
TMLDiagnostics.cpp
44ba7bf54434be88bda7a752f857d42cc92b462d 19-Aug-2009 Daniel Dunbar <daniel@zuster.org> Remove now unnecessary helper methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79460 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
TMLDiagnostics.cpp
0433a02f13f468188837dfe7e084acabb8c9d562 19-Aug-2009 Daniel Dunbar <daniel@zuster.org> Switch to SmallString::str from SmallString::c_str.
- Several FIXMEs due to non-Twinification of IRBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79455 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
7765934ad7e157b5fcf925792a38e01b1edbcf8a 19-Aug-2009 Daniel Dunbar <daniel@zuster.org> Switch to SmallString::str from SmallString::c_str.
- Several FIXMEs due to non-Twinification of IRBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79455 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
60987c9074e5ae6d6a1a2cba8bbf36788f5ea82b 19-Aug-2009 Daniel Dunbar <daniel@zuster.org> Convert parts of Rewriter to StringRef based API.
- Please accept my sincere apologies for the gratuitous elimination of code
duplication, manual string length counting, unnecessary strlen calls, etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79448 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
ewriteBlocks.cpp
ewriteMacros.cpp
ewriteObjC.cpp
d7407dc92c7d19cafce429e7e1cf9819d3fc0b92 19-Aug-2009 Daniel Dunbar <daniel@zuster.org> Convert parts of Rewriter to StringRef based API.
- Please accept my sincere apologies for the gratuitous elimination of code
duplication, manual string length counting, unnecessary strlen calls, etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79448 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
ewriteBlocks.cpp
ewriteMacros.cpp
ewriteObjC.cpp
f7b48307a77dd83a4e4ba728d983976254d357fd 19-Aug-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Store/load type source info from/to PCH files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79396 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
d4a7e54f489dd863a1778a7d18f1b21ae983b473 19-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Store/load type source info from/to PCH files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79396 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
b17120c5d87b1b078891071188b89ec4fe6857bf 19-Aug-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema interfaces.

DeclaratorDecl contains a DeclaratorInfo* to keep type source info.
Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl.
EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo.

Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79392 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
ewriteObjC.cpp
a1d5662d96465f0fddf8819d245da4d19b892eff 19-Aug-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce DeclaratorDecl and pass DeclaratorInfo through the Decl/Sema interfaces.

DeclaratorDecl contains a DeclaratorInfo* to keep type source info.
Subclasses of DeclaratorDecl are FieldDecl, FunctionDecl, and VarDecl.
EnumConstantDecl still inherits from ValueDecl since it has no need for DeclaratorInfo.

Decl/Sema interfaces accept a DeclaratorInfo as parameter but no DeclaratorInfo is created yet.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79392 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
ewriteObjC.cpp
5bb99723ed13ea4fe0d6b9bbb837b3c04daacd29 18-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed ClassProp data member of ObjCImplctSetterGetterRefExpr
to InterfaceDecl, as it is unrelated to any property and
holds the InterfaceDecl needed for accessing class getter/setter
methods using the dot-syntax.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79371 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
d2ae5aa732e8587816fd7a7be911460e337c178e 18-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed ClassProp data member of ObjCImplctSetterGetterRefExpr
to InterfaceDecl, as it is unrelated to any property and
holds the InterfaceDecl needed for accessing class getter/setter
methods using the dot-syntax.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79371 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
1c4da457d434b07b67f4d7dbb0b31351142de64d 18-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
Removed an unnecessary loop to get to setters incoming
argument. Added DoxyGen comments. Still more work
to do in this area (WIP).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79365 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
tmtXML.cpp
154440e6a8fa6ac5bca395876d79b530b39a2c1c 18-Aug-2009 Fariborz Jahanian <fjahanian@apple.com> Renamed ObjCKVCRefExpr to ObjCImplctSetterGetterRefExpr.
Removed an unnecessary loop to get to setters incoming
argument. Added DoxyGen comments. Still more work
to do in this area (WIP).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79365 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
tmtXML.cpp
e9835e137aeb9eb377f86cda52942c5acf279185 18-Aug-2009 Anders Carlsson <andersca@mac.com> Change ActOnReturnStmt to not take a FullExprArg. Instead, Sema will wrap the return expr inside a CXXExprWithTemporaries if needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79342 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
f53b4433abb7a3bc14c0329d3175cbc291280137 18-Aug-2009 Anders Carlsson <andersca@mac.com> Change ActOnReturnStmt to not take a FullExprArg. Instead, Sema will wrap the return expr inside a CXXExprWithTemporaries if needed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79342 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
bd9f51a0eb90a9be5e1394231d5e2925c546d527 16-Aug-2009 Anders Carlsson <andersca@mac.com> AddInitializerToDecl can't take a FullExprArg. Make it take an ExprArg, and create the CXXExprWithTemporaries before setting the initializer on the VarDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79176 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
9abf2aedae7538cfd85f3ff0898a6d14385c8e36 16-Aug-2009 Anders Carlsson <andersca@mac.com> AddInitializerToDecl can't take a FullExprArg. Make it take an ExprArg, and create the CXXExprWithTemporaries before setting the initializer on the VarDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79176 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
1c1c10d801f1e2c6d58582cb68547f6274273714 15-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Add an additional C++ hardcoded search path.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79075 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
03d6b6eba2bcc4eb4524fce28a2f8a018223bb01 15-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Add an additional C++ hardcoded search path.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79075 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
2ac46a53b5e5098e3c413cd65518981121f48d23 15-Aug-2009 Zhongxing Xu <xuzhongxing@gmail.com> Extend the ProgramPoint to include the context information LocationContext,
which is either a stack frame context of the function or a local scope
context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79072 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
25e695b2d574d919cc1bbddf3a2efe073d449b1c 15-Aug-2009 Zhongxing Xu <xuzhongxing@gmail.com> Extend the ProgramPoint to include the context information LocationContext,
which is either a stack frame context of the function or a local scope
context.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@79072 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
a784a15db729f4005666a649a7bbcbe479a1a03a 14-Aug-2009 Shantonu Sen <ssen@apple.com> PR4715

-Wno-error disables WarningsAsErrors instead of
mistakenly being treated like -Werror



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78987 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
b1d76bda73e476ea54c91d91ae5f9115c96135a1 14-Aug-2009 Shantonu Sen <ssen@apple.com> PR4715

-Wno-error disables WarningsAsErrors instead of
mistakenly being treated like -Werror



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78987 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
23a7302d3447acb67ac823ebb96eb68dea99da6d 12-Aug-2009 Nate Begeman <natebegeman@mac.com> Transition the PCH support for ShuffleVectorExpr over to ASTContext allocation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78783 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
888376a2bbcfc2f047902249f8455918e2489ae1 12-Aug-2009 Nate Begeman <natebegeman@mac.com> Transition the PCH support for ShuffleVectorExpr over to ASTContext allocation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78783 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
e85f43d31101a875a6621e43bde21dcc13d860ff 11-Aug-2009 Nate Begeman <natebegeman@mac.com> Take 2 on AltiVec-style vector initializers.

Fixes PR4704 problems

Addresses Eli's patch feedback re: ugly cast code

Updates all postfix operators to remove ParenListExprs. While this is awful,
no better solution (say, in the parser) is obvious to me. Better solutions
welcome.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78621 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
2ef13e5abef0570a9f567b4671367275c05d4d34 11-Aug-2009 Nate Begeman <natebegeman@mac.com> Take 2 on AltiVec-style vector initializers.

Fixes PR4704 problems

Addresses Eli's patch feedback re: ugly cast code

Updates all postfix operators to remove ParenListExprs. While this is awful,
no better solution (say, in the parser) is obvious to me. Better solutions
welcome.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78621 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
48cf40f8f2e06e54a63ff13f06a567f5cf489404 10-Aug-2009 Daniel Dunbar <daniel@zuster.org> Revert r78535, it is causing a number of failures to build projects.

--- Reverse-merging r78535 into '.':
D test/Sema/altivec-init.c
U include/clang/Basic/DiagnosticSemaKinds.td
U include/clang/AST/Expr.h
U include/clang/AST/StmtNodes.def
U include/clang/Parse/Parser.h
U include/clang/Parse/Action.h
U tools/clang-cc/clang-cc.cpp
U lib/Frontend/PrintParserCallbacks.cpp
U lib/CodeGen/CGExprScalar.cpp
U lib/Sema/SemaInit.cpp
U lib/Sema/Sema.h
U lib/Sema/SemaExpr.cpp
U lib/Sema/SemaTemplateInstantiateExpr.cpp
U lib/AST/StmtProfile.cpp
U lib/AST/Expr.cpp
U lib/AST/StmtPrinter.cpp
U lib/Parse/ParseExpr.cpp
U lib/Parse/ParseExprCXX.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78551 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
1df5109f475bcbc528eb1fb9fdb179dcadbb33a6 10-Aug-2009 Daniel Dunbar <daniel@zuster.org> Revert r78535, it is causing a number of failures to build projects.

--- Reverse-merging r78535 into '.':
D test/Sema/altivec-init.c
U include/clang/Basic/DiagnosticSemaKinds.td
U include/clang/AST/Expr.h
U include/clang/AST/StmtNodes.def
U include/clang/Parse/Parser.h
U include/clang/Parse/Action.h
U tools/clang-cc/clang-cc.cpp
U lib/Frontend/PrintParserCallbacks.cpp
U lib/CodeGen/CGExprScalar.cpp
U lib/Sema/SemaInit.cpp
U lib/Sema/Sema.h
U lib/Sema/SemaExpr.cpp
U lib/Sema/SemaTemplateInstantiateExpr.cpp
U lib/AST/StmtProfile.cpp
U lib/AST/Expr.cpp
U lib/AST/StmtPrinter.cpp
U lib/Parse/ParseExpr.cpp
U lib/Parse/ParseExprCXX.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78551 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
31af091f101c08ecb39a00c2b4741bec5cc00150 09-Aug-2009 Ryan Flynn <pizza@parseerror.com> map previously ignored __attribute((malloc)) to noalias attribute of llvm function's return

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78541 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
76168e289ca4b307259e3bc9b3353f03b05bb6b9 09-Aug-2009 Ryan Flynn <pizza@parseerror.com> map previously ignored __attribute((malloc)) to noalias attribute of llvm function's return

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78541 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
bc8e297c7d620cd63eeb31c641dc7f51a1076785 09-Aug-2009 Nate Begeman <natebegeman@mac.com> AltiVec-style vector initializer syntax, vec4 a = (vec4)(a, b, c, d);

In addition to being defined by the AltiVec PIM, this is also the vector
initializer syntax used by OpenCL, so that vector literals are compatible
with macro arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78535 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
25b4fdb9d63095448e6cbc97b8865b36b0c8cbb6 09-Aug-2009 Nate Begeman <natebegeman@mac.com> AltiVec-style vector initializer syntax, vec4 a = (vec4)(a, b, c, d);

In addition to being defined by the AltiVec PIM, this is also the vector
initializer syntax used by OpenCL, so that vector literals are compatible
with macro arguments.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78535 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
c915fa76c5429bbc235d8993dc218ad20bc26e3b 08-Aug-2009 Anders Carlsson <andersca@mac.com> Introduce a new PragmaPack attribute, and use it for #pragma pack. The PackedAttr now only represents __attribute__((packed)).

This is necessary because #pragma pack and __attribute__((packed)) have different semantics. No functionality change yet, but this lays the groundwork for fixing a record layout bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78483 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
a860e755f1f9f071b6a6a2f96128a6a258f5c331 08-Aug-2009 Anders Carlsson <andersca@mac.com> Introduce a new PragmaPack attribute, and use it for #pragma pack. The PackedAttr now only represents __attribute__((packed)).

This is necessary because #pragma pack and __attribute__((packed)) have different semantics. No functionality change yet, but this lays the groundwork for fixing a record layout bug.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78483 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
7103a89ce3a9e0628f339028a5ef5a8cde6169e0 08-Aug-2009 Edward O'Callaghan <eocallaghan@auroraux.org> Patch should implement packed enums - PR4098. Credit to Anders Johnsen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78471 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
fee13819693c8492f0c364bc704645e844ef737a 08-Aug-2009 Edward O'Callaghan <eocallaghan@auroraux.org> Patch should implement packed enums - PR4098. Credit to Anders Johnsen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78471 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
a5d06285584d8c5d4db1ebe09e6c48536b37794d 08-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce reference counting for statements and expressions, using it
to allow sharing of nodes. Simplifies some aspects of template
instantiation, and fixes both PR3444 and <rdar://problem/6757457>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78450 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
43d9d9243329b1b75d1a6efdad9f16d6fb386b8e 08-Aug-2009 Douglas Gregor <dgregor@apple.com> Introduce reference counting for statements and expressions, using it
to allow sharing of nodes. Simplifies some aspects of template
instantiation, and fixes both PR3444 and <rdar://problem/6757457>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78450 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
4fc8d2475e6d7a8f3927d54623f8ac4c3f3f8f0c 07-Aug-2009 Chris Lattner <sabre@nondot.org> add support for opensuse 11.1/11.2 search paths, patch by Stefan Reinauer
and Carl-Daniel Hailfinger!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78368 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ef888a4d7f0fa1596807f702d09df88044dcaf41 07-Aug-2009 Chris Lattner <sabre@nondot.org> add support for opensuse 11.1/11.2 search paths, patch by Stefan Reinauer
and Carl-Daniel Hailfinger!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78368 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
a47f101a74ecb12e5d04b913e3ea2b494b4f2db0 06-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Predefine __cplusplus to the right value (199711L), except when in GNU mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78283 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
36dd131b4981f31c4520c5430d21f4d159954c4d 06-Aug-2009 Douglas Gregor <dgregor@apple.com> Predefine __cplusplus to the right value (199711L), except when in GNU mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78283 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
da61ad2a4875cced61d9a02c2d0ec3b91d463414 06-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Support nested-name-specifiers for C++ member access expressions, e.g.,

this->Base::foo

from James Porter!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78278 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
fe85cedd58df7daed29201703cfb8806e12876d0 06-Aug-2009 Douglas Gregor <dgregor@apple.com> Support nested-name-specifiers for C++ member access expressions, e.g.,

this->Base::foo

from James Porter!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78278 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
ff71ed00addf14e2245d44045fcd64b77af913f3 06-Aug-2009 Zhongxing Xu <xuzhongxing@gmail.com> As GRState seems general enough, it is time to merge some template classes
and their impl base classes. This can greatly simply some code of the core
analysis engine. This patch merges ExplodedNodeImpl into ExplodedNode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78270 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
c5619d901a68dc27a9e310a6a831f03efebcd950 06-Aug-2009 Zhongxing Xu <xuzhongxing@gmail.com> As GRState seems general enough, it is time to merge some template classes
and their impl base classes. This can greatly simply some code of the core
analysis engine. This patch merges ExplodedNodeImpl into ExplodedNode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78270 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
cfe6ae592450d8466b4d78b59ff4526266549a9a 05-Aug-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce the canonical type smart pointers, and use them in a few places to
tighten up the static type system.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78164 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
50d62d1b4a98adbc83de8f8cd1379ea1c25656f7 05-Aug-2009 Douglas Gregor <dgregor@apple.com> Introduce the canonical type smart pointers, and use them in a few places to
tighten up the static type system.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78164 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
e359da7885fee82068d8edc5d99745f1bead1a98 04-Aug-2009 Daniel Dunbar <daniel@zuster.org> Update for LLVM API change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78044 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
2b1f59fca746f01f65adc2cd30c89731003f6681 04-Aug-2009 Daniel Dunbar <daniel@zuster.org> Update for LLVM API change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78044 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
365de411455d99cbe041297bc5acf2741a488e92 04-Aug-2009 Ted Kremenek <kremenek@apple.com> Emit a special 'BUGMETAEND' comment to aid in the postprocessing of HTML bug reports.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78021 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
9b4d45c911933c860224aef52bc3d8a7b3675945 04-Aug-2009 Ted Kremenek <kremenek@apple.com> Emit a special 'BUGMETAEND' comment to aid in the postprocessing of HTML bug reports.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78021 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
78b351c440d2609d1b0bf1029f51e208b24d619e 03-Aug-2009 Daniel Dunbar <daniel@zuster.org> Update for LLVM API change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77952 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
9ab76fa6909400643cbbb04a78ad59034cf09952 03-Aug-2009 Daniel Dunbar <daniel@zuster.org> Update for LLVM API change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77952 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
e754733efc0a9ba864e32f33854d2175fc055046 03-Aug-2009 Daniel Dunbar <daniel@zuster.org> Update for LLVM API change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77947 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
b0f17c71f2372953d168bb74a0abf850714869d5 03-Aug-2009 Daniel Dunbar <daniel@zuster.org> Update for LLVM API change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77947 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
bfae8c9112d0145b69818d26b4982104c0eedd84 03-Aug-2009 Zhongxing Xu <xuzhongxing@gmail.com> now we can let AnalysisManager to own the PathDiagnosticClient.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77945 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
d07a0d0279c09d1017f8450fce575a94dc9703c0 03-Aug-2009 Zhongxing Xu <xuzhongxing@gmail.com> now we can let AnalysisManager to own the PathDiagnosticClient.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77945 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
659e33c1812457c742fb7536f324b9f207e40b26 03-Aug-2009 Zhongxing Xu <xuzhongxing@gmail.com> Create only one AnalysisManager for each translation unit. In HandleCode(),
reset the current analysis context of the AnalysisManager.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77943 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
c471e7b44e63ff1b46b480e723c4130aeaef5a8a 03-Aug-2009 Zhongxing Xu <xuzhongxing@gmail.com> Create only one AnalysisManager for each translation unit. In HandleCode(),
reset the current analysis context of the AnalysisManager.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77943 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
9059ce69c27124185a2ddf8f44dbf7f816018fef 02-Aug-2009 Ted Kremenek <kremenek@apple.com> Fix regression caused by recent refactoring where HTML and plist files would not get flushed out when using '-disable-free'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77882 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
690a7f431d6863a101711e67636d51ddd13f35c5 02-Aug-2009 Ted Kremenek <kremenek@apple.com> Fix regression caused by recent refactoring where HTML and plist files would not get flushed out when using '-disable-free'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77882 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
5497ef5846b0d74590307f1e85dc097cfdc8dad7 01-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Additional AuroraUX header path.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77811 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
2ef398c69809edf816a942e3265df32983a87985 01-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Additional AuroraUX header path.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77811 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
25dbfaa209d2e88ebf63f759bfcdb1c9fd829960 01-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Add temp C++ include path for AuroraUX; patch by Edward O'Callaghan.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77786 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
868d01660de7fa9f3475b49d58e8a6a8067cb4d2 01-Aug-2009 Eli Friedman <eli.friedman@gmail.com> Add temp C++ include path for AuroraUX; patch by Edward O'Callaghan.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77786 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
069c23a8f980c6a76882435fc1b16df5b0eb492e 31-Jul-2009 John McCall <rjmccall@apple.com> Rename Action::TagKind to Action::TagUseKind, which removes both a misnomer
and a name collision.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77658 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
0f434ecbead44c1f4d5f9dda088f9827fa0dc40f 31-Jul-2009 John McCall <rjmccall@apple.com> Rename Action::TagKind to Action::TagUseKind, which removes both a misnomer
and a name collision.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77658 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
7ef181c5df246e133e86b97e684f650decc67e37 31-Jul-2009 Anders Carlsson <andersca@mac.com> Add a CastKind enum to CastExpr. Right now it's not used for much but it will be :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77650 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
cdef2b75aa60cde1ca00e0aa3f89139ac89c6ae4 31-Jul-2009 Anders Carlsson <andersca@mac.com> Add a CastKind enum to CastExpr. Right now it's not used for much but it will be :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77650 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ewriteObjC.cpp
3f87475905a878d00d4f506357c995ad1095c511 31-Jul-2009 Ted Kremenek <kremenek@apple.com> Fix use-after-release bug introduced in r77585 where the PathDiagnosticClient
created by AnalysisConsumer would be released by an instance of AnalysisManager
and then reused by later instances of AnalysisManager. Ownership of the
PathDiagnosticClient now belongs (for now) in AnalysisConsumer.

We also need this layering (for now) because the HTMLDiagnostiClient requires
that the entire translation unit be processed before emitting diagnostics. This
is done in its destructor (which should also be fixed, but that is another
issue).

This fixes PR 4653.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77648 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
82ec2e99084996eecbdf3a304f3cbba8c16c2f6b 31-Jul-2009 Ted Kremenek <kremenek@apple.com> Fix use-after-release bug introduced in r77585 where the PathDiagnosticClient
created by AnalysisConsumer would be released by an instance of AnalysisManager
and then reused by later instances of AnalysisManager. Ownership of the
PathDiagnosticClient now belongs (for now) in AnalysisConsumer.

We also need this layering (for now) because the HTMLDiagnostiClient requires
that the entire translation unit be processed before emitting diagnostics. This
is done in its destructor (which should also be fixed, but that is another
issue).

This fixes PR 4653.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77648 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
2b8ea8c929d7555e3ace2af1f543e738216d6131 30-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Initialize an otherwise-wild pointer. Fixes a crashy analyzer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77599 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
17edea8b0befb10066f7c6f5b01469d2fb679c9b 30-Jul-2009 Douglas Gregor <dgregor@apple.com> Initialize an otherwise-wild pointer. Fixes a crashy analyzer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77599 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
dd8984b526f92617127f1648c2389dd4d78357b3 30-Jul-2009 Zhongxing Xu <xuzhongxing@gmail.com> simple fixes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77587 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
7d49c71f436c4bc91ad09078458ed05052cb4d08 30-Jul-2009 Zhongxing Xu <xuzhongxing@gmail.com> simple fixes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77587 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
acdd51e121fdb6e33c8014bc41e89b26fba2e0c6 30-Jul-2009 Zhongxing Xu <xuzhongxing@gmail.com> Make AnalysisManager into its own source file and a pure data management class.
Move all components creation code into AnalysisConsumer::DigestAnalyzerOptions().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77585 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
fda7832b000ff8927386f093b52c067641679469 30-Jul-2009 Zhongxing Xu <xuzhongxing@gmail.com> Make AnalysisManager into its own source file and a pure data management class.
Move all components creation code into AnalysisConsumer::DigestAnalyzerOptions().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77585 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
22f30424e6655ba9d9a7ac81d8d273d2215f64d1 30-Jul-2009 Zhongxing Xu <xuzhongxing@gmail.com> This patch collects all analysis context data into a new class
AnalysisContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77563 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
97ab3941effe1f508c7113d9aa0c2887774f6fa8 30-Jul-2009 Zhongxing Xu <xuzhongxing@gmail.com> This patch collects all analysis context data into a new class
AnalysisContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77563 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
19e567a7f976257558abc106e3ace3cc2c98f561 30-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Make tag declarations redeclarable. This change has three purposes:

1) Allow the Index library (and any other interested client) to walk
the set of declarations for a given tag (enum, union, class,
whatever). At the moment, this information is not readily available.

2) Reduce our dependence on TagDecl::TypeForDecl being mapped down
to a TagType (for which getDecl() will return the tag definition, if
one exists). This property won't exist for class template partial
specializations.

3) Make the canonical declaration of a TagDecl actually canonical,
e.g., so that it does not change when the tag is defined.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77523 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
8e9e9ef5348bce1a8f0741a5684fac3de9701c28 30-Jul-2009 Douglas Gregor <dgregor@apple.com> Make tag declarations redeclarable. This change has three purposes:

1) Allow the Index library (and any other interested client) to walk
the set of declarations for a given tag (enum, union, class,
whatever). At the moment, this information is not readily available.

2) Reduce our dependence on TagDecl::TypeForDecl being mapped down
to a TagType (for which getDecl() will return the tag definition, if
one exists). This property won't exist for class template partial
specializations.

3) Make the canonical declaration of a TagDecl actually canonical,
e.g., so that it does not change when the tag is defined.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77523 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
d00cd9ec368acf3e615d55f659eca4639044ba7d 29-Jul-2009 Ted Kremenek <kremenek@apple.com> Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsRecordType() -> Type::getAs<RecordType>()
Type::getAsPointerType() -> Type::getAs<PointerType>()
Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsTagType() -> Type::getAs<TagType>()

And remove Type::getAsReferenceType(), etc.

This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77510 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
6217b80b7a1379b74cced1c076338262c3c980b3 29-Jul-2009 Ted Kremenek <kremenek@apple.com> Change uses of:
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsRecordType() -> Type::getAs<RecordType>()
Type::getAsPointerType() -> Type::getAs<PointerType>()
Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>()
Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>()
Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>()
Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>()
Type::getAsReferenceType() -> Type::getAs<ReferenceType>()
Type::getAsTagType() -> Type::getAs<TagType>()

And remove Type::getAsReferenceType(), etc.

This change is similar to one I made a couple weeks ago, but that was partly
reverted pending some additional design discussion. With Doug's pending smart
pointer changes for Types, it seemed natural to take this approach.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77510 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
9516db0afb503f1f0bd390c8753cd287f8fb74c7 29-Jul-2009 Daniel Dunbar <daniel@zuster.org> Don't use a formatted ostream when writing .ll either.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77474 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
12e85fcdff63153cb581946cfc3a5296b4dbcc98 29-Jul-2009 Daniel Dunbar <daniel@zuster.org> Don't use a formatted ostream when writing .ll either.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77474 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
f35fd67af396420775cbc2cef1d5694318dafef9 29-Jul-2009 Daniel Dunbar <daniel@zuster.org> Don't use a formatted ostream when writing .bc files. I don't really understand
this interface design, Chris please check.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77473 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
8c01cadd33e688e668163bde3c5af4d18a89461f 29-Jul-2009 Daniel Dunbar <daniel@zuster.org> Don't use a formatted ostream when writing .bc files. I don't really understand
this interface design, Chris please check.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77473 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
bfb12c1c0435f1aa15a5a7795a458a187eaea92b 29-Jul-2009 Daniel Dunbar <daniel@zuster.org> Add missing '"'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77416 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
3c415447d5d51d9527fbb5e3f42e19719fdae19b 29-Jul-2009 Daniel Dunbar <daniel@zuster.org> Add missing '"'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77416 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
ed2f9296431718d81ff66ebb5e677a07f870b87f 28-Jul-2009 Mike Stump <mrs@apple.com> Make longjmp a real builtin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77291 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
782fa308a765aeac2acb39c4e697c937ec21185b 28-Jul-2009 Mike Stump <mrs@apple.com> Make longjmp a real builtin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77291 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
d0f1a339494d5c181b9e93640d458b79a77f0cfe 28-Jul-2009 Ted Kremenek <kremenek@apple.com> (1) Enable PlistDiagnostics to take an option "PathDiagnosticClientFactory"
object that it can use to forward PathDiagnostics for further processing. Along
with this feature, the PlistDiagnostics object logs which files are created by
the forwarding of the PathDiagnostics.

(2) Create a new PathDiagnosticClientFactory object for HTMLDiagnostics,
allowing other PathDiagnosticClients to forward PathDiagnostics through an
opaque interface.

(3) Create a "plist-html" diagnostics option in AnalysisConsumer to allow the
logging of HTML files created in a hybrid Plist+HTML diagnostic client.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77264 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
TMLDiagnostics.cpp
listDiagnostics.cpp
f75560670bcdd59b051149bdece3eac14e313853 28-Jul-2009 Ted Kremenek <kremenek@apple.com> (1) Enable PlistDiagnostics to take an option "PathDiagnosticClientFactory"
object that it can use to forward PathDiagnostics for further processing. Along
with this feature, the PlistDiagnostics object logs which files are created by
the forwarding of the PathDiagnostics.

(2) Create a new PathDiagnosticClientFactory object for HTMLDiagnostics,
allowing other PathDiagnosticClients to forward PathDiagnostics through an
opaque interface.

(3) Create a "plist-html" diagnostics option in AnalysisConsumer to allow the
logging of HTML files created in a hybrid Plist+HTML diagnostic client.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77264 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
TMLDiagnostics.cpp
listDiagnostics.cpp
b2082e1c1199d8499f7a75e914ffbcf60c6c1d1e 27-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Make ObjCImplDecl inherit from ObjCContainerDecl.

ObjCContainerDecl now is the root class for objc decls that contain methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77235 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
aecae629269fae3bf484baf1d109e9a89d14eead 27-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make ObjCImplDecl inherit from ObjCContainerDecl.

ObjCContainerDecl now is the root class for objc decls that contain methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77235 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
8d2673796bc44d06fc206de4486c70755197ea70 26-Jul-2009 Nuno Lopes <nunoplopes@sapo.pt> add gentoo 2009.0 g++ header locations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77158 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ec9fd769d0bf3fe8b20790f5c34e9484da006eac 26-Jul-2009 Nuno Lopes <nunoplopes@sapo.pt> add gentoo 2009.0 g++ header locations

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77158 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
f84ca3d6a94c1470c7c2a0c55c30280443c6c795 26-Jul-2009 Daniel Dunbar <daniel@zuster.org> Update for API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77112 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
b2abd0638c7b1a7f126c823227b626fa2ac20935 26-Jul-2009 Daniel Dunbar <daniel@zuster.org> Update for API change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77112 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
946a8ec689783f40eafd99fa777524981c896ac6 26-Jul-2009 Daniel Dunbar <daniel@zuster.org> Lookup targets by Triple instead of Module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77108 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
82cfa7af5d2ad769c1a542c4da7ad368c094c214 26-Jul-2009 Daniel Dunbar <daniel@zuster.org> Lookup targets by Triple instead of Module.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@77108 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
29d293b79901491af6da2e2368ea8e506402e1fe 24-Jul-2009 Steve Naroff <snaroff@apple.com> Allow front-end 'isa' access on object's of type 'id'.
Enhance test case to cover 'isa' access on interface types (clang produces an error, GCC produces a warning).

Still need back-end CodeGen for ObjCIsaExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76979 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
f242b1b0c4e998911cb96b2ba7e27ab4a5abaed3 24-Jul-2009 Steve Naroff <snaroff@apple.com> Allow front-end 'isa' access on object's of type 'id'.
Enhance test case to cover 'isa' access on interface types (clang produces an error, GCC produces a warning).

Still need back-end CodeGen for ObjCIsaExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76979 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
95254bc9257d9bcb425c84bbb94a0b47d5e8ee0a 23-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Clean up the ActOnTag action, so that there is only a single entry
point that covers templates and non-templates. This should eliminate
the flood of warnings I introduced yesterday.

Removed the ActOnClassTemplate action, which is no longer used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76881 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
bd1099efde211cbb63fce3feee4ebcc6bac58781 23-Jul-2009 Douglas Gregor <dgregor@apple.com> Clean up the ActOnTag action, so that there is only a single entry
point that covers templates and non-templates. This should eliminate
the flood of warnings I introduced yesterday.

Removed the ActOnClassTemplate action, which is no longer used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76881 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
076d84ef05463f175fcb1377e16e7dab78ca5c1a 23-Jul-2009 Ted Kremenek <kremenek@apple.com> Add initial implementation of checking for uses of floating point as a loop counter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76833 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
dbfb5f853547c4cc2b4b39e90f01537dd317457a 23-Jul-2009 Ted Kremenek <kremenek@apple.com> Add initial implementation of checking for uses of floating point as a loop counter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76833 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
9060d0e1f3cf3feccdc9022a33b79b4063fe7cd4 21-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Add the location of the tag keyword into TagDecl. From Enea
Zaffanella, with tweaks from Abramo Bagnara.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76576 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
741dd9a7e1d63e4e385b657e4ce11c5d96d44f72 21-Jul-2009 Douglas Gregor <dgregor@apple.com> Add the location of the tag keyword into TagDecl. From Enea
Zaffanella, with tweaks from Abramo Bagnara.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76576 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
deb5ba826c64cdcf3758f8c4909a98cfcb3f0d10 21-Jul-2009 Ryan Flynn <pizza@parseerror.com> define __STDC_VERSION__ processor token for c94

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76514 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
07ef804f918d8aade8739a02e78c6209fd3062a9 21-Jul-2009 Ryan Flynn <pizza@parseerror.com> define __STDC_VERSION__ processor token for c94

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76514 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
200968606a3c72e1e53efc2a8ebe48f1e1510706 21-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Remove the ObjCCategoryImpls vector from Sema class.
Use ObjCInterfaceDecl::getCategoryClassMethod() and ObjCInterfaceDecl::getCategoryInstanceMethod() for the same functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76510 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
1cb35dd4840d21cec58648361180d5688446a9ca 21-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ObjCCategoryImpls vector from Sema class.
Use ObjCInterfaceDecl::getCategoryClassMethod() and ObjCInterfaceDecl::getCategoryInstanceMethod() for the same functionality.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76510 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
bf560028f96f190fa27059ae1b414dd02705f0dd 21-Jul-2009 Mike Stump <mrs@apple.com> Add yet more analysis for CFGs involving conditionals that are actually constant.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76500 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
e5af3ce53ec58995b09381ba645ab2117a46647b 21-Jul-2009 Mike Stump <mrs@apple.com> Add yet more analysis for CFGs involving conditionals that are actually constant.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76500 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
9c2aefb2845f600a09a8046072bae296d8eff565 21-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Reuse VarDecl::Init to store the default argument of a ParmVarDecl,
reducing the size of ParmVarDecl by one pointer. Also means that we'll
properly (de-)serialize default arguments in C++ PCH files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76487 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
75f1af02091235a21180cf22ac9f7dd0025577f6 21-Jul-2009 Douglas Gregor <dgregor@apple.com> Reuse VarDecl::Init to store the default argument of a ParmVarDecl,
reducing the size of ParmVarDecl by one pointer. Also means that we'll
properly (de-)serialize default arguments in C++ PCH files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76487 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
77763c58e3b7783c8e54671c2b696ecd81ed524f 18-Jul-2009 Steve Naroff <snaroff@apple.com> Remove ObjCQualifiedInterfaceType:-)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76321 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ewriteObjC.cpp
c15cb2af27514ecc879daba9aa01389c5203685d 18-Jul-2009 Steve Naroff <snaroff@apple.com> Remove ObjCQualifiedInterfaceType:-)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76321 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ewriteObjC.cpp
7f06ba96d59d72d4f6e6cbaae0115bb9cb8fb7b9 18-Jul-2009 Zhongxing Xu <xuzhongxing@gmail.com> Fix a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76303 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
089962112ebbb730dfe18c104566bcf9810b341e 18-Jul-2009 Zhongxing Xu <xuzhongxing@gmail.com> Fix a comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76303 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
57f5a16510845ae60498e50805903364b94fc08d 18-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Location should be passed to setLocEnd() not to setAtEndLoc() which belongs to ObjCContainerDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76268 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
c999f1f9f1f8c08084ef0d4450e9c844dd3c6161 18-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Location should be passed to setLocEnd() not to setAtEndLoc() which belongs to ObjCContainerDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76268 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
d9b39bfecbc4faec367c3b2b53b8a3c7f71bdc3b 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76193 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
35366a67baa970c287c714c957cf78a4131cf60d 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methods
until Doug Gregor's Type smart pointer code lands (or more discussion occurs).
These methods just call the new Type::getAs<XXX> methods, so we still have
reduced implementation redundancy. Having explicit getAsXXXType() methods makes
it easier to set breakpoints in the debugger.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76193 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
60d5671481f35143349d08261af20f08facbde17 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76139 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
5cad1f74469d4d8b4fc51fe53a7837778aeb6107 17-Jul-2009 Ted Kremenek <kremenek@apple.com> Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76139 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
f5de0a3cbaa216daf2ea7e42611bbd1ebad42fa7 16-Jul-2009 Ted Kremenek <kremenek@apple.com> Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.
This method is intended to eventually replace the individual
Type::getAsXXXType<> methods.

The motivation behind this change is twofold:

1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of
them are basically copy-and-paste.

2) By centralizing the implementation of the getAs<Type> logic we can more
smoothly move over to Doug Gregor's proposed canonical type smart pointer
scheme.

Along with this patch:

a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>.
b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76098 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteBlocks.cpp
ewriteObjC.cpp
1a1a6e2bd4c5aefd7fd643cf25915f9623a02e59 16-Jul-2009 Ted Kremenek <kremenek@apple.com> Add member template 'Type::getAs<T>', which converts a Type* to a respective T*.
This method is intended to eventually replace the individual
Type::getAsXXXType<> methods.

The motivation behind this change is twofold:

1) Reduce redundant implementations of Type::getAsXXXType() methods. Most of
them are basically copy-and-paste.

2) By centralizing the implementation of the getAs<Type> logic we can more
smoothly move over to Doug Gregor's proposed canonical type smart pointer
scheme.

Along with this patch:

a) Removed 'Type::getAsPointerType()'; now clients use getAs<PointerType>.
b) Removed 'Type::getAsBlockPointerTypE()'; now clients use getAs<BlockPointerType>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76098 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteBlocks.cpp
ewriteObjC.cpp
ba927fcab0eb1748bed5bf8af58507116a9dc522 16-Jul-2009 Ted Kremenek <kremenek@apple.com> Move the source-level CFG from libAST to libAnalysis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76092 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
e41611aa2237d06a0ef61db4528fb2883a8defcd 16-Jul-2009 Ted Kremenek <kremenek@apple.com> Move the source-level CFG from libAST to libAnalysis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@76092 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
6093e74141497b81adf3910d3fe17c0411ab2fac 15-Jul-2009 Ted Kremenek <kremenek@apple.com> Lexically order files in CMakeLists.txt files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75832 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
b3b73642bfb4417d6312725ad6cc8d73ae143aca 15-Jul-2009 Ted Kremenek <kremenek@apple.com> Lexically order files in CMakeLists.txt files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75832 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
856658798fc98d8150eab6898bea8497eb6a9565 15-Jul-2009 Daniel Dunbar <daniel@zuster.org> Reapply r75764: [llvm up] Switch to using the new TargetRegistry


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75821 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
f7d47c04d0a54c6a0359befff87ffb269db7afc6 15-Jul-2009 Daniel Dunbar <daniel@zuster.org> Reapply r75764: [llvm up] Switch to using the new TargetRegistry


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75821 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
b89c26285abdd7ac3696a5e101d303ec03ffa15f 15-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Revert r75764 "[llvm up] Switch to using the new TargetRegistry" to fix build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75814 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
93b33266db83e382ffd2afaf071d8649f00300b9 15-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Revert r75764 "[llvm up] Switch to using the new TargetRegistry" to fix build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75814 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
7bffd37bd2642e9d1bf0d093e9c1a7b3467f3014 15-Jul-2009 Steve Naroff <snaroff@apple.com> Implement the ObjC pseudo built-in types as clang "BuiltinType's". I say pseudo built-in types, since Sema still injects a typedef for recognition (i.e. they aren't truly built-ins from a parser perspective).

This removes the static data/methods on ObjCObjectPointerType while preserving the nice API (no need to fiddle with ASTContext:-).

This patch also adds Type::isObjCBuiltinType().

This should be the last fairly large patch related to recrafting the ObjC type system. The follow-on patches should be fairly small.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75808 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
de2e22d33afec98324a66a358dfe0951b3c7259a 15-Jul-2009 Steve Naroff <snaroff@apple.com> Implement the ObjC pseudo built-in types as clang "BuiltinType's". I say pseudo built-in types, since Sema still injects a typedef for recognition (i.e. they aren't truly built-ins from a parser perspective).

This removes the static data/methods on ObjCObjectPointerType while preserving the nice API (no need to fiddle with ASTContext:-).

This patch also adds Type::isObjCBuiltinType().

This should be the last fairly large patch related to recrafting the ObjC type system. The follow-on patches should be fairly small.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75808 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
cdb9c6151ff3aa23eafd66d735c7ef1357c9a991 15-Jul-2009 Dan Gohman <gohman@apple.com> Update for raw_fd_ostream API changes. raw_fd_ostream now has a
Force flag to control whether the case of opening an existing
file is considered an error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75802 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ixItRewriter.cpp
listDiagnostics.cpp
92db2841691b2f2a99294872ead8887854297ed7 15-Jul-2009 Dan Gohman <gohman@apple.com> Update for raw_fd_ostream API changes. raw_fd_ostream now has a
Force flag to control whether the case of opening an existing
file is considered an error.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75802 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
ixItRewriter.cpp
listDiagnostics.cpp
474de6e659eab47341c73ed0bab9fb6a0b423959 15-Jul-2009 Daniel Dunbar <daniel@zuster.org> [llvm up] Switch to using the new TargetRegistry.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75764 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
0dcf11a9c5b4a2f7b9d113c956fe70e31952bf8c 15-Jul-2009 Daniel Dunbar <daniel@zuster.org> [llvm up] Switch to using the new TargetRegistry.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75764 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
f0c76a4669ab5497d4224acada98c78a10be1989 14-Jul-2009 Chris Lattner <sabre@nondot.org> fix fallout of the LLVM codegen switching to formatted_raw_ostream.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75675 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
03eacc746c90b7cfa8d8cd992c67f5c2659d4822 14-Jul-2009 Chris Lattner <sabre@nondot.org> fix fallout of the LLVM codegen switching to formatted_raw_ostream.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75675 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
b79574e54f3e1b135b87511399ea63363654c2ad 14-Jul-2009 Steve Naroff <snaroff@apple.com> Add a "TypeSpecStartLoc" to FieldDecl. Patch contributed by Enea Zaffanella.

Note: One day, it might be useful to consider adding this info to DeclGroup (as the comments in FunctionDecl/VarDecl suggest). For now, I think this works fine. I considered moving this to ValueDecl (a common ancestor of FunctionDecl/VarDecl/FieldDecl), however this would add overhead to EnumConstantDecl (which would burn memory and isn't necessary).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75635 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
ea218b8e8f9ba82d1c76bcb7e86d121a5f65ebed 14-Jul-2009 Steve Naroff <snaroff@apple.com> Add a "TypeSpecStartLoc" to FieldDecl. Patch contributed by Enea Zaffanella.

Note: One day, it might be useful to consider adding this info to DeclGroup (as the comments in FunctionDecl/VarDecl suggest). For now, I think this works fine. I considered moving this to ValueDecl (a common ancestor of FunctionDecl/VarDecl/FieldDecl), however this would add overhead to EnumConstantDecl (which would burn memory and isn't necessary).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75635 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
2bcacb61cf94b71e5c87f29d517f8dc29fe3993e 14-Jul-2009 Alisdair Meredith <public@alisdairm.net> Basic support for C++0x unicode types. Support for literals will follow in an incremental patch

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75622 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
f5c209d23b20ada4a9b6235db50317239cbf6ae1 14-Jul-2009 Alisdair Meredith <public@alisdairm.net> Basic support for C++0x unicode types. Support for literals will follow in an incremental patch

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75622 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
a06a9dab263393b51d684461338946c552e1e23c 14-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write a CXXOperatorCallExpr from/to PCH files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75598 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ba0a9006dbc4814e1e35f82812cb5a1dad65e8b8 14-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write a CXXOperatorCallExpr from/to PCH files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75598 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
503891ac9cb50d90bbb592412fdf213291a189ff 14-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Read/write TagDecl's RBraceLoc from/to PCH files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75592 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
ad93a7476bc35d78ed615a60229ab3786b49463f 14-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Read/write TagDecl's RBraceLoc from/to PCH files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75592 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
329ec22704eee011640ebf37c29343e82fb984c6 11-Jul-2009 Steve Naroff <snaroff@apple.com> This patch includes a conceptually simple, but very intrusive/pervasive change.

The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches.

This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic.

By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time.

Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75314 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ewriteObjC.cpp
14108da7f7fc059772711e4ffee1322a27b152a7 11-Jul-2009 Steve Naroff <snaroff@apple.com> This patch includes a conceptually simple, but very intrusive/pervasive change.

The idea is to segregate Objective-C "object" pointers from general C pointers (utilizing the recently added ObjCObjectPointerType). The fun starts in Sema::GetTypeForDeclarator(), where "SomeInterface *" is now represented by a single AST node (rather than a PointerType whose Pointee is an ObjCInterfaceType). Since a significant amount of code assumed ObjC object pointers where based on C pointers/structs, this patch is very tedious. It should also explain why it is hard to accomplish this in smaller, self-contained patches.

This patch does most of the "heavy lifting" related to moving from PointerType->ObjCObjectPointerType. It doesn't include all potential "cleanups". The good news is additional cleanups can be done later (some are noted in the code). This patch is so large that I didn't want to include any changes that are purely aesthetic.

By making the ObjC types truly built-in, they are much easier to work with (and require fewer "hacks"). For example, there is no need for ASTContext::isObjCIdStructType() or ASTContext::isObjCClassStructType()! We believe this change (and the follow-up cleanups) will pay dividends over time.

Given the amount of code change, I do expect some fallout from this change (though it does pass all of the clang tests). If you notice any problems, please let us know asap! Thanks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75314 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ewriteObjC.cpp
c3f4605e59914ca20aef4b3e4d3225aa121389dd 08-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch adds test to my previous patch for assigning to
gc'able structs in the Next runtime and adds missing
PCH info.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75014 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
643b7dfb7803003d62e18da65cbe81ad001851b7 08-Jul-2009 Fariborz Jahanian <fjahanian@apple.com> Patch adds test to my previous patch for assigning to
gc'able structs in the Next runtime and adds missing
PCH info.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75014 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
151fac73d9d9dd2f14606c124f54abbce2e19144 07-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Make ASTContext explicitly keep track of the declaration for the C
FILE type, rather than using name lookup to find FILE within the
translation unit. Within precompiled headers, FILE is treated as yet
another "special type" (like __builtin_va_list).

This change should provide a performance improvement (not verified),
since the lookup into the translation unit declaration
forces the (otherwise unneeded) construction of a large hash table.
More importantly, with precompiled headers, the construction
of that table requires deserializing most of the top-level
declarations from the precompiled header, which are then unused.

Fixes PR 4509.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74911 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
c29f77b769bcc5b6dc85e72c8e3cc2e348e5cf25 07-Jul-2009 Douglas Gregor <dgregor@apple.com> Make ASTContext explicitly keep track of the declaration for the C
FILE type, rather than using name lookup to find FILE within the
translation unit. Within precompiled headers, FILE is treated as yet
another "special type" (like __builtin_va_list).

This change should provide a performance improvement (not verified),
since the lookup into the translation unit declaration
forces the (otherwise unneeded) construction of a large hash table.
More importantly, with precompiled headers, the construction
of that table requires deserializing most of the top-level
declarations from the precompiled header, which are then unused.

Fixes PR 4509.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74911 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
3ee12aed6dce6dab954485b4f6e6d391bab96588 07-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce the notion of "Relocatable" precompiled headers, which are built
with a particular system root directory and can be used with a different
system root directory when the headers it depends on have been installed.
Relocatable precompiled headers rewrite the file names of the headers used
when generating the PCH file into the corresponding file names of the
headers available when using the PCH file.

Addresses <rdar://problem/7001604>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74885 91177308-0d34-0410-b5e6-96231b3b80d8
eneratePCH.cpp
CHReader.cpp
CHWriter.cpp
e650c8c3bca2f58cad8ffa8aab63126d26e890cd 07-Jul-2009 Douglas Gregor <dgregor@apple.com> Introduce the notion of "Relocatable" precompiled headers, which are built
with a particular system root directory and can be used with a different
system root directory when the headers it depends on have been installed.
Relocatable precompiled headers rewrite the file names of the headers used
when generating the PCH file into the corresponding file names of the
headers available when using the PCH file.

Addresses <rdar://problem/7001604>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74885 91177308-0d34-0410-b5e6-96231b3b80d8
eneratePCH.cpp
CHReader.cpp
CHWriter.cpp
fef5a6851c83be9ba9ae70a9b4b757b92e657a66 06-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Update CMake files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74864 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
0daea7a162bee39b1b1dd63b7bceccd3224a6a63 06-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Update CMake files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74864 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
98eec710d45954ac3c74ed8cedd85fd0dac4a0db 06-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Move the 'ResolveLocationInAST' function from the Frontend library to the Index library.

Also, cut down its comments; more comments will be added to ASTLocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74860 91177308-0d34-0410-b5e6-96231b3b80d8
esolveLocation.cpp
818e15b89facfe0b62c8c22c18fde383a17455eb 06-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move the 'ResolveLocationInAST' function from the Frontend library to the Index library.

Also, cut down its comments; more comments will be added to ASTLocation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74860 91177308-0d34-0410-b5e6-96231b3b80d8
esolveLocation.cpp
75abd9c49cd26ed18bc99eafa34e3e733f92f3ca 06-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Move ASTLocation and DeclReferenceMap from the AST library to the Index library.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74859 91177308-0d34-0410-b5e6-96231b3b80d8
esolveLocation.cpp
ccbcb70ee96cb67ed6c8b4142d050f3a6764edd7 06-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move ASTLocation and DeclReferenceMap from the AST library to the Index library.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74859 91177308-0d34-0410-b5e6-96231b3b80d8
esolveLocation.cpp
2fcbc1e545a47bc3cd1da08944516f17a6e08c56 06-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Rename 'ASTNode' -> 'ASTLocation'.

ASTLocation is a much better name for its intended purpose which to represent a "point" into the AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74858 91177308-0d34-0410-b5e6-96231b3b80d8
esolveLocation.cpp
874012b1fb80dff2ec227c726a0c63d55e3db63f 06-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Rename 'ASTNode' -> 'ASTLocation'.

ASTLocation is a much better name for its intended purpose which to represent a "point" into the AST.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74858 91177308-0d34-0410-b5e6-96231b3b80d8
esolveLocation.cpp
1e78281bbb8d614637a102e77c2f3288e30b9f8d 06-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Fix PR 4489, a crash in PCH loading that occurs when loading the name
of a top-level declaration loads another top-level declaration of the
same name whose type depends on the first declaration having been
completed. This commit breaks the circular dependency by delaying
loads of top-level declarations triggered by loading a name until we
are no longer recursively loading types or declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74847 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
d89275bc865e2b552836c7b33e636d4f86b8de6d 06-Jul-2009 Douglas Gregor <dgregor@apple.com> Fix PR 4489, a crash in PCH loading that occurs when loading the name
of a top-level declaration loads another top-level declaration of the
same name whose type depends on the first declaration having been
completed. This commit breaks the circular dependency by delaying
loads of top-level declarations triggered by loading a name until we
are no longer recursively loading types or declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74847 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
1d381135f0c9dcbac521112b3f6936caf871b91a 06-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Keep track of the Expr used to describe the size of an array type,
from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74831 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
7e7eb3da052a6d80ddf2377cab0384c798f73f75 06-Jul-2009 Douglas Gregor <dgregor@apple.com> Keep track of the Expr used to describe the size of an array type,
from Enea Zaffanella!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74831 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
7283e46a51b6df0a044224f2bbbc4000a94ecb91 06-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Avoid re-checking the parameters of a function, when trying to resolve a location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74799 91177308-0d34-0410-b5e6-96231b3b80d8
esolveLocation.cpp
07796e1c522921e2b396df36bf9c1f702ffb2fb5 06-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Avoid re-checking the parameters of a function, when trying to resolve a location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74799 91177308-0d34-0410-b5e6-96231b3b80d8
esolveLocation.cpp
85837dbd7c835c29804518b269c9d329784ccc43 06-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Make use of ASTNode for return value of clang::ResolveLocationInAST() and in the index-test tool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74798 91177308-0d34-0410-b5e6-96231b3b80d8
esolveLocation.cpp
49dd5851c463963a8a78f5222ea72cfaa6db1029 06-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make use of ASTNode for return value of clang::ResolveLocationInAST() and in the index-test tool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74798 91177308-0d34-0410-b5e6-96231b3b80d8
esolveLocation.cpp
4770f5e3abd05a418ec5c9a2180a092dca3e1750 06-Jul-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Do an early check for function definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74796 91177308-0d34-0410-b5e6-96231b3b80d8
esolveLocation.cpp
685477f910901e57b2441981c3bd3d5b9c0f228d 06-Jul-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Do an early check for function definition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74796 91177308-0d34-0410-b5e6-96231b3b80d8
esolveLocation.cpp
a252b23fb4318b2bf84fa86bd9c55fd15a85b588 02-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Add support for retrieving the Doxygen comment associated with a given
declaration in the AST.

The new ASTContext::getCommentForDecl function searches for a comment
that is attached to the given declaration, and returns that comment,
which may be composed of several comment blocks.

Comments are always available in an AST. However, to avoid harming
performance, we don't actually parse the comments. Rather, we keep the
source ranges of all of the comments within a large, sorted vector,
then lazily extract comments via a binary search in that vector only
when needed (which never occurs in a "normal" compile).

Comments are written to a precompiled header/AST file as a blob of
source ranges. That blob is only lazily loaded when one requests a
comment for a declaration (this never occurs in a "normal" compile).

The indexer testbed now supports comment extraction. When the
-point-at location points to a declaration with a Doxygen-style
comment, the indexer testbed prints the associated comment
block(s). See test/Index/comments.c for an example.

Some notes:
- We don't actually attempt to parse the comment blocks themselves,
beyond identifying them as Doxygen comment blocks to associate them
with a declaration.
- We won't find comment blocks that aren't adjacent to the
declaration, because we start our search based on the location of
the declaration.
- We don't go through the necessary hops to find, for example,
whether some redeclaration of a declaration has comments when our
current declaration does not. Similarly, we don't attempt to
associate a \param Foo marker in a function body comment with the
parameter named Foo (although that is certainly possible).
- Verification of my "no performance impact" claims is still "to be
done".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74704 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2e22253e03e175144aeb9d13350a12fd83f858be 02-Jul-2009 Douglas Gregor <dgregor@apple.com> Add support for retrieving the Doxygen comment associated with a given
declaration in the AST.

The new ASTContext::getCommentForDecl function searches for a comment
that is attached to the given declaration, and returns that comment,
which may be composed of several comment blocks.

Comments are always available in an AST. However, to avoid harming
performance, we don't actually parse the comments. Rather, we keep the
source ranges of all of the comments within a large, sorted vector,
then lazily extract comments via a binary search in that vector only
when needed (which never occurs in a "normal" compile).

Comments are written to a precompiled header/AST file as a blob of
source ranges. That blob is only lazily loaded when one requests a
comment for a declaration (this never occurs in a "normal" compile).

The indexer testbed now supports comment extraction. When the
-point-at location points to a declaration with a Doxygen-style
comment, the indexer testbed prints the associated comment
block(s). See test/Index/comments.c for an example.

Some notes:
- We don't actually attempt to parse the comment blocks themselves,
beyond identifying them as Doxygen comment blocks to associate them
with a declaration.
- We won't find comment blocks that aren't adjacent to the
declaration, because we start our search based on the location of
the declaration.
- We don't go through the necessary hops to find, for example,
whether some redeclaration of a declaration has comments when our
current declaration does not. Similarly, we don't attempt to
associate a \param Foo marker in a function body comment with the
parameter named Foo (although that is certainly possible).
- Verification of my "no performance impact" claims is still "to be
done".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74704 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2988c55b808ee8fa6956aa32f0ee3e2cb256f9a2 02-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Fix PR 4489, a PCH crash during de-serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74664 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ae4df629dda13736c9e3251921b168084cd01978 02-Jul-2009 Douglas Gregor <dgregor@apple.com> Fix PR 4489, a PCH crash during de-serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74664 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
6602e71406e3dee6998a2687024bf63aaa641717 02-Jul-2009 Owen Anderson <resistor@mac.com> Update for changes in LLVM. Hopefully this is the last one for a while.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74657 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
8f1ca78009ca1bdb66903c51b9bbaa81f58ea72a 02-Jul-2009 Owen Anderson <resistor@mac.com> Update for changes in LLVM. Hopefully this is the last one for a while.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74657 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
900fe062fcfd74f60ae171a0eb247aaec1c00929 01-Jul-2009 Owen Anderson <resistor@mac.com> Hold the LLVMContext by reference instead of by pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74642 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
c93f49832d2dae19a24d644c8021388fc5b099ee 01-Jul-2009 Owen Anderson <resistor@mac.com> Hold the LLVMContext by reference instead of by pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74642 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
2bbc304d98ba6d54220f985e72d5cfdf9fbb9fc2 01-Jul-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Add header search path for Gentoo stable, x86_64 version.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74626 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
4d374d4a4832a01d5d3b75c59cb1567e60df41e7 01-Jul-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Add header search path for Gentoo stable, x86_64 version.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74626 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
ab960bac45b692b11867953f222e92bc9380ea4b 01-Jul-2009 Owen Anderson <resistor@mac.com> Update for LLVMContext+Module change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74615 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
42253cc3bc006661da1287aafef93d52d00dfed1 01-Jul-2009 Owen Anderson <resistor@mac.com> Update for LLVMContext+Module change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74615 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
38e3180fb0d08290be62eb24c84a27e5ccdc5110 01-Jul-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4192: fix the definition of int64_t on x86_64 Linux.

Note that I'm guessing that *BSD and Solaris do the same thing as Linux
here, but it's quite possible I'm wrong; if the following testcase
gives an error on x86-64 with gcc for any of those operating systems, please
tell me:

#include <stdint.h>

int64_t x; long x;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74583 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
3c7b6e46c5f9bdbe0676c52d80df98b68b02be99 01-Jul-2009 Eli Friedman <eli.friedman@gmail.com> Fix for PR4192: fix the definition of int64_t on x86_64 Linux.

Note that I'm guessing that *BSD and Solaris do the same thing as Linux
here, but it's quite possible I'm wrong; if the following testcase
gives an error on x86-64 with gcc for any of those operating systems, please
tell me:

#include <stdint.h>

int64_t x; long x;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74583 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
b25d0ee142859d124aa36507904bacd87a50a58e 30-Jun-2009 Zhongxing Xu <xuzhongxing@gmail.com> remove dead code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74517 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
51bbd1b5cf019a6262219787f0d2f159801677d6 30-Jun-2009 Zhongxing Xu <xuzhongxing@gmail.com> remove dead code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74517 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ab6e38adbcdbdb4e7d211b4ff7a52d871ea0e994 30-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> De-ASTContext-ify DeclContext.

Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74506 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
nalysisConsumer.cpp
eclXML.cpp
CHWriter.cpp
esolveLocation.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
17945a0f64fe03ff6ec0c2146005a87636e3ac12 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> De-ASTContext-ify DeclContext.

Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74506 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
nalysisConsumer.cpp
eclXML.cpp
CHWriter.cpp
esolveLocation.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
ccb9efea4c1a88ccf62ac49d60f98b754897695a 30-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the getBody() methods of Decl and subclasses.

Timings showed no significant difference before and after the commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74504 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
eclXML.cpp
CHWriterDecl.cpp
esolveLocation.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
6fb0aee4f9dc261bbec72e1283ad8dc0557a6d96 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the getBody() methods of Decl and subclasses.

Timings showed no significant difference before and after the commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74504 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
eclXML.cpp
CHWriterDecl.cpp
esolveLocation.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
9a6fb96f74f39d19180dc87f4232ad3617f3f2de 30-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the printing related methods of Decl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74503 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
esolveLocation.cpp
f1d60eaf3f70975ee262852af2d6aeabd140ed58 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the printing related methods of Decl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74503 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
esolveLocation.cpp
fe5f9736723cbaae5423f98ebbd0f0f537b51de4 30-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the attribute-related methods of Decl.
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.

This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
40b598eea1310ec9ed554d56ce3e25b34c585458 30-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Remove the ASTContext parameter from the attribute-related methods of Decl.
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.

This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
7099c789f054f1e7480f498d60aa94b0326c285f 30-Jun-2009 Chris Lattner <sabre@nondot.org> Key decisions about 'bool' vs '_Bool' to be based on a new flag in langoptions.

This is simple enough, but then I thought it would be nice to make PrintingPolicy
get a LangOptions so that various things can key off "bool" and "C++" independently.
This spiraled out of control. There are many fixme's, but I think things are slightly
better than they were before.

One thing that can be improved: CFG should probably have an ASTContext pointer in it,
which would simplify its clients.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74493 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
esolveLocation.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
e4f2142d00fa5fdb580c4e2413da91882d955381 30-Jun-2009 Chris Lattner <sabre@nondot.org> Key decisions about 'bool' vs '_Bool' to be based on a new flag in langoptions.

This is simple enough, but then I thought it would be nice to make PrintingPolicy
get a LangOptions so that various things can key off "bool" and "C++" independently.
This spiraled out of control. There are many fixme's, but I think things are slightly
better than they were before.

One thing that can be improved: CFG should probably have an ASTContext pointer in it,
which would simplify its clients.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74493 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
esolveLocation.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
39e99a4bd7d690178f494899078d0723522d5247 29-Jun-2009 Bill Wendling <isanbard@gmail.com> Make the StackProtector bitfield use enums instead of obscure numbers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74414 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
4ebe3e4c811a376c423a544f5e76ee2e96533324 29-Jun-2009 Bill Wendling <isanbard@gmail.com> Make the StackProtector bitfield use enums instead of obscure numbers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74414 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
e1d4f5d6840e99b8345dd755ec4a335ff4539fcf 28-Jun-2009 Bill Wendling <isanbard@gmail.com> Add stack protector support to clang. This generates the 'ssp' and 'sspreq'
function attributes. There are predefined macros that are defined when stack
protectors are used: __SSP__=1 with -fstack-protector and __SSP_ALL__=2 with
-fstack-protector-all.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74405 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
45483f7a1b3e57b4603b141bee80596b2d4dd443 28-Jun-2009 Bill Wendling <isanbard@gmail.com> Add stack protector support to clang. This generates the 'ssp' and 'sspreq'
function attributes. There are predefined macros that are defined when stack
protectors are used: __SSP__=1 with -fstack-protector and __SSP_ALL__=2 with
-fstack-protector-all.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74405 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
4a8498cc0f251e839912285112a014a5d1248648 26-Jun-2009 Anders Carlsson <andersca@mac.com> Implement enough of the 'auto' keyword so we can claim to support N2546.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74307 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
e89d15944dd3be750a09805ad21222d2fa9321fa 26-Jun-2009 Anders Carlsson <andersca@mac.com> Implement enough of the 'auto' keyword so we can claim to support N2546.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74307 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
607021675efc13cdaa93bbe22fa4526307d48cd3 26-Jun-2009 Nate Begeman <natebegeman@mac.com> OpenCL 1.0 support: attributes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74280 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
6f3d838867538638b9bbf412028e8537ae12f3e5 26-Jun-2009 Nate Begeman <natebegeman@mac.com> OpenCL 1.0 support: attributes


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74280 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
d1c53ffd5f0af6258181e026c0ef6c202990495c 26-Jun-2009 Ted Kremenek <kremenek@apple.com> Introduce a new concept to the static analyzer: SValuator.

GRTransferFuncs had the conflated role of both constructing SVals (symbolic
expressions) as well as handling checker-specific logic. Now SValuator has the
role of constructing SVals from expressions and GRTransferFuncs just handles
checker-specific logic. The motivation is by separating these two concepts we
will be able to much more easily create richer constraint-generating logic
without coupling it to the main checker transfer function logic.

We now have one implementation of SValuator: SimpleSValuator.

SimpleSValuator is essentially the SVal-related logic that was in GRSimpleVals
(which is removed in this patch). This includes the logic for EvalBinOp,
EvalCast, etc. Because SValuator has a narrower role than the old
GRTransferFuncs, the interfaces are much simpler, and so is the implementation
of SimpleSValuator compared to GRSimpleVals. I also did a line-by-line review of
SVal-related logic in GRSimpleVals and cleaned it up while moving it over to
SimpleSValuator.

As a consequence of removing GRSimpleVals, there is no longer a
'-checker-simple' option. The '-checker-cfref' did everything that option did
but also ran the retain/release checker. Of course a user may not always wish to
run the retain/release checker, nor do we wish core analysis logic buried in the
checker-specific logic. The next step is to refactor the logic in CFRefCount.cpp
to separate out these pieces into the core analysis engine.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74229 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
6c07bdba93b095b66e2c8c82dd5ed458fa8285ea 26-Jun-2009 Ted Kremenek <kremenek@apple.com> Introduce a new concept to the static analyzer: SValuator.

GRTransferFuncs had the conflated role of both constructing SVals (symbolic
expressions) as well as handling checker-specific logic. Now SValuator has the
role of constructing SVals from expressions and GRTransferFuncs just handles
checker-specific logic. The motivation is by separating these two concepts we
will be able to much more easily create richer constraint-generating logic
without coupling it to the main checker transfer function logic.

We now have one implementation of SValuator: SimpleSValuator.

SimpleSValuator is essentially the SVal-related logic that was in GRSimpleVals
(which is removed in this patch). This includes the logic for EvalBinOp,
EvalCast, etc. Because SValuator has a narrower role than the old
GRTransferFuncs, the interfaces are much simpler, and so is the implementation
of SimpleSValuator compared to GRSimpleVals. I also did a line-by-line review of
SVal-related logic in GRSimpleVals and cleaned it up while moving it over to
SimpleSValuator.

As a consequence of removing GRSimpleVals, there is no longer a
'-checker-simple' option. The '-checker-cfref' did everything that option did
but also ran the retain/release checker. Of course a user may not always wish to
run the retain/release checker, nor do we wish core analysis logic buried in the
checker-specific logic. The next step is to refactor the logic in CFRefCount.cpp
to separate out these pieces into the core analysis engine.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74229 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
909e06eccd9b9cee59e83c8fd5c4d4c1b3a801ca 26-Jun-2009 Nate Begeman <natebegeman@mac.com> Write/Read new Language Options


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74221 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
b9e7e63ae2098bc02e79c032df0a3124d09a4b4e 26-Jun-2009 Nate Begeman <natebegeman@mac.com> Write/Read new Language Options


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74221 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
31f83514430c650800e656aa67555f0960e65f44 26-Jun-2009 Nate Begeman <natebegeman@mac.com> PCH support for OpenCL language options


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74220 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
69cfb9be9bd3feab96e844bf0edf1b7546c48a02 26-Jun-2009 Nate Begeman <natebegeman@mac.com> PCH support for OpenCL language options


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74220 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
40bf2835dac05cd3701487bf0b6ba0440befecb4 25-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce the ResolveLocationInAST function which takes an ASTContext and a SourceLocation and it resolves it into a <Decl*, Stmt*> pair.

Decl* is the declaration associated with this source location and Stmt* is the statement/expression that the location points to.
If the location does not point to a statement node, Stmt* is null.

ResolveLocationInAST (along with converting a file:line:column triplet to a SourceLocation) will be useful for an IDE client and for clang's test suite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74197 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
esolveLocation.cpp
53d4c14a989523afc6aa8fff275ec3ab26eb6c18 25-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce the ResolveLocationInAST function which takes an ASTContext and a SourceLocation and it resolves it into a <Decl*, Stmt*> pair.

Decl* is the declaration associated with this source location and Stmt* is the statement/expression that the location points to.
If the location does not point to a statement node, Stmt* is null.

ResolveLocationInAST (along with converting a file:line:column triplet to a SourceLocation) will be useful for an IDE client and for clang's test suite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74197 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
esolveLocation.cpp
3a50322f8b319f0c8609ac1e296657750c3cb871 25-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Handle PCHReader::IgnorePCH, it gets returned for when the file does not exist.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74196 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
106c9981f18084e60602244f1feaeabbbe8ab5e8 25-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Handle PCHReader::IgnorePCH, it gets returned for when the file does not exist.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74196 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
68a308146106dcc57402c453e1203fa7fb7372f5 25-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Add missing dependencies to the CMake build system

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74162 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
f391e098b2bc695f60a10da8003a5ed1a85b61ce 25-Jun-2009 Douglas Gregor <dgregor@apple.com> Add missing dependencies to the CMake build system

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74162 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
93ab533a2e9522a2e9a7695cb7446812fc9e70a6 24-Jun-2009 Anders Carlsson <andersca@mac.com> Add a DecltypeType type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74099 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
395b475a4474f1c7574d927ad142ca0c7997cbca 24-Jun-2009 Anders Carlsson <andersca@mac.com> Add a DecltypeType type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74099 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
864afaee67fe0d998a8bd086d68dfefa54b26041 24-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Update CMakeLists.txt

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74011 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
9336bcf24e4188fe4a24862c0f5299c03d951f89 24-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Update CMakeLists.txt

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74011 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
d5d096e5861e3b291f1f170a716a622fd28e06a5 23-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Fix some TableGen-related dependencies for the Clang CMake build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73976 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
3c092bce5fb4523854c3429e0af44f99c6fe2b92 23-Jun-2009 Douglas Gregor <dgregor@apple.com> Fix some TableGen-related dependencies for the Clang CMake build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73976 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
4b5874bb063c92f63cda8a65866849ca5dfb9680 23-Jun-2009 Chris Lattner <sabre@nondot.org> switch Warnings.cpp to use the diagnostics machinery to print diagnostics, not *fprintf*!
Among other things, this makes the warning about unknown warning options mappable.
For example:

$ clang t.c -Werror -Wfoo
error: unknown warning option '-Wfoo' [-Wunknown-warning-option]

For another thing, they are properly color coded now too :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73936 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
8ea841b1152308ae11c23a7836dead36e47d96e3 23-Jun-2009 Chris Lattner <sabre@nondot.org> switch Warnings.cpp to use the diagnostics machinery to print diagnostics, not *fprintf*!
Among other things, this makes the warning about unknown warning options mappable.
For example:

$ clang t.c -Werror -Wfoo
error: unknown warning option '-Wfoo' [-Wunknown-warning-option]

For another thing, they are properly color coded now too :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73936 91177308-0d34-0410-b5e6-96231b3b80d8
arnings.cpp
5912220b54135f50487aa2a7f7d3ef8e827dea71 23-Jun-2009 Chris Lattner <sabre@nondot.org> __APPLE_CC__ should only be set when building for darwin targets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73934 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
7478bbfea8ec19962ba8e47d0b8b4de15f5a5943 23-Jun-2009 Chris Lattner <sabre@nondot.org> __APPLE_CC__ should only be set when building for darwin targets.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73934 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
b2b5a7a5844d19ff1d33b19e5ebb47ef494c5964 20-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Add the license part to the new source files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73825 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
4b562cf889bc59e1914dd2c5d9fbd7e7bfa1ad77 20-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Add the license part to the new source files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73825 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
d850947d634d5d8ab0c1480135cbf0959a80e19b 20-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Serialize FunctionDecl's EndRangeLoc out to the PCH file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73822 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
8cff90e1f74ebd5e6ca37c1c96f7f73937bbad23 20-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Serialize FunctionDecl's EndRangeLoc out to the PCH file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73822 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
dbfe01e9e1119e2e691101e914fbf8b577a0cd7d 20-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Introduce the ASTUnit class.

ASTUnit is a helper class to allow easy loading of an ASTContext from a PCH file. No users for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73819 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
0853a02c3b04d96a3c432b883e403175c954cd81 20-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Introduce the ASTUnit class.

ASTUnit is a helper class to allow easy loading of an ASTContext from a PCH file. No users for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73819 91177308-0d34-0410-b5e6-96231b3b80d8
STUnit.cpp
da3513138b55fe2b8ba8f81a8e91c645fd95bc43 20-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Added writing and reading of the ConstQualAdded flag of
BlockDeclRefExpr to PCH.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73800 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
9b0b57c6f9996bfdb67248f6942dd23acfa36167 20-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Added writing and reading of the ConstQualAdded flag of
BlockDeclRefExpr to PCH.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73800 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
981892622a7fbb6d0e7eb7759ed7e8039e46bef9 20-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Keep track of when declarations are "used" according to C and
C++. This logic is required to trigger implicit instantiation of
function templates and member functions of class templates, which will
be implemented separately.

This commit includes support for -Wunused-parameter, printing warnings
for named parameters that are not used within a function/Objective-C
method/block. Fixes <rdar://problem/6505209>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73797 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
e0762c92110dfdcdd207db461a4ea17afd168f1e 20-Jun-2009 Douglas Gregor <dgregor@apple.com> Keep track of when declarations are "used" according to C and
C++. This logic is required to trigger implicit instantiation of
function templates and member functions of class templates, which will
be implemented separately.

This commit includes support for -Wunused-parameter, printing warnings
for named parameters that are not used within a function/Objective-C
method/block. Fixes <rdar://problem/6505209>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73797 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
cae77debf37fc73963b4fdcc8651d2985fc6b94f 19-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Fix bug in the new PCHReader constructor. PP and Context should be initialized to 0.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73762 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
5710211845ebe34ec815e08a6e282eafd6118388 19-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix bug in the new PCHReader constructor. PP and Context should be initialized to 0.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73762 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
e3f4bda53544f2a5a8fe31ab7c86bed1e4e66b01 19-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Make changes to PCHReader to allow reading a PCH file without having a pre-initialized Preprocessor.

-Introduce 'PCHReaderListener' which is an abstract interface for getting various information from the PCHReader.
-If PCHReader is constructed without a Preprocessor, it can still load the file and invoke the callbacks of PCHReaderListener.
-If PCHReader is constructed with an initialized Preprocessor, PCHValidator is used as a PCHReaderListener to validate the contents of the PCH file against the given Preprocessor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73741 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
11e51106329c550d008fad2c657c053d81611ea8 19-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Make changes to PCHReader to allow reading a PCH file without having a pre-initialized Preprocessor.

-Introduce 'PCHReaderListener' which is an abstract interface for getting various information from the PCHReader.
-If PCHReader is constructed without a Preprocessor, it can still load the file and invoke the callbacks of PCHReaderListener.
-If PCHReader is constructed with an initialized Preprocessor, PCHValidator is used as a PCHReaderListener to validate the contents of the PCH file against the given Preprocessor.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73741 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
98da6aed9fbc7fc82dd581c7bb647412f7864299 18-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
68584ed35ad819a1668e3f527ba7f5dd4ae6a333 18-Jun-2009 Douglas Gregor <dgregor@apple.com> Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
0753762135a753f942001b5b5b6ebbe7de07e549 18-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Add some missing CMake dependencies

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73700 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
0adea828ec9db09bf54ca4efa54b2a2f688726b5 18-Jun-2009 Douglas Gregor <dgregor@apple.com> Add some missing CMake dependencies

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73700 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
38bc2b568f9a179119f196f7bcebd87b37c6355e 18-Jun-2009 Argiris Kirtzidis <akyrtzi@gmail.com> Move CXXMethodDecl::OutOfLineDefinition into Decl::OutOfLine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73651 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
f5cecfbdcd20be224861f9e67c5973a9a2b61512 18-Jun-2009 Argyrios Kyrtzidis <akyrtzi@gmail.com> Move CXXMethodDecl::OutOfLineDefinition into Decl::OutOfLine.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73651 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
c75c1a882cad91f2edc6a926eb8cd725abad2262 18-Jun-2009 Steve Naroff <snaroff@apple.com> First step toward fixing <rdar://problem/6613046> refactor clang objc type representation.

Add a type (ObjCObjectPointerType) and remove a type (ObjCQualifiedIdType).

This large/tedious patch is just a first step. Next step is to remove ObjCQualifiedInterfaceType. After that, I will remove the magic TypedefType for 'id' (installed by Sema). This work will enable various simplifications throughout clang (when dealing with ObjC types).

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73649 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bc 18-Jun-2009 Steve Naroff <snaroff@apple.com> First step toward fixing <rdar://problem/6613046> refactor clang objc type representation.

Add a type (ObjCObjectPointerType) and remove a type (ObjCQualifiedIdType).

This large/tedious patch is just a first step. Next step is to remove ObjCQualifiedInterfaceType. After that, I will remove the magic TypedefType for 'id' (installed by Sema). This work will enable various simplifications throughout clang (when dealing with ObjC types).

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73649 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
ca4d44fddb55ffd7a976db5a13e77a6f7c3e68fe 17-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> Search path for 64-bit Ubuntu Linux, from Anders Johnsen

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73637 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
15e92322a77c6b6f03da76f0cecd598b5ccdf877 17-Jun-2009 Douglas Gregor <dgregor@apple.com> Search path for 64-bit Ubuntu Linux, from Anders Johnsen

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73637 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
86e20d021b955f83db4494ef577f045560b97864 15-Jun-2009 Douglas Gregor <doug.gregor@gmail.com> More XML output support, from Olaf Krzikalla!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73402 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eclXML.cpp
ocumentXML.cpp
tmtXML.cpp
ypeXML.cpp
038f75abf5abd1e35736dd5c751ba20df1158aaa 15-Jun-2009 Douglas Gregor <dgregor@apple.com> More XML output support, from Olaf Krzikalla!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73402 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eclXML.cpp
ocumentXML.cpp
tmtXML.cpp
ypeXML.cpp
5b5ca8efdc85d40d2d6ac8b498f9a28fa3c9ca9e 15-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4388: get rid of an extra # line directive; in addition to being
unnecessary, this was causing issues for assembler-with-cpp mode, which
doesn't process the directive.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73382 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
ae96a9637af7beea89a66d43bf3595b5a7d2756d 15-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4388: get rid of an extra # line directive; in addition to being
unnecessary, this was causing issues for assembler-with-cpp mode, which
doesn't process the directive.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73382 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
8cd1da5163ab9d86552cb3fafaede109ae90c013 15-Jun-2009 Chris Lattner <sabre@nondot.org> Minor tweak to -fdiagnostics-print-source-range-info to make it print
ranges more similar to the console output. Consider:

#define FOO(X, Y) X/ Y

void foo(int *P, int *Q) {
FOO(P, Q);
}

Before we emitted:

t.c:4:3:{4:3-4:6}{4:3-4:6}: error: invalid operands to binary expression ('int *' and 'int *')
FOO(P, Q);
^~~~~~~~~
...

Note that while we underline the macro args that the range info just includes FOO
without its macros. This change teaches the printed ranges to include macro args
also so that we get:

t.c:4:3:{4:3-4:12}{4:3-4:12}: error: invalid operands to binary expression ('int *' and 'int *')
FOO(P, Q);
^~~~~~~~~
...

This fixes rdar://6939599


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73378 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
81ebe9bf80b9a4eb1e5a30b0de39b2d638044ae4 15-Jun-2009 Chris Lattner <sabre@nondot.org> Minor tweak to -fdiagnostics-print-source-range-info to make it print
ranges more similar to the console output. Consider:

#define FOO(X, Y) X/ Y

void foo(int *P, int *Q) {
FOO(P, Q);
}

Before we emitted:

t.c:4:3:{4:3-4:6}{4:3-4:6}: error: invalid operands to binary expression ('int *' and 'int *')
FOO(P, Q);
^~~~~~~~~
...

Note that while we underline the macro args that the range info just includes FOO
without its macros. This change teaches the printed ranges to include macro args
also so that we get:

t.c:4:3:{4:3-4:12}{4:3-4:12}: error: invalid operands to binary expression ('int *' and 'int *')
FOO(P, Q);
^~~~~~~~~
...

This fixes rdar://6939599


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73378 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
8c5a4775fe5a82a35098196e929e65e422d0cca0 15-Jun-2009 Chris Lattner <sabre@nondot.org> If PCH refers to a file that doesn't exist anymore, emit a nice error
like:
fatal error: could not find file '1.h' referenced by PCH file
instead of aborting with an assertion failure, PR4219



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73371 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
d3555ae09f3d31f7cac84a85d3915459fd34c657 15-Jun-2009 Chris Lattner <sabre@nondot.org> If PCH refers to a file that doesn't exist anymore, emit a nice error
like:
fatal error: could not find file '1.h' referenced by PCH file
instead of aborting with an assertion failure, PR4219



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73371 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
d6304d0a76440f041e1693c2d502bec3cd20e46c 15-Jun-2009 Chris Lattner <sabre@nondot.org> no really, add the lines :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73367 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
ed2d7c4ffd4112ddf10cb95e48428bae0b36377a 15-Jun-2009 Chris Lattner <sabre@nondot.org> no really, add the lines :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73367 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
daea244f6df820d4919fc1842d854c228fc36e95 15-Jun-2009 Chris Lattner <sabre@nondot.org> Fix PR2741 by making our newline tracking be aware of newlines that
can occur in the middle of comment tokens.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73365 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
3ee211fd15dfeeb51bb69681084cdfcea427f314 15-Jun-2009 Chris Lattner <sabre@nondot.org> Fix PR2741 by making our newline tracking be aware of newlines that
can occur in the middle of comment tokens.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73365 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
0485d88ad80aec19d42e079659f2ccf7a636b791 13-Jun-2009 Chris Lattner <sabre@nondot.org> add the location of the ')' in a do/while statement to DoStmt.
This fixes a source range problem reported by Olaf Krzikalla.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73266 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
rintParserCallbacks.cpp
989135901c750af61ef012b6b0a0368be415bc46 13-Jun-2009 Chris Lattner <sabre@nondot.org> add the location of the ')' in a do/while statement to DoStmt.
This fixes a source range problem reported by Olaf Krzikalla.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73266 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
rintParserCallbacks.cpp
a116e6e7d544e9e9680fc917709147ea71069877 12-Jun-2009 Anders Carlsson <andersca@mac.com> It's an error to use a function declared in a class definition as a default argument before the function has been declared.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73234 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
5e300d1a8e37f24e71f8cf204b982f20f85cf91a 12-Jun-2009 Anders Carlsson <andersca@mac.com> It's an error to use a function declared in a class definition as a default argument before the function has been declared.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73234 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
0d09dab7b724ae442a10e288d9663b49bf45aa08 11-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4371: Reduce the inlining threshold outside of -O3. This makes
the clang inlining threshold consistent with the threshold for llvm-gcc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73204 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
b9b7dd644275911f38ec77b23014904481af2bda 11-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4371: Reduce the inlining threshold outside of -O3. This makes
the clang inlining threshold consistent with the threshold for llvm-gcc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73204 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
6b6ca949df5444625f4b527ae2da1d3cb8fc03fe 08-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Misc minor fixes for clang for the Windows target.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73050 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
abc4e32603bd9d3e392e23762cc366e45d772685 08-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Misc minor fixes for clang for the Windows target.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73050 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
45b1e22a0aeb450188be75c8ea07ea70a757ce20 08-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Don't allow defining a block with a non-prototype type. Remove a
hack which introduces some strange inconsistencies in compatibility
for block pointers.

Note that unlike an earlier revision proposed on cfe-commits, this patch
still allows declaring block pointers without a prototype.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73041 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteBlocks.cpp
687abffee40d0459fe5eecf3e5ee6e60be69d93c 08-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Don't allow defining a block with a non-prototype type. Remove a
hack which introduces some strange inconsistencies in compatibility
for block pointers.

Note that unlike an earlier revision proposed on cfe-commits, this patch
still allows declaring block pointers without a prototype.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73041 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteBlocks.cpp
074cf971ecca9fb93427f5e2b044858570bdd9ba 05-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Use of DeclContext for objc's ivars. No functionality
change. More to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72951 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
496b5a894c5ec5425de53909f5aac3fb4771a2ec 05-Jun-2009 Fariborz Jahanian <fjahanian@apple.com> Use of DeclContext for objc's ivars. No functionality
change. More to follow.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72951 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
d9389beef9a889d95ea8417cc44db22e30ad9523 05-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Move CharIsSigned from TargetInfo to LangOptions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72928 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
CHReader.cpp
CHWriter.cpp
15b91764d08e886391c865c4a444d7b51141c284 05-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Move CharIsSigned from TargetInfo to LangOptions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72928 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
CHReader.cpp
CHWriter.cpp
eff0a42db6b07f91e3a7e7f78c209707b81a3ef8 05-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Move a couple Darwin-specific defines into getDarwinDefines.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72900 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
2de4feeef29c837466a5f109e75f37ec2022bb28 05-Jun-2009 Eli Friedman <eli.friedman@gmail.com> Move a couple Darwin-specific defines into getDarwinDefines.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72900 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
ec461bbb6ac59a1fb09628b8e7e8e23243775aaa 04-Jun-2009 Chris Lattner <sabre@nondot.org> DefineBuiltinMacro is always passed two args, remove the defaulted third
one.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72868 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
810dc54e1c091f7ee0167ef6e271e2ea308882e1 04-Jun-2009 Chris Lattner <sabre@nondot.org> DefineBuiltinMacro is always passed two args, remove the defaulted third
one.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72868 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
eff3712dc7206a3819b1f01a27d4834ae13977f3 04-Jun-2009 Edwin Török <edwintorok@gmail.com> Add ANSI color support for clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72855 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
603fca728136f0e5d258a84e7bd4a0e1e9bd0803 04-Jun-2009 Torok Edwin <edwintorok@gmail.com> Add ANSI color support for clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72855 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
247f30922f7e07c5df5cd6ccd11e837340446398 03-Jun-2009 Daniel Dunbar <daniel@zuster.org> (llvm up) Switch to using StandardPasses.h
- One functionality change, the LoopIndexSplit pass is now reenabled (it was
disabled in r60089 but we forgot to reenable it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72787 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
10d861e00d008179b8fdc17fd31f26847b62d3bf 03-Jun-2009 Daniel Dunbar <daniel@zuster.org> (llvm up) Switch to using StandardPasses.h
- One functionality change, the LoopIndexSplit pass is now reenabled (it was
disabled in r60089 but we forgot to reenable it).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72787 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
fb37afdd530dac68ebb90d71321757ba25241470 03-Jun-2009 Duncan Sands <baldrick@free.fr> Compile fix needed by the solaris system gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72772 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
63682f9c64ba48854d26870486cc33b3291f71b3 03-Jun-2009 Duncan Sands <baldrick@free.fr> Compile fix needed by the solaris system gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72772 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
29b61a5b3315c23f5801d39b2e925d44dc9b2214 03-Jun-2009 Zhongxing Xu <xuzhongxing@gmail.com> emit ORIGINAL_FILE_NAME record ID to blockinfo block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72759 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
51e774d42269e3b22d746184c0b9076fc13b32e6 03-Jun-2009 Zhongxing Xu <xuzhongxing@gmail.com> emit ORIGINAL_FILE_NAME record ID to blockinfo block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72759 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
d27b66b72540a65f89a15328b7112f79242439a2 03-Jun-2009 Daniel Dunbar <daniel@zuster.org> Add clang-cc support for -disable-llvm-optzns.
- Avoids running any LLVM optimizations, even at -O2, etc., while still keeping
any language changes these optimizations imply.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72742 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
877db3852e29c5b5a2dc25b3fe4a3b78619aa904 03-Jun-2009 Daniel Dunbar <daniel@zuster.org> Add clang-cc support for -disable-llvm-optzns.
- Avoids running any LLVM optimizations, even at -O2, etc., while still keeping
any language changes these optimizations imply.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72742 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
ec0df5f4b74dd3fb37fdb574defc36f5397594b9 02-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4288: Make -dD (dump macros with preprocessed source) play nicely with
# line directives.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72724 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
3e753e279d2457cf16b45be88032c4a117f9adb3 02-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4288: Make -dD (dump macros with preprocessed source) play nicely with
# line directives.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72724 91177308-0d34-0410-b5e6-96231b3b80d8
rintPreprocessedOutput.cpp
33eb56a4ceb2c845ea8219ddc7020e94708ff93b 01-Jun-2009 Zhongxing Xu <xuzhongxing@gmail.com> Unify coding style.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72682 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
44dfc98b68a482ab92e691a9215167c82515f359 01-Jun-2009 Zhongxing Xu <xuzhongxing@gmail.com> Unify coding style.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72682 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
4569b7c20479815dcf64e2746fce1cb2919bea36 01-Jun-2009 Zhongxing Xu <xuzhongxing@gmail.com> Use a reference to modify the DeclIDs map.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72681 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
0e1081388a7f3ae1a2c59dcd03de898a3b391f8e 01-Jun-2009 Zhongxing Xu <xuzhongxing@gmail.com> Use a reference to modify the DeclIDs map.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72681 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriterDecl.cpp
61f1d9c2deacbf5088afd640b1accdc881333bfc 31-May-2009 Duncan Sands <baldrick@free.fr> Unbreak the clang build by applying the same temporary
workaround for machine code emitter changes as was used
in llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72657 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
813a2bb6f320611aaa447fbeada826bacecb93b5 31-May-2009 Duncan Sands <baldrick@free.fr> Unbreak the clang build by applying the same temporary
workaround for machine code emitter changes as was used
in llvm-gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72657 91177308-0d34-0410-b5e6-96231b3b80d8
ackend.cpp
1d768747ea6bfb2024a247821769c39362484d93 30-May-2009 Anders Carlsson <andersca@mac.com> ActOnReturnStmt should also take a FullExprArg.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72641 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
a0ab25d2808fe77ffff54f25a015893791dfd4b6 30-May-2009 Anders Carlsson <andersca@mac.com> ActOnReturnStmt should also take a FullExprArg.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72641 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
f9f05b833a9778ec1405b6c8c79ae9a2e2de65b0 30-May-2009 Anders Carlsson <andersca@mac.com> AddInitializerToDecl needs to take a full expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72640 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
f5dcd3885865c931fdbd16f36237af70743d53c6 30-May-2009 Anders Carlsson <andersca@mac.com> AddInitializerToDecl needs to take a full expression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72640 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
011a736c2535295b6d35275dc082504373d5f657 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Pass an ASTContext into Stmt::printPretty.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72611 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteBlocks.cpp
ewriteObjC.cpp
3a9eb44f2906e44ca29ae2d9df56fb9824ef7d05 30-May-2009 Eli Friedman <eli.friedman@gmail.com> Pass an ASTContext into Stmt::printPretty.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72611 91177308-0d34-0410-b5e6-96231b3b80d8
ewriteBlocks.cpp
ewriteObjC.cpp
996677cffa764e70e85f289a2edd88aa48b57c2d 30-May-2009 Douglas Gregor <doug.gregor@gmail.com> Refactor and clean up the AST printer, so that it uses a DeclVisitor,
walks through DeclContexts properly, and prints more of the
information available in the AST. The functionality is still available
via -ast-print, -ast-dump, etc., and also via the new member functions
Decl::dump() and Decl::print().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72597 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ocumentXML.cpp
4fe0c8e9c76b96e7aff21696a40dacc09d0237bc 30-May-2009 Douglas Gregor <dgregor@apple.com> Refactor and clean up the AST printer, so that it uses a DeclVisitor,
walks through DeclContexts properly, and prints more of the
information available in the AST. The functionality is still available
via -ast-print, -ast-dump, etc., and also via the new member functions
Decl::dump() and Decl::print().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72597 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ocumentXML.cpp
3bf3bbcb3cf79cc5bc065a011f5ae195667d3a29 29-May-2009 Douglas Gregor <doug.gregor@gmail.com> Create a new PrintingPolicy class, which we pass down through the AST
printing logic to help customize the output. For now, we use this
rather than a special flag to suppress the "struct" when printing
"struct X" and to print the Boolean type as "bool" in C++ but "_Bool"
in C.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72590 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ocumentXML.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
d249e1d1f1498b81314459ceda19d6ff25c278ad 29-May-2009 Douglas Gregor <dgregor@apple.com> Create a new PrintingPolicy class, which we pass down through the AST
printing logic to help customize the output. For now, we use this
rather than a special flag to suppress the "struct" when printing
"struct X" and to print the Boolean type as "bool" in C++ but "_Bool"
in C.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72590 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ocumentXML.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
4d57af2198b8cfe9505c43266383419c1303ecfd 29-May-2009 Eli Friedman <eli.friedman@gmail.com> If a declarator group declares a type, make sure to add that declaration
to the DeclGroup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72559 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
c1dc653b08226c1d8e1732f9d8b03b82869900bc 29-May-2009 Eli Friedman <eli.friedman@gmail.com> If a declarator group declares a type, make sure to add that declaration
to the DeclGroup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72559 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
71f06033638805d6179308b7d574241500d5056f 29-May-2009 Douglas Gregor <doug.gregor@gmail.com> When we parse a tag specifier, keep track of whether that tag
specifier resulted in the creation of a new TagDecl node, which
happens either when the tag specifier was a definition or when the tag
specifier was the first declaration of that tag type. This information
has several uses, the first of which is implemented in this commit:

1) In C++, one is not allowed to define tag types within a type
specifier (e.g., static_cast<struct S { int x; } *>(0) is
ill-formed) or within the result or parameter types of a
function. We now diagnose this.

2) We can extend DeclGroups to contain information about any tags
that are declared/defined within the declaration specifiers of a
variable, e.g.,

struct Point { int x, y, z; } p;

This will help improve AST printing and template instantiation,
among other things.

3) For C99, we can keep track of whether a tag type is defined
within the type of a parameter, to properly cope with cases like,
e.g.,

int bar(struct T2 { int x; } y) {
struct T2 z;
}

We can also do similar things wherever there is a type specifier,
e.g., to keep track of where the definition of S occurs in this
legal C99 code:

(struct S { int x, y; } *)0





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72555 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
402abb55fc2e0cdda5fb1ac90009b1f5f6774906 29-May-2009 Douglas Gregor <dgregor@apple.com> When we parse a tag specifier, keep track of whether that tag
specifier resulted in the creation of a new TagDecl node, which
happens either when the tag specifier was a definition or when the tag
specifier was the first declaration of that tag type. This information
has several uses, the first of which is implemented in this commit:

1) In C++, one is not allowed to define tag types within a type
specifier (e.g., static_cast<struct S { int x; } *>(0) is
ill-formed) or within the result or parameter types of a
function. We now diagnose this.

2) We can extend DeclGroups to contain information about any tags
that are declared/defined within the declaration specifiers of a
variable, e.g.,

struct Point { int x, y, z; } p;

This will help improve AST printing and template instantiation,
among other things.

3) For C99, we can keep track of whether a tag type is defined
within the type of a parameter, to properly cope with cases like,
e.g.,

int bar(struct T2 { int x; } y) {
struct T2 z;
}

We can also do similar things wherever there is a type specifier,
e.g., to keep track of where the definition of S occurs in this
legal C99 code:

(struct S { int x, y; } *)0





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72555 91177308-0d34-0410-b5e6-96231b3b80d8
rintParserCallbacks.cpp
2767d88f088ce07f489e6a64592950f9c0a91ebd 28-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Reintroduce the home for exception specs, and make Sema fill it. However, keep the spec out of the canonical type this time. Net effect is currently nothing, because the spec isn't checked anywhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72498 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
465226e23a3008bd68973513dda1f9e3cd27dbdd 28-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Reintroduce the home for exception specs, and make Sema fill it. However, keep the spec out of the canonical type this time. Net effect is currently nothing, because the spec isn't checked anywhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72498 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
8d71743661227dd7a938d217ae28c55f2b7c1abf 27-May-2009 Douglas Gregor <doug.gregor@gmail.com> Enumeration declarations that were instantiated from an enumeration
within a template now have a link back to the enumeration from which
they were instantiated. This means that we can now find the
instantiation of an anonymous enumeration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72482 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
8dbc3c64965f99e48830885835b7d2fc26ec3cf5 27-May-2009 Douglas Gregor <dgregor@apple.com> Enumeration declarations that were instantiated from an enumeration
within a template now have a link back to the enumeration from which
they were instantiated. This means that we can now find the
instantiation of an anonymous enumeration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72482 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
83418529244038b34ae9990b4cf6ac0a92f8c741 27-May-2009 Steve Naroff <snaroff@apple.com> Convert ObjC qualified type clients over to using iterators.

This allows me to remove some API that I don't want to carry over to ObjCObjectPointerType.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72475 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
446ee4eb4fc4c705a59365252df7a5c253daafa1 27-May-2009 Steve Naroff <snaroff@apple.com> Convert ObjC qualified type clients over to using iterators.

This allows me to remove some API that I don't want to carry over to ObjCObjectPointerType.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72475 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
4833ff0f4a21577e2b4d2c870adab24e5199ef7a 26-May-2009 Douglas Gregor <doug.gregor@gmail.com> When evaluating a VarDecl as a constant or determining whether it is
an integral constant expression, maintain a cache of the value and the
is-an-ICE flag within the VarDecl itself. This eliminates
exponential-time behavior of the Fibonacci template metaprogram.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72428 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
78d1583d0b36b7d6d8d10234cdc19ab94adf765a 26-May-2009 Douglas Gregor <dgregor@apple.com> When evaluating a VarDecl as a constant or determining whether it is
an integral constant expression, maintain a cache of the value and the
is-an-ICE flag within the VarDecl itself. This eliminates
exponential-time behavior of the Fibonacci template metaprogram.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72428 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
f15e7f3697d917cd75f48591b1faf2a07a2d6473 23-May-2009 Eli Friedman <eli.friedman@gmail.com> Add IEEE quad support to DefineFloatMacros.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72314 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
2665a75c16b93a4977225472aa0e7bcf32ddcec6 23-May-2009 Eli Friedman <eli.friedman@gmail.com> Add IEEE quad support to DefineFloatMacros.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72314 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
6ff34ef8ef1cf459efd71f87a37eead204d35206 23-May-2009 Eli Friedman <eli.friedman@gmail.com> PR4247: Widen the buffer slightly so it can hold all the definitions for
PPC double double.

(No testcase because no normal target uses the format at the moment.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72310 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
bf22be630e3d45c5c9c37bacb6325e16314431a6 23-May-2009 Eli Friedman <eli.friedman@gmail.com> PR4247: Widen the buffer slightly so it can hold all the definitions for
PPC double double.

(No testcase because no normal target uses the format at the moment.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72310 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
4e28419bb5e65771db0ea641cb3872033629522a 23-May-2009 Douglas Gregor <doug.gregor@gmail.com> Fix lots of PCH crashes caused by the new assertions in
llvm::SmallVector, using data() instead of &[0]. The PCH testsuite now
runs cleanly (again).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72292 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
75fdb2377604e53678102076991bea345ace4692 23-May-2009 Douglas Gregor <dgregor@apple.com> Fix lots of PCH crashes caused by the new assertions in
llvm::SmallVector, using data() instead of &[0]. The PCH testsuite now
runs cleanly (again).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72292 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
1b38e64a3d89e6d6230966b6ec760868d0d66525 23-May-2009 Ted Kremenek <kremenek@apple.com> Fix PCH crash caused by new assertions in llvm::SmallVector. Use
ProtoRefs.data() instead of &ProtoRefs[0] to access the raw buffer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72291 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
66ef111b167833c197cded0a1befab4a483d7d6d 23-May-2009 Ted Kremenek <kremenek@apple.com> Fix PCH crash caused by new assertions in llvm::SmallVector. Use
ProtoRefs.data() instead of &ProtoRefs[0] to access the raw buffer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72291 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
fefd5e89c5144fec7fdaff9c2c50f3237879261d 22-May-2009 Fariborz Jahanian <fjahanian@apple.com> This patch adds support for sender-aware dispatch in Objective-C for the GNU runtime, when
compiled with -fobjc-sender-dependent-dispatch. This is used in AOP, COP, implementing object
planes, and a few other things.
Patch by David Chisnall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72275 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
34e65770ad6142b033d6cec4f476ed20fb248bf3 22-May-2009 Fariborz Jahanian <fjahanian@apple.com> This patch adds support for sender-aware dispatch in Objective-C for the GNU runtime, when
compiled with -fobjc-sender-dependent-dispatch. This is used in AOP, COP, implementing object
planes, and a few other things.
Patch by David Chisnall.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72275 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
0183848ce45894254e1649431a8569b0a06c5cfb 22-May-2009 Zhongxing Xu <xuzhongxing@gmail.com> Pull EmitRecord() out of loop. It should be called only once.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72252 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
3d8216a9d325e095414302bda7a0af9549f9c40b 22-May-2009 Zhongxing Xu <xuzhongxing@gmail.com> Pull EmitRecord() out of loop. It should be called only once.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72252 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
4061e9857da99d584fbbae7a12eb26531bfb53f3 21-May-2009 Douglas Gregor <doug.gregor@gmail.com> Fix CMake build for AST XML dumper

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72228 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
100bb76aa972ec3baf7581f82680bef76f8e95c3 21-May-2009 Douglas Gregor <dgregor@apple.com> Fix CMake build for AST XML dumper

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72228 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
8987c0341afa395e09d29ae5439d2d814ca87121 21-May-2009 Douglas Gregor <doug.gregor@gmail.com> AST XML dump, from Olaf Krzikalla!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72224 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ocumentXML.cpp
tmtXML.cpp
ee75c05c1a0218369cac26ab1c847d9a04e4db88 21-May-2009 Douglas Gregor <dgregor@apple.com> AST XML dump, from Olaf Krzikalla!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72224 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ocumentXML.cpp
tmtXML.cpp
9e6bef4fb5efb19c7286fa24d8aedab9c3d625fc 21-May-2009 Jay Foad <jay.foad@gmail.com> Use v.data() instead of &v[0] when SmallVector v might be empty.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
rintPreprocessedOutput.cpp
beaaccd8e2a8748f77b66e2b330fb9136937e14c 21-May-2009 Jay Foad <jay.foad@gmail.com> Use v.data() instead of &v[0] when SmallVector v might be empty.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72210 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
rintPreprocessedOutput.cpp
306d7251d0fe8749f2a6a8cb67546830be520f0c 20-May-2009 Fariborz Jahanian <fjahanian@apple.com> implementation of format_arg for ObjC methods/functions.
Still more to do.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72173 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
5b160927672440076aa53c31d84149f70fd8d40e 20-May-2009 Fariborz Jahanian <fjahanian@apple.com> implementation of format_arg for ObjC methods/functions.
Still more to do.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72173 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
8c034071faaf00e2688154451c4ad0ba252dc18b 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Build fixes for r72135.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72136 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
4df2c42581280bb1a02a5d034dbf657514cc56e8 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Build fixes for r72135.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72136 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
7efefa5a73ae01e3abb862d530bc8d59f11dbb87 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Move AnalysisConsumer.h and Analyses.def from tools/clang-cc to
include/clang/Frontend, and move AnalysisConsumer.cpp from
tools/clang-cc to lib/Frontend.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72135 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
MakeLists.txt
0ec78fa2c92b714de41cc87cfa79e4877ab5479e 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Move AnalysisConsumer.h and Analyses.def from tools/clang-cc to
include/clang/Frontend, and move AnalysisConsumer.cpp from
tools/clang-cc to lib/Frontend.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72135 91177308-0d34-0410-b5e6-96231b3b80d8
nalysisConsumer.cpp
MakeLists.txt
b4fee44d26d0a4979464081ace20bc3d13db9f73 19-May-2009 Duncan Sands <baldrick@free.fr> Add missing include for stderr and fprintf, needed
when compiling with gcc-4.4.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72109 91177308-0d34-0410-b5e6-96231b3b80d8
iagChecker.cpp
825511013cad8d303bb583d46f55b32e74d5d5ad 19-May-2009 Duncan Sands <baldrick@free.fr> Add missing include for stderr and fprintf, needed
when compiling with gcc-4.4.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72109 91177308-0d34-0410-b5e6-96231b3b80d8
iagChecker.cpp
bd6cd5a87425acd9fc51439d5980e6ee3ddf95ac 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Fix a crash with -emit-html from stdin.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72104 91177308-0d34-0410-b5e6-96231b3b80d8
TMLPrint.cpp
24200917df7f66afed031e6f4f1672158d28d377 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Fix a crash with -emit-html from stdin.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72104 91177308-0d34-0410-b5e6-96231b3b80d8
TMLPrint.cpp
9b5cc704fd0e659797c3199876b7ff033da1b57b 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Clean up some unnecessary includes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72101 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
rintPreprocessedOutput.cpp
ewriteObjC.cpp
arnings.cpp
ac8d6298a8ae9276412d8c054957dfa65a69eb14 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Clean up some unnecessary includes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72101 91177308-0d34-0410-b5e6-96231b3b80d8
ependencyFile.cpp
rintPreprocessedOutput.cpp
ewriteObjC.cpp
arnings.cpp
5cfc7dee733e2b801180881deee0134972f03166 19-May-2009 Eli Friedman <eli.friedman@gmail.com> CMake updates for r72099; untested, so please tell me if there are any
issues.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72100 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ba60149b92571d92e41b477915e784191d35dfa8 19-May-2009 Eli Friedman <eli.friedman@gmail.com> CMake updates for r72099; untested, so please tell me if there are any
issues.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72100 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
7e1d637529268aecf06e0a5f270265b213cf1218 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Move clang-cc.h to lib/Frontend/Utils.h, and move the associated .cpp
files to lib/Frontend.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72099 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
ependencyFile.cpp
iagChecker.cpp
rintParserCallbacks.cpp
rintPreprocessedOutput.cpp
ewriteMacros.cpp
ewriteTest.cpp
arnings.cpp
b09f6e15c59b89d5820db8ef40598eb1d1323c1f 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Move clang-cc.h to lib/Frontend/Utils.h, and move the associated .cpp
files to lib/Frontend.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72099 91177308-0d34-0410-b5e6-96231b3b80d8
acheTokens.cpp
ependencyFile.cpp
iagChecker.cpp
rintParserCallbacks.cpp
rintPreprocessedOutput.cpp
ewriteMacros.cpp
ewriteTest.cpp
arnings.cpp
a1dcd7e011f6cb0d6d1cc2f8d4637d0bf963df29 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Attempted CMake build fixes for r72060; this is untested, so please tell
me if there are any issues.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72063 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
2aa39cd55cdb73f26fb9123e6b5a57e69fe43013 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Attempted CMake build fixes for r72060; this is untested, so please tell
me if there are any issues.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72063 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
22a4efdff773597c4dc620f7fa2e5b720c8840af 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Move ASTConsumers.h to include/clang/Frontend, and move the associated
.cpp files to lib/Frontend. (As proposed on cfe-dev.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72060 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ackend.cpp
eneratePCH.cpp
TMLPrint.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
39d7c4d2d980651c4263b67cf0ab61dec34cd76b 19-May-2009 Eli Friedman <eli.friedman@gmail.com> Move ASTConsumers.h to include/clang/Frontend, and move the associated
.cpp files to lib/Frontend. (As proposed on cfe-dev.)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72060 91177308-0d34-0410-b5e6-96231b3b80d8
STConsumers.cpp
ackend.cpp
eneratePCH.cpp
TMLPrint.cpp
ewriteBlocks.cpp
ewriteObjC.cpp
d670cfea0a7b6c71a1c13340fb75d7be678d0976 19-May-2009 Douglas Gregor <doug.gregor@gmail.com> "This patch fixes an obvious buffer overrun in
SelectInterestingSourceRegion()," from Jay Foad!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72049 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
1f0eb56d7cd1b24c21ac24112dfb41d3b29fb21c 19-May-2009 Douglas Gregor <dgregor@apple.com> "This patch fixes an obvious buffer overrun in
SelectInterestingSourceRegion()," from Jay Foad!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72049 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
e934dca8a88f890a67e926c94903fe3dd46bbd54 18-May-2009 Eli Friedman <eli.friedman@gmail.com> Remove unused parameter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71996 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
f086e3bef1d98d3fb6c17c8d6b62f3eedd9eb78c 18-May-2009 Eli Friedman <eli.friedman@gmail.com> Remove unused parameter.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71996 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
83df82a4b8272c846b2b24350784793b57f8f561 16-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for IndirectGotoStmt. Now my life is complete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71917 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
5f1b9e689fa5c101512aef99225f2afea1673449 16-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for IndirectGotoStmt. Now my life is complete.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71917 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
34712db615418b178dff09ba45112bc44c4e1993 16-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for switch statements


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71916 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
dbb26db1d426fb6caaaf1b4fa47b46d1947c12c9 16-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for switch statements


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71916 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
1401330b1c620dd8e14af4e2c1b1589cf68dc2c3 16-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for "for" loops

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71901 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
5831c6a1efc47e6a19d82fe3dd25b5b8fef6979d 16-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for "for" loops

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71901 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
ef482764777252110a1095e7f5b7a300ccb26d4e 15-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for do-while statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71899 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
9f3ca2a7747bd47f14d7693f333103fac29a24d2 15-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for do-while statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71899 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
30033494eab58aefa22eb275c00ef458b8e6a538 15-May-2009 Douglas Gregor <doug.gregor@gmail.com> Template instantiation for "if" statements. Also:

- Skip semantic analysis of the "if" condition if it is type-dependent.
- Added the location of the "else" keyword into IfStmt, so that we can
provide it for type-checking after template instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71875 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
d06f6ca61062f85926eb9d409eb3d4f8afcf93c7 15-May-2009 Douglas Gregor <dgregor@apple.com> Template instantiation for "if" statements. Also:

- Skip semantic analysis of the "if" condition if it is type-dependent.
- Added the location of the "else" keyword into IfStmt, so that we can
provide it for type-checking after template instantiation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71875 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderStmt.cpp
CHWriterStmt.cpp
f1d5a3449183e6ac6ce4a699be5091cb4083bab5 15-May-2009 Douglas Gregor <doug.gregor@gmail.com> When word-wrapping, be more defensive about a ridiculously small number of columns. Fixes <rdar://problem/6892178>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71870 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
c95bd4de800dfc643f0dab0122757f9ca9723fe9 15-May-2009 Douglas Gregor <dgregor@apple.com> When word-wrapping, be more defensive about a ridiculously small number of columns. Fixes <rdar://problem/6892178>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71870 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
4bbe30c0ffd1fe7866abf6c8e39d12b982c96066 15-May-2009 Chris Lattner <sabre@nondot.org> Fix processing of -Ufoo to not inject "#undef foo 1" into the predefines
buffer. This caused exciting nonsense like this:

$ clang t.c -fsyntax-only -UMACRO
In file included from <built-in>:104:
<command line>:1:14: warning: extra tokens at end of #undef directive [-Wextra-tokens]
#undef MACRO 1
^
//
1 diagnostic generated.

rdar://6891800


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71860 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
dcdecf4a777e503b24de6b15a054d580b585c06c 15-May-2009 Chris Lattner <sabre@nondot.org> Fix processing of -Ufoo to not inject "#undef foo 1" into the predefines
buffer. This caused exciting nonsense like this:

$ clang t.c -fsyntax-only -UMACRO
In file included from <built-in>:104:
<command line>:1:14: warning: extra tokens at end of #undef directive [-Wextra-tokens]
#undef MACRO 1
^
//
1 diagnostic generated.

rdar://6891800


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71860 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
f98556020bc7f248ac17c9804e4e5af1a636f514 15-May-2009 Anders Carlsson <andersca@mac.com> Check that the function being overridden is virtual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71802 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
77b7f1d4fb782c9152f91b76f9f8b1d1af21bd35 15-May-2009 Anders Carlsson <andersca@mac.com> Check that the function being overridden is virtual.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71802 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
d9d6d50992923eeb0c0ac0a2ec2d227867d35787 14-May-2009 Anders Carlsson <andersca@mac.com> Improvements to the FunctionDecl getters/setters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71800 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
a75e8534f2b7c2480c48f31f301bd00b241c5499 14-May-2009 Anders Carlsson <andersca@mac.com> Improvements to the FunctionDecl getters/setters.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71800 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
260059cab5bab4960880bc9155b32618201d7994 14-May-2009 Douglas Gregor <doug.gregor@gmail.com> Link FunctionDecls instantiated from the member functions of a class
template to the FunctionDecls from which they were instantiated. This
is a necessary first step to support instantiation of the definitions
of such functions, but by itself does essentially nothing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71792 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
1eee0e753fb390b04848846e837714ec774b7bfd 14-May-2009 Douglas Gregor <dgregor@apple.com> Link FunctionDecls instantiated from the member functions of a class
template to the FunctionDecls from which they were instantiated. This
is a necessary first step to support instantiation of the definitions
of such functions, but by itself does essentially nothing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71792 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriterDecl.cpp
f23101418d1c1844893aa52420f5ba19742aaf9f 13-May-2009 Anders Carlsson <andersca@mac.com> Disable access control by default. It can be enabled with the -faccess-control option. When we have better support for it, we can enable it by default again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71706 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
a33d9b4ebf732a5da6d56fd7319ff6c020789b1c 13-May-2009 Anders Carlsson <andersca@mac.com> Disable access control by default. It can be enabled with the -faccess-control option. When we have better support for it, we can enable it by default again.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71706 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
180f341a528dd5608704b40de48620720e6a9dc7 13-May-2009 Fariborz Jahanian <fjahanian@apple.com> Some early declarations to support sentinel attribute on
message dispatches (and function calls later). No change in
functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71683 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
5b53005fb9ef24b8bdfe995f29b4662de468128a 13-May-2009 Fariborz Jahanian <fjahanian@apple.com> Some early declarations to support sentinel attribute on
message dispatches (and function calls later). No change in
functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71683 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
eccf0d1b36ba01b1465076bad8ed54d859ffa0e3 12-May-2009 Douglas Gregor <doug.gregor@gmail.com> Make precompiled headers work with -E. When we're only preprocessing
(with -E), we turn the PCH include into an implicit include of the
file from which the PCH file was generated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71534 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
b64c19365deab788753d29c9bc881253c3f16f37 12-May-2009 Douglas Gregor <dgregor@apple.com> Make precompiled headers work with -E. When we're only preprocessing
(with -E), we turn the PCH include into an implicit include of the
file from which the PCH file was generated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71534 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
5d0ead717d57405b4a3b34a55b77579ea8b2774e 10-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement C++0x nullptr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71405 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
6e8ed16ffef02b82995a90bdcf10ffff7d63839a 10-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Implement C++0x nullptr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71405 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
13ddd1af28133402e076d9d446f4f21152fe92fa 09-May-2009 Ted Kremenek <kremenek@apple.com> Add back Parse/Sema support for attributes cf_returns_retained and
ns_returns_retained, but do not include the other ownership attributes
we previously had.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71308 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
b71368d28532908ae1c2dc23f91761781205b3d0 09-May-2009 Ted Kremenek <kremenek@apple.com> Add back Parse/Sema support for attributes cf_returns_retained and
ns_returns_retained, but do not include the other ownership attributes
we previously had.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71308 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
f084b0ae1f63ac979e9472bf1e320e27b813e4f4 08-May-2009 Ted Kremenek <kremenek@apple.com> Remove experimental ownership attributes from Clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71216 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
008fc73ac971e5d30c8710e37e1f5f8a843052f1 08-May-2009 Ted Kremenek <kremenek@apple.com> Remove experimental ownership attributes from Clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71216 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
ba9a371cb3438f165ff6191c42732f699968eea2 07-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Back out r70506 (exception spec in AST) again. We won't have exception specs until we've had a lot more discussion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71125 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
bfa2fcba545fb270f31205d616846c2bfaf4e47e 07-May-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Back out r70506 (exception spec in AST) again. We won't have exception specs until we've had a lot more discussion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71125 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
0c0b436adcd305637545448d4fb383edf8185966 06-May-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate extra vertical space in Clang diagnostics

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71066 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
2cc2b9ca22d21cd855f06f545b8720f6a7a965b4 06-May-2009 Douglas Gregor <dgregor@apple.com> Eliminate extra vertical space in Clang diagnostics

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71066 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
3669cca6e6e7dfa6c68f475520f8bd5a995181ea 06-May-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6849429 - -Wunused-value with deeply nested macro expansion generates untraceable warnings

The "instantiated from" messages coming from the caret diagnostics system are
basically walking the macro expansion tree, emitting each level as it goes. However, it was
skipping certain leaves in the tree by skipping up the entire instantiation arm every time
it went up one spelling arm. This caused it to miss some things. For example, in this
testcase:

#define M1(x) x
#define M2 1;

void foo() {
M1(M2)
}

we now print:

/Users/sabre/Desktop/clang-unused-value-macro.c:6:2: warning: expression result unused

M1(M2)
^~~~~~
/Users/sabre/Desktop/clang-unused-value-macro.c:6:5: note: instantiated from:

M1(M2)
^~
/Users/sabre/Desktop/clang-unused-value-macro.c:3:12: note: instantiated from:

#define M2 1;
^

Previously we didn't print the last line, so we never emitted the caret pointing to the 1!

Incidentally, the spaces between the lines is really noisy, I think we should reconsider
this heuristic (which adds them when the printed code starts too close to the start of the
line).

The regression test can't use -verify, because -verify doesn't catch notes for macro
instantiation history.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71025 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
037fb7f3691966aa66f2b878a149fba57b947355 06-May-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6849429 - -Wunused-value with deeply nested macro expansion generates untraceable warnings

The "instantiated from" messages coming from the caret diagnostics system are
basically walking the macro expansion tree, emitting each level as it goes. However, it was
skipping certain leaves in the tree by skipping up the entire instantiation arm every time
it went up one spelling arm. This caused it to miss some things. For example, in this
testcase:

#define M1(x) x
#define M2 1;

void foo() {
M1(M2)
}

we now print:

/Users/sabre/Desktop/clang-unused-value-macro.c:6:2: warning: expression result unused

M1(M2)
^~~~~~
/Users/sabre/Desktop/clang-unused-value-macro.c:6:5: note: instantiated from:

M1(M2)
^~
/Users/sabre/Desktop/clang-unused-value-macro.c:3:12: note: instantiated from:

#define M2 1;
^

Previously we didn't print the last line, so we never emitted the caret pointing to the 1!

Incidentally, the spaces between the lines is really noisy, I think we should reconsider
this heuristic (which adds them when the printed code starts too close to the start of the
line).

The regression test can't use -verify, because -verify doesn't catch notes for macro
instantiation history.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@71025 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
03d242e18e54faad6da12eab590ddd5e261d077a 05-May-2009 Ted Kremenek <kremenek@apple.com> Implement attribute 'ns_autorelease'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70990 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
69aa08072decc20094bd1f75f4f9842e9bd357ad 05-May-2009 Ted Kremenek <kremenek@apple.com> Implement attribute 'ns_autorelease'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70990 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
fed3c098f6345dfd908c0c27583db7140996ad8b 05-May-2009 Ted Kremenek <kremenek@apple.com> Implement attribute 'cf_returns_owned' (mirrors 'ns_returns_owned').


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70952 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
e351aa10dab6eb8b9b502166c7035dc7b0e723e0 05-May-2009 Ted Kremenek <kremenek@apple.com> Implement attribute 'cf_returns_owned' (mirrors 'ns_returns_owned').


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70952 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
a8d6fd978099620a754b62c590c39ca0dc0068a7 05-May-2009 Ted Kremenek <kremenek@apple.com> Remove experimental attribute 'ns_ownership_make_collectable.'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70940 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
d99b345a1ae77c746ef025e6a050908d69e2c543 05-May-2009 Ted Kremenek <kremenek@apple.com> Remove experimental attribute 'ns_ownership_make_collectable.'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70940 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
028e811124293fa0c0f670ce16d102bbf76cf1c9 04-May-2009 Ted Kremenek <kremenek@apple.com> Rename attributes 'objc_ownership...' to 'ns_ownership...'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70897 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
75494ffb4ed3964fa22fb9ab15fddecedbc9fe10 04-May-2009 Ted Kremenek <kremenek@apple.com> Rename attributes 'objc_ownership...' to 'ns_ownership...'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70897 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
03d27943db8899157cd8aa4fcfb56abcba229435 04-May-2009 Ted Kremenek <kremenek@apple.com> Rename attributes:
'objc_ownership_cfretain' -> 'cf_ownership_retain'
'objc_ownership_cfrelease' -> 'cf_ownership_release'

Motivation: Core Foundation objects can be used in isolation from Objective-C,
and this forces users to reason about the separate semantics of CF objects. More
Sema support pending.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70884 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
31c215e62031b14e85c2f695c261817c044b465b 04-May-2009 Ted Kremenek <kremenek@apple.com> Rename attributes:
'objc_ownership_cfretain' -> 'cf_ownership_retain'
'objc_ownership_cfrelease' -> 'cf_ownership_release'

Motivation: Core Foundation objects can be used in isolation from Objective-C,
and this forces users to reason about the separate semantics of CF objects. More
Sema support pending.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70884 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
394b622390b3171c0e5f576686847af980f81178 04-May-2009 Douglas Gregor <doug.gregor@gmail.com> Simplify the interesting-region code by assimmilating blocks of non-whitespace text with each expansion step. It's easier and seems to have better results.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70833 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
2fb3ea3ea447fb643173b098fa05a192441b089e 04-May-2009 Douglas Gregor <dgregor@apple.com> Simplify the interesting-region code by assimmilating blocks of non-whitespace text with each expansion step. It's easier and seems to have better results.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70833 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
4762943a09bbebaaef03d790c1f20a7574afa4b3 04-May-2009 Douglas Gregor <doug.gregor@gmail.com> Tweak the extraction of the "interesting" part of a source range in two ways:

1) First of all, we treat _ as part of an identifier and not as
punctuation (oops).
2) Second of all, always make sure that the token that the ^ is
pointing at is fully within the "interesting" part of the range.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70831 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
cfe1f9d86d4d3b2538ed41a9f5ff313dcd20c6a9 04-May-2009 Douglas Gregor <dgregor@apple.com> Tweak the extraction of the "interesting" part of a source range in two ways:

1) First of all, we treat _ as part of an identifier and not as
punctuation (oops).
2) Second of all, always make sure that the token that the ^ is
pointing at is fully within the "interesting" part of the range.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70831 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
9cc1d78616eaa211ec1b50b2f6606d42a638bc3b 04-May-2009 Daniel Dunbar <daniel@zuster.org> Fix an infinite loop in diagnostic printing.
- The diagnostic is still poor, however. Doug, can you investigate?

- Improved the test case to not depend on the file name, now it can
be extended to actually check the formatting of the diagnostics
(I'm hoping grep -A is portable here).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70807 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
1ef29d217ef9084bca57fe31e0d1541efa6d120a 04-May-2009 Daniel Dunbar <daniel@zuster.org> Fix an infinite loop in diagnostic printing.
- The diagnostic is still poor, however. Doug, can you investigate?

- Improved the test case to not depend on the file name, now it can
be extended to actually check the formatting of the diagnostics
(I'm hoping grep -A is portable here).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70807 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
c271ecb2f129206f9f33a6484256510e47a63ea5 03-May-2009 Douglas Gregor <doug.gregor@gmail.com> Fix crash in source-line truncation code for diagnostic
printing. Also, when we only need to truncate the line at the end,
make sure there is room for the ellipsis.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70781 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
2167de4c4934d6beb3af3a4d74ee160def67f74a 03-May-2009 Douglas Gregor <dgregor@apple.com> Fix crash in source-line truncation code for diagnostic
printing. Also, when we only need to truncate the line at the end,
make sure there is room for the ellipsis.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70781 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
9499a5def55be9c41c13d6d78f59b45ca8820351 03-May-2009 Chris Lattner <sabre@nondot.org> temporary hack to work around PR4128


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70681 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
cb6929bf439bbb5bc4604ac18893c790be63f95f 03-May-2009 Chris Lattner <sabre@nondot.org> temporary hack to work around PR4128


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70681 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
b5579aa855fa210a8c43f74319c4dc3d09304d14 03-May-2009 Douglas Gregor <doug.gregor@gmail.com> When a fix-it hint would span multiple lines, don't print it; half a
fix-it hint is much worse than no fix-it hint. (Fixes PR4084).

When we need to truncate a source line to fix in the terminal, make
sure to take the width of the fix-it information into account, too.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70656 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
844da34736c0439ae50017826a7393406e75acd8 03-May-2009 Douglas Gregor <dgregor@apple.com> When a fix-it hint would span multiple lines, don't print it; half a
fix-it hint is much worse than no fix-it hint. (Fixes PR4084).

When we need to truncate a source line to fix in the terminal, make
sure to take the width of the fix-it information into account, too.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70656 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
99bb29258a11abb5fe4957d540ad54a043f43940 03-May-2009 Douglas Gregor <doug.gregor@gmail.com> When we truncate a source line to fit it within the terminal width,
show an ellipsis where we have removed text. An example:

/Users/dgregor/Projects/llvm/tools/clang/test/Misc/message-length.c:18:120:
warning:
comparison of distinct pointer types ('int *' and 'float *')
...a_func_to_call(ip == FloatPointer, ip[ALongIndexName], ...
~~ ^ ~~~~~~~~~~~~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70655 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
7d101f6fd7f311b0a7fdd83a50f8668bd8a659cd 03-May-2009 Douglas Gregor <dgregor@apple.com> When we truncate a source line to fit it within the terminal width,
show an ellipsis where we have removed text. An example:

/Users/dgregor/Projects/llvm/tools/clang/test/Misc/message-length.c:18:120:
warning:
comparison of distinct pointer types ('int *' and 'float *')
...a_func_to_call(ip == FloatPointer, ip[ALongIndexName], ...
~~ ^ ~~~~~~~~~~~~



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70655 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
3dd11e8624b74e300b58e9cafaa52b7a090704ce 03-May-2009 Douglas Gregor <doug.gregor@gmail.com> Respect the COLUMNS environment variable for word-wrapping (so we get
word-wrapping by default in Emacs; yay!). Thanks, Daniel.

Use LLVM's System layer rather than calling isatty() directly.

Fix a thinko in printing the indentation string that was causing some
weird output.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70654 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
44cf08ecf648210347191942b1664e36d46290c5 03-May-2009 Douglas Gregor <dgregor@apple.com> Respect the COLUMNS environment variable for word-wrapping (so we get
word-wrapping by default in Emacs; yay!). Thanks, Daniel.

Use LLVM's System layer rather than calling isatty() directly.

Fix a thinko in printing the indentation string that was causing some
weird output.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70654 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
f2ab4fbb4ad8b1c6c2ad21a865c2605a86d4ff2a 02-May-2009 Douglas Gregor <doug.gregor@gmail.com> When printing a source line as part of a diagnostic, the source line
might be wider than we're supposed to print. In this case, we try to
select the "important" subregion of the source line, which contains
everything that we want to show (e.g., with underlining and the caret
itself) and tries to also contain some of the context.

From the fantastically long line in the test case, we get an error
message that slices down to this:

message-length.c:18:120: warning: comparison of distinct pointer types
('int *' and 'float *')
a_func_to_call(ip == FloatPointer, ip[ALongIndexName],
~~ ^ ~~~~~~~~~~~~

There are a bunch of gee-it-sounds-good heuristics in here, which seem
to do well on the various simple tests I've thrown at it. However,
we're going to need to look at a bunch more diagnostics to tweak these
heuristics.

This is the second part of <rdar://problem/6711348>. Almost there!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70597 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
47f717788082cdc38b899faf18acc8d1cda1b9c5 02-May-2009 Douglas Gregor <dgregor@apple.com> When printing a source line as part of a diagnostic, the source line
might be wider than we're supposed to print. In this case, we try to
select the "important" subregion of the source line, which contains
everything that we want to show (e.g., with underlining and the caret
itself) and tries to also contain some of the context.

From the fantastically long line in the test case, we get an error
message that slices down to this:

message-length.c:18:120: warning: comparison of distinct pointer types
('int *' and 'float *')
a_func_to_call(ip == FloatPointer, ip[ALongIndexName],
~~ ^ ~~~~~~~~~~~~

There are a bunch of gee-it-sounds-good heuristics in here, which seem
to do well on the various simple tests I've thrown at it. However,
we're going to need to look at a bunch more diagnostics to tweak these
heuristics.

This is the second part of <rdar://problem/6711348>. Almost there!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70597 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
a4eb3e7ad4c72d6783145f023a2cdea9b9421a18 01-May-2009 Douglas Gregor <doug.gregor@gmail.com> Implement -fmessage-length=N, which word-wraps diagnostics to N columns.

Also, put a line of whitespace between the diagnostic and the source
code/caret line when the start of the actual source code text lines up
(or nearly lines up) with the most recent line of the diagnostic. For
example, here it's okay for the last line of the diagnostic to be
(vertically) next to the source line, because there is horizontal
whitespace to separate them:

decl-expr-ambiguity.cpp:12:16: error: function-style cast to a builtin
type can only take one argument
typeof(int)(a,5)<<a;

However, here is a case where we need the vertical separation (since
there is no horizontal separation):

message-length.c:10:46: warning: incompatible pointer types initializing 'void
(int, float, char, float)', expected 'int (*)(int, float, short,
float)'

int (*fp1)(int, float, short, float) = f;

This is part one of <rdar://problem/6711348>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70578 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
fffd93f38340d4d2ca7ee78a8c91c890b2ff3fa0 01-May-2009 Douglas Gregor <dgregor@apple.com> Implement -fmessage-length=N, which word-wraps diagnostics to N columns.

Also, put a line of whitespace between the diagnostic and the source
code/caret line when the start of the actual source code text lines up
(or nearly lines up) with the most recent line of the diagnostic. For
example, here it's okay for the last line of the diagnostic to be
(vertically) next to the source line, because there is horizontal
whitespace to separate them:

decl-expr-ambiguity.cpp:12:16: error: function-style cast to a builtin
type can only take one argument
typeof(int)(a,5)<<a;

However, here is a case where we need the vertical separation (since
there is no horizontal separation):

message-length.c:10:46: warning: incompatible pointer types initializing 'void
(int, float, char, float)', expected 'int (*)(int, float, short,
float)'

int (*fp1)(int, float, short, float) = f;

This is part one of <rdar://problem/6711348>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70578 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
74942cde3da623741b60c2524fc44ef0cb35724b 30-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make a home for exception specs in the AST. Now Sema can hook them up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70506 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
7b9a2ee5a4393001bdec7dec841eb7c811da492c 30-Apr-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make a home for exception specs in the AST. Now Sema can hook them up.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70506 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
6cc7e415d42291bf01e0295d9d6344e106613c48 30-Apr-2009 Chris Lattner <sabre@nondot.org> initial support for __[u]int128_t, which should be basically
compatible with VC++ and GCC. The codegen/mangling angle hasn't
been fully ironed out yet. Note that we accept int128_t even in
32-bit mode, unlike gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70464 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2df9ced9fd1e8c7d7b38443db07e0e811de22571 30-Apr-2009 Chris Lattner <sabre@nondot.org> initial support for __[u]int128_t, which should be basically
compatible with VC++ and GCC. The codegen/mangling angle hasn't
been fully ironed out yet. Note that we accept int128_t even in
32-bit mode, unlike gcc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70464 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
b8d8c4b797ae9dbc67c5af93b81aab696d4edfff 29-Apr-2009 Ted Kremenek <kremenek@apple.com> BugReporter/PathDiagnostics:
- Add an (optional) short description for BugReports for clients that want
to distinguish between long and short descriptions for bugs
- Make the bug report for VLA less obscene for Plist diagnostics by using
the short description


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70415 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
d49967f8764135ae65658e354b6d38e3637c9de3 29-Apr-2009 Ted Kremenek <kremenek@apple.com> BugReporter/PathDiagnostics:
- Add an (optional) short description for BugReports for clients that want
to distinguish between long and short descriptions for bugs
- Make the bug report for VLA less obscene for Plist diagnostics by using
the short description


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70415 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
404ba8e4265c9a41834c007c1460f9133d074109 29-Apr-2009 Chris Lattner <sabre@nondot.org> In -fdiagnostics-print-source-range-info mode, print a space before the
lines that clang extracts from the source code so that machine parsing can
easily ignore them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70337 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
770dbf04b4e56a2aa0901b7515318cf9e59adf2a 29-Apr-2009 Chris Lattner <sabre@nondot.org> In -fdiagnostics-print-source-range-info mode, print a space before the
lines that clang extracts from the source code so that machine parsing can
easily ignore them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70337 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
ff8648dfaac35f96f8b59bf84ac2cd60cbe9d995 29-Apr-2009 Ted Kremenek <kremenek@apple.com> Implement ownership attribute 'objc_ownership_make_collectable'. This allows one
to add 'CFMakeCollectable' semantics to a method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70336 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
bf20dbdec6ab7d02e96fac937ad57b2b95c0675c 29-Apr-2009 Ted Kremenek <kremenek@apple.com> Implement ownership attribute 'objc_ownership_make_collectable'. This allows one
to add 'CFMakeCollectable' semantics to a method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70336 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
9ea9b16b3a393848e22a5618e6ce5e09335ec2ec 29-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Make all PCH-incompatibility warnings into errors, and abort
compilation if the user requested a PCH file but no such PCH file
exists.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70332 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
1ab86ac92282a92ab847e2ea36c124152c52911d 29-Apr-2009 Douglas Gregor <dgregor@apple.com> Make all PCH-incompatibility warnings into errors, and abort
compilation if the user requested a PCH file but no such PCH file
exists.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70332 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
eae710dbfdd50a4e38a16abab06cebaec36f733a 28-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Make the PCH reader use the diagnostics system for its complaints.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70330 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderStmt.cpp
a02b147b66ff9f1a22bac4ec7fd1b0d54a40e5bf 28-Apr-2009 Douglas Gregor <dgregor@apple.com> Make the PCH reader use the diagnostics system for its complaints.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70330 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderStmt.cpp
67d911724155fa3891f413f53e96b90da5367324 28-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Optimize IdentifierInfo storage within the precompiled header. We've
now gotten back about 180k of the 500k we lost.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70326 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
5998da5c29dae3f654cb65738ff237203e2222c8 28-Apr-2009 Douglas Gregor <dgregor@apple.com> Optimize IdentifierInfo storage within the precompiled header. We've
now gotten back about 180k of the 500k we lost.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70326 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2c09dad5d0b90bdf187a97f47a0e69642128c64d 28-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Implement a minor space optimization for the PCH identifier table,
which eliminates the storage for IdentifierInfo in the "uninteresting
identifier" cases. Sadly, this only brought back 7k of the 500k we
lost :(


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70325 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
a92193ebd9840e5ce4de1b09e49f1b024c0f5c2f 28-Apr-2009 Douglas Gregor <dgregor@apple.com> Implement a minor space optimization for the PCH identifier table,
which eliminates the storage for IdentifierInfo in the "uninteresting
identifier" cases. Sadly, this only brought back 7k of the 500k we
lost :(


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70325 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
1c6d8cc2aa707c53740b36f68e6905ec27d998d1 28-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Replace a lame fprintf with a slightly-less lame diagnostic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70322 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
af1795be18cbb522a8b45ca3664457f281ce348d 28-Apr-2009 Douglas Gregor <dgregor@apple.com> Replace a lame fprintf with a slightly-less lame diagnostic

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70322 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
9113781d8b352804637adcee35f508728db3000e 28-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Implement checking for macro definitions that occur on the command
line when using a PCH that were not provided when building the PCH
file. If those names were used as identifiers somewhere in the PCH
file, reject the PCH file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70321 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
92b059ea944adaa3e00bb53d63a09868a4752547 28-Apr-2009 Douglas Gregor <dgregor@apple.com> Implement checking for macro definitions that occur on the command
line when using a PCH that were not provided when building the PCH
file. If those names were used as identifiers somewhere in the PCH
file, reject the PCH file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70321 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
6861977b27bd8e368e892fac2aabee984d908111 28-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Revert r70075 and r70078, which reorganized the PCH on-disk hash table
for identifiers to separate "interesting" from "uninteresting"
identifiers. However, to cope with compiler invocations where the
predefines buffers mismatch, we need to be able to search the complete
identifier table. Cocoa.h.pch is now about 500k larger that it used to
be :(


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70320 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
02fc75169afe785c114e795ec4d24edfb4073c42 28-Apr-2009 Douglas Gregor <dgregor@apple.com> Revert r70075 and r70078, which reorganized the PCH on-disk hash table
for identifiers to separate "interesting" from "uninteresting"
identifiers. However, to cope with compiler invocations where the
predefines buffers mismatch, we need to be able to search the complete
identifier table. Cocoa.h.pch is now about 500k larger that it used to
be :(


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70320 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
32de63123fdd5d3a0bb1a552d8830eafb6150d4c 28-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Allow some differences between the predefines buffer used to build a
PCH file and the predefines buffer used when including the PCH
file. We (explicitly) detect conflicting macro definitions (rejecting
the PCH file) and about missing macro definitions (they'll be
automatically pulled from the PCH file anyway).

We're missing some checking to make sure that new macro definitions
won't have any impact on the PCH file itself (e.g., #define'ing an
identifier that the PCH file used).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70316 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
e721f95069d42b899c20c1caabdc6184dd42b820 28-Apr-2009 Douglas Gregor <dgregor@apple.com> Allow some differences between the predefines buffer used to build a
PCH file and the predefines buffer used when including the PCH
file. We (explicitly) detect conflicting macro definitions (rejecting
the PCH file) and about missing macro definitions (they'll be
automatically pulled from the PCH file anyway).

We're missing some checking to make sure that new macro definitions
won't have any impact on the PCH file itself (e.g., #define'ing an
identifier that the PCH file used).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70316 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
26583b607ad9493cb75d245e9979063505a30430 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Remove unused LangOptions NoExtensions and Boolean.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70282 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
c71133f0cf820f0708b9dd141563b910530498c1 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Remove unused LangOptions NoExtensions and Boolean.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70282 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
b706474bce78d4c9349eca8699401495f3425fe9 28-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Add a header containing the Clang version; make the driver use this
Clang version value rather than hard-coding "1.0".

Add PCH and Clang version information into the PCH file. Reject PCH
files with the wrong version information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70264 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ab41e63821dc60ad144d0684df8d79a9eef86b75 28-Apr-2009 Douglas Gregor <dgregor@apple.com> Add a header containing the Clang version; make the driver use this
Clang version value rather than hard-coding "1.0".

Add PCH and Clang version information into the PCH file. Reject PCH
files with the wrong version information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70264 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ea436b8fcbc95d326ad4b6212ff291c2c8ca4c17 28-Apr-2009 Chris Lattner <sabre@nondot.org> fix test/PCH/method_pool.m


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70263 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
6bf690fd464b76d35cdf1ac8e4ed693585b36a4d 28-Apr-2009 Chris Lattner <sabre@nondot.org> fix test/PCH/method_pool.m


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70263 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
772a7c184cc7a808c18aa562faeb3b9a3fa2c5ed 28-Apr-2009 Chris Lattner <sabre@nondot.org> -E, -Eonly and -parse-noop now work with PCH!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70259 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
cc7dea8f32a46dac852178df1557fc97e799e3d1 28-Apr-2009 Chris Lattner <sabre@nondot.org> -E, -Eonly and -parse-noop now work with PCH!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70259 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
270d29a011a26eb1470fe0124007cbc9e173692c 27-Apr-2009 Chris Lattner <sabre@nondot.org> Teach PCH that ASTContext is optional. Move -parse-noop and -Eonly (so far)
processing to after PCH is loaded. -Eonly and -parse-noop are close to working
with PCH now but are not quite there yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70257 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
d1d64a027554b635d644957ef071ec04ea1f7063 27-Apr-2009 Chris Lattner <sabre@nondot.org> Teach PCH that ASTContext is optional. Move -parse-noop and -Eonly (so far)
processing to after PCH is loaded. -Eonly and -parse-noop are close to working
with PCH now but are not quite there yet.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70257 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
578851959507ebbfcbfc14a795f0ec9bda8a4462 27-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Be more careful in our teardown of the PCHReader after deciding to
ignore a PCH file.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70251 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
2bf1eb09f06a9792fa94dff0703f2aa2c4bace2a 27-Apr-2009 Douglas Gregor <dgregor@apple.com> Be more careful in our teardown of the PCHReader after deciding to
ignore a PCH file.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70251 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
b36b20d3f53ca48e995a8810dfcc0c6f205699ea 27-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Add Sema::ExtVectorDecls and Sema::ObjCCategoryImpls to the PCH file. Since these vectors are very, very rarely used and, when used in headers, and even when used are relatively small, we load them eagerly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70240 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
b81c17092039f39be60e9656a37cffbdf2e2c783 27-Apr-2009 Douglas Gregor <dgregor@apple.com> Add Sema::ExtVectorDecls and Sema::ObjCCategoryImpls to the PCH file. Since these vectors are very, very rarely used and, when used in headers, and even when used are relatively small, we load them eagerly.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70240 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
203169f80fe7bb3fbc52921019983206230afc01 27-Apr-2009 Ted Kremenek <kremenek@apple.com> Add two new checker-specific attributes: 'objc_ownership_release' and
'objc_ownership_cfrelease'. These are the 'release' equivalents of
'objc_ownership_retain' and 'objc_ownership_cfretain' respectively.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70235 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
c6a59e4bf225c7f8152faca72897321f0f6cabd1 27-Apr-2009 Ted Kremenek <kremenek@apple.com> Add two new checker-specific attributes: 'objc_ownership_release' and
'objc_ownership_cfrelease'. These are the 'release' equivalents of
'objc_ownership_retain' and 'objc_ownership_cfretain' respectively.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70235 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
eb559a6e246b7ac94883ae2dfed82e323e065ecd 27-Apr-2009 Chris Lattner <sabre@nondot.org> make these be unsigned now that they are eagerly created.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70229 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
828e18cd80319c67b9b9776d1ed5411161d9f0bf 27-Apr-2009 Chris Lattner <sabre@nondot.org> make these be unsigned now that they are eagerly created.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70229 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
93307da4b35dc38cdde60a3cffdb326a3f78fffd 27-Apr-2009 Chris Lattner <sabre@nondot.org> shrink SOURCE_LOCATION_OFFSETS to use 4-byte entries instead of 8-byte
entries, shaving 100K off the PCH file for cocoa.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70228 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
090d9b53e32bb30d9e74de895bb59b409bd49e00 27-Apr-2009 Chris Lattner <sabre@nondot.org> shrink SOURCE_LOCATION_OFFSETS to use 4-byte entries instead of 8-byte
entries, shaving 100K off the PCH file for cocoa.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70228 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
6cc5d1953169b8efbb5a86fff4d2b18de3b77579 27-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Implement caching of stat() calls for precompiled headers, which is
essentially the same thing we do with pretokenized headers. stat()
caching improves performance of the Cocoa-prefixed "Hello, World" by
45%.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70223 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
4fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57 27-Apr-2009 Douglas Gregor <dgregor@apple.com> Implement caching of stat() calls for precompiled headers, which is
essentially the same thing we do with pretokenized headers. stat()
caching improves performance of the Cocoa-prefixed "Hello, World" by
45%.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70223 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
15830ed32a2bdfd4d16bdedd4f155d013a5f6720 27-Apr-2009 Ted Kremenek <kremenek@apple.com> Add new checker-specific attribute 'objc_ownership_cfretain'. This is the same
as 'objc_ownership_cfretain' except that the method acts like a CFRetain instead
of a [... retain] (important in GC modes). Checker support is wired up, but
currently only for Objective-C message expressions (not function calls).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70218 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
4064de959853503d9b87065adac1b277fff8af20 27-Apr-2009 Ted Kremenek <kremenek@apple.com> Add new checker-specific attribute 'objc_ownership_cfretain'. This is the same
as 'objc_ownership_cfretain' except that the method acts like a CFRetain instead
of a [... retain] (important in GC modes). Checker support is wired up, but
currently only for Objective-C message expressions (not function calls).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70218 91177308-0d34-0410-b5e6-96231b3b80d8
CHReaderDecl.cpp
CHWriter.cpp
ea332f372ec042d2de10c6939972199210d8b08b 27-Apr-2009 Chris Lattner <sabre@nondot.org> encode the type and decl offsets with 32-bits for entry instead
of 64 bits. This cuts 400KB off the PCH file for cocoa (7.1 ->
6.7MB):

Before:

Record Histogram:
Count # Bits % Abv Record Kind
1 14296 SOURCE_LOCATION_PRELOADS
1 1699598 100.00 SOURCE_LOCATION_OFFSETS
1 1870766 100.00 METHOD_POOL
1 212988 100.00 SELECTOR_OFFSETS
1 88 STATISTICS
1 106 SPECIAL_TYPES
1 18033788 100.00 IDENTIFIER_TABLE
1 1806428 100.00 IDENTIFIER_OFFSET
1 170 100.00 TARGET_TRIPLE
1 268 LANGUAGE_OPTIONS
1 5168252 100.00 DECL_OFFSET
1 952700 100.00 TYPE_OFFSET

After:

Record Histogram:
Count # Bits % Abv Record Kind
1 14296 SOURCE_LOCATION_PRELOADS
1 1699598 100.00 SOURCE_LOCATION_OFFSETS
1 1870766 100.00 METHOD_POOL
1 212988 100.00 SELECTOR_OFFSETS
1 88 STATISTICS
1 106 SPECIAL_TYPES
1 18033788 100.00 IDENTIFIER_TABLE
1 1806428 100.00 IDENTIFIER_OFFSET
1 170 100.00 TARGET_TRIPLE
1 268 LANGUAGE_OPTIONS
1 2584156 100.00 DECL_OFFSET
1 476380 100.00 TYPE_OFFSET



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70216 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
c732f5a4ae13a75b5dfa8f640a50f94db2d3092c 27-Apr-2009 Chris Lattner <sabre@nondot.org> encode the type and decl offsets with 32-bits for entry instead
of 64 bits. This cuts 400KB off the PCH file for cocoa (7.1 ->
6.7MB):

Before:

Record Histogram:
Count # Bits % Abv Record Kind
1 14296 SOURCE_LOCATION_PRELOADS
1 1699598 100.00 SOURCE_LOCATION_OFFSETS
1 1870766 100.00 METHOD_POOL
1 212988 100.00 SELECTOR_OFFSETS
1 88 STATISTICS
1 106 SPECIAL_TYPES
1 18033788 100.00 IDENTIFIER_TABLE
1 1806428 100.00 IDENTIFIER_OFFSET
1 170 100.00 TARGET_TRIPLE
1 268 LANGUAGE_OPTIONS
1 5168252 100.00 DECL_OFFSET
1 952700 100.00 TYPE_OFFSET

After:

Record Histogram:
Count # Bits % Abv Record Kind
1 14296 SOURCE_LOCATION_PRELOADS
1 1699598 100.00 SOURCE_LOCATION_OFFSETS
1 1870766 100.00 METHOD_POOL
1 212988 100.00 SELECTOR_OFFSETS
1 88 STATISTICS
1 106 SPECIAL_TYPES
1 18033788 100.00 IDENTIFIER_TABLE
1 1806428 100.00 IDENTIFIER_OFFSET
1 170 100.00 TARGET_TRIPLE
1 268 LANGUAGE_OPTIONS
1 2584156 100.00 DECL_OFFSET
1 476380 100.00 TYPE_OFFSET



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70216 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
cd4da47cb7b56df43204438af87a838b91bc3e4f 27-Apr-2009 Chris Lattner <sabre@nondot.org> add an abbreviation for common PARM_VAR_DECL. All but 9 of the
parm var decls in leopard cocoa.h end up using this abbreviation,
which shrinks the bitcode file by about 50K: 7217736->7167120.

Before:
Block ID #12 (DECLS_BLOCK):
Num Instances: 1
Total Size: 2.23595e+07b/2.79494e+06B/698736W
% of file: 38.7233
Num SubBlocks: 0
Num Abbrevs: 0
Num Records: 139387
% Abbrev Recs: 0

After:
Block ID #12 (DECLS_BLOCK):
Num Instances: 1
Total Size: 2.02405e+07b/2.53006e+06B/632516W
% of file: 35.301
Num SubBlocks: 0
Num Abbrevs: 1
Num Records: 139387
% Abbrev Recs: 19.2902



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70199 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
CHWriterDecl.cpp
ea5ce4705df0743093925585d8edc80e0d8fe3ff 27-Apr-2009 Chris Lattner <sabre@nondot.org> add an abbreviation for common PARM_VAR_DECL. All but 9 of the
parm var decls in leopard cocoa.h end up using this abbreviation,
which shrinks the bitcode file by about 50K: 7217736->7167120.

Before:
Block ID #12 (DECLS_BLOCK):
Num Instances: 1
Total Size: 2.23595e+07b/2.79494e+06B/698736W
% of file: 38.7233
Num SubBlocks: 0
Num Abbrevs: 0
Num Records: 139387
% Abbrev Recs: 0

After:
Block ID #12 (DECLS_BLOCK):
Num Instances: 1
Total Size: 2.02405e+07b/2.53006e+06B/632516W
% of file: 35.301
Num SubBlocks: 0
Num Abbrevs: 1
Num Records: 139387
% Abbrev Recs: 19.2902



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70199 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
CHWriterDecl.cpp
85e3f6403c916826059ce55304724ce8a30f37bd 27-Apr-2009 Chris Lattner <sabre@nondot.org> fix a couple more places that should be using the DeclCursor instead
of the normal stream cursor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70198 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
c47be9e5dda1dfcf65ee7a33f35198a16d239b84 27-Apr-2009 Chris Lattner <sabre@nondot.org> fix a couple more places that should be using the DeclCursor instead
of the normal stream cursor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70198 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
32e231c5db47643c2d0b131ce193289613b3f361 27-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Load most of the source manager's information lazily from the PCH
file. In particular, only eagerly load source location entries for
files and for the predefines buffer. Other buffers and
macro-instantiation source location entries are loaded lazily.

With the Cocoa-prefixed "Hello, World", we only load 815/26555 source
location entities. This halves the amount of user time we spend in
this "Hello, World" program with -fsyntax-only (down to .007s).

This optimization is part 1 of 2 for the source manager. This
eliminates most of the user time in loading a PCH file. We still spend
too much time initialize File structures (especially in the calls to
stat), so we need to either make the loading of source location
entries for files lazy or import the stat cache from the PTH
implementation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70196 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
7f94b0b0c6791013d2f72ced9b4bedd3b23673a6 27-Apr-2009 Douglas Gregor <dgregor@apple.com> Load most of the source manager's information lazily from the PCH
file. In particular, only eagerly load source location entries for
files and for the predefines buffer. Other buffers and
macro-instantiation source location entries are loaded lazily.

With the Cocoa-prefixed "Hello, World", we only load 815/26555 source
location entities. This halves the amount of user time we spend in
this "Hello, World" program with -fsyntax-only (down to .007s).

This optimization is part 1 of 2 for the source manager. This
eliminates most of the user time in loading a PCH file. We still spend
too much time initialize File structures (especially in the calls to
stat), so we need to either make the loading of source location
entries for files lazy or import the stat cache from the PTH
implementation.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70196 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
bfa474940107f16821bd901729723b925639cf3e 27-Apr-2009 Chris Lattner <sabre@nondot.org> split expr/stmt writing out to PCHWriterStmt.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70194 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
CHWriter.cpp
CHWriterStmt.cpp
63377d56de98cfef089a5758e8d4c7597a30269e 27-Apr-2009 Chris Lattner <sabre@nondot.org> split expr/stmt writing out to PCHWriterStmt.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70194 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
CHWriter.cpp
CHWriterStmt.cpp
d83ede54ef51562891c0d3f78f8dc4a85b326a86 27-Apr-2009 Chris Lattner <sabre@nondot.org> split decl writing out to its own PCHWriterDecl.cpp file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70193 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
CHWriter.cpp
CHWriterDecl.cpp
12b1c7615d4f9a2edc544be499f895f16ac100ed 27-Apr-2009 Chris Lattner <sabre@nondot.org> split decl writing out to its own PCHWriterDecl.cpp file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70193 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
CHWriter.cpp
CHWriterDecl.cpp
0526d1a8f431f3adeda122ca7940e9827e19f369 27-Apr-2009 Chris Lattner <sabre@nondot.org> unclone SavedStreamPosition


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70192 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
02602be3ccc3b29da5b91d2502c3419404992409 27-Apr-2009 Chris Lattner <sabre@nondot.org> unclone SavedStreamPosition


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70192 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
99dccc84c730795af666c5f9a6b913506adc2a8a 27-Apr-2009 Chris Lattner <sabre@nondot.org> move attribute reading to PCHReaderDecl.cpp, remove some
extraneous braces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70191 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
4e3fcc845b43a890f660a8abcee5e358882c5e8e 27-Apr-2009 Chris Lattner <sabre@nondot.org> move attribute reading to PCHReaderDecl.cpp, remove some
extraneous braces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70191 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
3ef219654679759209eb61e7ac047f2ff1038e27 27-Apr-2009 Chris Lattner <sabre@nondot.org> read all decls (and attributes and stmts/exprs referenced by the decl)
from the DeclsCursor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70190 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
da93061f56d5820725b01a140879d047554e7d32 27-Apr-2009 Chris Lattner <sabre@nondot.org> read all decls (and attributes and stmts/exprs referenced by the decl)
from the DeclsCursor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70190 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
77055f6ac2f8f9975ce75657b6719eca7500fc17 27-Apr-2009 Chris Lattner <sabre@nondot.org> rename GetStmt -> GetDeclStmt to make it clear that the stmt read
is part of a decl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70189 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
887e2b375fc5e00084ec7bf3dd050c2ca399a6d2 27-Apr-2009 Chris Lattner <sabre@nondot.org> rename GetStmt -> GetDeclStmt to make it clear that the stmt read
is part of a decl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70189 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
3282c39104c4c3618151e31715f0253668ad7034 27-Apr-2009 Chris Lattner <sabre@nondot.org> change the interface to ReadStmt to force clients to pass a cursor in to read from.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70188 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
52e97d1afc98cf4cf0a6cb8f43769dfd8acbab20 27-Apr-2009 Chris Lattner <sabre@nondot.org> change the interface to ReadStmt to force clients to pass a cursor in to read from.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70188 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHReaderDecl.cpp
CHReaderStmt.cpp
283c061970f55172d62ef6505b12789397de8217 27-Apr-2009 Chris Lattner <sabre@nondot.org> split decl reading out to its own PCHReaderDecl.cpp file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70187 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
CHReader.cpp
CHReaderDecl.cpp
698f925dedd956cf7c2d7f77ba6192eb04b31e60 27-Apr-2009 Chris Lattner <sabre@nondot.org> split decl reading out to its own PCHReaderDecl.cpp file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70187 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
CHReader.cpp
CHReaderDecl.cpp
095479470190b1e987673f2164206c9987041dbf 27-Apr-2009 Chris Lattner <sabre@nondot.org> split stmt/expr deserialization out to PCHReaderStmt.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70186 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
CHReader.cpp
CHReaderStmt.cpp
4c6f952b70abd69e52fa567393c60295edb8a1a5 27-Apr-2009 Chris Lattner <sabre@nondot.org> split stmt/expr deserialization out to PCHReaderStmt.cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70186 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
CHReader.cpp
CHReaderStmt.cpp
be9a830b71d48d86a57de025386b48db1ed33c31 27-Apr-2009 Chris Lattner <sabre@nondot.org> remove dead var


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70174 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
8849e64ad4255278ccaa17443d88f117cde89933 27-Apr-2009 Chris Lattner <sabre@nondot.org> remove dead var


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70174 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
4fc71ebb2461b40b9ccddd3ae4bec5148f491be3 27-Apr-2009 Chris Lattner <sabre@nondot.org> Set up DeclsCursor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70173 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
6367f6d06308ef29c28d2c1604ded45625caeec9 27-Apr-2009 Chris Lattner <sabre@nondot.org> Set up DeclsCursor.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70173 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
d16afaa79d8457c63a22507aeb44656afce253b9 27-Apr-2009 Chris Lattner <sabre@nondot.org> add stmt/expr names to BlockInfo block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70172 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
0558df2da807646e65d4fa290f4e92114af1a746 27-Apr-2009 Chris Lattner <sabre@nondot.org> add stmt/expr names to BlockInfo block.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70172 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
880f3f75a0b6c4fc9a3040b10f454bf2f284bac0 27-Apr-2009 Chris Lattner <sabre@nondot.org> drop the _ID suffixes from block names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70169 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
2f4efd10c805cb779618c1a22a35eb07b5043c4e 27-Apr-2009 Chris Lattner <sabre@nondot.org> drop the _ID suffixes from block names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70169 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
8a0e316ebceaa87417f1f4fe021bbad07d3fae63 27-Apr-2009 Chris Lattner <sabre@nondot.org> add the decl names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70167 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
0ff8cda4442cff571aba1be91dd16f64a0bf16aa 27-Apr-2009 Chris Lattner <sabre@nondot.org> add the decl names.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70167 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
920673ad289a21844df0394223f94c89731f3f30 27-Apr-2009 Chris Lattner <sabre@nondot.org> make llvm-bcanalyzer dump out PCH files symbolically. We should probably
eventually get an option to turn this off, but it is nice for looking at
statistics. For example, the types block now prints:

Block ID #11 (TYPES_BLOCK_ID):
Num Instances: 1
Total Size: 895100b/111888B/27971.9W
% of file: 1.55801
Num SubBlocks: 0
Num Abbrevs: 0
Num Records: 14899
% Abbrev Recs: 0

Code Histogram:
5478 TYPE_FUNCTION_PROTO
2683 TYPE_TYPEDEF
2460 TYPE_POINTER
2047 TYPE_ENUM
1553 TYPE_RECORD
283 TYPE_CONSTANT_ARRAY
274 TYPE_OBJC_INTERFACE
76 TYPE_INCOMPLETE_ARRAY
10 TYPE_VECTOR
9 TYPE_OBJC_QUALIFIED_ID
5 TYPE_FUNCTION_NO_PROTO
5 TYPE_EXT_QUAL
3 TYPE_TYPEOF_EXPR



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70166 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
b145b1e9de866e79fb386e4a074dc0b41853acf3 27-Apr-2009 Chris Lattner <sabre@nondot.org> make llvm-bcanalyzer dump out PCH files symbolically. We should probably
eventually get an option to turn this off, but it is nice for looking at
statistics. For example, the types block now prints:

Block ID #11 (TYPES_BLOCK_ID):
Num Instances: 1
Total Size: 895100b/111888B/27971.9W
% of file: 1.55801
Num SubBlocks: 0
Num Abbrevs: 0
Num Records: 14899
% Abbrev Recs: 0

Code Histogram:
5478 TYPE_FUNCTION_PROTO
2683 TYPE_TYPEDEF
2460 TYPE_POINTER
2047 TYPE_ENUM
1553 TYPE_RECORD
283 TYPE_CONSTANT_ARRAY
274 TYPE_OBJC_INTERFACE
76 TYPE_INCOMPLETE_ARRAY
10 TYPE_VECTOR
9 TYPE_OBJC_QUALIFIED_ID
5 TYPE_FUNCTION_NO_PROTO
5 TYPE_EXT_QUAL
3 TYPE_TYPEOF_EXPR



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70166 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
ce066715485bcbaef75127726123466f334ae488 27-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Some fixes for PCH (de-)serialization of Objective-C AST nodes:
- Deal with the Receiver/ClassInfo shared storage in ObjCMessageExpr
- Implement PCH support for ImplicitParamDecl
- Fix the handling of the body of an ObjCMethodDecl
- Several cast -> cast_or_null fixes
- Make Selector::getIdentifierInfoForSlot work for 1-argument, NULL
selectors.
- Make Selector::getAsString() work with NULL selectors.
- Fix the names of VisitObjCAtCatchStmt and VisitObjCAtFinallyStmt
in the PCH reader and writer; these were never getting called.

At this point, all of the pch-test tests pass for C and Objective-C.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70163 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
405bad07391494d2eb025f8222c256c66b56e5f8 27-Apr-2009 Douglas Gregor <dgregor@apple.com> Some fixes for PCH (de-)serialization of Objective-C AST nodes:
- Deal with the Receiver/ClassInfo shared storage in ObjCMessageExpr
- Implement PCH support for ImplicitParamDecl
- Fix the handling of the body of an ObjCMethodDecl
- Several cast -> cast_or_null fixes
- Make Selector::getIdentifierInfoForSlot work for 1-argument, NULL
selectors.
- Make Selector::getAsString() work with NULL selectors.
- Fix the names of VisitObjCAtCatchStmt and VisitObjCAtFinallyStmt
in the PCH reader and writer; these were never getting called.

At this point, all of the pch-test tests pass for C and Objective-C.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70163 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
587788acb2b8676ab19fa2d3ce36201b5ecd68b1 26-Apr-2009 Chris Lattner <sabre@nondot.org> Adjust to LLVM API changes that went into r70157.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70158 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
b9fa917e90d5d70d2d84c8cb7e7470b3828f957d 26-Apr-2009 Chris Lattner <sabre@nondot.org> Adjust to LLVM API changes that went into r70157.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70158 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
79762bd703e2b04ae7b723e036ccc73760f4b1b4 26-Apr-2009 Steve Naroff <snaroff@apple.com> Add PCH read/write support for ObjC statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70143 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
1eb5540760dc79502e32d4fe9c28217476ea14b9 26-Apr-2009 Steve Naroff <snaroff@apple.com> Add PCH read/write support for ObjC statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70143 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
a323e973b64f678d38afb55d1f8aedc0d9cc4e63 26-Apr-2009 Steve Naroff <snaroff@apple.com> Make sure we have a code in the node:-)

This fixes all the -emit-pch problems discovered by utils/pch-test.pl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70125 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
e1fb77f430b658dc540b40f6f7318b42a77e93d0 26-Apr-2009 Steve Naroff <snaroff@apple.com> Make sure we have a code in the node:-)

This fixes all the -emit-pch problems discovered by utils/pch-test.pl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70125 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
e43f09701f8318d58bbfb83b4f729f4ee71a550b 26-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> When writing a PCH file, write multiple type and declaration blocks as
necessary and iterate until all types and declarations have been
written. This reduces the Cocoa.h PCH file size by about 4% (since we
don't write types we don't need), and fixes problems where writing a
declaration generates a new type.

This doesn't seem to have any impact on performance either way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70109 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
366809a4e9340b3458b471e2294a75a9f09ea304 26-Apr-2009 Douglas Gregor <dgregor@apple.com> When writing a PCH file, write multiple type and declaration blocks as
necessary and iterate until all types and declarations have been
written. This reduces the Cocoa.h PCH file size by about 4% (since we
don't write types we don't need), and fixes problems where writing a
declaration generates a new type.

This doesn't seem to have any impact on performance either way.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70109 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
4a9e927b03ecc65ca47cc4e1cd7b8d5c1fae1cf9 26-Apr-2009 Chris Lattner <sabre@nondot.org> split ObjC and C++ Statements out into their own headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70105 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
16f0049415ec596504891259e2a83e19871c0d52 26-Apr-2009 Chris Lattner <sabre@nondot.org> split ObjC and C++ Statements out into their own headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70105 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
c0478bf9526f9b16badd70a153f86409ca8fd024 26-Apr-2009 Chris Lattner <sabre@nondot.org> implement PCH support for the rest of ExprObjC.h, including
the missing bits of ObjCMessageExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70100 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
0389e6bd0159bfdd08f7c50a37543b6e3adf0c33 26-Apr-2009 Chris Lattner <sabre@nondot.org> implement PCH support for the rest of ExprObjC.h, including
the missing bits of ObjCMessageExpr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70100 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
f6e1fb2133ca91ae39c2a7534387fc906df92405 26-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Don't read all of the records in the PCH file's preprocessor block,
most of which are ignored. Instead, move the __COUNTER__ value out to
a PCH-level record (since it is handled eagerly) and move the header
file information into the SourceManager block (which is also,
currently, loaded eagerly).

This results in another 17% performance improvement in the
Cocoa-prefixed "Hello, World" with PCH.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70097 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2eafc1b56347f772729e082e6bac824b0ef1b585 26-Apr-2009 Douglas Gregor <dgregor@apple.com> Don't read all of the records in the PCH file's preprocessor block,
most of which are ignored. Instead, move the __COUNTER__ value out to
a PCH-level record (since it is handled eagerly) and move the header
file information into the SourceManager block (which is also,
currently, loaded eagerly).

This results in another 17% performance improvement in the
Cocoa-prefixed "Hello, World" with PCH.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70097 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
eccb51d39a22a7cd1b4c61fedf43416a42990542 26-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Lazily load the controlling macros for all of the headers known in the
PCH file. In the Cocoa-prefixed "Hello, World" benchmark, this takes
us from reading 503 identifiers down to 37 and from 470 macros down to
4. It also results in an 8% performance improvement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70094 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
8c5a760b82e73ed90b560090772db97e2ae27b09 26-Apr-2009 Douglas Gregor <dgregor@apple.com> Lazily load the controlling macros for all of the headers known in the
PCH file. In the Cocoa-prefixed "Hello, World" benchmark, this takes
us from reading 503 identifiers down to 37 and from 470 macros down to
4. It also results in an 8% performance improvement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70094 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
4d7a6e4d810eb52f561d4db8fabe972c9d50881c 25-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Optimize the loading of an identifier from a PCH file when given the
identifier's ID. In this case, we know where the identifier's entry is
located in the hash table (it starts right before the identifier
string itself), so skip the hash table lookup and read the entry
directly. The performance improvement here is, gain, hard to quantify,
but it's the right thing to do.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70078 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
17e1c5eba505d0c99e35aa6143631653db668fb6 25-Apr-2009 Douglas Gregor <dgregor@apple.com> Optimize the loading of an identifier from a PCH file when given the
identifier's ID. In this case, we know where the identifier's entry is
located in the hash table (it starts right before the identifier
string itself), so skip the hash table lookup and read the entry
directly. The performance improvement here is, gain, hard to quantify,
but it's the right thing to do.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70078 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
85c4a8731f6f3914157e9f927a4cc28c966767dd 25-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH optimization for the identifier table, where we separate
"interesting" identifiers (e.g., those where the IdentifierInfo has
some useful information) from "uninteresting" identifiers (where the
IdentifierInfo is just a name). This makes the hash table smaller (so
searching in it should be faster) and, when loading "uninteresting"
identifiers, we skip the lookup in the hash table.

PCH file size is slightly smaller than before (since we don't emit the
contents of the uninteresting IdentifierInfo structures). The
Cocoa.h-prefixed "Hello, World" doesn't show any speedup, although
we're getting to the point where system noise is a bit issue.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70075 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
d6595a40fe12e3d5ffe5ce48987b379d547439a4 25-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH optimization for the identifier table, where we separate
"interesting" identifiers (e.g., those where the IdentifierInfo has
some useful information) from "uninteresting" identifiers (where the
IdentifierInfo is just a name). This makes the hash table smaller (so
searching in it should be faster) and, when loading "uninteresting"
identifiers, we skip the lookup in the hash table.

PCH file size is slightly smaller than before (since we don't emit the
contents of the uninteresting IdentifierInfo structures). The
Cocoa.h-prefixed "Hello, World" doesn't show any speedup, although
we're getting to the point where system noise is a bit issue.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70075 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
4bb24884988d2b074aa2e12fd47bea5e348ce716 25-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Revert my changes that try to avoid creating StringMap entries for
identifiers. They don't yet work, but will inhibit future
optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70071 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
5f8e3302242cf94de2f8e46d10167f57fcf747c3 25-Apr-2009 Douglas Gregor <dgregor@apple.com> Revert my changes that try to avoid creating StringMap entries for
identifiers. They don't yet work, but will inhibit future
optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70071 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
9966411847ba573e826c4df17c0d46507b6a5c10 25-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Start implementing the PTH IdentifierInfo-saving trick in PCH,
allocating IdentifierInfos with a pointer into the string data stored
in the PCH file rather than having an entry in the identifier table's
string map. However, we don't actually get these savings at the
moment, because we go through the IdentifierTable when loading
identifiers from the on-disk hash table.

This commit is for record-keeping purposes only. I'll be reverting
this change (and the PCH layout tweak that preceded it) because it
appears that implementing this optimization will collide with another,
future optimization to reduce the size of the on-disk hash table for
identifiers. That optimization is likely to provide more benefit (with
less voodoo).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70070 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
5da8161bdff1c81ab93b55ddd0fd45dc2123ef85 25-Apr-2009 Douglas Gregor <dgregor@apple.com> Start implementing the PTH IdentifierInfo-saving trick in PCH,
allocating IdentifierInfos with a pointer into the string data stored
in the PCH file rather than having an entry in the identifier table's
string map. However, we don't actually get these savings at the
moment, because we go through the IdentifierTable when loading
identifiers from the on-disk hash table.

This commit is for record-keeping purposes only. I'll be reverting
this change (and the PCH layout tweak that preceded it) because it
appears that implementing this optimization will collide with another,
future optimization to reduce the size of the on-disk hash table for
identifiers. That optimization is likely to provide more benefit (with
less voodoo).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70070 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
0d614eb20e5b2944975281d5886ada821c761c4e 25-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Tweak the data layout for the on-disk hash table of identifiers in the PCH file so that the key layout matches that of the PTH key layout

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70066 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
1986cadcb30bbffafd321d9ac9f73fc3df050e74 25-Apr-2009 Douglas Gregor <dgregor@apple.com> Tweak the data layout for the on-disk hash table of identifiers in the PCH file so that the key layout matches that of the PTH key layout

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70066 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
de44c9f1baf170c98ccc534c653d3f1ff24b0426 25-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Write the identifier offsets array into the PCH file as a blob, so
that the PCH reader does not have to decode the VBR encoding at PCH
load time.

Also, reduce the size of the identifier offsets from 64 bits down to
32 bits. The identifier table itself isn't going to grow to more than
4GB :)

Overall, this results in a 13% speedup in the Cocoa-prefixed "Hello,
World" benchmark.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70063 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2b3a5a83ea30bde7fa8f9d8e9a0cb12623759bfb 25-Apr-2009 Douglas Gregor <dgregor@apple.com> Write the identifier offsets array into the PCH file as a blob, so
that the PCH reader does not have to decode the VBR encoding at PCH
load time.

Also, reduce the size of the identifier offsets from 64 bits down to
32 bits. The identifier table itself isn't going to grow to more than
4GB :)

Overall, this results in a 13% speedup in the Cocoa-prefixed "Hello,
World" benchmark.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70063 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
24a224c9dd91b2a8c673f170f343b7884a5c68de 25-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Write the declaration and type offset arrays into the bitstream as
blobs, so that we don't need to do any work to get these arrays into
memory at PCH load time.

This gives another 19% performance improvement to the Cocoa-prefixed
"Hello, World!".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70059 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
8f5dc7fe4d42cea78fa92d1638f753cf65b54cb5 25-Apr-2009 Douglas Gregor <dgregor@apple.com> Write the declaration and type offset arrays into the bitstream as
blobs, so that we don't need to do any work to get these arrays into
memory at PCH load time.

This gives another 19% performance improvement to the Cocoa-prefixed
"Hello, World!".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70059 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2d71183cd5b0a6bd39cab83e42ab182b0ab445d6 25-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Load the selector table lazily from the PCH file.

This results in a 10% speedup on the Cocoa-prefixed "Hello, World!",
all of which is (not surprisingly) user time. There was a tiny
reduction in the size of the PCH file for Cocoa.h, because certain
selectors aren't being written twice.

I'm using two new tricks here that I'd like to replicate elsewhere:
(1) The selectors not used in the global method pool are packed into
the blob after the global method pool's on-disk hash table and
stored as keys, so that all selectors are in the same blob.
(2) We record the offsets of each selector key when we write it into
the global method pool (or after it, in the same blob). The offset
table is written as a blob, so that we don't need to pack/unpack a
SmallVector with its contents.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70055 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
83941df2745d69c05acee3174c7a265c206f70d9 25-Apr-2009 Douglas Gregor <dgregor@apple.com> Load the selector table lazily from the PCH file.

This results in a 10% speedup on the Cocoa-prefixed "Hello, World!",
all of which is (not surprisingly) user time. There was a tiny
reduction in the size of the PCH file for Cocoa.h, because certain
selectors aren't being written twice.

I'm using two new tricks here that I'd like to replicate elsewhere:
(1) The selectors not used in the global method pool are packed into
the blob after the global method pool's on-disk hash table and
stored as keys, so that all selectors are in the same blob.
(2) We record the offsets of each selector key when we write it into
the global method pool (or after it, in the same blob). The offset
table is written as a blob, so that we don't need to pack/unpack a
SmallVector with its contents.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70055 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
315ec17ba7cb2b7fdcf8706f0431d2644415e901 25-Apr-2009 Steve Naroff <snaroff@apple.com> Fix indexing error in PCHStmtReader::VisitArraySubscriptExpr().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70046 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
d3f632eda7a81b00a08f9bd0b3eae1133cb5526b 25-Apr-2009 Steve Naroff <snaroff@apple.com> Fix indexing error in PCHStmtReader::VisitArraySubscriptExpr().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70046 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
fb3e40219796596ee5d29f90929ff05c4df4f77e 25-Apr-2009 Steve Naroff <snaroff@apple.com> Add PCH support for ObjCMessageExpr (needed to build Mail).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70044 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
c4f0bbdb166fbc31ab2cf0f6ff573fde9fa307b3 25-Apr-2009 Steve Naroff <snaroff@apple.com> Add PCH support for ObjCMessageExpr (needed to build Mail).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70044 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
0a6e5b7a4984dd569dd12b0c71ab10193adc5739 25-Apr-2009 Steve Naroff <snaroff@apple.com> Fixup comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70040 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
87f0f8252d441474820c106a3c9afda13256daef 25-Apr-2009 Steve Naroff <snaroff@apple.com> Fixup comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70040 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
c1166736536f658a1b9fe9c234a83e20e32cff00 25-Apr-2009 Steve Naroff <snaroff@apple.com> Fix a major bug in PCHReader::ReadSelectorBlock().

Also simplify some syntax in PCHWriter::WritePreprocessor(), suggested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70039 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
72de9219a74be47ea5aa6cf9a730d17e2366f268 25-Apr-2009 Steve Naroff <snaroff@apple.com> Fix a major bug in PCHReader::ReadSelectorBlock().

Also simplify some syntax in PCHWriter::WritePreprocessor(), suggested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70039 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
f93cfeefb4604d8d5a6c657111659a95a5538d0b 25-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Make sure that the consumer sees all interested decls. This fixes Preview

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70007 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
c62a2fe1957626bc4b29402b2d0a3694dfaa3280 25-Apr-2009 Douglas Gregor <dgregor@apple.com> Make sure that the consumer sees all interested decls. This fixes Preview

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70007 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
b98860c39ac5162b4b628962bdc08dd3571cdc3a 25-Apr-2009 Ted Kremenek <kremenek@apple.com> Add new checker-specific attribute 'objc_ownership_retain'. This isn't hooked up
to the checker yet, but essentially it allows a user to specify that an
Objective-C method or C function increments the reference count of a passed
object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70005 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
de9a81b92e9098daa8ca19df138e4807b4d8afe8 25-Apr-2009 Ted Kremenek <kremenek@apple.com> Add new checker-specific attribute 'objc_ownership_retain'. This isn't hooked up
to the checker yet, but essentially it allows a user to specify that an
Objective-C method or C function increments the reference count of a passed
object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70005 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
afb99486d5ce8981f69d2cd3abda5b24488015b0 25-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> When we de-serialize an Objective-C protocol, hand it to the AST consumer so that we can create metadata

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70003 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
ad38a8595f2458309de3a8e30d0d3d62566b984f 25-Apr-2009 Douglas Gregor <dgregor@apple.com> When we de-serialize an Objective-C protocol, hand it to the AST consumer so that we can create metadata

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70003 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
aa6e3187858164dac3c4d950b07d5b7b63f2e3bd 25-Apr-2009 Ted Kremenek <kremenek@apple.com> Add new checker-specific attribute 'objc_ownership_returns'. This isn't hooked
up to the checker yet, but essentially it allows a user to specify that an
Objective-C method or C function returns an owned an Objective-C object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70001 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
0fc169e864aef7fc9a782e60b222a360f406704a 25-Apr-2009 Ted Kremenek <kremenek@apple.com> Add new checker-specific attribute 'objc_ownership_returns'. This isn't hooked
up to the checker yet, but essentially it allows a user to specify that an
Objective-C method or C function returns an owned an Objective-C object.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70001 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
5efc1055acbe1205ba526783fc5a5a8b969eb344 25-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Once the protocol list has been loaded from the PCH file, add it to
the Objective-C interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69993 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
d5e662d7226b3790848faece71f8522b21373334 25-Apr-2009 Douglas Gregor <dgregor@apple.com> Once the protocol list has been loaded from the PCH file, add it to
the Objective-C interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69993 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
9c266985e5b8f80ee8ecc1d1ef3fcfb14691ada9 24-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Fix two small but very nasty bugs in the PCH writer for method pools:
(1) Make sure to pad on-disk hash tables with 4 bytes, not 2, since
the reader assumes that bucket data is aligned on 4-byte
boundaries.
(2) Don't emit the number of factory methods twice. This was
throwing off the data counts and therefore causing lookups to
fail. I've added asserts so that this class of error cannot happen
again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69991 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
a67e58c8fa03c2f1aa7609bf5a436d1adba75eef 24-Apr-2009 Douglas Gregor <dgregor@apple.com> Fix two small but very nasty bugs in the PCH writer for method pools:
(1) Make sure to pad on-disk hash tables with 4 bytes, not 2, since
the reader assumes that bucket data is aligned on 4-byte
boundaries.
(2) Don't emit the number of factory methods twice. This was
throwing off the data counts and therefore causing lookups to
fail. I've added asserts so that this class of error cannot happen
again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69991 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
c3221aae610fea665bf76ddee6ea3fc260c3fd6d 24-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for the global method pool (= instance and factory method
pools, combined). The methods in the global method pool are lazily
loaded from an on-disk hash table when Sema looks into its version of
the hash tables.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69989 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
f0aaf7a59729a4ae0146e3464ee987745be95829 24-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for the global method pool (= instance and factory method
pools, combined). The methods in the global method pool are lazily
loaded from an on-disk hash table when Sema looks into its version of
the hash tables.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69989 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
cda68f24c5d807d6e7d3cc6bf267bbd56d1b8861 24-Apr-2009 Steve Naroff <snaroff@apple.com> Add PCH support for #import.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69987 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
83d63c78810556d26b62ac4cbae2eda6cdd2570c 24-Apr-2009 Steve Naroff <snaroff@apple.com> Add PCH support for #import.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69987 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
bac01dbb4d84eab99a9a1d0b232ec4bf9bfb12ee 24-Apr-2009 Steve Naroff <snaroff@apple.com> Use cast_or_null instead of ternary operator (suggested by Doug).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69975 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
07772607284cd10cedf2365fac0e3d9b3332cfc6 24-Apr-2009 Steve Naroff <snaroff@apple.com> Use cast_or_null instead of ternary operator (suggested by Doug).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69975 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
9de1c95422c4df1de9b89f62d871abc743bc1fba 24-Apr-2009 Steve Naroff <snaroff@apple.com> Allow the next catoregory slot to be null.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69969 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
521c91024febe01213f134528279f81a2c13bf02 24-Apr-2009 Steve Naroff <snaroff@apple.com> Allow the next catoregory slot to be null.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69969 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
afd5eb3af38dafa1ca646d8a12946d6b74e02404 24-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate Sema::ObjCImplementations, relying instead on name lookup. What's good for uniformity is good for PCH (or is it the other way around?).

As part of this, make ObjCImplDecl inherit from NamedDecl (since
ObjCImplementationDecls now need to have names so that they can be
found). This brings ObjCImplDecl very, very close to
ObjCContainerDecl; we may be able to merge them soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69941 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
8fc463adf0116fdcbff86e9cca11955aad1649fe 24-Apr-2009 Douglas Gregor <dgregor@apple.com> Eliminate Sema::ObjCImplementations, relying instead on name lookup. What's good for uniformity is good for PCH (or is it the other way around?).

As part of this, make ObjCImplDecl inherit from NamedDecl (since
ObjCImplementationDecls now need to have names so that they can be
found). This brings ObjCImplDecl very, very close to
ObjCContainerDecl; we may be able to merge them soon.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69941 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
e57c8cc462866bad1013b19612aecd732027d055 24-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate Sema::ObjCProtocols. Instead, we place ObjCProtocolDecls in
their own namespace (IDNS_Protocol) and use the normal name-lookup
routines to find them. Aside from the simplification this provides
(one less DenseMap!), it means that protocols will be lazily
deserialized from PCH files.

Make the code size of the selector table block match the code size of
the type and decl blocks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69939 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
6e378de1aebdfeb44f2a7677ed207b32b3a41fbf 24-Apr-2009 Douglas Gregor <dgregor@apple.com> Eliminate Sema::ObjCProtocols. Instead, we place ObjCProtocolDecls in
their own namespace (IDNS_Protocol) and use the normal name-lookup
routines to find them. Aside from the simplification this provides
(one less DenseMap!), it means that protocols will be lazily
deserialized from PCH files.

Make the code size of the selector table block match the code size of
the type and decl blocks.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69939 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
ae660c730d1cb8f016598f6c0ecbe777864d6b22 24-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for categories in Objective-C interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69933 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
133f482ddc2704ebcb23e2a743f1812173a42e91 24-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for categories in Objective-C interfaces.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69933 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
bb21d4b846f28e38fd204faca328dccd74eb4fa5 24-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for all of the predefined Objective-C types, such as id,
SEL, Class, Protocol, CFConstantString, and
__objcFastEnumerationState. With this, we can now run the Objective-C
methods and properties PCH tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69932 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
319ac896a0fef7365d5589b8021db7e41207fe42 24-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for all of the predefined Objective-C types, such as id,
SEL, Class, Protocol, CFConstantString, and
__objcFastEnumerationState. With this, we can now run the Objective-C
methods and properties PCH tests.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69932 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
9b6348dcc3aaa88b9b04dd51acb0d4c0bb35cf9b 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Fix handling of C99 "extern inline" semantics when dealing with
multiple declarations of the function. Should fix PR3989 and
<rdar://problem/6818429>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69905 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
b3efa98e320590e8be9d62818e89e599303e65b4 23-Apr-2009 Douglas Gregor <dgregor@apple.com> Fix handling of C99 "extern inline" semantics when dealing with
multiple declarations of the function. Should fix PR3989 and
<rdar://problem/6818429>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69905 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
74b916a03f269222c7f5cdc7f61d92d3abf73e2f 23-Apr-2009 Steve Naroff <snaroff@apple.com> More PushOnScopeChain() FIXME's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69894 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
8f06f84e8be64962cc478e3e8867336768cac79b 23-Apr-2009 Steve Naroff <snaroff@apple.com> More PushOnScopeChain() FIXME's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69894 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
104956fba2bc122c5b1982ed7442169eaec563fc 23-Apr-2009 Steve Naroff <snaroff@apple.com> Sema::ActOnStartClassInterface(): Use PushOnScopeChains().

This enables class recognition to work with PCH. I believe this means we can remove Sema::ObjCInterfaceDecls and it's usage within Sema::LookupName(). Will investigate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69891 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
a7503a735d56473a67987880726f8bf731ee3463 23-Apr-2009 Steve Naroff <snaroff@apple.com> Sema::ActOnStartClassInterface(): Use PushOnScopeChains().

This enables class recognition to work with PCH. I believe this means we can remove Sema::ObjCInterfaceDecls and it's usage within Sema::LookupName(). Will investigate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69891 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
9e84d784a1500c536defc79dd1977b519d3d3a46 23-Apr-2009 Steve Naroff <snaroff@apple.com> Add PCH read/write support for Objective-C Selectors.

Note: This support is non-lazy. Once we get "Cocoa.h" humming, we can optimize this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69884 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
90cd1bb1baac2a0221f3642de0cbea3244b116e5 23-Apr-2009 Steve Naroff <snaroff@apple.com> Add PCH read/write support for Objective-C Selectors.

Note: This support is non-lazy. Once we get "Cocoa.h" humming, we can optimize this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69884 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
37a54fd84c8eee22873f71728a07377185fa1799 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH (de-)serialization of the protocols in an ObjCInterfaceDecl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69860 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
291be393aa33759e6e34b6429c5ffa206ba50115 23-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH (de-)serialization of the protocols in an ObjCInterfaceDecl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69860 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
f4936c754aa5c1b32db1dc3b7e225563e5f87ec5 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Add the PCH reader stub for ObjCCompatibleAliasDecl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69859 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
17eee4af16ff04e10a1626fbce0e09c4a0b00321 23-Apr-2009 Douglas Gregor <dgregor@apple.com> Add the PCH reader stub for ObjCCompatibleAliasDecl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69859 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
3f2c50557dc32075200f8fcb01dcfebfafa1a3ec 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for ObjCPropertyImplDecl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69858 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
8818c4fb69cb2a4eec94b217a90f94f9e075296e 23-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for ObjCPropertyImplDecl

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69858 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
087dbf396b59df6b944ef48f1fe55d5c15b8deb2 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> The ivars in an ObjCImplementationDecl are now stored in the
DeclContext rather than in a separate list. This makes PCH
(de-)serialization trivial, so that ivars can be loaded lazily.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69857 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
8f36aba016c2d236a90f9ecf0a66904209202202 23-Apr-2009 Douglas Gregor <dgregor@apple.com> The ivars in an ObjCImplementationDecl are now stored in the
DeclContext rather than in a separate list. This makes PCH
(de-)serialization trivial, so that ivars can be loaded lazily.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69857 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
58e7ce47236aad981c16afe395717dc1cd487fe5 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for ObjCCategoryImplDecl (which can't be tested now).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69856 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
10b0e1fa3aabd8877dbbc0df1f2414e04afd5fdd 23-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for ObjCCategoryImplDecl (which can't be tested now).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69856 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
bd336c56bd4b95167487c8a74a385650c01f417c 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH (de-)serialization for ObjCImplDecl. This can't be tested yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69855 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2c2d43c557beca1b4ba4bd743f33978aecb46a97 23-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH (de-)serialization for ObjCImplDecl. This can't be tested yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69855 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
3839f1c3e2fa6dd5a0482a7d948037c4d03ef4de 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for Objective-C property declarations (UNTESTED!)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69843 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
70e5a14c6076d63833c62d1d6d628c26309897c1 23-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for Objective-C property declarations (UNTESTED!)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69843 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
af136d9f428db2566b8b0a4eabf5d3efa785884c 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Add PCH statistics for the number/percent of lexical/visible declcontexts read

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69835 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2512308525ff328aa992da0b5ee14a488d2ea93a 23-Apr-2009 Douglas Gregor <dgregor@apple.com> Add PCH statistics for the number/percent of lexical/visible declcontexts read

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69835 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
070be452f47b7b9275b2a58521776f3c54753ea4 23-Apr-2009 Ted Kremenek <kremenek@apple.com> Add PathDiagnosticRange to PathDiagnostics. These simply wrap SourceRange and
indicate whether or not the range represents an absolute range or should be
extended by lexing to the end of the token.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69834 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
4c5fcd946971756bd644fe76511f292e10225981 23-Apr-2009 Ted Kremenek <kremenek@apple.com> Add PathDiagnosticRange to PathDiagnostics. These simply wrap SourceRange and
indicate whether or not the range represents an absolute range or should be
extended by lexing to the end of the token.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69834 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
062d9488c9023deaad365aa3e866648958d9e199 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Support locally-declared external declarations in PCH files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69833 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
14c22f20c077cecd68581952a0c227f8c180be03 23-Apr-2009 Douglas Gregor <dgregor@apple.com> Support locally-declared external declarations in PCH files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69833 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
77b2cd556f47fcfd22ed1748565a2a71d441df21 23-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Support tentative definitions in precompiled headers. This isn't likely
to happen (ever), but at least we'll do the right thing when it does.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69829 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
4c0e86b392c5fb0cb771551fc877edb6979be69c 23-Apr-2009 Douglas Gregor <dgregor@apple.com> Support tentative definitions in precompiled headers. This isn't likely
to happen (ever), but at least we'll do the right thing when it does.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69829 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2554cf263da9a23af8664d438de44c02dbb76422 22-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate some FIXMEs in the PCH reader that were either already fixed or aren't actually things to fix

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69827 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
6cfc1a8b7582b8433b61222502effb018c534393 22-Apr-2009 Douglas Gregor <dgregor@apple.com> Eliminate some FIXMEs in the PCH reader that were either already fixed or aren't actually things to fix

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69827 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
405b6430b88da6b23b37ec9de82c905b9e919314 22-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Minimize the number and kind of "external definitions" that the PCH
file needs to store. CodeGen needs to see these definitions (via
HandleTopLevelDecl), otherwise it won't be able to generate code for
them.

This patch notifies the consumer (e.g., CodeGen) about function
definitions and variable definitions when the corresponding
declarations are deserialized. Hence, we don't eagerly deserialize the
declarations for every variable or function that has a definition in
the PCH file. This gives another 5% speedup for the Carbon-prefixed
"Hello, World!", and brings our PCH statistics down to something far
more reasonable:

*** PCH Statistics:
13/20693 types read (0.062823%)
17/59230 declarations read (0.028702%)
54/44914 identifiers read (0.120230%)
0/32954 statements read (0.000000%)
5/6187 macros read (0.080815%)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69820 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
0af2ca4b6ddc788658069a0994941268ce250fc7 22-Apr-2009 Douglas Gregor <dgregor@apple.com> Minimize the number and kind of "external definitions" that the PCH
file needs to store. CodeGen needs to see these definitions (via
HandleTopLevelDecl), otherwise it won't be able to generate code for
them.

This patch notifies the consumer (e.g., CodeGen) about function
definitions and variable definitions when the corresponding
declarations are deserialized. Hence, we don't eagerly deserialize the
declarations for every variable or function that has a definition in
the PCH file. This gives another 5% speedup for the Carbon-prefixed
"Hello, World!", and brings our PCH statistics down to something far
more reasonable:

*** PCH Statistics:
13/20693 types read (0.062823%)
17/59230 declarations read (0.028702%)
54/44914 identifiers read (0.120230%)
0/32954 statements read (0.000000%)
5/6187 macros read (0.080815%)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69820 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
da38c6ca35b4fb57a2638f0fa2bdf9226fa51ce9 22-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Lazy loading of builtins for precompiled headers.

PCH files now contain complete information about builtins, including
any declarations that have been synthesized as part of building the
PCH file. When using a PCH file, we do not initialize builtins at all;
when needed, they'll be found in the PCH file.

This optimization translations into a 9% speedup for "Hello, World!"
with Carbon.h as a prefix header and roughly a 5% speedup for 403.gcc
with its prefix header. We're also reading less of the PCH file for
"Hello, World!":

*** PCH Statistics:
286/20693 types read (1.382110%)
1630/59230 declarations read (2.751984%)
764/44914 identifiers read (1.701029%)
1/32954 statements read (0.003035%)
5/6187 macros read (0.080815%)

down from

*** PCH Statistics:
411/20693 types read (1.986179%)
2553/59230 declarations read (4.310316%)
1093/44646 identifiers read (2.448148%)
1/32954 statements read (0.003035%)
21/6187 macros read (0.339421%)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69815 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2deaea37a637dd01221d0cced343702a39d8132c 22-Apr-2009 Douglas Gregor <dgregor@apple.com> Lazy loading of builtins for precompiled headers.

PCH files now contain complete information about builtins, including
any declarations that have been synthesized as part of building the
PCH file. When using a PCH file, we do not initialize builtins at all;
when needed, they'll be found in the PCH file.

This optimization translations into a 9% speedup for "Hello, World!"
with Carbon.h as a prefix header and roughly a 5% speedup for 403.gcc
with its prefix header. We're also reading less of the PCH file for
"Hello, World!":

*** PCH Statistics:
286/20693 types read (1.382110%)
1630/59230 declarations read (2.751984%)
764/44914 identifiers read (1.701029%)
1/32954 statements read (0.003035%)
5/6187 macros read (0.080815%)

down from

*** PCH Statistics:
411/20693 types read (1.986179%)
2553/59230 declarations read (4.310316%)
1093/44646 identifiers read (2.448148%)
1/32954 statements read (0.003035%)
21/6187 macros read (0.339421%)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69815 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
08491aeda7486a8393f2fc895024d66fc9d56bb3 22-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Remove some debugging output from the PCH reader

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69803 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
01f4fa2928b22f88fb91035b9f000087ad25003d 22-Apr-2009 Douglas Gregor <dgregor@apple.com> Remove some debugging output from the PCH reader

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69803 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
dbd4f8e3fab4278f2e6d288640347dbdd003086b 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Add another workaround for -include.
- If we don't find a file looking relative to the current working
directory, fall back to header search. This is closer to what would
happen if the lookup was starting from right directory in the first
place (except it will find files in the directory of the main
source file, which I *think* should not be found).

- PR3992.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69794 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
1e7c6b67879b41369d5e8ddadb8aa6cef9013910 22-Apr-2009 Daniel Dunbar <daniel@zuster.org> Add another workaround for -include.
- If we don't find a file looking relative to the current working
directory, fall back to header search. This is closer to what would
happen if the lookup was starting from right directory in the first
place (except it will find files in the directory of the main
source file, which I *think* should not be found).

- PR3992.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69794 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
b64206c5f93e51a1857706eeab24cf945491ef42 22-Apr-2009 Chris Lattner <sabre@nondot.org> ObjCQualifiedClass is dead, remove it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69783 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
068360e16fa4504a6fb80affebae5c5713629a96 22-Apr-2009 Chris Lattner <sabre@nondot.org> ObjCQualifiedClass is dead, remove it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69783 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
bab2c0ff809142523e2f5488145a8c8e96087f64 22-Apr-2009 Chris Lattner <sabre@nondot.org> deserialization support for qualified interfaces


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69782 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
c6fa4450b827d1e3674494fc9659eae006a86b49 22-Apr-2009 Chris Lattner <sabre@nondot.org> deserialization support for qualified interfaces


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69782 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
9b9f23586594572ec4c581b15c883f2a84a44ff1 22-Apr-2009 Chris Lattner <sabre@nondot.org> pch support for protocol qualified id's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69781 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
d7a3fcd48cb308074cc95031252bc64966f0703d 22-Apr-2009 Chris Lattner <sabre@nondot.org> pch support for protocol qualified id's.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69781 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
c49bbe72221ca7cde0d45c52ae6a72374b2d8529 22-Apr-2009 Chris Lattner <sabre@nondot.org> add three new objc expression types. @selector doesn't work because we have no
way to serialize selectors yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69780 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
3a57a3765b6192a94ff4e5997ae0489a1471b308 22-Apr-2009 Chris Lattner <sabre@nondot.org> add three new objc expression types. @selector doesn't work because we have no
way to serialize selectors yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69780 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
80f83c6f299e76871b6b4f63b20de18197cd0cdc 22-Apr-2009 Chris Lattner <sabre@nondot.org> implement serialization support for @encode,
fix a couple of bugs in reader support for ObjCInterfaceDecl,
and add support for reading ObjCInterfaceType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69779 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
4dcf151a555ff51e4d643e8e6eeb80f121d11d1b 22-Apr-2009 Chris Lattner <sabre@nondot.org> implement serialization support for @encode,
fix a couple of bugs in reader support for ObjCInterfaceDecl,
and add support for reading ObjCInterfaceType.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69779 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
37f477ebbb9755380e3d8849e6281d5239157431 22-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Reorganize built-in initialization to separate the creation of target builtins from marking IdentifierInfos as builtins. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69774 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
71dfdb9bc91b5d81b124e6091c903e4efd87149d 22-Apr-2009 Douglas Gregor <dgregor@apple.com> Reorganize built-in initialization to separate the creation of target builtins from marking IdentifierInfos as builtins. No functionality change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69774 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
ad52eb926c44a9753743683953638894a2877db0 22-Apr-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6814950 - stdint.h isn't "-pedantic -std=c89" clean,
by marking the predefines buffer as a system header. The problem
with stdint is that it was getting problems like this:

/Volumes/Projects/cvs/llvm/Debug/lib/clang/1.0/include/stdint.h:43:9: warning: 'long long' is an extension when C99 mode is not enabled
typedef __INT64_TYPE__ int64_t;
^
<built-in>:73:29: note: instantiated from:
#define __INT64_TYPE__ long long
^

We correctly silence warnings in system headers, but only if the
spelling location of the token came from the system header. This is
designed so that if you use a system macro in your code that you don't
get punished for its definition. This is all cool except that the
predefines buffer wasn't considered a system header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69770 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
3936024941229e235aed7f53949a117a54eebf68 22-Apr-2009 Chris Lattner <sabre@nondot.org> Fix rdar://6814950 - stdint.h isn't "-pedantic -std=c89" clean,
by marking the predefines buffer as a system header. The problem
with stdint is that it was getting problems like this:

/Volumes/Projects/cvs/llvm/Debug/lib/clang/1.0/include/stdint.h:43:9: warning: 'long long' is an extension when C99 mode is not enabled
typedef __INT64_TYPE__ int64_t;
^
<built-in>:73:29: note: instantiated from:
#define __INT64_TYPE__ long long
^

We correctly silence warnings in system headers, but only if the
spelling location of the token came from the system header. This is
designed so that if you use a system macro in your code that you don't
get punished for its definition. This is all cool except that the
predefines buffer wasn't considered a system header.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69770 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
e0ad2dd12bdb710fe5ae52da85066aba9e35d927 22-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Lazy deserialization of macro definitions for precompiled headers.

This optimization improves performance on the Carbon-prefixed "Hello,
World!" example by 57%. For reference, we're now about 2.25x faster
than GCC PCH. We're also pulling in far less of the PCH file:

*** PCH Statistics:
411/20693 types read (1.986179%)
2553/59230 declarations read (4.310316%)
1093/44646 identifiers read (2.448148%)
1/32954 statements read (0.003035%)
21/6187 macros read (0.339421%)




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69755 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
37e2684abfe38207fdb90620da062bb18c23f29a 22-Apr-2009 Douglas Gregor <dgregor@apple.com> Lazy deserialization of macro definitions for precompiled headers.

This optimization improves performance on the Carbon-prefixed "Hello,
World!" example by 57%. For reference, we're now about 2.25x faster
than GCC PCH. We're also pulling in far less of the PCH file:

*** PCH Statistics:
411/20693 types read (1.986179%)
2553/59230 declarations read (4.310316%)
1093/44646 identifiers read (2.448148%)
1/32954 statements read (0.003035%)
21/6187 macros read (0.339421%)




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69755 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
35ca85e7bc8b8a4165ae0e40629ba858a2d635c0 22-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Don't bother writing a visible-declarations record for the translation
unit into the PCH file, since we won't be performing name lookup into
it anyway. Reduces the size of the Carbon.h PCH file by ~200k.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69739 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
aff22dff5ecc8955d51dfdc107e6b034c30c1512 22-Apr-2009 Douglas Gregor <dgregor@apple.com> Don't bother writing a visible-declarations record for the translation
unit into the PCH file, since we won't be performing name lookup into
it anyway. Reduces the size of the Carbon.h PCH file by ~200k.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69739 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
c713da9e66dd3c47ee7b0011172e03b59ff02420 22-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Lazy deserialization of the declaration chains associated with
identifiers from a precompiled header.

This patch changes the primary name lookup method for entities within
a precompiled header. Previously, we would load all of the names of
declarations at translation unit scope into a large DenseMap (inside
the TranslationUnitDecl's DeclContext), and then perform a special
"last resort" lookup into this DeclContext when we knew there was a
PCH file (see Sema::LookupName). Now, when we see an identifier named
for the first time, we load all of the declarations with that name
that are visible from the translation unit into the IdentifierInfo's
chain of declarations. Thus, the explicit "look into the translation
unit's DeclContext" code is gone, and Sema effectively uses the same
IdentifierInfo-based name lookup mechanism whether we are using a PCH
file or not.

This approach should help PCH scale with the size of the input program
rather than the size of the PCH file. The "Hello, World!" application
with Carbon.h as a PCH file now loads 20% of the identifiers in the
PCH file rather than 85% of the identifiers.

90% of the 20% of identifiers loaded are actually loaded when we
deserialize the preprocessor state. The next step is to make the
preprocessor load macros lazily, which should drastically reduce the
number of types, declarations, and identifiers loaded for "Hello,
World".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69737 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
668c1a4fdcc56bdd050256b1688e116fe84b72db 22-Apr-2009 Douglas Gregor <dgregor@apple.com> Lazy deserialization of the declaration chains associated with
identifiers from a precompiled header.

This patch changes the primary name lookup method for entities within
a precompiled header. Previously, we would load all of the names of
declarations at translation unit scope into a large DenseMap (inside
the TranslationUnitDecl's DeclContext), and then perform a special
"last resort" lookup into this DeclContext when we knew there was a
PCH file (see Sema::LookupName). Now, when we see an identifier named
for the first time, we load all of the declarations with that name
that are visible from the translation unit into the IdentifierInfo's
chain of declarations. Thus, the explicit "look into the translation
unit's DeclContext" code is gone, and Sema effectively uses the same
IdentifierInfo-based name lookup mechanism whether we are using a PCH
file or not.

This approach should help PCH scale with the size of the input program
rather than the size of the PCH file. The "Hello, World!" application
with Carbon.h as a PCH file now loads 20% of the identifiers in the
PCH file rather than 85% of the identifiers.

90% of the 20% of identifiers loaded are actually loaded when we
deserialize the preprocessor state. The next step is to make the
preprocessor load macros lazily, which should drastically reduce the
number of types, declarations, and identifiers loaded for "Hello,
World".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69737 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
007b7f8fb9daecf903d31835050c133a82c2c31d 21-Apr-2009 Ted Kremenek <kremenek@apple.com> Plist diagnostics: Remove deprecated single-point locations in control-flow
pieces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69719 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
a104de8ec5f2ebd1e28982d43841e406809cc85d 21-Apr-2009 Ted Kremenek <kremenek@apple.com> Plist diagnostics: Remove deprecated single-point locations in control-flow
pieces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69719 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
97b53bda541230096b4966b4ae44d02b1756dad5 21-Apr-2009 Steve Naroff <snaroff@apple.com> Add pch reader/writer support for most of DeclObjC.h. Very close to reading/writing all ObjC AST nodes that we will encounter in header files (still a few FIXME's).

Once selector support is in place, we should be able to take this for a spin (and add test cases).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69674 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
30833f8d77c08f8f16371776fde85a9fde3d9b6e 21-Apr-2009 Steve Naroff <snaroff@apple.com> Add pch reader/writer support for most of DeclObjC.h. Very close to reading/writing all ObjC AST nodes that we will encounter in header files (still a few FIXME's).

Once selector support is in place, we should be able to take this for a spin (and add test cases).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69674 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
9bf72c617e23cc1d9ff3d557dcb266e4818b2397 21-Apr-2009 Chris Lattner <sabre@nondot.org> this time with more workingness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69669 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
32b325fb33d4bd7a5324c73f338144390362da39 21-Apr-2009 Chris Lattner <sabre@nondot.org> this time with more workingness.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69669 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
1f38f6149b4a1b13280e8c224391dc14d48cebe9 21-Apr-2009 Chris Lattner <sabre@nondot.org> fix massive testsuite failures from Alexei's patch due to inverted logic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69666 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
62f86c4555e14456acef6b251fcb13a66c3ce6dd 21-Apr-2009 Chris Lattner <sabre@nondot.org> fix massive testsuite failures from Alexei's patch due to inverted logic.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69666 91177308-0d34-0410-b5e6-96231b3b80d8
nitPreprocessor.cpp
94269d741940b43053feb62986cf97a487032829 21-Apr-2009 Chris Lattner <sabre@nondot.org> Split preprocessor initialization logic out of clang-cc into
libfrontend. Patch by Alexei Svitkine!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69664 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
nitPreprocessor.cpp
e116ccf140b813ecd20e3fb4041d7d0b8a967c0b 21-Apr-2009 Chris Lattner <sabre@nondot.org> Split preprocessor initialization logic out of clang-cc into
libfrontend. Patch by Alexei Svitkine!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69664 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
nitPreprocessor.cpp
fd0739efe7b826eaef2dd05ecab33022a4984433 21-Apr-2009 Chris Lattner <sabre@nondot.org> make "in included from" and "in instatiation from" messages respect
-fno-show-location, patch by Alexei Svitkine (PR4024)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69657 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
5ce24c87918dde1716d6c9f3ca6acf8b6c1c5472 21-Apr-2009 Chris Lattner <sabre@nondot.org> make "in included from" and "in instatiation from" messages respect
-fno-show-location, patch by Alexei Svitkine (PR4024)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69657 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
ff9a6098a9ae0ccd6ef60b0cb8fcee9caa5b0a42 20-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Write the identifier table into the PCH file as an on-disk hash table
that also includes the contents of the IdentifierInfo itself (the
various fields and flags, along with the chain of identifiers visible
at the top level that have that name).

We don't make any use of the hash table yet, except that our
identifier ID -> string mapping points into the hash table now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69625 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
3251ceb90b3fec68e86d6dcfa58836e20a7205c3 20-Apr-2009 Douglas Gregor <dgregor@apple.com> Write the identifier table into the PCH file as an on-disk hash table
that also includes the contents of the IdentifierInfo itself (the
various fields and flags, along with the chain of identifiers visible
at the top level that have that name).

We don't make any use of the hash table yet, except that our
identifier ID -> string mapping points into the hash table now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69625 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
7333b4925d5032304792f8b0a268549bbbc3a6ef 20-Apr-2009 Steve Naroff <snaroff@apple.com> Add pch reader/writer support for ObjCContainerDecl, ObjCInterfaceDecl, & ObjCIvarDecl.

Next step: Add selector support to PCHWriter::AddDeclarationName().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69619 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
33feeb019a5742b286eededd5446ec0fe87c5a61 20-Apr-2009 Steve Naroff <snaroff@apple.com> Add pch reader/writer support for ObjCContainerDecl, ObjCInterfaceDecl, & ObjCIvarDecl.

Next step: Add selector support to PCHWriter::AddDeclarationName().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69619 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
15ce6cc75018b69a2fc849c9ee5bceb30e0e67c1 20-Apr-2009 Chris Lattner <sabre@nondot.org> the __gnuc_inline__ attribute is actually named __gnu_inline__,
PR4023


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69618 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
cf2a7211b4785068c7efa836baab90b198a4d2a6 20-Apr-2009 Chris Lattner <sabre@nondot.org> the __gnuc_inline__ attribute is actually named __gnu_inline__,
PR4023


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69618 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
87887da76ef2e4c5d22ce9bb45623b6b9a24cf19 20-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce the notion of a SemaConsumer, which is an ASTConsumer that
also gets access to the Sema object performing semantic analysis. This
will be used by the PCH writer to serialize Sema state.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69595 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
e7785040107266d01ebdcc066365f70b7ace371f 20-Apr-2009 Douglas Gregor <dgregor@apple.com> Introduce the notion of a SemaConsumer, which is an ASTConsumer that
also gets access to the Sema object performing semantic analysis. This
will be used by the PCH writer to serialize Sema state.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69595 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
79ea0e0d94f7bbe2f26ac0eaf995e420bb7298c9 20-Apr-2009 Steve Naroff <snaroff@apple.com> Add pch reader/writer support for ObjCMethodDecl.

Test will be enabled with ObjCInterfaceDecl is added.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69594 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
53c9d8a4b8f0a76cb9dd2fdd8c433ccf110f2eec 20-Apr-2009 Steve Naroff <snaroff@apple.com> Add pch reader/writer support for ObjCMethodDecl.

Test will be enabled with ObjCInterfaceDecl is added.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69594 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
947806340a4945f144df624179b8afb9958cdcca 20-Apr-2009 Chris Lattner <sabre@nondot.org> don't crash on invalid ranges in -fprint-source-range-info
mode, just ignore them as usual.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69558 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
74548e67d835254c3852b95bfb6dbbd6609a91f5 20-Apr-2009 Chris Lattner <sabre@nondot.org> don't crash on invalid ranges in -fprint-source-range-info
mode, just ignore them as usual.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69558 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
041bd734664c2ce26c8c1fbf7c0403309dd0764b 19-Apr-2009 Chris Lattner <sabre@nondot.org> implement compiler support for -fno-diagnostics-fixit-info,
rdar://6805442


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69525 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
aa5bf2e8dc01f9835efef76222dc440a5c18b160 19-Apr-2009 Chris Lattner <sabre@nondot.org> implement compiler support for -fno-diagnostics-fixit-info,
rdar://6805442


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69525 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
9ef9c284e6791a48278b3b76cfa85b05cc0c5a20 19-Apr-2009 Chris Lattner <sabre@nondot.org> Add location info for indirect goto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69497 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ad56d684259f706b7c0ae5ad9c23adb4f2926817 19-Apr-2009 Chris Lattner <sabre@nondot.org> Add location info for indirect goto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69497 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
5afd980a70db300bd438cc3a6b3039cde566c5c7 18-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Don't emit name-lookup tables for functions or methods in the PCH files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69449 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
58f06995ada075131ab9ac72a411450caaa65605 18-Apr-2009 Douglas Gregor <dgregor@apple.com> Don't emit name-lookup tables for functions or methods in the PCH files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69449 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
e01ad449597f9ae32fda68a1991ed1fd0bece9e3 18-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Store the type ID for __builtin_va_list in the PCH file, so that the
AST context's __builtin_va_list type will be set when the PCH file is
loaded. This fixes the crash when CodeGen'ing a va_arg expression
pulled in from a PCH file.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69421 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ad1de006ea080b540e480efc6b86c2e201dbf1ec 18-Apr-2009 Douglas Gregor <dgregor@apple.com> Store the type ID for __builtin_va_list in the PCH file, so that the
AST context's __builtin_va_list type will be set when the PCH file is
loaded. This fixes the crash when CodeGen'ing a va_arg expression
pulled in from a PCH file.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69421 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
3b9a7c8115604645e51bd272985603fa4f3c6d61 18-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Lazy deserialization of function bodies for PCH files. For the Carbon
"Hello, World!", this takes us from deserializing 6469
statements/expressions down to deserializing 1
statement/expression. It only translated into a 1% improvement on the
Carbon-prefixed 403.gcc, but (a) it's the right thing to do, and (b)
we expect this to matter more once we lazily deserialize identifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69407 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
250fc9c859fdeed3f200ae911a7e7ea338f38436 18-Apr-2009 Douglas Gregor <dgregor@apple.com> Lazy deserialization of function bodies for PCH files. For the Carbon
"Hello, World!", this takes us from deserializing 6469
statements/expressions down to deserializing 1
statement/expression. It only translated into a 1% improvement on the
Carbon-prefixed 403.gcc, but (a) it's the right thing to do, and (b)
we expect this to matter more once we lazily deserialize identifiers.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69407 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
e3241e9ede65d127bd9e98fa29d8aa7546288434 18-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> FunctionDecl::getBody() is getting an ASTContext argument for use in
lazy PCH deserialization. Propagate that argument wherever it needs to
be. No functionality change, except that I've tightened up a few PCH
tests in preparation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69406 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
7297134f128423fce2e88f92421ed135bded7d4e 18-Apr-2009 Douglas Gregor <dgregor@apple.com> FunctionDecl::getBody() is getting an ASTContext argument for use in
lazy PCH deserialization. Propagate that argument wherever it needs to
be. No functionality change, except that I've tightened up a few PCH
tests in preparation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69406 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
456e095968a54d21f42ddbbc666e7afbeb2265b6 18-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Keep track of the number of statements/expressions written to and read
from a PCH file. It turns out that "Hello, World!" is bringing in 19%
of all of the statements in Carbon.h, so we need to be lazy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69393 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
3e1af84bb0092a1aafb49deaa4ab6664c9a9071b 18-Apr-2009 Douglas Gregor <dgregor@apple.com> Keep track of the number of statements/expressions written to and read
from a PCH file. It turns out that "Hello, World!" is bringing in 19%
of all of the statements in Carbon.h, so we need to be lazy.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69393 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
3e1f9fb48943b37644188d83a59cc0bf4d666462 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for inline assembly statements.

This completes support for all of C (+ extensions). We can (again)
build a PCH file for Carbon.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69385 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
cd7d5a9dc558178ed7a66032f888781b3c592e4f 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for inline assembly statements.

This completes support for all of C (+ extensions). We can (again)
build a PCH file for Carbon.h.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69385 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
5f7937dc4f4b2513881265a8cb78f5629ad1fadc 17-Apr-2009 Chris Lattner <sabre@nondot.org> refactor htmldiags to be created up front like the other diag clients.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69379 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
409d4e716a01a71c4fecfaec59ca8348c8a5d275 17-Apr-2009 Chris Lattner <sabre@nondot.org> refactor htmldiags to be created up front like the other diag clients.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69379 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
e14647ec947219ab23108cb1cdb29f957a12bd09 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH tests for va_arg expressions. Verified that the blocks test does create a BlockDeclRefExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69376 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
f7dac085f82d2cf395950db137f0bbf00fb305a8 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH tests for va_arg expressions. Verified that the blocks test does create a BlockDeclRefExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69376 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
e246b741a2f4b00a690b9e975201b7ced23f68cf 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for blocks

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69373 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
84af7c27cdc615ff917a501d61256b4049383c97 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for blocks

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69373 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
eca12f63c262ab4d44f40b966790c9155518b3ae 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for GNU statement expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69370 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
6a2dd55b0b3ae376d449a4b07bbb6b2d30b26330 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for GNU statement expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69370 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
95a8fe35717bf897cc9c0bcc47482a4ba3301120 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for indirect gotos and address-of-label expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69369 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
7d5c2f241c74e5f8d9ec492e8f9f268e5e9ae41f 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for indirect gotos and address-of-label expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69369 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
6e411bfd8bc304cf4746140e2ff51d243a564d27 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for labels and goto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69364 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
1de05feeeafe5b215fe7617594a7076a5192a6e2 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for labels and goto.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69364 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
78ff29fdafdbdf8fcf3de07337355aa99eb00cf2 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for declaration statements, and a test for PredefinedExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69356 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
84f2170062014d268951902164bed0d8bdea0e82 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for declaration statements, and a test for PredefinedExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69356 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
22d2dcd05c69e223587fa4f3ce3f356d1631007f 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for return statements.

Optimize PCH encoding for switch-case statements slightly, by making
the switch-case numbering local to a particular statement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69355 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
0de9d8857b715c2f45c987651f4ce06d73330d93 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for return statements.

Optimize PCH encoding for switch-case statements slightly, by making
the switch-case numbering local to a particular statement.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69355 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
fb5f25baeb2fc7145db78312e05b9e34b39ec4e3 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for do-while and for loops

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69334 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
67d8249924ef38a5375ff9c92cd21c1854d6abab 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for do-while and for loops

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69334 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
a6b503f5f754f4c798ce80471cbcdf03a01205a3 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for while and continue statements

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69332 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
d921cf976b4769af8d06d6763a2547dadf7940ab 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for while and continue statements

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69332 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
9c4782a93e8963f9b180c851b00a5f3568a5918b 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for the first batch of statements, including null,
compound, case, default, if, switch, and break statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69329 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
025452fa0eda63e150cfaeebe64f0a19c96b3a06 17-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for the first batch of statements, including null,
compound, case, default, if, switch, and break statements.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69329 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ddf4d0986f74b2376a44acde84ba6633d851a6e5 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Clean up the declaration-decoding step in the PCH reader, using the
same ueber-easy visitor scheme used for expressions/statements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69320 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
cb70bb2899944b42c6269caa9e39a81ca146fe81 17-Apr-2009 Douglas Gregor <dgregor@apple.com> Clean up the declaration-decoding step in the PCH reader, using the
same ueber-easy visitor scheme used for expressions/statements.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69320 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
c72f6c80b9e2f14ecff2f30ad6f8ba2f8906d17d 17-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Prepare PCH reader and writer for (de-)serialization of statements. No
functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69319 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
c9490c000f515c29f200a1215328d8ab9a0f3818 17-Apr-2009 Douglas Gregor <dgregor@apple.com> Prepare PCH reader and writer for (de-)serialization of statements. No
functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69319 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
8ee040e4581ec7530eae4b689ab7a4a9c9ce9bbd 16-Apr-2009 Chris Lattner <sabre@nondot.org> tblgen is now passing diagnostic group information in the .inc file, ignore it everywhere.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69269 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
19cbb44e3c4f2181dafa2ab92d3e3a26619b71d9 16-Apr-2009 Chris Lattner <sabre@nondot.org> tblgen is now passing diagnostic group information in the .inc file, ignore it everywhere.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69269 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
a96ec3bcfecbf4d1a9b4b6523060eb591a905810 16-Apr-2009 Chris Lattner <sabre@nondot.org> implement framework for -fdiagnostics-show-option, but tblgen isn't
passing down the right info yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69268 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
d51d74a3e89c5e5fc9bfd2814996a5feab6dc932 16-Apr-2009 Chris Lattner <sabre@nondot.org> implement framework for -fdiagnostics-show-option, but tblgen isn't
passing down the right info yet.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69268 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
ceb004d789eb5057182c35d399bbde104dec2fc3 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate pch::TYPE_ATTR, which is never used

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69256 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
63f5c2646e75041277657aa1392a5bdd643367a7 16-Apr-2009 Douglas Gregor <dgregor@apple.com> Eliminate pch::TYPE_ATTR, which is never used

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69256 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
b70b48fec5bfeef402757d6ca8034ff879d52a66 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for CompoundLiteralExpr. This is the last C expression
that does not require PCH support for statements. Only AddrLabelExpr,
StmtExpr, and BlockExpr remain (for C).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69255 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ba6d7e7fa5f79959d3eef39adb5620d845ba5198 16-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for CompoundLiteralExpr. This is the last C expression
that does not require PCH support for statements. Only AddrLabelExpr,
StmtExpr, and BlockExpr remain (for C).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69255 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
6710a3cb6c5ecf9a10f118028aac70bffbc42a67 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for InitListExpr, DesignatedInitExpr, and ImplicitValueInitExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69251 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
d077d759d0c7fceee98f4e77b6423a3f11cfc849 16-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for InitListExpr, DesignatedInitExpr, and ImplicitValueInitExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69251 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
725e94b56fd3a575a687ef6aedcb28d8fb614904 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for ShuffleVectorExpr and BlockDeclRefExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69244 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
94cd5d1397bb1a8bcd109602aa38dd787b164c22 16-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for ShuffleVectorExpr and BlockDeclRefExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69244 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
209d4621adeb4554b5e64a05d53c2fe40b0061d9 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for TypesCompatibleExpr, ChooseExpr, and GNUNullExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69242 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
44cae0c8669cdf83618cbe7fd36ea7a8e51cf97f 16-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for TypesCompatibleExpr, ChooseExpr, and GNUNullExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69242 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ec0b8294b6a1a71300f08b0485ba370d4952ee73 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for ExtVectorElementExpr and VAArgExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69240 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
d3c98a02c73417689deaaa6671ea6df7f2a8a73c 16-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for ExtVectorElementExpr and VAArgExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69240 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
c599bbf9f6816cbefa2650ab18a4ce610775425f 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for CompoundAssignOperator and ConditionalOperator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69237 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
ad90e96fb7eed26d5217dd06ba50ecbbbebb59e6 16-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for CompoundAssignOperator and ConditionalOperator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69237 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
21ddd8cd9f39e8090e6637fc59eec1ead8092060 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for ImaginaryLiteral and ArraySubscriptExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69233 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
cb2ca73c1d7e76cc1358ce51457d2d5837d84f9b 16-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for ImaginaryLiteral and ArraySubscriptExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69233 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
bdd4ba50747c173689db9dcf01c02e05b975962f 16-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for ExtQualType

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69230 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
6d473967121ac70ecede83bb2b47247e9a3766f3 16-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for ExtQualType

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69230 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
1c5078881cbde0e85b487f7f022b91801646d4b5 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for declaration attributes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69225 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
68a2eb0cc76267ba0615992fb5e0977853c397b2 15-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for declaration attributes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69225 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
3c8ff3ef86712c7684a1bea8a72130a776402f66 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for the string literal of a FileScopeAsmDecl.
Some minor cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69196 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
6a2bfb2ead4489db37e80b696a6d7cc073c76fd7 15-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for the string literal of a FileScopeAsmDecl.
Some minor cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69196 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
364e5802d19e46d42913107998c5ff6008dd4cd1 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> For source location entries that describe instantiations, encode the
token length in the PCH file rather than trying (and failing) to
reconstruct it be getting the spelling token's length.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69191 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
f60e9918690fcf02974bc1ebecd42c99d561855e 15-Apr-2009 Douglas Gregor <dgregor@apple.com> For source location entries that describe instantiations, encode the
token length in the PCH file rather than trying (and failing) to
reconstruct it be getting the spelling token's length.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69191 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
7e2b1cd1ea97a4d2ff8096be01d92646715414c2 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for MemberExpr and CallExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69186 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
1f0d0133b0e8d1f01f63951ee04927796b34740d 15-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for MemberExpr and CallExpr.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69186 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
596e093e4eb79a78ceb02d8d3b78d3c6d3088cc0 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for string literals

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69172 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
673ecd6a4a9f7c12fb6f76f84f654dbdcdc89e76 15-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for string literals

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69172 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
12d7405658246a6252805e4d64f54d4ebef41859 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for UnaryOperator, SizeOfAlignOfExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69169 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
0b0b77fa29c74c99a77548ed86ca8a04f7cf6b02 15-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for UnaryOperator, SizeOfAlignOfExpr

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69169 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
6dc849b5755bea2b54d624a2cfeff2d0d65dbdb9 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Don't tip-to around BitstreamReader::JumpToBit jumping to the end of the stream. LLVM has been updated to allow this

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69146 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
62e445c4dff3cfa6b040153a6f53116073d85846 15-Apr-2009 Douglas Gregor <dgregor@apple.com> Don't tip-to around BitstreamReader::JumpToBit jumping to the end of the stream. LLVM has been updated to allow this

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69146 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
c75d0cbfbe5a6c525a1eaf5d2062a0386e5fc6b4 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for CStyleCastExpr and BinaryOperator expression kinds.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69119 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
db600c330a37b1c3ab4533310729910ee188f900 15-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for CStyleCastExpr and BinaryOperator expression kinds.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69119 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
4ea0b1fbabc67f7d2a1fe35df8dc0b1bd6bfdf56 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for ParenExpr


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69106 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
c04db4feefa2b0dbbc6876cb4eeeee108aa6791d 15-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for ParenExpr


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69106 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
a151ba485fefb14e2237321ba13c346853f765e3 15-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Add PCH support for ImplicitCastExprs. This is the first expression
kind PCH handles that has an expression as an operand, so most of this
work is in the infrastructure to rebuild expression trees from the
serialized representation. We now store expressions in post-order
(e.g., Reverse Polish Notation), so that we can easily rebuild the
appropriate expression tree.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69101 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
087fd536809ebe754d91c641a98917e02dd7452d 15-Apr-2009 Douglas Gregor <dgregor@apple.com> Add PCH support for ImplicitCastExprs. This is the first expression
kind PCH handles that has an expression as an operand, so most of this
work is in the infrastructure to rebuild expression trees from the
serialized representation. We now store expressions in post-order
(e.g., Reverse Polish Notation), so that we can easily rebuild the
appropriate expression tree.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69101 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
e1be6022a0d3c1b7bc55c74f96edaac22f1da21a 15-Apr-2009 Chris Lattner <sabre@nondot.org> Change Lexer::MeasureTokenLength to take a LangOptions reference.
This allows it to accurately measure tokens, so that we get:

t.cpp:8:13: error: unknown type name 'X'
static foo::X P;
~~~~~^

instead of the woefully inferior:

t.cpp:8:13: error: unknown type name 'X'
static foo::X P;
~~~~ ^

Most of this is just plumbing to push the reference around.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69099 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
TMLDiagnostics.cpp
CHReader.cpp
listDiagnostics.cpp
extDiagnosticPrinter.cpp
2c78b873f4f3823ae859c15674cb3d76c8554113 15-Apr-2009 Chris Lattner <sabre@nondot.org> Change Lexer::MeasureTokenLength to take a LangOptions reference.
This allows it to accurately measure tokens, so that we get:

t.cpp:8:13: error: unknown type name 'X'
static foo::X P;
~~~~~^

instead of the woefully inferior:

t.cpp:8:13: error: unknown type name 'X'
static foo::X P;
~~~~ ^

Most of this is just plumbing to push the reference around.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69099 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
TMLDiagnostics.cpp
CHReader.cpp
listDiagnostics.cpp
extDiagnosticPrinter.cpp
e2f3720dcee0a0fa77ddffa42a7cd4c88006659e 14-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Add PCH support for PredefinedExpr and FloatingLiteral expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69084 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
17fc223395d51be582fc666bb6ea21bd1dff26dc 14-Apr-2009 Douglas Gregor <dgregor@apple.com> Add PCH support for PredefinedExpr and FloatingLiteral expressions

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69084 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
c10f86ffa5a4693fe3f3779305047d260c35d90b 14-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for a few very, very simple kinds of expressions. Hook up
expression (de-)serialization for VLAs, variable initializers,
enum constant initializers, and bitfield widths.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69075 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
0b7489194f9f89fac39d57211c1e7953ae50251f 14-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for a few very, very simple kinds of expressions. Hook up
expression (de-)serialization for VLAs, variable initializers,
enum constant initializers, and bitfield widths.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69075 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
631f6c64882b5254c5e4dbde6ec604dd4b96fd23 14-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> When writing a PCH file, keep track of all of the non-static,
non-inline external definitions (and tentative definitions) that are
found at the top level. The corresponding declarations are stored in a
record in the PCH file, so that they can be provided to the
ASTConsumer (via HandleTopLevelDecl) when the PCH file is read.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69005 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
fdd0172ca1b3c837f8c2b37d69cc2085234e09fa 14-Apr-2009 Douglas Gregor <dgregor@apple.com> When writing a PCH file, keep track of all of the non-static,
non-inline external definitions (and tentative definitions) that are
found at the top level. The corresponding declarations are stored in a
record in the PCH file, so that they can be provided to the
ASTConsumer (via HandleTopLevelDecl) when the PCH file is read.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69005 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2a49179c4c884b49f446728ccf0f306751396255 14-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Partial PCH support for FileScopeAsmDecl and BlockDecl. Both require
expression or statement serialization before we can test them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69002 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
1028bc67d56ea088c3a57c4c44c3f6aeff60a031 14-Apr-2009 Douglas Gregor <dgregor@apple.com> Partial PCH support for FileScopeAsmDecl and BlockDecl. Both require
expression or statement serialization before we can test them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69002 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
23ce3a5b5e65ff7d43001cd829a99932173a345e 14-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for functions and their parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68997 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
3a2f7e42514ddbec983c61826ce85d3071e23e8e 14-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for functions and their parameters.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68997 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
982365e249bd61429e7ed4e38556b8cd84dc356e 13-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH support for record decls/types and their fields. Now that we can
handle the definition of __builtin_va_list on x86-64, eliminate the
forced -triple in PCH tests to get better coverage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68988 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
8c70006581a9b9e9485570ca727a6c5f7be63521 13-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH support for record decls/types and their fields. Now that we can
handle the definition of __builtin_va_list on x86-64, eliminate the
forced -triple in PCH tests to get better coverage.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68988 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
9cf47427ae3a7a84b45b881dcf380840c9d4dfae 13-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Print the number (and percentage) of identifiers read from the PCH file as part of its statistics

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68985 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
2d41cc1a8c82d892b82218d20487d0cde199dc77 13-Apr-2009 Douglas Gregor <dgregor@apple.com> Print the number (and percentage) of identifiers read from the PCH file as part of its statistics

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68985 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
88fd09d449e6b2130eae76ebcf71dbd6df25c5b4 13-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce PCH (de-)serialization for most compound types, excluding
Objective-C types and record types for the moment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68984 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
b4e715beeb670b30a8d1237085e3379fe28afb0f 13-Apr-2009 Douglas Gregor <dgregor@apple.com> Introduce PCH (de-)serialization for most compound types, excluding
Objective-C types and record types for the moment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68984 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
47f1b2cbd21093c1348fe3c59f513cb2abed3255 13-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Add PCH support for enumerations and enumerators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68974 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
0a2b45e5885b6b8477b167042c0f6cd1d99a1f13 13-Apr-2009 Douglas Gregor <dgregor@apple.com> Add PCH support for enumerations and enumerators.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68974 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
183ad60a72fb9caf6fadf77ad95e229cf940244d 13-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Make the reading of the line table from a PCH file more robust against
the unlikely event that the filename IDs in the stored line table end
up being different from the filename IDs in the newly-created line
table.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68965 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
ff0a9872aafbe9c0c37b06f33ed013471fc361f8 13-Apr-2009 Douglas Gregor <dgregor@apple.com> Make the reading of the line table from a PCH file more robust against
the unlikely event that the filename IDs in the stored line table end
up being different from the filename IDs in the newly-created line
table.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68965 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
635f97f496328be23baade4b8c0e2cb5f4215d34 13-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Include the SourceManager's line table in the PCH file. We can now
properly cope with #line directives in PCH files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68963 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
bd94500d3aa60092fb0f1e90f53fb0d03fa502a8 13-Apr-2009 Douglas Gregor <dgregor@apple.com> Include the SourceManager's line table in the PCH file. We can now
properly cope with #line directives in PCH files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68963 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
4b21c20753389c64f7f0a89e6ef34d0eaaf3e3ce 13-Apr-2009 Chris Lattner <sabre@nondot.org> implement the microsoft/gnu "__COUNTER__" macro: rdar://4329310


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68933 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
c1f9d828c733ec1eba06d01070735d1f36fda733 13-Apr-2009 Chris Lattner <sabre@nondot.org> implement the microsoft/gnu "__COUNTER__" macro: rdar://4329310


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68933 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
29241860a38d1db6de4aad454cb74452c265dd53 11-Apr-2009 Chris Lattner <sabre@nondot.org> now that we have an identifier table in the PCH file, finish hooking up
macro deserialization. We now correctly install II's in tokens, handle
function-like macros, etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68882 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
7356a31327be9b3c3434a0c88746028980da5684 11-Apr-2009 Chris Lattner <sabre@nondot.org> now that we have an identifier table in the PCH file, finish hooking up
macro deserialization. We now correctly install II's in tokens, handle
function-like macros, etc.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68882 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
64b65f88dfb89c769c6e7a7c53a80d85d01ffdec 11-Apr-2009 Chris Lattner <sabre@nondot.org> add some #includes for better compatibility with gcc 4.4,
thanks to Tobias Stadler for pointing this out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68868 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
3c304bd9ec2b4611572d4cbae9e1727bbecb5dc9 11-Apr-2009 Chris Lattner <sabre@nondot.org> add some #includes for better compatibility with gcc 4.4,
thanks to Tobias Stadler for pointing this out.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68868 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
7a224cfc5265f1a06cdbabbc3fbfe8387ecc3d02 11-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Store unique IDs for identifiers in the PCH file. Use some bitmangling
so that we only need to perform the lookup and identifier resolution
once per identifier in the PCH file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68846 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
afaf308b779cd8e8fc8c42601b9f383423c15c2d 11-Apr-2009 Douglas Gregor <dgregor@apple.com> Store unique IDs for identifiers in the PCH file. Use some bitmangling
so that we only need to perform the lookup and identifier resolution
once per identifier in the PCH file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68846 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
b3a04c8b6ed5c93e1358246ff80dc869ca2a0efd 11-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Compare the predefines buffer in the PCH file with the predefines
buffer generated for the current translation unit. If they are
different, complain and then ignore the PCH file. This effectively
checks for all compilation options that somehow would affect
preprocessor state (-D, -U, -include, the dreaded -imacros, etc.).

When we do accept the PCH file, throw away the contents of the
predefines buffer rather than parsing them, since all of the results
of that parsing are already stored in the PCH file. This eliminates
the ugliness with the redefinition of __builtin_va_list, among other
things.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68838 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
e1d918e9fe55e3b34401fd5d420c47ea0f9572c9 11-Apr-2009 Douglas Gregor <dgregor@apple.com> Compare the predefines buffer in the PCH file with the predefines
buffer generated for the current translation unit. If they are
different, complain and then ignore the PCH file. This effectively
checks for all compilation options that somehow would affect
preprocessor state (-D, -U, -include, the dreaded -imacros, etc.).

When we do accept the PCH file, throw away the contents of the
predefines buffer rather than parsing them, since all of the results
of that parsing are already stored in the PCH file. This eliminates
the ugliness with the redefinition of __builtin_va_list, among other
things.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68838 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
9a1c029d139454f15270d4a2a9f993c97a29c5c5 11-Apr-2009 Chris Lattner <sabre@nondot.org> do a dance with predefines, and finally enable reading of macros from
PCH. This works now, except for limitations not being able to do things
with identifiers. The basic example in the testcase works though.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68832 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
531cc8355608295caa01f31fa4e078d77a3d6470 11-Apr-2009 Chris Lattner <sabre@nondot.org> do a dance with predefines, and finally enable reading of macros from
PCH. This works now, except for limitations not being able to do things
with identifiers. The basic example in the testcase works though.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68832 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
db1c81b6e4f5129686a794228c7b7c7a3a8a74a5 10-Apr-2009 Chris Lattner <sabre@nondot.org> add support for reading macros. This does all the reading (with a bunch of
fixme's, e.g. for tokens with identifiers) but does not actually install
them. Some details with the predefines buffer needs to be sorted out first.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68828 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
42d42b5b84603032e57add333b5b44e0ef99bd9e 10-Apr-2009 Chris Lattner <sabre@nondot.org> add support for reading macros. This does all the reading (with a bunch of
fixme's, e.g. for tokens with identifiers) but does not actually install
them. Some details with the predefines buffer needs to be sorted out first.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68828 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
b5887f3db333427f9e0bb3adcdd46d8df71a6a7b 10-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Encode the target triple in the PCH file, and check that target triple when using the PCH file

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68824 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2bec0410d268779f601bd509e0302a500af7ac6a 10-Apr-2009 Douglas Gregor <dgregor@apple.com> Encode the target triple in the PCH file, and check that target triple when using the PCH file

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68824 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
179cfb1201fb5a1e80f0f65abab334f414210a73 10-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Implement serialization/deserialization of LangOptions in the PCH
file. When de-serializing LangOptions, we check that the
currently-provided language options are consistent with the options
used to compile the PCH file. If they are not, we emit a diagnostic
and ignore the PCH file.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68820 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
0a0428e96c6f1e8bef7a481a9eb69a6f6df38951 10-Apr-2009 Douglas Gregor <dgregor@apple.com> Implement serialization/deserialization of LangOptions in the PCH
file. When de-serializing LangOptions, we check that the
currently-provided language options are consistent with the options
used to compile the PCH file. If they are not, we emit a diagnostic
and ignore the PCH file.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68820 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
0523c0162c49b9a1d47a7a1fc45521a18b99641b 10-Apr-2009 Chris Lattner <sabre@nondot.org> add a new PP_MACRO_NAME hack so that I can test object-like macros.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68803 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
d14f27053c5d2a9140eed38b9d208b94e7f83b31 10-Apr-2009 Chris Lattner <sabre@nondot.org> add a new PP_MACRO_NAME hack so that I can test object-like macros.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68803 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
850eabdc06c965f36bc4dda0e47c4075eec94165 10-Apr-2009 Chris Lattner <sabre@nondot.org> emit tokens, constify the Preprocessor passed down into PCH writer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68798 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
df961c28f84666051ad59d2da1f44023f6366d02 10-Apr-2009 Chris Lattner <sabre@nondot.org> emit tokens, constify the Preprocessor passed down into PCH writer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68798 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
1b094953f00df1cf46a584cb986fd56d3eff8973 10-Apr-2009 Chris Lattner <sabre@nondot.org> emit function-like and object-like macros to the PCH file.
Note that we don't do anything useful with identifier infos yet
and don't emit the tokens that the macros are defined to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68797 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
7c5d24efcd2e505b5739f7def08dfe25ce59a1b2 10-Apr-2009 Chris Lattner <sabre@nondot.org> emit function-like and object-like macros to the PCH file.
Note that we don't do anything useful with identifier infos yet
and don't emit the tokens that the macros are defined to.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68797 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
c965f557ef12842ddef9c005ccb617682d088cf5 10-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Add PCH sources to CMake build files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68794 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
f1202511ee2438ba6e57489c2d4e84342b35436c 10-Apr-2009 Douglas Gregor <dgregor@apple.com> Add PCH sources to CMake build files

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68794 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ac8f280704e948b8051e8e9bd7f557127d31624b 10-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Various minor fixes to PCH reading and writing, with general
cleanup. Aside from a minor tweak to the PCH file format, no
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68793 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
8038d5182b72dcdef292f6fb8539ad77f338855a 10-Apr-2009 Douglas Gregor <dgregor@apple.com> Various minor fixes to PCH reading and writing, with general
cleanup. Aside from a minor tweak to the PCH file format, no
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68793 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
84b04f1ebdc0027c3230f91792c9861124146203 10-Apr-2009 Chris Lattner <sabre@nondot.org> improve punctuation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68791 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
f04ad69fed38d26fc0d6f7d6fd0a4631ddfbc7fe 10-Apr-2009 Chris Lattner <sabre@nondot.org> improve punctuation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68791 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
ffc05ed23455aa7ae1e33a8e1d9227015d2666ac 10-Apr-2009 Chris Lattner <sabre@nondot.org> Arrange for the preprocessor to be passed down into the PCH writer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68790 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
0b1fb988012da21d996c43e36867787a7a07b889 10-Apr-2009 Chris Lattner <sabre@nondot.org> Arrange for the preprocessor to be passed down into the PCH writer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68790 91177308-0d34-0410-b5e6-96231b3b80d8
CHWriter.cpp
ab1cef74f1dd3666977c3d53645f21306f96e086 10-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> PCH serialization/deserialization of the source manager. With this
improvement, source locations read from the PCH file will properly
resolve to the source files that were used to build the PCH file
itself.

Once we have the preprocessor state stored in the PCH file, source
locations that refer to macro instantiations that occur in the PCH
file should have the appropriate instantiation information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68758 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
14f79002e58556798e86168c63e48d533287eda5 10-Apr-2009 Douglas Gregor <dgregor@apple.com> PCH serialization/deserialization of the source manager. With this
improvement, source locations read from the PCH file will properly
resolve to the source files that were used to build the PCH file
itself.

Once we have the preprocessor state stored in the PCH file, source
locations that refer to macro instantiations that occur in the PCH
file should have the appropriate instantiation information.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68758 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
c34897dac02ae4ac32e65601c9b175fa17edf1f6 10-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Implementation of pre-compiled headers (PCH) based on lazy
de-serialization of abstract syntax trees.

PCH support serializes the contents of the abstract syntax tree (AST)
to a bitstream. When the PCH file is read, declarations are serialized
as-needed. For example, a declaration of a variable "x" will be
deserialized only when its VarDecl can be found by a client, e.g.,
based on name lookup for "x" or traversing the entire contents of the
owner of "x".

This commit provides the framework for serialization and (lazy)
deserialization, along with support for variable and typedef
declarations (along with several kinds of types). More
declarations/types, along with important auxiliary structures (source
manager, preprocessor, etc.), will follow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68732 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
2cf2634ffdb4f7c8d46cef3f8e60a55993f1c57a 10-Apr-2009 Douglas Gregor <dgregor@apple.com> Implementation of pre-compiled headers (PCH) based on lazy
de-serialization of abstract syntax trees.

PCH support serializes the contents of the abstract syntax tree (AST)
to a bitstream. When the PCH file is read, declarations are serialized
as-needed. For example, a declaration of a variable "x" will be
deserialized only when its VarDecl can be found by a client, e.g.,
based on name lookup for "x" or traversing the entire contents of the
owner of "x".

This commit provides the framework for serialization and (lazy)
deserialization, along with support for variable and typedef
declarations (along with several kinds of types). More
declarations/types, along with important auxiliary structures (source
manager, preprocessor, etc.), will follow.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68732 91177308-0d34-0410-b5e6-96231b3b80d8
CHReader.cpp
CHWriter.cpp
1780d8a35c775c8047ad5e68f24e02e882893c1f 05-Apr-2009 Ted Kremenek <kremenek@apple.com> Fix output of ranges in analyzer plist files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68437 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
f076339c679a889f751873a9cf8e5ad4a8686a03 05-Apr-2009 Ted Kremenek <kremenek@apple.com> Fix output of ranges in analyzer plist files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68437 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
24b48b064cb801d6f38ad8f7aac0f535bc0be3e0 02-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Add a new command-line option "-fixit-at=file:line:column" that only
applies fix-its to error messages that occur at that specific location
in the program.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68342 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
26df2f09587ad6978ac8e357ca46b2731d591cc4 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Add a new command-line option "-fixit-at=file:line:column" that only
applies fix-its to error messages that occur at that specific location
in the program.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68342 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
563a251a2b3d640d631c014bea16eda560c27d3e 02-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Provide FIX-IT notes to describe what fix-it is doing behind the
scenes, using the underlying diagnostic client to format the
messages.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68324 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
de4bf6a63219c5b9d3bce1fed3dfe075568098a0 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Provide FIX-IT notes to describe what fix-it is doing behind the
scenes, using the underlying diagnostic client to format the
messages.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68324 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
8f87d0c59ea728b9f405cb88a57a15f1d38801ff 02-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Some cleanups to the fix-it rewriter. Thanks, Chris

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68322 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ixItRewriter.cpp
837a406c6666ebe4dc7b75f7848a7c0cc523e307 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Some cleanups to the fix-it rewriter. Thanks, Chris

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68322 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ixItRewriter.cpp
25bd1a9fc1a75380a92860159361ad0983ccad98 02-Apr-2009 Ted Kremenek <kremenek@apple.com> Also "flatten" PathLocations fed to the HTMLDiagnosticClient. We need a better
long-term strategy, but this should work for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68297 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
7db0a94675a0d5f33120e39144c3827d8bc8994f 02-Apr-2009 Ted Kremenek <kremenek@apple.com> Also "flatten" PathLocations fed to the HTMLDiagnosticClient. We need a better
long-term strategy, but this should work for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68297 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
899ae67dc06ebe16da389d33b837962a85c6db04 02-Apr-2009 Ted Kremenek <kremenek@apple.com> Hack: Add 'PathDiagnostic::flattenLocations()'. Because PlistDiagnosticClient
can use a PathLocation after any reference Stmts are reclaimed,
flattenLocation() converts those references to statements to source ranges.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68292 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
96a69267fc771dcb288bb7b3c5b5b6d49a9542ff 02-Apr-2009 Ted Kremenek <kremenek@apple.com> Hack: Add 'PathDiagnostic::flattenLocations()'. Because PlistDiagnosticClient
can use a PathLocation after any reference Stmts are reclaimed,
flattenLocation() converts those references to statements to source ranges.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68292 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
9f52b2a46fc7ec69fc1baa7944a7f8a444643c7e 02-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Clean up -fixit output slightly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68278 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
261034861d2c8cfbd6036e56f22f57d7a3736861 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Clean up -fixit output slightly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68278 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
133d2554efb2245f1757becfd369cb298495f0bc 02-Apr-2009 Douglas Gregor <doug.gregor@gmail.com> Introduce a "-fixit" mode to clang-cc that applies code-modification hints.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68268 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
558cb56caf8906e0adbe643e3febbef0b7af1b9f 02-Apr-2009 Douglas Gregor <dgregor@apple.com> Introduce a "-fixit" mode to clang-cc that applies code-modification hints.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68268 91177308-0d34-0410-b5e6-96231b3b80d8
ixItRewriter.cpp
94d4d870eb74a1694da9b4a7728d0ebe64b9178c 02-Apr-2009 Ted Kremenek <kremenek@apple.com> For plist diagnostics, use the extensive PathDiagnostic generation algorithm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68264 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
67f496497532a8b58b8bae11772aea858124475c 02-Apr-2009 Ted Kremenek <kremenek@apple.com> For plist diagnostics, use the extensive PathDiagnostic generation algorithm.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68264 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
2fba615a01fdcf27d03c41117bfc266db7955812 01-Apr-2009 Ted Kremenek <kremenek@apple.com> - Changed PathDiagnosticPiece::getLocation() to return a PathDiagnosticLocation
instead of a FullSourceLoc. This resulted in a bunch of small edits in various
clients.
- Updated BugReporter to include an alternate PathDiagnostic generation
algorithm for PathDiagnosticClients desiring more control-flow pieces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68193 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
listDiagnostics.cpp
5fb5dfb6646464db3cd6d54a6332375c8fe36b75 01-Apr-2009 Ted Kremenek <kremenek@apple.com> - Changed PathDiagnosticPiece::getLocation() to return a PathDiagnosticLocation
instead of a FullSourceLoc. This resulted in a bunch of small edits in various
clients.
- Updated BugReporter to include an alternate PathDiagnostic generation
algorithm for PathDiagnosticClients desiring more control-flow pieces.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68193 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
listDiagnostics.cpp
f9ea36b71d12c7dff9b75db5f20001c91884fa84 31-Mar-2009 Ted Kremenek <kremenek@apple.com> Allow two codepaths for PathDiagnostic generation. This patch mainly consists of
refactoring to make this possible (no functionality change).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68141 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
7dc8664a54f4ede40a5f4adee3f5081a59d7ee1c 31-Mar-2009 Ted Kremenek <kremenek@apple.com> Allow two codepaths for PathDiagnostic generation. This patch mainly consists of
refactoring to make this possible (no functionality change).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68141 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
b1c888acb94f6dda5af888206606d47c85a9822d 28-Mar-2009 Ted Kremenek <kremenek@apple.com> Properly escape special characters in <string>'s in plist file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67924 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
b0b6f726ab78ca32d60c5970777ae1d383d047df 28-Mar-2009 Ted Kremenek <kremenek@apple.com> Properly escape special characters in <string>'s in plist file.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67924 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
28def6c6642bb0c2f90509c060ea5d953bfd59a1 27-Mar-2009 Ted Kremenek <kremenek@apple.com> analyzer plist: For PathDiagnosticControlFlowPieces, now output an array of
start-end points, where start and end are source ranges.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67847 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
f48fbc6cb1a7fa972d89f2e0adf5c4b5495160e3 27-Mar-2009 Ted Kremenek <kremenek@apple.com> analyzer plist: For PathDiagnosticControlFlowPieces, now output an array of
start-end points, where start and end are source ranges.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67847 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
4fc6675f8e39837f7a791a844eea744792528c3d 27-Mar-2009 Ted Kremenek <kremenek@apple.com> Emit aggregate "location" for PathDiagnostic to plist. This fixes <rdar://problem/6729558>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67845 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
ca1bada92c6e95d7beed2afdde5eaf3759fa8607 27-Mar-2009 Ted Kremenek <kremenek@apple.com> Emit aggregate "location" for PathDiagnostic to plist. This fixes <rdar://problem/6729558>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67845 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
149f0d82b1430ec62e86e942fb366da1749f21fd 27-Mar-2009 Ted Kremenek <kremenek@apple.com> BugReporter:
- Added an internal helper class 'PathDiagnosticBuilder' which now bundles the
'ExecutionContinues' methods.
- Added preliminary diagnostics for short-circuit '&&' and '||'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67822 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
babdd7b56d02e2b6924a2c93b061d6a48bb5f0ca 27-Mar-2009 Ted Kremenek <kremenek@apple.com> BugReporter:
- Added an internal helper class 'PathDiagnosticBuilder' which now bundles the
'ExecutionContinues' methods.
- Added preliminary diagnostics for short-circuit '&&' and '||'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67822 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
d55809de94c2c69ec250d8950290dc16e868aaed 24-Mar-2009 Mike Stump <mrs@apple.com> Really fix cmake style builds.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67633 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
a43a21ef141fd2e814f4936ff0291a8306e00b97 24-Mar-2009 Mike Stump <mrs@apple.com> Really fix cmake style builds.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67633 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
8c0c2c1ec553f89bbfa36bcb8ac37125662d84c9 19-Mar-2009 Ted Kremenek <kremenek@apple.com> Plist diagnostics: distinguish between regular and extended messages for "events".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67269 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
61dc71ab04ffb38a2387057e70885f260a5b1e32 19-Mar-2009 Ted Kremenek <kremenek@apple.com> Plist diagnostics: distinguish between regular and extended messages for "events".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67269 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
026a2ef889178bbf6707465b73909aa38aaf7e6b 17-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Build system changes to use TableGen to generate the various
diagnostics. This builds on the patch that Sebastian committed and
then revert. Major differences are:

- We don't remove or use the current ".def" files. Instead, for now,
we just make sure that we're building the ".inc" files.
- Fixed CMake makefiles to run TableGen and build the ".inc" files
when needed. Tested with both the Xcode and Makefile generators
provided by CMake, so it should be solid.
- Fixed normal makefiles to handle out-of-source builds that involve
the ".inc" files.

I'll send a separate patch to the list with Sebastian's changes that
eliminate the use of the .def files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67058 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
a393e9eedcc28b25f521a4feceb3b56e3d0d360f 17-Mar-2009 Douglas Gregor <dgregor@apple.com> Build system changes to use TableGen to generate the various
diagnostics. This builds on the patch that Sebastian committed and
then revert. Major differences are:

- We don't remove or use the current ".def" files. Instead, for now,
we just make sure that we're building the ".inc" files.
- Fixed CMake makefiles to run TableGen and build the ".inc" files
when needed. Tested with both the Xcode and Makefile generators
provided by CMake, so it should be solid.
- Fixed normal makefiles to handle out-of-source builds that involve
the ".inc" files.

I'll send a separate patch to the list with Sebastian's changes that
eliminate the use of the .def files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67058 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
695a4f5758026f41a046aa9182252c2736048cb4 13-Mar-2009 Chris Lattner <sabre@nondot.org> implement a new -fprint-source-range-info option, which
defaults to off. When enabled, it emits range info along
with the file/line/col information for a diagnostic. This
allows tools that textually parse the output of clang to know
where the ranges are, even if they span multiple lines. For
example, with:

$ clang exprs.c -fprint-source-range-info

We now produce:

exprs.c:21:11:{21:12-21:13}: warning: use of unary operator that may be intended as compound assignment (+=)
var =+ 5; // expected-warning {{use of unary operator that may be intended as compound assignment (+=)}}
^~
exprs.c:22:11:{22:12-22:13}: warning: use of unary operator that may be intended as compound assignment (-=)
var =- 5; // expected-warning {{use of unary operator that may be intended as compound assignment (-=)}}
^~
exprs.c:36:13:{36:3-36:12}: error: assignment to cast is illegal, lvalue casts are not supported
(float*)X = P; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}}
~~~~~~~~~ ^
exprs.c:41:4:{41:3-41:4}: error: called object type 'int' is not a function or function pointer
X(); // expected-error {{called object type 'int' is not a function or function pointer}}
~^
exprs.c:45:15:{45:8-45:14}{45:17-45:24}: error: invalid operands to binary expression ('int *' and '_Complex float')
P = (P-42) + Gamma*4; // expected-error {{invalid operands to binary expression ('int *' and '_Complex float')}}
~~~~~~ ^ ~~~~~~~
exprs.c:61:7:{61:16-61:22}: error: invalid application of '__alignof' to bitfield
R = __alignof(P->x); // expected-error {{invalid application of '__alignof' to bitfield}} expected-warning {{extension used}}
^ ~~~~~~

Note the range info after the column in the initial diagnostic.

This is obviously really annoying if you're not a tool parsing the
output of clang, which is why it is off by default.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66862 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
1fbee5d02860d3c72a713d3dfb4179fa9f400cb3 13-Mar-2009 Chris Lattner <sabre@nondot.org> implement a new -fprint-source-range-info option, which
defaults to off. When enabled, it emits range info along
with the file/line/col information for a diagnostic. This
allows tools that textually parse the output of clang to know
where the ranges are, even if they span multiple lines. For
example, with:

$ clang exprs.c -fprint-source-range-info

We now produce:

exprs.c:21:11:{21:12-21:13}: warning: use of unary operator that may be intended as compound assignment (+=)
var =+ 5; // expected-warning {{use of unary operator that may be intended as compound assignment (+=)}}
^~
exprs.c:22:11:{22:12-22:13}: warning: use of unary operator that may be intended as compound assignment (-=)
var =- 5; // expected-warning {{use of unary operator that may be intended as compound assignment (-=)}}
^~
exprs.c:36:13:{36:3-36:12}: error: assignment to cast is illegal, lvalue casts are not supported
(float*)X = P; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}}
~~~~~~~~~ ^
exprs.c:41:4:{41:3-41:4}: error: called object type 'int' is not a function or function pointer
X(); // expected-error {{called object type 'int' is not a function or function pointer}}
~^
exprs.c:45:15:{45:8-45:14}{45:17-45:24}: error: invalid operands to binary expression ('int *' and '_Complex float')
P = (P-42) + Gamma*4; // expected-error {{invalid operands to binary expression ('int *' and '_Complex float')}}
~~~~~~ ^ ~~~~~~~
exprs.c:61:7:{61:16-61:22}: error: invalid application of '__alignof' to bitfield
R = __alignof(P->x); // expected-error {{invalid application of '__alignof' to bitfield}} expected-warning {{extension used}}
^ ~~~~~~

Note the range info after the column in the initial diagnostic.

This is obviously really annoying if you're not a tool parsing the
output of clang, which is why it is off by default.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66862 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
b11cd810cc59b9e037d8217c3c3bf6ddfe161267 12-Mar-2009 Ted Kremenek <kremenek@apple.com> PathDiagnostics:
- PathDiagnosticControlFlowPiece now consists of a "start" and "end" location
to indicating the branch location and where the branch goes.

BugReporter:
- Updated BugReporter to construct PathDiagnosticControlFlowPiece objects with
"end" locations.

PlistDiagnostics:
- Plists now contain the bug "type" (not just bug "category")
- Plists now encode control-flow pieces differently than events; now the
"start" and "end" locations are recorded


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66818 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
082cb8d7bd9bdb3fe58e8e1a2897c79c4ebcc3a7 12-Mar-2009 Ted Kremenek <kremenek@apple.com> PathDiagnostics:
- PathDiagnosticControlFlowPiece now consists of a "start" and "end" location
to indicating the branch location and where the branch goes.

BugReporter:
- Updated BugReporter to construct PathDiagnosticControlFlowPiece objects with
"end" locations.

PlistDiagnostics:
- Plists now contain the bug "type" (not just bug "category")
- Plists now encode control-flow pieces differently than events; now the
"start" and "end" locations are recorded


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66818 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
56d25a726f0bdb4db08021b9e98782ada5241eaf 10-Mar-2009 Douglas Gregor <doug.gregor@gmail.com> Extend the notion of active template instantiations to include the
context of a template-id for which we need to instantiate default
template arguments.

In the TextDiagnosticPrinter, don't suppress the caret diagnostic if
we are producing a non-note diagnostic that follows a note diagnostic
with the same location, because notes are (conceptually) a part of the
warning or error that comes before them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66572 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
df667e71b1daadeacb230cf94fc717843f1a138a 10-Mar-2009 Douglas Gregor <dgregor@apple.com> Extend the notion of active template instantiations to include the
context of a template-id for which we need to instantiate default
template arguments.

In the TextDiagnosticPrinter, don't suppress the caret diagnostic if
we are producing a non-note diagnostic that follows a note diagnostic
with the same location, because notes are (conceptually) a part of the
warning or error that comes before them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66572 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
383bee593ec9faa7b78901e498d8c1d9370daa1a 10-Mar-2009 Ted Kremenek <kremenek@apple.com> BugReporter:
- Group control flow and event PathDiagnosticPieces into PathDiagnosticMacroPieces.
- Afterwards, eliminate any PathDiagnosticMacroPieces from a PathDiagnostic that
contain no informative events.

HTMLDiagnostics:
- Use new information about PathDiagnosticMacroPieces to specially format
message bubbles for macro expansions containing interesting events.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66524 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
0e5c8d4ca6c7e472ddde13495c8d3558983de85a 10-Mar-2009 Ted Kremenek <kremenek@apple.com> BugReporter:
- Group control flow and event PathDiagnosticPieces into PathDiagnosticMacroPieces.
- Afterwards, eliminate any PathDiagnosticMacroPieces from a PathDiagnostic that
contain no informative events.

HTMLDiagnostics:
- Use new information about PathDiagnosticMacroPieces to specially format
message bubbles for macro expansions containing interesting events.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66524 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
a12db96998818edf5a371e1da68cbd6c608882a9 10-Mar-2009 Ted Kremenek <kremenek@apple.com> Handle "Macro" PathDiagnosticPiece kind when getting string identifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66518 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
listDiagnostics.cpp
0008683bee5ab26c2a5a495adb2a894fc7e7c7c9 10-Mar-2009 Ted Kremenek <kremenek@apple.com> Handle "Macro" PathDiagnosticPiece kind when getting string identifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66518 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
listDiagnostics.cpp
d9e7241d5fc4026dfc0f251553bb15ba936bb2e8 08-Mar-2009 Chris Lattner <sabre@nondot.org> generalize the "end of line" checking logic to stop at any \0 at the
end of line instead of just the end of buffer. Scratch buffers contain
embedded \0's between tokens which are logic line separators. If a
normal text buffer contains \0's, it doesn't make a lot of sense to include
them in the caret diag output anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66374 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
cd1148b6145094ae3cabd02e6ef1d50dcc2d07b0 08-Mar-2009 Chris Lattner <sabre@nondot.org> generalize the "end of line" checking logic to stop at any \0 at the
end of line instead of just the end of buffer. Scratch buffers contain
embedded \0's between tokens which are logic line separators. If a
normal text buffer contains \0's, it doesn't make a lot of sense to include
them in the caret diag output anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66374 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
0617ed1abf6a6d95c281a3b40e2ac7d2159880f2 03-Mar-2009 Ted Kremenek <kremenek@apple.com> Resize message bubble back to original size.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65892 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
4e25ee3b12040a4309543585cfa5b8687cbc213c 03-Mar-2009 Ted Kremenek <kremenek@apple.com> Resize message bubble back to original size.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65892 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
7573886f2a82f6d383436a361ebaa555ad5f5d3a 03-Mar-2009 Ted Kremenek <kremenek@apple.com> Adjust HTML message bubbles to utilize information from PathDiagnosticPiece::Kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65891 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
80bae763da8bf3f3c73379a1e5d10f5bce266bca 03-Mar-2009 Ted Kremenek <kremenek@apple.com> Adjust HTML message bubbles to utilize information from PathDiagnosticPiece::Kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65891 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
7d6220ca4a53b38673473fd461ff8e983d22225e 02-Mar-2009 Chris Lattner <sabre@nondot.org> improve compatibility with GCC 4.4, patch by Michel Salim (PR3697)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65884 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
3daed52a57d03765223021f5f921bdc280c8f3cc 02-Mar-2009 Chris Lattner <sabre@nondot.org> improve compatibility with GCC 4.4, patch by Michel Salim (PR3697)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65884 91177308-0d34-0410-b5e6-96231b3b80d8
nitHeaderSearch.cpp
8beef05146314be5c96fd9d4be40a9bc6322c675 02-Mar-2009 Ted Kremenek <kremenek@apple.com> Plist diagnostics now include PathDiagnostPiece::Kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65878 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
ae3487f78747512ce718c6c00ef888787da50a1e 02-Mar-2009 Ted Kremenek <kremenek@apple.com> Plist diagnostics now include PathDiagnostPiece::Kind.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65878 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
f07c457ca172991ca2ec225d00edf6aa2f7f2477 02-Mar-2009 Ted Kremenek <kremenek@apple.com> Update HTML diagnostics to honor the different between 'event' and 'control-flow' diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65877 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
2f10398814e8d58cce029a7e73af21bb274dcd42 02-Mar-2009 Ted Kremenek <kremenek@apple.com> Update HTML diagnostics to honor the different between 'event' and 'control-flow' diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65877 91177308-0d34-0410-b5e6-96231b3b80d8
TMLDiagnostics.cpp
9ccffa7517fe3f6ad14a69bc669d28fe5eef3a7e 02-Mar-2009 Chris Lattner <sabre@nondot.org> fix PR2639


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65869 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
7b5b5b4409a64849908f67b9e389c0ba185b64b0 02-Mar-2009 Chris Lattner <sabre@nondot.org> fix PR2639


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65869 91177308-0d34-0410-b5e6-96231b3b80d8
extDiagnosticPrinter.cpp
202ca6503e4c218e4c95b137320640a5b337f359 02-Mar-2009 Daniel Dunbar <daniel@zuster.org> Fix name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65865 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
4ad19bf5b94593beff85cc0e1dfb2a6bb67bf3d3 02-Mar-2009 Daniel Dunbar <daniel@zuster.org> Fix name.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65865 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
4edc2b555a5d6d93b9fa49cd5fda5cd46f633e50 02-Mar-2009 Ted Kremenek <kremenek@apple.com> For now, do not output the 'DisplayHint' in plist files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65861 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
3d7f2bc5a53adeec60c14b2f763cc59545d725f2 02-Mar-2009 Ted Kremenek <kremenek@apple.com> For now, do not output the 'DisplayHint' in plist files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65861 91177308-0d34-0410-b5e6-96231b3b80d8
listDiagnostics.cpp
68952de6d75d9d1fad97e67eea6deeaeddd2cd6b 02-Mar-2009 Daniel Dunbar <daniel@zuster.org> Rename lib/Driver (etc) to lib/Frontend in prep for the *actual*
driver taking lib/Driver.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65811 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
TMLDiagnostics.cpp
nitHeaderSearch.cpp
akefile
anagerRegistry.cpp
listDiagnostics.cpp
extDiagnosticBuffer.cpp
extDiagnosticPrinter.cpp
e1bd4e6d7c5b13462f83245865f7d9e9b6ea8486 02-Mar-2009 Daniel Dunbar <daniel@zuster.org> Rename lib/Driver (etc) to lib/Frontend in prep for the *actual*
driver taking lib/Driver.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65811 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
TMLDiagnostics.cpp
nitHeaderSearch.cpp
akefile
anagerRegistry.cpp
listDiagnostics.cpp
extDiagnosticBuffer.cpp
extDiagnosticPrinter.cpp