Commit Graph

21646 Commits

Author SHA1 Message Date
Daniel Dunbar 7c4de04c30 Driver: Fix -### to quote shell special characters, following gcc.
llvm-svn: 99053
2010-03-20 08:01:53 +00:00
Eric Christopher 595ecbe5c4 Add sse4.2 support to this test.
llvm-svn: 99052
2010-03-20 07:48:45 +00:00
Eric Christopher 08f135274d Add sse4.2 header and builtin support.
llvm-svn: 99051
2010-03-20 07:43:28 +00:00
Daniel Dunbar 4ff562d557 IRgen: Wrap atomic intrinsics with memory barriers, to ensure we honor the semantics.
- This should be conservatively correct, we eventually should have target hooks for platforms that are less strict.

llvm-svn: 99050
2010-03-20 07:04:11 +00:00
Daniel Dunbar 4c43e31d21 Evaluate: Fix a subtle bug in the pointer evaluator in which we would do an
expression computation in the wrong bit-width, and end up generating a totally
bogus array reference (_g0+8589934546).
 - This showed up on Prolangs/cdecl.

llvm-svn: 99042
2010-03-20 05:53:45 +00:00
Daniel Dunbar e46b52a35f Driver: Fix a number of -fapple-kext issues:
- Disable RTTI.
 - Disable use of __cxa_atexit.
 - Disable unwind tables.
 - Enable freestanding mode.

Also, honor -fhosted correctly.

<rdar://problem/7515383> C++ support: -fapple-kext not honored

llvm-svn: 99041
2010-03-20 04:52:14 +00:00
Daniel Dunbar 4e3e0991e9 Revert r99024, "Augment path diagnostics to include displaying when a message
expression", statistical evidence indicates it has some kind of memory error.

llvm-svn: 99040
2010-03-20 04:28:39 +00:00
Daniel Dunbar fe06df4bf3 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.

llvm-svn: 99039
2010-03-20 04:15:41 +00:00
Daniel Dunbar 7572284f4f IRgen: Inline GenerateCXXGlobal[VarDecl]InitFunc into sole caller.
llvm-svn: 99038
2010-03-20 04:15:29 +00:00
John McCall 2d8c760df7 Implement -Wshadow for parameter declarations as well.
llvm-svn: 99037
2010-03-20 04:12:52 +00:00
Eric Christopher 86af0bae8a Add a newline at the end of the file.
llvm-svn: 99026
2010-03-20 01:19:04 +00:00
Eric Christopher 6ed351ab2d For legacy compatibility add a varargs.h header.
llvm-svn: 99025
2010-03-20 01:18:30 +00:00
Ted Kremenek 8a8e3e61aa Augment path diagnostics to include displaying when a message expression
is not evaluated because the receiver is nil.

llvm-svn: 99024
2010-03-20 01:17:30 +00:00
Daniel Dunbar ed45c3f2b9 Driver: Force joining of "-l" "foo", the linker doesn't eat that format.
<rdar://problem/7641151> clang must eat spaces after -l

llvm-svn: 99023
2010-03-20 01:12:03 +00:00
Daniel Dunbar 4ea3aea534 Driver: Allow Render{Separate,Joined} option flags on JoinedOrSeparate option types.
Also, simplify/fix SeparateArg::render with forced join.

llvm-svn: 99022
2010-03-20 01:12:00 +00:00
Daniel Dunbar aef1db1d71 Fix unused variable warning.
llvm-svn: 99021
2010-03-20 01:11:56 +00:00
Eric Christopher 33124e20c7 Migrate typedefs to the top level of xmmintrin.h and remove the same
one from emmintrin.h.

llvm-svn: 99020
2010-03-20 01:08:47 +00:00
Eric Christopher 576a9f2508 Add include for smmintrin.h to this test.
llvm-svn: 99019
2010-03-20 01:06:48 +00:00
Daniel Dunbar 47d25b18db Driver: Fix possible crash when targetting an unknown (unsupported) Darwin
platform, e.g. ppc.

llvm-svn: 99016
2010-03-20 00:50:21 +00:00
Douglas Gregor 3dc10b530e 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.

llvm-svn: 99015
2010-03-20 00:41:21 +00:00
John McCall 7ec5043c2c 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.

llvm-svn: 99012
2010-03-19 23:29:14 +00:00
Douglas Gregor 9507d46d62 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.

llvm-svn: 99007
2010-03-19 22:13:20 +00:00
Douglas Gregor 8aaca67b0a 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. 

llvm-svn: 99004
2010-03-19 21:58:23 +00:00
Douglas Gregor aae9224e49 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.

llvm-svn: 99002
2010-03-19 21:51:54 +00:00
Fariborz Jahanian 5140920a48 More coherent diagnostics when ivar is placed n categories.
(related to radar 7538989).

llvm-svn: 98993
2010-03-19 21:25:51 +00:00
Ted Kremenek 00da3b9a80 Teach clang_getCursorKindSpelling() about CXCursor_InvalidCode.
llvm-svn: 98982
2010-03-19 20:39:05 +00:00
Ted Kremenek e184ac5a66 Make the CIndex API more resilient to being used on invalid code.
llvm-svn: 98981
2010-03-19 20:39:03 +00:00
Ted Kremenek c517974e9e Add test case for <rdar://problem/7770737>.
llvm-svn: 98979
2010-03-19 19:45:03 +00:00
Daniel Dunbar 1c201fbf73 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.

llvm-svn: 98978
2010-03-19 19:44:04 +00:00
John McCall ce5cbdc4ff Promote enum types during -Wsign-compare. Fixes some spurious warnings,
mostly during conditional expressions.

llvm-svn: 98975
2010-03-19 18:53:26 +00:00
Fariborz Jahanian d5bb8cb348 Diagnose conversion of 'Class' to/from objective-c
object pointer types.
Fixes radar 7634850.

llvm-svn: 98970
2010-03-19 18:06:10 +00:00
Douglas Gregor 7dc8722bd3 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.

llvm-svn: 98966
2010-03-19 17:12:43 +00:00
Douglas Gregor 7f6d60dcc2 Optionally store a PreprocessingRecord in the preprocessor itself, and
tie its creation to a CC1 flag -detailed-preprocessing-record.

llvm-svn: 98963
2010-03-19 16:15:56 +00:00
Douglas Gregor fc7a4813ab Try to improve computation of the main file name for debug
information, to address recent gdb failures.

llvm-svn: 98959
2010-03-19 14:49:09 +00:00
John McCall ef01f71a5a Pretty-print anonymous types using their kind and presumed location.
Fixes PR6643.  Patch by Mike M!

llvm-svn: 98946
2010-03-19 07:56:44 +00:00
John McCall a0296f7987 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.

llvm-svn: 98945
2010-03-19 07:35:19 +00:00
Douglas Gregor 51c2351d30 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.

llvm-svn: 98940
2010-03-19 06:12:06 +00:00
Douglas Gregor 5272e80ce5 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.

llvm-svn: 98935
2010-03-19 05:22:59 +00:00
Bob Wilson 4f559a3042 Revert 98907 since it is breaking buildbots.
--- Reverse-merging r98907 into '.':
D    test/Index/c-index-getCursor-pp.c
U    tools/CIndex/CIndex.cpp

llvm-svn: 98929
2010-03-19 03:57:57 +00:00
Douglas Gregor 20004ee7d2 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.

llvm-svn: 98907
2010-03-19 00:18:31 +00:00
John McCall a332b953e8 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.

llvm-svn: 98899
2010-03-18 23:49:19 +00:00
Douglas Gregor c6b5a3df1e 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>.

llvm-svn: 98898
2010-03-18 23:46:43 +00:00
Douglas Gregor e56c353eb1 Try to appease MSVC's standard library
llvm-svn: 98878
2010-03-18 21:28:30 +00:00
Douglas Gregor 5810ead358 Try to appease MSVC
llvm-svn: 98875
2010-03-18 21:25:12 +00:00
Ted Kremenek 361ffd947c 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>.

llvm-svn: 98874
2010-03-18 21:23:08 +00:00
Ted Kremenek abb1dddfcd Add bounds check in PCHReader. when reading source file entry record
llvm-svn: 98873
2010-03-18 21:23:05 +00:00
Fariborz Jahanian 8342e5776e Some cleanup, change diagnostic when assigning to
a property which is not lvalue.

llvm-svn: 98848
2010-03-18 18:50:41 +00:00
Douglas Gregor 78ae2481b6 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.

llvm-svn: 98842
2010-03-18 18:23:03 +00:00
Douglas Gregor 06d6d32762 Expose macro definitions as CIndex cursors. These can still only be
generated by clang_annotateTokens().

llvm-svn: 98837
2010-03-18 18:04:21 +00:00
Douglas Gregor 065f8d11ca 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.

llvm-svn: 98836
2010-03-18 17:52:52 +00:00
Benjamin Kramer 966e934b34 Replace some SmallVectors with arrays.
llvm-svn: 98833
2010-03-18 16:59:57 +00:00
Douglas Gregor 1793c07114 Defang
llvm-svn: 98827
2010-03-18 15:37:47 +00:00
Douglas Gregor 02ded2a56c More token-annotation experimentation, preprocessing the annotated
token sequence to detect macro instantiations (that produce at least
token). WIP.

llvm-svn: 98826
2010-03-18 15:23:44 +00:00
Douglas Gregor 48d75d1bda Defang a test that's failing intermittently on windows
llvm-svn: 98825
2010-03-18 14:59:12 +00:00
Kovarththanan Rajaratnam 8fc5a80905 Fix 80 col violation
llvm-svn: 98823
2010-03-18 13:56:20 +00:00
Kovarththanan Rajaratnam 5a487710b5 Simply tags target
llvm-svn: 98822
2010-03-18 13:52:43 +00:00
John McCall fb6f52671a 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

llvm-svn: 98818
2010-03-18 08:19:33 +00:00
Kovarththanan Rajaratnam 5497e49ae4 Make some typedefs private
llvm-svn: 98817
2010-03-18 07:45:30 +00:00
Kovarththanan Rajaratnam 3fd8082ff5 Rename variable to indicate what it is being used for
llvm-svn: 98816
2010-03-18 07:18:10 +00:00
John McCall 84f0267301 Redeclaration lookups for parameter names should be flagged as redeclaration lookups
so they don't trigger diagnostics like (say) access control.

llvm-svn: 98806
2010-03-18 06:42:38 +00:00
Ted Kremenek 48ad2c92fc Bump clang minor version (1.5).
llvm-svn: 98801
2010-03-18 04:39:55 +00:00
Ted Kremenek c342c9c001 Refactor argument checking in CallAndMessageChecker to be the same
for both CallExprs and ObjCMessageExprs.

llvm-svn: 98800
2010-03-18 03:22:29 +00:00
Anders Carlsson 18c582d9c8 When dumping vtables, also dump the thunks.
llvm-svn: 98799
2010-03-18 02:44:19 +00:00
Ted Kremenek 9c05f4ef69 Detect pass-by-value arguments that are structs that contain
uninitialized data.

llvm-svn: 98796
2010-03-18 02:17:27 +00:00
Ted Kremenek e174fda979 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.

llvm-svn: 98795
2010-03-18 01:22:39 +00:00
Ted Kremenek 1bc22f719f Simplify code (and remove 'dyn_cast') by using ObjCProperyDecl::findPropertyDecl().
llvm-svn: 98794
2010-03-18 01:22:36 +00:00
Ted Kremenek 1ff615ce4c Turn several PCH reader assertions into compiler errors, thus making
the PCHReader more robust to corrupt or invalid PCH files.

llvm-svn: 98788
2010-03-18 00:56:54 +00:00
Douglas Gregor 92a524fd47 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. 

llvm-svn: 98786
2010-03-18 00:42:48 +00:00
Anders Carlsson 56446146fd More work on thunks.
llvm-svn: 98765
2010-03-17 20:06:32 +00:00
John McCall 39e8288b40 Implement non-dependent friend functions and classes.
llvm-svn: 98764
2010-03-17 20:01:29 +00:00
John McCall 71ba5f27de 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.

llvm-svn: 98760
2010-03-17 19:25:57 +00:00
Douglas Gregor ee8fed0146 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.

llvm-svn: 98754
2010-03-17 18:46:59 +00:00
Douglas Gregor fc20f82726 XFAIL this test on that silly Windows platform. Grrr
llvm-svn: 98750
2010-03-17 18:28:02 +00:00
Douglas Gregor f475990d86 Remove this test. It is causing problems has has relatively little value
llvm-svn: 98730
2010-03-17 16:04:04 +00:00
Douglas Gregor 319aa6c4b5 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.

llvm-svn: 98729
2010-03-17 16:03:44 +00:00
Douglas Gregor 4ad3da2843 Entering the main source file in the preprocessor can fail if the
source file has been changed. Handle that failure more gracefully.

llvm-svn: 98727
2010-03-17 15:44:30 +00:00
Douglas Gregor 22fde23b6e Check the inode in addition to size and modification time to determine
whether a file has changed since it was originally read.

llvm-svn: 98726
2010-03-17 15:33:06 +00:00
Douglas Gregor 6597f59506 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.

llvm-svn: 98725
2010-03-17 15:30:15 +00:00
Kovarththanan Rajaratnam eeed0cc32d Simplify error path using OwningPtr
llvm-svn: 98722
2010-03-17 09:47:30 +00:00
Kovarththanan Rajaratnam 9ff84d9c27 Simplify ProcessWarningOptions since it can't fail
llvm-svn: 98721
2010-03-17 09:36:02 +00:00
Kovarththanan Rajaratnam 5d272cda19 Remove useless forward decl.
llvm-svn: 98720
2010-03-17 09:25:49 +00:00
Kovarththanan Rajaratnam 4a94ba56f1 Issue a proper diagnostic if we couldn't open dump file
llvm-svn: 98719
2010-03-17 09:24:48 +00:00
Kovarththanan Rajaratnam c1e817ef51 Remove useless foward decl.
llvm-svn: 98718
2010-03-17 08:44:19 +00:00
John McCall cb81625851 Add another compatibility note and tweak a few of the existing ones.
llvm-svn: 98717
2010-03-17 07:10:56 +00:00
Chandler Carruth 7b621ea10a Fix a typo in a tag.
llvm-svn: 98713
2010-03-17 05:46:21 +00:00
John McCall fb803d7dcb Grant nested classes the access privileges of their enclosing classes.
llvm-svn: 98710
2010-03-17 04:58:56 +00:00
Rafael Espindola fcc4739089 Document common clang compatibility issues.
Patch by Zhanyong Wan.

llvm-svn: 98708
2010-03-17 04:31:53 +00:00
Rafael Espindola cd7eef900f Correctly mangle dependent TypenameType.
Fixes PR6625.

llvm-svn: 98707
2010-03-17 04:28:11 +00:00
Zhongxing Xu 03fd76663e Mark CXXThisRegion in the current or parent stack frame context as live so that
their bindings are not removed.

llvm-svn: 98705
2010-03-17 03:35:08 +00:00
John McCall 59bb1d4657 Make -faccess-control and -fno-access-control driver options.
llvm-svn: 98703
2010-03-17 01:32:13 +00:00
John McCall 9a3da8e6cf Provide a test case for PR6629.
llvm-svn: 98702
2010-03-17 01:31:25 +00:00
John McCall 2ff380a43a Clean up after ourselves when there's an error parsing the base clause.
Fixes the crash-on-invalid in PR6629.

llvm-svn: 98698
2010-03-17 00:38:33 +00:00
Douglas Gregor 81dfb30e4c Don't "take" the file manager and source manager when
ASTUnit::LoadFromCompilerInvocation() fails to create target
information.

llvm-svn: 98697
2010-03-17 00:32:06 +00:00
Fariborz Jahanian b8b0ea330c objective-c patch to provide type safty when blocks are passing or
returning objc objects. There will be a corresponding objective-c++
patch soon.

llvm-svn: 98696
2010-03-17 00:20:01 +00:00
Douglas Gregor 5444aa6d3d Emit output of PCH consistency checking test case to a separate text file and grep that
llvm-svn: 98695
2010-03-17 00:09:23 +00:00
Fariborz Jahanian fa24e1066f Issue error when a byref array is accessed in a block
literal. Fixes radar 7760213.

llvm-svn: 98693
2010-03-16 23:39:51 +00:00
Douglas Gregor 1668355e06 Remove unused variable
llvm-svn: 98691
2010-03-16 22:54:32 +00:00
Douglas Gregor 82752ec843 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.

llvm-svn: 98690
2010-03-16 22:53:51 +00:00
Douglas Gregor dc970f0866 Audit all Preprocessor::getSpelling() callers, improving failure
recovery for those that need it.

llvm-svn: 98689
2010-03-16 22:30:13 +00:00
Blaine Garst a41f71212a fix copyright & typo
llvm-svn: 98688
2010-03-16 22:02:16 +00:00
John McCall 9a9ae00442 Forgot the testcases.
llvm-svn: 98685
2010-03-16 21:50:59 +00:00
John McCall a2a3f7dc11 Implement -Wshadow. Based on a patch by Mike M.!
llvm-svn: 98684
2010-03-16 21:48:18 +00:00
Chris Lattner 87c5e2f5d4 update link
llvm-svn: 98682
2010-03-16 21:43:03 +00:00
John McCall a630995f50 Perform access control for the implicit calls to base and member destructors
that occur in constructors (on the unwind path).

llvm-svn: 98681
2010-03-16 21:39:52 +00:00
Blaine Garst ade4303e2b at least give the Apple ABI a name that reflects Apple in prep for other ABI specs that might come along
llvm-svn: 98678
2010-03-16 21:22:41 +00:00
Blaine Garst 1832cdb2d3 rev existing doc to account for recent ABI changes
llvm-svn: 98676
2010-03-16 21:21:07 +00:00
Douglas Gregor a71b9d0678 Update get*LineNumber() and get*ColumnNumber() functions to pass the
Invalid bit through; there are no safety-critical callers of these
functions.

llvm-svn: 98674
2010-03-16 20:53:17 +00:00
Douglas Gregor 42fe858cd6 Audit all callers of SourceManager::getCharacterData(); update some of
them to recover more gracefully on failure.

llvm-svn: 98672
2010-03-16 20:46:42 +00:00
Douglas Gregor 554e0b1ec2 Audit all callers of SourceManager::getBufferData(); fix the one that
needs better error recovery.

llvm-svn: 98667
2010-03-16 20:26:15 +00:00
Douglas Gregor 4fb7fbef3b Audit all getBuffer() callers (for both the FullSourceLoc and
SourceManager versions), updating those callers that need to recover
gracefully from failure.

llvm-svn: 98665
2010-03-16 20:01:30 +00:00
Douglas Gregor 26266da3c3 Teach the one caller of SourceManager::getMemoryBufferForFile() to cope with errors
llvm-svn: 98664
2010-03-16 19:49:24 +00:00
Chris Lattner 379e1b9cc9 accept and ignore __gcc_tdiag__ so we don't produce warnings
building mainline GCC, PR6542

llvm-svn: 98661
2010-03-16 19:29:19 +00:00
Douglas Gregor a2f4945099 Make sure we actually override ReadHeaderFileInfo when we meant to
llvm-svn: 98655
2010-03-16 19:09:18 +00:00
Daniel Dunbar 35621a9dcc Driver: Fix forwarding of -fno-lax-vector-conversions.
llvm-svn: 98639
2010-03-16 16:57:46 +00:00
Douglas Gregor 5712ebced0 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>.

llvm-svn: 98636
2010-03-16 16:35:32 +00:00
Benjamin Kramer 0ca3c62078 Switch another function to StringRef instead of char pointer pairs.
llvm-svn: 98631
2010-03-16 14:48:07 +00:00
Benjamin Kramer eb92dc0b09 Let SourceManager::getBufferData return StringRef instead of a pair of two const char*.
llvm-svn: 98630
2010-03-16 14:14:31 +00:00
Zhongxing Xu 0eb690390d Add VisitCXXContructExpr logic to the analyzer. This still has not fully worked
since RemoveDeadBinding mistakenly remove the binding to CXXThisRegion. 

llvm-svn: 98629
2010-03-16 13:14:16 +00:00
John McCall ab8c273b4f Access control for implicit calls to copy assignment operators and copy
constructors from implicitly-defined members.

llvm-svn: 98614
2010-03-16 06:11:48 +00:00
Douglas Gregor 00a0cf70d9 Don't consume tokens past the end-of-file in an @interface. Fixes
<rdar://problem/7735566>.

llvm-svn: 98613
2010-03-16 06:04:47 +00:00
John McCall f857e0bbe7 Perform access control even for the implicit destructor calls from implicit
destructor definitions.  Remove some code duplication.

llvm-svn: 98611
2010-03-16 05:36:30 +00:00
John McCall 1064d7ef29 Perform access control for the implicit base and member destructor calls
required when emitting a destructor definition.

llvm-svn: 98609
2010-03-16 05:22:47 +00:00
Douglas Gregor 7bda4b8310 Introduce optional "Invalid" parameters to routines that invoke the
SourceManager's getBuffer() and, therefore, could fail, along with
Preprocessor::getSpelling(). Use the Invalid parameters in the literal
parsers (string, floating point, integral, character) to make them
robust against errors that stem from, e.g., PCH files that are not
consistent with the underlying file system.

I still need to audit every use caller to all of these routines, to
determine which ones need specific handling of error conditions.

llvm-svn: 98608
2010-03-16 05:20:39 +00:00
Douglas Gregor 874cc62876 Use SourceManager's Diagnostic object for all file-reading errors,
simplifying the SourceManager interfaces somewhat.

llvm-svn: 98598
2010-03-16 00:35:39 +00:00
Douglas Gregor e0fbb83b8b Give SourceManager a Diagnostic object with which to report errors,
and start simplifying the interfaces in SourceManager that can fail.

llvm-svn: 98594
2010-03-16 00:06:06 +00:00
Douglas Gregor 0adf3182b0 Add some <cstdio> includes to unbreak the buildbots
llvm-svn: 98591
2010-03-15 23:33:37 +00:00
Eric Christopher 8c6f61394f Add remaining sse4.1 intrinsics and builtins.
llvm-svn: 98587
2010-03-15 23:22:58 +00:00
Douglas Gregor 802b77601e 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()).

llvm-svn: 98585
2010-03-15 22:54:52 +00:00
Ted Kremenek d133a86aa3 Move method FindPropertyVisibleInPrimaryClass() from ObjCContainerDecl to ObjCInterfaceDecl.
Also change this method to lookup property declarations using DeclContext::lookup().

llvm-svn: 98574
2010-03-15 20:30:07 +00:00
Ted Kremenek ddcd1093a4 Change ObjCCategoryDecl::FindPropertyDeclaration() to lookup
property decls using DeclContext::lookup().

llvm-svn: 98571
2010-03-15 20:11:53 +00:00
Ted Kremenek 4fb821ec0d Make 'findPropertyDecl()' a static method of ObjCPropertyDecl.
llvm-svn: 98570
2010-03-15 20:11:46 +00:00
Ted Kremenek e01bec9791 Add 'expected-note'
llvm-svn: 98560
2010-03-15 18:47:29 +00:00
Ted Kremenek 679708ee34 Correctly determine if the @property has been previously declared. If
a property has the same name as the ivar it wraps then the old logic
wouldn't find the previous property declaration.

llvm-svn: 98559
2010-03-15 18:47:25 +00:00
Fariborz Jahanian b397e43dea objective-c++ must take into account qualifiers when
considering valid objc pointer converions.

llvm-svn: 98557
2010-03-15 18:36:00 +00:00
Ted Kremenek f3bc99dd56 Add comment to CFG to 'buildCFG()' arguments indicating that scope
support is not fully implemented.

llvm-svn: 98555
2010-03-15 17:45:13 +00:00
Ted Kremenek bc1a67bee3 Rename clang_constructUSR_ObjCategory to clang_constructUSR_ObjCCategory.
(there was a missing 'C').

llvm-svn: 98554
2010-03-15 17:38:58 +00:00
Kovarththanan Rajaratnam 94b9af889e Remove useless forward decl.
llvm-svn: 98553
2010-03-15 17:31:29 +00:00
Douglas Gregor ea16606fcd During C++ name lookup, use DeclContext::Equals() rather than
comparing DeclContext pointers, to avoid having to remember to call
getPrimaryContext() everywhere. This is the last part PR6594.

llvm-svn: 98546
2010-03-15 15:26:48 +00:00
Douglas Gregor 6623006249 Implement C++ [temp.local]p8, which specifies that a template
parameter hides a namespace-scope declararion with the same name in an
out-of-line definition of a template. The lookup requires a strange
interleaving of lexical and semantic scopes (go C++), which I have not
yet handled in the typo correction/code completion path.

Fixes PR6594.

llvm-svn: 98544
2010-03-15 14:33:29 +00:00
John McCall c33dec3664 Add support for -Wwrite-strings. Patch by Mike M! Fixes PR 4804.
llvm-svn: 98541
2010-03-15 10:54:44 +00:00
John McCall 3e11ebebc8 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.

llvm-svn: 98540
2010-03-15 10:12:16 +00:00
John McCall 1e3a1a7eff Remember access paths for visible conversion decls.
llvm-svn: 98539
2010-03-15 09:07:48 +00:00
Anton Korobeynikov 762c6b7346 Fix thinko and enable clang build on mingw again (hopefully)
llvm-svn: 98492
2010-03-14 12:55:35 +00:00
Kovarththanan Rajaratnam b4c0f5cc79 Add EmitString helper method
llvm-svn: 98488
2010-03-14 08:35:19 +00:00
Kovarththanan Rajaratnam d3fa9721fb Unbreak last commit. This should have been part of r98478.
llvm-svn: 98480
2010-03-14 07:55:43 +00:00
Kovarththanan Rajaratnam fb0762057e Pass file string by reference
llvm-svn: 98478
2010-03-14 07:38:15 +00:00
Kovarththanan Rajaratnam d16d38c0b9 Path related cleanup. Remove unnecessary variables.
llvm-svn: 98473
2010-03-14 07:15:57 +00:00
Kovarththanan Rajaratnam a9c81a8848 Use makeAbsolute()
llvm-svn: 98472
2010-03-14 07:06:50 +00:00
Kovarththanan Rajaratnam b65a14802c Move to anonymous namespace
llvm-svn: 98469
2010-03-14 06:48:05 +00:00
David Chisnall 2bfc50bf68 Fixed copy-and-paste error causing categories to contain the protocols declared on the class, not the protocols declared on the category.
llvm-svn: 98455
2010-03-13 22:20:45 +00:00
Benjamin Kramer f156b9d55d Revert 98439. There is a bad race condition in sys::Path::makeUnique on win32.
llvm-svn: 98452
2010-03-13 21:22:49 +00:00
Rafael Espindola a530f9c03b Add missing space.
llvm-svn: 98448
2010-03-13 20:14:52 +00:00
Douglas Gregor b14d123774 Give explicit template instantiations weak ODR linkage. Former
iterations of this patch gave explicit template instantiation
link-once ODR linkage, which permitted the back end to eliminate
unused symbols. Weak ODR linkage still requires the symbols to be
generated.

llvm-svn: 98441
2010-03-13 18:23:07 +00:00
Rafael Espindola 13327bbe55 Fix PR6562. If a type is dependent, we don't know if it will have implicit
destructors.

llvm-svn: 98440
2010-03-13 18:12:56 +00:00
Benjamin Kramer 84c37f9903 Make getTemporaryPath a static member of CIndexer and use it to replace tmpnam calls.
This fixes linker warnings on linux.

llvm-svn: 98439
2010-03-13 13:05:20 +00:00
Benjamin Kramer 69b3c43391 Use raw_ostream instead of sprintf.
llvm-svn: 98438
2010-03-13 12:06:51 +00:00
Benjamin Kramer 5ac3b0be2d Simplify code.
llvm-svn: 98437
2010-03-13 11:34:41 +00:00
Kovarththanan Rajaratnam ba2c65277a Use SmallString instead of SmallVector
llvm-svn: 98436
2010-03-13 10:17:05 +00:00
Kovarththanan Rajaratnam e5f1c197af No need to call setIdentifierInfo() after LookUpIdentifierInfo() which LookUpIdentifierInfo() will automatically do
llvm-svn: 98435
2010-03-13 08:53:33 +00:00
Douglas Gregor 17b76185f1 Re-revert the explicit template instantiation linkage patch. I am beginning to look incompetent
llvm-svn: 98425
2010-03-13 03:49:57 +00:00
Douglas Gregor 89cae0f224 Reinstate patch to turn explicit template instantiations into weak symbols
llvm-svn: 98424
2010-03-13 03:14:19 +00:00
Ted Kremenek d071c6019a Implement several CIndex functions for constructing USRs from C-strings instead of AST elements.
llvm-svn: 98421
2010-03-13 02:50:34 +00:00
John McCall 44c064be73 Check compatibility of vector types using their canonicalizations.
Fixes an assertion arising C overload analysis, but really I can't imagine
that this wouldn't cause a thousand other uncaught failures.

Fixes PR6600.

llvm-svn: 98400
2010-03-12 23:14:13 +00:00
Jeffrey Yasskin f6442f80cb Allow users to set CPPFLAGS and CXXFLAGS on the make command line.
Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test)
llvm-svn: 98399
2010-03-12 22:55:16 +00:00
Ted Kremenek f59409623e Use llvm::SmallVector instead of std::vector.
llvm-svn: 98397
2010-03-12 22:22:36 +00:00
Fariborz Jahanian c6140734c5 Fix a rare corner case bug which exposed a serious block API generation
when initialized variable is a byref block variable and is referenced recursively
in the initializer (you guessed it, it is block implementation of
fibonacci number). Fix, on the other hand is trvial, by generating the
API for byref variable before API for its initializer. We will have this
test added to our internal test suite as a clang-style test is not possible
due to very convoluted IR sequence. Fixes radar 7745514.

llvm-svn: 98393
2010-03-12 21:40:43 +00:00
Devang Patel a42d3ea60e If main file name is empty then use "<unknown>".
llvm-svn: 98385
2010-03-12 21:04:27 +00:00
John McCall b5fe7094b2 Preserve the inherited-default-argument bit through instantiation.
llvm-svn: 98375
2010-03-12 20:02:47 +00:00
John McCall f3cd665d5a Remember whether a ParmVarDecl was spelled with a default argument or
whether it inherited one from a previous declaration.

Patch by Enea Zaffanella!

llvm-svn: 98362
2010-03-12 18:31:32 +00:00
Ted Kremenek c52ea21a6e Fix grammar
llvm-svn: 98352
2010-03-12 16:46:36 +00:00
Kovarththanan Rajaratnam 52ceee58d3 Make IdentifierTable::get(StringRef) "primary" (no functionality change)
llvm-svn: 98347
2010-03-12 12:01:19 +00:00
Kovarththanan Rajaratnam 00682a48f4 Reintroduce r98340 and r98341 now without copy/paste errors.
Thanks to Ben for pointing this out.

llvm-svn: 98345
2010-03-12 11:27:37 +00:00
Kovarththanan Rajaratnam e604f14c96 Back out r98340 abd r98341
llvm-svn: 98344
2010-03-12 11:00:51 +00:00
Kovarththanan Rajaratnam a3b09590e6 Add IdentifierTable::get() overload and start using it
llvm-svn: 98343
2010-03-12 10:32:27 +00:00
Nuno Lopes 4cbc8bd1bc fix PR6584: __SSE3__ not defined with -mss3
llvm-svn: 98342
2010-03-12 10:20:09 +00:00
Kovarththanan Rajaratnam f1aa69d103 Switch parameter order for consistency (no functionality change)
llvm-svn: 98341
2010-03-12 10:17:07 +00:00
Kovarththanan Rajaratnam e2acea7c53 Add keywords using StringRef
llvm-svn: 98340
2010-03-12 10:14:26 +00:00
Kovarththanan Rajaratnam 47b55969c3 Cleanup using StringRef
llvm-svn: 98339
2010-03-12 09:33:31 +00:00
Kovarththanan Rajaratnam 661a309933 Switch over IdentifierInfoLookup to StringRef
llvm-svn: 98337
2010-03-12 08:23:34 +00:00
John McCall c493a73240 Improve the unused-value check to look into comma expressions and filter out
voids in sub-expressions.  Patch by Mike M!

Fixes PR4806.

llvm-svn: 98335
2010-03-12 07:11:26 +00:00
Anders Carlsson 5d3b901e48 More this adjustment simplification.
llvm-svn: 98333
2010-03-12 05:28:07 +00:00
Douglas Gregor 539bc40906 Revert the linkage change for explicit template instantiations; something is amiss
llvm-svn: 98332
2010-03-12 05:13:59 +00:00
Anders Carlsson 3c289673d6 Remove OldOffset.
llvm-svn: 98331
2010-03-12 05:02:01 +00:00
Anders Carlsson 2b2b8f1949 Remove debug output.
llvm-svn: 98330
2010-03-12 04:55:20 +00:00
Anders Carlsson 8a2402989d Begin simplifying handling of thunks.
llvm-svn: 98329
2010-03-12 04:54:20 +00:00
Douglas Gregor ee3f72299c Give explicit template instantiations weak linkage (but don't defer
them). Fixes PR6578.

llvm-svn: 98328
2010-03-12 04:49:06 +00:00
John McCall b8b94668b6 Extend the builtin syntax to allow address-space qualifiers on pointers and
references.  Based on a patch by Arnaud de Grandmaison!

llvm-svn: 98327
2010-03-12 04:21:28 +00:00
Ted Kremenek 959e830292 Split Sema::ActOnProperty() into two recursive functions to clearly separate
the handling of class extensions from other cases.

llvm-svn: 98326
2010-03-12 02:31:10 +00:00
Eric Christopher 6932b2e8b7 Add SSE4 packed integer comparisons and corresponding intrinsics.
llvm-svn: 98323
2010-03-12 01:22:33 +00:00
John McCall 9caafbc5ca Add an extra test to this test-case.
llvm-svn: 98322
2010-03-12 01:20:21 +00:00
John McCall 16927f6274 Implement basic support for friend types and functions in non-dependent
contexts.

llvm-svn: 98321
2010-03-12 01:19:31 +00:00
Ted Kremenek 90e2fc2fb3 Fix 80 col violations.
llvm-svn: 98320
2010-03-12 00:49:00 +00:00
Ted Kremenek ac597f3416 Move 'ActOn' methods to the beginning of the file
so we can clearly see the parser entry points.

llvm-svn: 98319
2010-03-12 00:46:40 +00:00
Ted Kremenek fd1d11c020 Update CMake build.
llvm-svn: 98318
2010-03-12 00:38:40 +00:00
Ted Kremenek 7a7a0808b9 Split Sema logic for ObjC @property and @synthesize into
a separate file.

llvm-svn: 98317
2010-03-12 00:38:38 +00:00
Eric Christopher e486f68b59 Integer array extraction for sse4.1.
llvm-svn: 98305
2010-03-11 23:50:18 +00:00
Eric Christopher e7594305bc Add packed integer array insertion.
llvm-svn: 98299
2010-03-11 23:36:29 +00:00
Devang Patel 01bb5ce932 Keep track of Record context to ensure that record elements are properly nested in debug info.
llvm-svn: 98283
2010-03-11 20:01:48 +00:00
Ted Kremenek 86838aafee For ivars created using @synthesize, set their DeclContext to be
the @implementation (instead of the @interface) and actually add
the ivar to the DeclContext (which we weren't doing before).

This allows us to simplify ASTContext::CollectNonClassIvars() by
removing ASTContext::CollectProtocolSynthesizedIvars().  Now all
ivars can be found by either inspecting the ObjCInterfaceDecl and
its companion ObjCImplementationDecl.

llvm-svn: 98280
2010-03-11 19:44:54 +00:00
John McCall 71d8d9b468 Warn about comparing an unsigned expression with 0 in tautological ways.
Patch by mikem!

llvm-svn: 98279
2010-03-11 19:43:18 +00:00
John McCall 6b0dcd9dd1 Remember the PR number.
llvm-svn: 98276
2010-03-11 19:33:57 +00:00
John McCall e40b58ec2f Implement -Wmissing-field-initializers. Patch by mikem!
llvm-svn: 98275
2010-03-11 19:32:38 +00:00
Daniel Dunbar 44e51ea41f Use -emit-llvm-only, to avoid leaving a temp around.
llvm-svn: 98267
2010-03-11 18:23:02 +00:00
Fariborz Jahanian 3a106e7029 Add tentative support for accessing local variables with
external linkage (static, extern, etc.) in blocks in
rewriter. wip.

llvm-svn: 98265
2010-03-11 18:20:03 +00:00
Chris Lattner 9723d6c699 fix PR6433, crash on va_arg of typedef.
llvm-svn: 98264
2010-03-11 18:19:55 +00:00
Daniel Dunbar 66187b3c6e Driver: Free Action objects.
llvm-svn: 98263
2010-03-11 18:04:58 +00:00
Daniel Dunbar 86d838970b Driver: Free synthesized derived arguments.
llvm-svn: 98262
2010-03-11 18:04:53 +00:00
Daniel Dunbar 66e2768918 Driver: Free jobs in JobList and PipedJob instances.
llvm-svn: 98261
2010-03-11 18:04:49 +00:00
Ted Kremenek e3243224bf Update checker build.
llvm-svn: 98259
2010-03-11 16:47:29 +00:00
Anders Carlsson dd819c981f Use the new vtable layout code for computing virtual base offset offsets.
llvm-svn: 98257
2010-03-11 16:06:20 +00:00
Rafael Espindola 4d5c3d99e5 Correctly mangle address of member in template arguments. Fixes PR6460
llvm-svn: 98254
2010-03-11 14:07:00 +00:00
John McCall 45d878b0f0 Fix a self-host problem caused by this over-eager assertion. I'm not sure
there's a good equivalent that's actually true, unfortunately.

llvm-svn: 98253
2010-03-11 09:33:17 +00:00
John McCall 58f10c3380 Maintain type source information for functions through template
instantiation.  Based on a patch by Enea Zaffanella!  I found a way to
reduce some of the redundancy between TreeTransform's "standard"
FunctionProtoType transformation and TemplateInstantiator's override,
and I killed off the old SubstFunctionType by adding type source info
for the last cases where we were creating FunctionDecls without TSI
(at least that get passed through template instantiation).

llvm-svn: 98252
2010-03-11 09:03:00 +00:00
John McCall bbbbe4eaaf Split C++ friend declarations into their own header/implementation file.
I'm expecting this portion of the AST to grow and change, and I'd like to
be able to do that with minimal recompilation.  If this proves unnecessary
when access control is fully-implemented, I'll fold the classes back into
DeclCXX.h.

llvm-svn: 98249
2010-03-11 07:50:04 +00:00
Anders Carlsson 4cbe83cccb Rename getVirtualBaseOffsetIndex to getVirtualBaseOffsetOffset to reflect what it actually does.
llvm-svn: 98248
2010-03-11 07:15:17 +00:00
Anders Carlsson e4424888e4 When possible, use the vbase offset offsets from the most derived class directly.
llvm-svn: 98247
2010-03-11 07:00:45 +00:00
Anders Carlsson 3521552ebe Add a test.
llvm-svn: 98246
2010-03-11 06:44:31 +00:00
Anders Carlsson 7f6b71e222 Keep track of, and dump, vbase offset offsets.
llvm-svn: 98245
2010-03-11 06:43:12 +00:00
Anders Carlsson 9f28dbc53a Fix tests.
llvm-svn: 98242
2010-03-11 06:10:52 +00:00
Anders Carlsson d5531e2d18 Run the new vtable builder for construction vtables as well now. Note that we still don't use the data it generates.
llvm-svn: 98239
2010-03-11 05:48:21 +00:00
Anders Carlsson fe9009635d More record layout builder cleanup and simplification.
llvm-svn: 98238
2010-03-11 05:42:17 +00:00
Anders Carlsson de710c9125 Get rid of the PrimaryBase parameter from LayoutVirtualBases.
llvm-svn: 98233
2010-03-11 04:33:54 +00:00
Anders Carlsson f7b7a1e781 More cleanup towards fixing the real bug.
llvm-svn: 98232
2010-03-11 04:24:02 +00:00
Anders Carlsson 6a84889d3f Replace the class offset vectors in RecordLayoutBuilder with maps instead so we'll have faster lookup and so we can detect duplicates.
llvm-svn: 98231
2010-03-11 04:10:39 +00:00
Anders Carlsson f2fa75bdbb More cleanup.
llvm-svn: 98230
2010-03-11 03:39:12 +00:00
Anders Carlsson c4c00ec41b More record layout builder cleanup.
llvm-svn: 98229
2010-03-11 02:41:30 +00:00
Anders Carlsson 09db5370b7 Assert that primary bases always have offset 0.
llvm-svn: 98223
2010-03-11 01:49:18 +00:00
Ted Kremenek e0966be5ce Remove unused 'IVars' field from ObjCInterfaceDecl. That functionality
has migrated to DeclContext.

llvm-svn: 98213
2010-03-11 00:36:10 +00:00
Anders Carlsson aa87b4eab1 Remove the IndirectPrimary parameter in LayoutVirtualBases; it's already there as a member variable.
llvm-svn: 98211
2010-03-11 00:21:21 +00:00
Anders Carlsson 8630b5b09b More cleanup and simplification of the record layout builder.
llvm-svn: 98208
2010-03-11 00:15:35 +00:00
John McCall ea8d8bb718 Support PPC-32 DWARF EH intrinisics. Thanks to rdivacky for his assistance.
llvm-svn: 98206
2010-03-11 00:10:12 +00:00
Chris Lattner 4d94109903 set alignment on static locals properly, patch by Arnaud de Grandmaison!
llvm-svn: 98204
2010-03-10 23:59:59 +00:00
Anders Carlsson 0d0b588fb2 Get rid of the LayoutBaseNonVirtually; it was used to lay out a base either as a non-virtual base or a virtual base.
llvm-svn: 98198
2010-03-10 22:26:24 +00:00
Anders Carlsson 09ffa32b92 More shuffling.
llvm-svn: 98197
2010-03-10 22:21:28 +00:00
Anders Carlsson f08e681ba8 Cleanups, no functionality change yet.
llvm-svn: 98196
2010-03-10 22:16:06 +00:00
Chris Lattner 93f0a7dda1 add DESTDIR support for clang headers, PR6556.
Patch by Matthias Klose!

llvm-svn: 98192
2010-03-10 21:26:01 +00:00
Anders Carlsson 423406f335 Fix calculation of whether a member function needs a thunk in construction vtables.
llvm-svn: 98191
2010-03-10 21:25:37 +00:00
Fariborz Jahanian a4a925febb Change the 'super' messaging API in the rewriter.
Fixes radar 7738452.

llvm-svn: 98190
2010-03-10 21:17:41 +00:00
John McCall c9d4a84c2a Suppress the tag when printing an ElaboratedType if the language options
claim this is C.  We don't make ElaboratedTypes in C, but sometimes
the language options during pretty-print lie to us.

The rewriter should really be fixed to not rely on how types are pretty-printed,
though.

llvm-svn: 98189
2010-03-10 21:05:46 +00:00
Anders Carlsson 115b4756b5 We were mistakenly marking morally virtual bases as being uninteresting. Fix this.
llvm-svn: 98180
2010-03-10 19:39:11 +00:00
Anders Carlsson 703a08605f Ignore non-interesting bases when emitting construction vtables.
llvm-svn: 98177
2010-03-10 19:15:26 +00:00
Ted Kremenek 1794ec4a30 Simplify assertion.
llvm-svn: 98176
2010-03-10 19:09:37 +00:00
Ted Kremenek fe697ebaaf Remove '#if 0' code. Lazy compound values have proven their worth.
llvm-svn: 98175
2010-03-10 19:09:34 +00:00
Ted Kremenek 1a0c4d5900 Fix -Wsign-compare warnings reported by clang++.
llvm-svn: 98174
2010-03-10 19:09:31 +00:00
Ted Kremenek 4a26524050 Fix -Wsign-compare warning reported by clang++.
llvm-svn: 98170
2010-03-10 18:22:38 +00:00
Ted Kremenek 9e92d3f99d Remove the subregion map cache. It is no longer used.
llvm-svn: 98161
2010-03-10 16:38:44 +00:00
Ted Kremenek 2ce82b2323 Fix stale comment.
llvm-svn: 98160
2010-03-10 16:38:41 +00:00
Ted Kremenek ddce4a3d0f Really apply (unnoticed weird git-svn merge conflict in 98144): Refactor RegionStore::RemoveDeadBindings to use the same core cluster analysis algorithm as RegionStore::InvalidateRegions().
Beyond simplifying the algorithm significantly, we no longer
need to build subregion maps in RemoveDeadBindings().  This
and other changes cause a significant speedup: the time to
analyze sqlite3.c (single core) drops by 14%.

llvm-svn: 98159
2010-03-10 16:32:56 +00:00
Rafael Espindola e81620fb88 Move test and also test codegen.
llvm-svn: 98154
2010-03-10 14:01:14 +00:00
John McCall 85f9055955 When pretty-printing tag types, only print the tag if we're in C (and
therefore not creating ElaboratedTypes, which are still pretty-printed
with the written tag).

Most of these testcase changes were done by script, so don't feel too
sorry for my fingers.

llvm-svn: 98149
2010-03-10 11:27:22 +00:00