]> granicus.if.org Git - clang/log
clang
14 years agoDriver: Fix possible crash when targetting an unknown (unsupported) Darwin
Daniel Dunbar [Sat, 20 Mar 2010 00:50:21 +0000 (00:50 +0000)]
Driver: Fix possible crash when targetting an unknown (unsupported) Darwin
platform, e.g. ppc.

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

14 years agoOptimize region-of-interest based cursor walks through the
Douglas Gregor [Sat, 20 Mar 2010 00:41:21 +0000 (00:41 +0000)]
Optimize region-of-interest based cursor walks through the
preprocessed entities by grouping preprocessed entities by file
ID. This drastically improves performance of repeated
clang_getCursor() calls local tests, although it is a bit ugly.

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

14 years agoChange CodeGenModule to rely on the Module's symbol table instead of
John McCall [Fri, 19 Mar 2010 23:29:14 +0000 (23:29 +0000)]
Change CodeGenModule to rely on the Module's symbol table instead of
shadowing it in the GlobalDeclMap.  Eliminates the string-uniquing
requirement for mangled names, which should help C++ codegen times a little.
Forces us to do string lookups instead of pointer lookups, which might hurt
codegen times a little across the board.  We'll see how it plays out.

Removing the string-uniquing requirement implicitly fixes any bugs like
PR6635 which arose from the fact that we had multiple uniquing tables for
different kinds of identifiers.

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

14 years agoRemove the capture, serialization, and deserialization of comment
Douglas Gregor [Fri, 19 Mar 2010 22:13:20 +0000 (22:13 +0000)]
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

14 years agoRobustify PreprocessingRecord slightly, by only creating macro
Douglas Gregor [Fri, 19 Mar 2010 21:58:23 +0000 (21:58 +0000)]
Robustify PreprocessingRecord slightly, by only creating macro
instantiations when we have the corresponding macro definition and by
removing macro definition information from our table when the macro is
undefined.

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

14 years agoImplement serialization and lazy deserialization of the preprocessing
Douglas Gregor [Fri, 19 Mar 2010 21:51:54 +0000 (21:51 +0000)]
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

14 years agoMore coherent diagnostics when ivar is placed n categories.
Fariborz Jahanian [Fri, 19 Mar 2010 21:25:51 +0000 (21:25 +0000)]
More coherent diagnostics when ivar is placed n categories.
(related to radar 7538989).

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

14 years agoTeach clang_getCursorKindSpelling() about CXCursor_InvalidCode.
Ted Kremenek [Fri, 19 Mar 2010 20:39:05 +0000 (20:39 +0000)]
Teach clang_getCursorKindSpelling() about CXCursor_InvalidCode.

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

14 years agoMake the CIndex API more resilient to being used on invalid code.
Ted Kremenek [Fri, 19 Mar 2010 20:39:03 +0000 (20:39 +0000)]
Make the CIndex API more resilient to being used on invalid code.

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

14 years agoAdd test case for <rdar://problem/7770737>.
Ted Kremenek [Fri, 19 Mar 2010 19:45:03 +0000 (19:45 +0000)]
Add test case for  <rdar://problem/7770737>.

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

14 years agoclang -cc1: Kill off -empty-input only, and replace with -init-only which is an
Daniel Dunbar [Fri, 19 Mar 2010 19:44:04 +0000 (19:44 +0000)]
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

14 years agoPromote enum types during -Wsign-compare. Fixes some spurious warnings,
John McCall [Fri, 19 Mar 2010 18:53:26 +0000 (18:53 +0000)]
Promote enum types during -Wsign-compare.  Fixes some spurious warnings,
mostly during conditional expressions.

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

14 years agoDiagnose conversion of 'Class' to/from objective-c
Fariborz Jahanian [Fri, 19 Mar 2010 18:06:10 +0000 (18:06 +0000)]
Diagnose conversion of 'Class' to/from objective-c
object pointer types.
Fixes radar 7634850.

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

14 years agoMake the preprocessing record a PPCallbacks subclass itself,
Douglas Gregor [Fri, 19 Mar 2010 17:12:43 +0000 (17:12 +0000)]
Make the preprocessing record a PPCallbacks subclass itself,
eliminating the extra PopulatePreprocessingRecord object. This will
become useful once we start writing the preprocessing record to
precompiled headers.

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

14 years agoOptionally store a PreprocessingRecord in the preprocessor itself, and
Douglas Gregor [Fri, 19 Mar 2010 16:15:56 +0000 (16:15 +0000)]
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

14 years agoTry to improve computation of the main file name for debug
Douglas Gregor [Fri, 19 Mar 2010 14:49:09 +0000 (14:49 +0000)]
Try to improve computation of the main file name for debug
information, to address recent gdb failures.

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

14 years agoPretty-print anonymous types using their kind and presumed location.
John McCall [Fri, 19 Mar 2010 07:56:44 +0000 (07:56 +0000)]
Pretty-print anonymous types using their kind and presumed location.
Fixes PR6643.  Patch by Mike M!

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

14 years agoRemember the "found declaration" for an overload candidate, which is the
John McCall [Fri, 19 Mar 2010 07:35:19 +0000 (07:35 +0000)]
Remember the "found declaration" for an overload candidate, which is the
entity (if applicable) which was actually looked up.  If a candidate was found
via a using declaration, this is the UsingShadowDecl;  otherwise, if
the candidate is template specialization, this is the template;  otherwise,
this is the function.

The point of this exercise is that "found declarations" are the entities
we do access control for, not their underlying declarations.  Broadly speaking,
this patch fixes access control for using declarations.

There is a *lot* of redundant code calling into the overload-resolution APIs;
we really ought to clean that up.

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

14 years agoFix a longstanding (but previously unknown) bug in the lazy
Douglas Gregor [Fri, 19 Mar 2010 06:12:06 +0000 (06:12 +0000)]
Fix a longstanding (but previously unknown) bug in the lazy
deserialization of precompiled headers, where the deserialization of
the source location entry for a buffer (e.g., macro instantiation
scratch space) would overwrite a one-element FileID cache in the
source manager. When tickled at the wrong time, we would return the
wrong decomposed source location and eventually cause c-index-test to
crash.

Found by dumb luck. It's amazing this hasn't shown up before.

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

14 years agoVisit preprocessing elements (macro instantiations and macro
Douglas Gregor [Fri, 19 Mar 2010 05:22:59 +0000 (05:22 +0000)]
Visit preprocessing elements (macro instantiations and macro
definitions) as part of the translation unit, so that normal
visitation, token-annotation, and cursor-at retrieval all see
preprocessing elements.

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

14 years agoRevert 98907 since it is breaking buildbots.
Bob Wilson [Fri, 19 Mar 2010 03:57:57 +0000 (03:57 +0000)]
Revert 98907 since it is breaking buildbots.
--- Reverse-merging r98907 into '.':
D    test/Index/c-index-getCursor-pp.c
U    tools/CIndex/CIndex.cpp

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

14 years agoVisit preprocessing elements (macro instantiations and macro
Douglas Gregor [Fri, 19 Mar 2010 00:18:31 +0000 (00:18 +0000)]
Visit preprocessing elements (macro instantiations and macro
definitions) as part of the translation unit, so that normal
visitation, token-annotation, and cursor-at retrieval all see
preprocessing elements.

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

14 years agoWhen elevating access along an inheritance path, initialize the computed
John McCall [Thu, 18 Mar 2010 23:49:19 +0000 (23:49 +0000)]
When elevating access along an inheritance path, initialize the computed
access to the (elevated) access of the accessed declaration, if applicable,
rather than plunking that access onto the end after we've calculated the
inheritance access.

Also, being a friend of a derived class gives you public access to its
members (subject to later modification by further inheritance);  it does
not simply ignore a single location of restricted inheritance.

Also, when computing the best unprivileged path to a subobject, preserve
the information that the worst path might be AS_none (forbidden) rather
than a minimum of AS_private.

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

14 years agoFor debug information, get the main file name from the source manager
Douglas Gregor [Thu, 18 Mar 2010 23:46:43 +0000 (23:46 +0000)]
For debug information, get the main file name from the source manager
rather than from the -main-file-name flag, since the source manager
has proper path information. Fixes <rdar://problem/7769538>.

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

14 years agoTry to appease MSVC's standard library
Douglas Gregor [Thu, 18 Mar 2010 21:28:30 +0000 (21:28 +0000)]
Try to appease MSVC's standard library

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

14 years agoTry to appease MSVC
Douglas Gregor [Thu, 18 Mar 2010 21:25:12 +0000 (21:25 +0000)]
Try to appease MSVC

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

14 years agoMake PredefinedExpr::ComputeName() more robust to incorrect
Ted Kremenek [Thu, 18 Mar 2010 21:23:08 +0000 (21:23 +0000)]
Make PredefinedExpr::ComputeName() more robust to incorrect
code when we are printing the name of an Objective-C method
whose class has not been declared.  Fixes <rdar://problem/7495713>.

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

14 years agoAdd bounds check in PCHReader. when reading source file entry record
Ted Kremenek [Thu, 18 Mar 2010 21:23:05 +0000 (21:23 +0000)]
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

14 years agoSome cleanup, change diagnostic when assigning to
Fariborz Jahanian [Thu, 18 Mar 2010 18:50:41 +0000 (18:50 +0000)]
Some cleanup, change diagnostic when assigning to
a property which is not lvalue.

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

14 years agoExplicitly link macro instantiations to macro definitions in the
Douglas Gregor [Thu, 18 Mar 2010 18:23:03 +0000 (18:23 +0000)]
Explicitly link macro instantiations to macro definitions in the
preprocessing record. Use that link with clang_getCursorReferenced()
and clang_getCursorDefinition() to match instantiations of a macro to
the definition of the macro.

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

14 years agoExpose macro definitions as CIndex cursors. These can still only be
Douglas Gregor [Thu, 18 Mar 2010 18:04:21 +0000 (18:04 +0000)]
Expose macro definitions as CIndex cursors. These can still only be
generated by clang_annotateTokens().

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

14 years agoIntroduce the notion of a "preprocessing record", which keeps track of
Douglas Gregor [Thu, 18 Mar 2010 17:52:52 +0000 (17:52 +0000)]
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

14 years agoReplace some SmallVectors with arrays.
Benjamin Kramer [Thu, 18 Mar 2010 16:59:57 +0000 (16:59 +0000)]
Replace some SmallVectors with arrays.

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

14 years agoDefang
Douglas Gregor [Thu, 18 Mar 2010 15:37:47 +0000 (15:37 +0000)]
Defang

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

14 years agoMore token-annotation experimentation, preprocessing the annotated
Douglas Gregor [Thu, 18 Mar 2010 15:23:44 +0000 (15:23 +0000)]
More token-annotation experimentation, preprocessing the annotated
token sequence to detect macro instantiations (that produce at least
token). WIP.

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

14 years agoDefang a test that's failing intermittently on windows
Douglas Gregor [Thu, 18 Mar 2010 14:59:12 +0000 (14:59 +0000)]
Defang a test that's failing intermittently on windows

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

14 years agoFix 80 col violation
Kovarththanan Rajaratnam [Thu, 18 Mar 2010 13:56:20 +0000 (13:56 +0000)]
Fix 80 col violation

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

14 years agoSimply tags target
Kovarththanan Rajaratnam [Thu, 18 Mar 2010 13:52:43 +0000 (13:52 +0000)]
Simply tags target

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

14 years agofrom code inspection, we were treating placement news with one argument as
John McCall [Thu, 18 Mar 2010 08:19:33 +0000 (08:19 +0000)]
from code inspection, we were treating placement news with one argument as
non-placement news when selecting the corresponding operator delete;  this is
fixed.
Access and ambiguity control for calls to operator new and delete.  Also AFAICT

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

14 years agoMake some typedefs private
Kovarththanan Rajaratnam [Thu, 18 Mar 2010 07:45:30 +0000 (07:45 +0000)]
Make some typedefs private

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

14 years agoRename variable to indicate what it is being used for
Kovarththanan Rajaratnam [Thu, 18 Mar 2010 07:18:10 +0000 (07:18 +0000)]
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

14 years agoRedeclaration lookups for parameter names should be flagged as redeclaration lookups
John McCall [Thu, 18 Mar 2010 06:42:38 +0000 (06:42 +0000)]
Redeclaration lookups for parameter names should be flagged as redeclaration lookups
so they don't trigger diagnostics like (say) access control.

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

14 years agoBump clang minor version (1.5).
Ted Kremenek [Thu, 18 Mar 2010 04:39:55 +0000 (04:39 +0000)]
Bump clang minor version (1.5).

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

14 years agoRefactor argument checking in CallAndMessageChecker to be the same
Ted Kremenek [Thu, 18 Mar 2010 03:22:29 +0000 (03:22 +0000)]
Refactor argument checking in CallAndMessageChecker to be the same
for both CallExprs and ObjCMessageExprs.

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

14 years agoWhen dumping vtables, also dump the thunks.
Anders Carlsson [Thu, 18 Mar 2010 02:44:19 +0000 (02:44 +0000)]
When dumping vtables, also dump the thunks.

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

14 years agoDetect pass-by-value arguments that are structs that contain
Ted Kremenek [Thu, 18 Mar 2010 02:17:27 +0000 (02:17 +0000)]
Detect pass-by-value arguments that are structs that contain
uninitialized data.

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

14 years agoTweak dead stores checker to not emit a warning when initialization
Ted Kremenek [Thu, 18 Mar 2010 01:22:39 +0000 (01:22 +0000)]
Tweak dead stores checker to not emit a warning when initialization
a scalar variable with a scalar parameter.  This is a
form of defensive programming.  If the variable is unused,
it will be caused by -Wunused-variable.

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

14 years agoSimplify code (and remove 'dyn_cast') by using ObjCProperyDecl::findPropertyDecl().
Ted Kremenek [Thu, 18 Mar 2010 01:22:36 +0000 (01:22 +0000)]
Simplify code (and remove 'dyn_cast') by using ObjCProperyDecl::findPropertyDecl().

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

14 years agoTurn several PCH reader assertions into compiler errors, thus making
Ted Kremenek [Thu, 18 Mar 2010 00:56:54 +0000 (00:56 +0000)]
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

14 years agoExperimental stab at using relexing to identify preprocessor
Douglas Gregor [Thu, 18 Mar 2010 00:42:48 +0000 (00:42 +0000)]
Experimental stab at using relexing to identify preprocessor
directives while annotating tokens in CIndex. This functionality
should probably be factored out of this routine, but we're not there
yet.

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

14 years agoMore work on thunks.
Anders Carlsson [Wed, 17 Mar 2010 20:06:32 +0000 (20:06 +0000)]
More work on thunks.

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

14 years agoImplement non-dependent friend functions and classes.
John McCall [Wed, 17 Mar 2010 20:01:29 +0000 (20:01 +0000)]
Implement non-dependent friend functions and classes.

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

14 years agoActOnTagDefinitionError is supposed to 'unwind' ActOnTagStartDefinition, not
John McCall [Wed, 17 Mar 2010 19:25:57 +0000 (19:25 +0000)]
ActOnTagDefinitionError is supposed to 'unwind' ActOnTagStartDefinition, not
ActOnStartCXXMemberDeclaration.  We haven't started the field collector on this
class yet, so don't stop it.  Fixes a crash in the VS buildbot and a memory error
on all the others.

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

14 years agoReduce the default alignment for ASTContext and Stmt/Expr allocation
Douglas Gregor [Wed, 17 Mar 2010 18:46:59 +0000 (18:46 +0000)]
Reduce the default alignment for ASTContext and Stmt/Expr allocation
from 16 bytes to 8 bytes, since we don't ever use those low 4
bits. Should save some storage.

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

14 years agoXFAIL this test on that silly Windows platform. Grrr
Douglas Gregor [Wed, 17 Mar 2010 18:28:02 +0000 (18:28 +0000)]
XFAIL this test on that silly Windows platform. Grrr

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

14 years agoRemove this test. It is causing problems has has relatively little value
Douglas Gregor [Wed, 17 Mar 2010 16:04:04 +0000 (16:04 +0000)]
Remove this test. It is causing problems has has relatively little value

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

14 years agoRemove warning about shadowing a built-in; built-ins aren't actually
Douglas Gregor [Wed, 17 Mar 2010 16:03:44 +0000 (16:03 +0000)]
Remove warning about shadowing a built-in; built-ins aren't actually
considered to be a part of the translation unit unless they're named
in a way that brings them into existence.

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

14 years agoEntering the main source file in the preprocessor can fail if the
Douglas Gregor [Wed, 17 Mar 2010 15:44:30 +0000 (15:44 +0000)]
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

14 years agoCheck the inode in addition to size and modification time to determine
Douglas Gregor [Wed, 17 Mar 2010 15:33:06 +0000 (15:33 +0000)]
Check the inode in addition to size and modification time to determine
whether a file has changed since it was originally read.

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

14 years agoUse a simple diagnostic (file modified) when we detect that a file has
Douglas Gregor [Wed, 17 Mar 2010 15:30:15 +0000 (15:30 +0000)]
Use a simple diagnostic (file modified) when we detect that a file has
changed, rather than trying to point out how it changed. The "why"
doesn't matter.

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

14 years agoSimplify error path using OwningPtr
Kovarththanan Rajaratnam [Wed, 17 Mar 2010 09:47:30 +0000 (09:47 +0000)]
Simplify error path using OwningPtr

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

14 years agoSimplify ProcessWarningOptions since it can't fail
Kovarththanan Rajaratnam [Wed, 17 Mar 2010 09:36:02 +0000 (09:36 +0000)]
Simplify ProcessWarningOptions since it can't fail

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

14 years agoRemove useless forward decl.
Kovarththanan Rajaratnam [Wed, 17 Mar 2010 09:25:49 +0000 (09:25 +0000)]
Remove useless forward decl.

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

14 years agoIssue a proper diagnostic if we couldn't open dump file
Kovarththanan Rajaratnam [Wed, 17 Mar 2010 09:24:48 +0000 (09:24 +0000)]
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

14 years agoRemove useless foward decl.
Kovarththanan Rajaratnam [Wed, 17 Mar 2010 08:44:19 +0000 (08:44 +0000)]
Remove useless foward decl.

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

14 years agoAdd another compatibility note and tweak a few of the existing ones.
John McCall [Wed, 17 Mar 2010 07:10:56 +0000 (07:10 +0000)]
Add another compatibility note and tweak a few of the existing ones.

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

14 years agoFix a typo in a tag.
Chandler Carruth [Wed, 17 Mar 2010 05:46:21 +0000 (05:46 +0000)]
Fix a typo in a tag.

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

14 years agoGrant nested classes the access privileges of their enclosing classes.
John McCall [Wed, 17 Mar 2010 04:58:56 +0000 (04:58 +0000)]
Grant nested classes the access privileges of their enclosing classes.

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

14 years agoDocument common clang compatibility issues.
Rafael Espindola [Wed, 17 Mar 2010 04:31:53 +0000 (04:31 +0000)]
Document common clang compatibility issues.

Patch by Zhanyong Wan.

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

14 years agoCorrectly mangle dependent TypenameType.
Rafael Espindola [Wed, 17 Mar 2010 04:28:11 +0000 (04:28 +0000)]
Correctly mangle dependent TypenameType.
Fixes PR6625.

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

14 years agoMark CXXThisRegion in the current or parent stack frame context as live so that
Zhongxing Xu [Wed, 17 Mar 2010 03:35:08 +0000 (03:35 +0000)]
Mark CXXThisRegion in the current or parent stack frame context as live so that
their bindings are not removed.

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

14 years agoMake -faccess-control and -fno-access-control driver options.
John McCall [Wed, 17 Mar 2010 01:32:13 +0000 (01:32 +0000)]
Make -faccess-control and -fno-access-control driver options.

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

14 years agoProvide a test case for PR6629.
John McCall [Wed, 17 Mar 2010 01:31:25 +0000 (01:31 +0000)]
Provide a test case for PR6629.

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

14 years agoClean up after ourselves when there's an error parsing the base clause.
John McCall [Wed, 17 Mar 2010 00:38:33 +0000 (00:38 +0000)]
Clean up after ourselves when there's an error parsing the base clause.
Fixes the crash-on-invalid in PR6629.

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

14 years agoDon't "take" the file manager and source manager when
Douglas Gregor [Wed, 17 Mar 2010 00:32:06 +0000 (00:32 +0000)]
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

14 years agoobjective-c patch to provide type safty when blocks are passing or
Fariborz Jahanian [Wed, 17 Mar 2010 00:20:01 +0000 (00:20 +0000)]
objective-c patch to provide type safty when blocks are passing or
returning objc objects. There will be a corresponding objective-c++
patch soon.

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

14 years agoEmit output of PCH consistency checking test case to a separate text file and grep...
Douglas Gregor [Wed, 17 Mar 2010 00:09:23 +0000 (00:09 +0000)]
Emit output of PCH consistency checking test case to a separate text file and grep that

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

14 years agoIssue error when a byref array is accessed in a block
Fariborz Jahanian [Tue, 16 Mar 2010 23:39:51 +0000 (23:39 +0000)]
Issue error when a byref array is accessed in a block
literal. Fixes radar 7760213.

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

14 years agoRemove unused variable
Douglas Gregor [Tue, 16 Mar 2010 22:54:32 +0000 (22:54 +0000)]
Remove unused variable

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

14 years agoTeach SourceManager's content cache to keep track of whether its
Douglas Gregor [Tue, 16 Mar 2010 22:53:51 +0000 (22:53 +0000)]
Teach SourceManager's content cache to keep track of whether its
buffer was invalid when it was created, and use that bit to always set
the "Invalid" flag according to whether the buffer is invalid. This
ensures that all accesses to an invalid buffer are marked invalid,
improving recovery.

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

14 years agoAudit all Preprocessor::getSpelling() callers, improving failure
Douglas Gregor [Tue, 16 Mar 2010 22:30:13 +0000 (22:30 +0000)]
Audit all Preprocessor::getSpelling() callers, improving failure
recovery for those that need it.

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

14 years agofix copyright & typo
Blaine Garst [Tue, 16 Mar 2010 22:02:16 +0000 (22:02 +0000)]
fix copyright & typo

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

14 years agoForgot the testcases.
John McCall [Tue, 16 Mar 2010 21:50:59 +0000 (21:50 +0000)]
Forgot the testcases.

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

14 years agoImplement -Wshadow. Based on a patch by Mike M.!
John McCall [Tue, 16 Mar 2010 21:48:18 +0000 (21:48 +0000)]
Implement -Wshadow.  Based on a patch by Mike M.!

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

14 years agoupdate link
Chris Lattner [Tue, 16 Mar 2010 21:43:03 +0000 (21:43 +0000)]
update link

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

14 years agoPerform access control for the implicit calls to base and member destructors
John McCall [Tue, 16 Mar 2010 21:39:52 +0000 (21:39 +0000)]
Perform access control for the implicit calls to base and member destructors
that occur in constructors (on the unwind path).

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

14 years agoat least give the Apple ABI a name that reflects Apple in prep for other ABI specs...
Blaine Garst [Tue, 16 Mar 2010 21:22:41 +0000 (21:22 +0000)]
at least give the Apple ABI a name that reflects Apple in prep for other ABI specs that might come along

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

14 years agorev existing doc to account for recent ABI changes
Blaine Garst [Tue, 16 Mar 2010 21:21:07 +0000 (21:21 +0000)]
rev existing doc to account for recent ABI changes

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

14 years agoUpdate get*LineNumber() and get*ColumnNumber() functions to pass the
Douglas Gregor [Tue, 16 Mar 2010 20:53:17 +0000 (20:53 +0000)]
Update get*LineNumber() and get*ColumnNumber() functions to pass the
Invalid bit through; there are no safety-critical callers of these
functions.

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

14 years agoAudit all callers of SourceManager::getCharacterData(); update some of
Douglas Gregor [Tue, 16 Mar 2010 20:46:42 +0000 (20:46 +0000)]
Audit all callers of SourceManager::getCharacterData(); update some of
them to recover more gracefully on failure.

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

14 years agoAudit all callers of SourceManager::getBufferData(); fix the one that
Douglas Gregor [Tue, 16 Mar 2010 20:26:15 +0000 (20:26 +0000)]
Audit all callers of SourceManager::getBufferData(); fix the one that
needs better error recovery.

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

14 years agoAudit all getBuffer() callers (for both the FullSourceLoc and
Douglas Gregor [Tue, 16 Mar 2010 20:01:30 +0000 (20:01 +0000)]
Audit all getBuffer() callers (for both the FullSourceLoc and
SourceManager versions), updating those callers that need to recover
gracefully from failure.

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

14 years agoTeach the one caller of SourceManager::getMemoryBufferForFile() to cope with errors
Douglas Gregor [Tue, 16 Mar 2010 19:49:24 +0000 (19:49 +0000)]
Teach the one caller of SourceManager::getMemoryBufferForFile() to cope with errors

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

14 years agoaccept and ignore __gcc_tdiag__ so we don't produce warnings
Chris Lattner [Tue, 16 Mar 2010 19:29:19 +0000 (19:29 +0000)]
accept and ignore __gcc_tdiag__ so we don't produce warnings
building mainline GCC, PR6542

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

14 years agoMake sure we actually override ReadHeaderFileInfo when we meant to
Douglas Gregor [Tue, 16 Mar 2010 19:09:18 +0000 (19:09 +0000)]
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

14 years agoDriver: Fix forwarding of -fno-lax-vector-conversions.
Daniel Dunbar [Tue, 16 Mar 2010 16:57:46 +0000 (16:57 +0000)]
Driver: Fix forwarding of -fno-lax-vector-conversions.

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

14 years agoFix header-search problems with precompiled headers, where the
Douglas Gregor [Tue, 16 Mar 2010 16:35:32 +0000 (16:35 +0000)]
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

14 years agoSwitch another function to StringRef instead of char pointer pairs.
Benjamin Kramer [Tue, 16 Mar 2010 14:48:07 +0000 (14:48 +0000)]
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

14 years agoLet SourceManager::getBufferData return StringRef instead of a pair of two const...
Benjamin Kramer [Tue, 16 Mar 2010 14:14:31 +0000 (14:14 +0000)]
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

14 years agoAdd VisitCXXContructExpr logic to the analyzer. This still has not fully worked
Zhongxing Xu [Tue, 16 Mar 2010 13:14:16 +0000 (13:14 +0000)]
Add VisitCXXContructExpr logic to the analyzer. This still has not fully worked
since RemoveDeadBinding mistakenly remove the binding to CXXThisRegion.

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