Commit Graph

10227 Commits

Author SHA1 Message Date
Douglas Gregor f224ae06d2 Clean up the rest of the local -> global declaration ID mappings
within the ASTReader (I hope).

llvm-svn: 135720
2011-07-21 23:29:11 +00:00
Douglas Gregor 7fb091977d In the ASTReader, factor out the loading of (local) declaration IDs,
such that every declaration ID loaded from an AST file will go through
a central local -> global mapping function. At present, this change
does nothing, since the local -> global mapping function is the
identity function.

This is the mechanical part of the refactoring; a follow-up patch will
address a few remaining areas where it's not obvious whether we're
dealing with local or global IDs.

llvm-svn: 135711
2011-07-21 22:35:25 +00:00
Argyrios Kyrtzidis 4145732818 Fix diagnostic when loading a PCH which has different enabled/disabled state of -fobjc-arc. rdar://9818341
llvm-svn: 135707
2011-07-21 21:56:04 +00:00
Jonathan D. Turner 3766fdb654 Cleaning up more of the ID situation in the AST reader. This patch relaxes and generalizes how CXX base specifiers are identified and loaded by using a ContinuousRangeMap. This also adds a global bit offset (or base) to the PerFileData.
llvm-svn: 135705
2011-07-21 21:15:19 +00:00
Douglas Gregor 204b8717d4 Add some debugging output to the AST reader, so we can see the global remappings we generate
llvm-svn: 135701
2011-07-21 19:50:14 +00:00
Fariborz Jahanian b5a52ca0c9 objc - Diagnose missing method return type specifier under
a warning flag. // rdar://9615045

llvm-svn: 135681
2011-07-21 17:00:47 +00:00
Douglas Gregor f676fdc8ea One last RandomAccessIterator operator for PreprocessingRecord::iterator
llvm-svn: 135680
2011-07-21 16:37:44 +00:00
Douglas Gregor cbd50c3201 Add the remaining RandomAccessIterator operations to
PreprocessingRecord::iterator. Where's concept_map when I need it?

llvm-svn: 135679
2011-07-21 16:35:41 +00:00
Francois Pichet 14c7ed4b0b For some reason I don't fully comprehend, the MSVC debug build will fail with a huge 50+ lines template error message if PreprocessingRecord::iterator has no operator<()
llvm-svn: 135670
2011-07-21 06:26:00 +00:00
Ted Kremenek 86070b9c0f Move AnalysisManager constructor out of line. No functionality change (yet).
llvm-svn: 135667
2011-07-21 05:22:52 +00:00
Ted Kremenek 189ecec4db Simplify passing of CFGBuildOptions around for AnalysisContext. No functionality change.
llvm-svn: 135666
2011-07-21 05:22:47 +00:00
Richard Trieu bb43dec255 Remove warning for conditional operands of differend signedness from -Wsign-compare. Cases that previously warn on this will have a different warning emitted from -Wsign-conversion.
llvm-svn: 135664
2011-07-21 02:46:28 +00:00
Douglas Gregor 63745d5935 New libclang API to expose container type for code completion, from
Connor Wakamo!

llvm-svn: 135651
2011-07-21 01:05:26 +00:00
Douglas Gregor 4a9c39a2f6 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.

llvm-svn: 135646
2011-07-21 00:47:40 +00:00
Anna Zaks 9ccf84e35d Addressing code review comments for commit 135509 - Add FixItHints in case a C++ function call is missing * or & operators on
llvm-svn: 135643
2011-07-21 00:34:39 +00:00
Jonathan D. Turner 350056821a Continuing to improve and generalize how IDs are handled in ASTReader. This patch cleans up and generalizes TypeID loading and uses a similar table-lookup to Doug's previous Decl patch.
llvm-svn: 135622
2011-07-20 21:31:32 +00:00
Chad Rosier 1988642124 Temporarily revert r135614 while I fix the cmake build.
llvm-svn: 135621
2011-07-20 21:16:17 +00:00
Chad Rosier e3805fc118 When the compiler crashes, the compiler driver now produces diagnostic information
including the fully preprocessed source file(s) and command line arguments.  The 
developer is asked to attach this diagnostic information to a bug report.

llvm-svn: 135614
2011-07-20 20:26:32 +00:00
Fariborz Jahanian a644f9cb73 arc-objc++: Issue an arc specific diagnostic when overload resolution
fails because of lifetime differences of parameter and argument type.
// rdar://9790531

llvm-svn: 135593
2011-07-20 17:14:09 +00:00
Chris Lattner d2b92d6544 arrayref should now move in here, and redundant #includes of <cassert> can go
away (since it comes in through Casting.h).  This will have to wait for another
day when I'm unmotivated though, or someone else to pick it up :)

llvm-svn: 135579
2011-07-20 07:13:40 +00:00
Chris Lattner c5efe4e520 remove some now-redundant forward declarations.
llvm-svn: 135578
2011-07-20 07:12:43 +00:00
Chris Lattner 62ff6e8b17 add raw_ostream and Twine to LLVM.h, eliminating a ton of llvm:: qualifications.
llvm-svn: 135577
2011-07-20 07:06:53 +00:00
Chris Lattner 01cf8db38b now that we have a centralized place to do so, add some using declarations for
some common llvm types: stringref and smallvector.  This cleans up the codebase
quite a bit.

llvm-svn: 135576
2011-07-20 06:58:45 +00:00
Chris Lattner dba38736a5 introduce a centralized place to introduce and inject llvm types into the
clang namespace.  There are a number of LLVM types that are used pervasively
and it doesn't make sense to keep qualifying them.  Start with casting
operators.

llvm-svn: 135574
2011-07-20 06:37:11 +00:00
Douglas Gregor 270e014b7a Use a ContinuousRangeMap to map from the global macro definition ID in
the AST reader down to the AST file + local ID, rather than walking
the PCH chain. More cleanup/generalization, although there is more
work to do for preprocessed entities. In particular, the
"preallocation" scheme for preprocessed entities is not going to work
well with late loading of PCH files, and it's likely we'll have to do
something akin to the SourceManager's negative/positive loading.

llvm-svn: 135556
2011-07-20 01:29:15 +00:00
Douglas Gregor 2262d28bab Use a ContinuousRangeMap to map from the global selector ID in the AST
reader down to the AST file + local ID, rather than walking the PCH
chain. No functionality change; this is generalization and cleanup.

llvm-svn: 135554
2011-07-20 01:10:58 +00:00
Douglas Gregor 19d2635d8c Use a ContinuousRangeMap to map from the global identifier ID in the
AST reader down to the AST file + local ID, rather than walking the
PCH chain. No functionality change; this is generalization and cleanup.

llvm-svn: 135551
2011-07-20 00:59:32 +00:00
Douglas Gregor 551273e176 Try to appease MSVC's standard library.
llvm-svn: 135549
2011-07-20 00:31:58 +00:00
Douglas Gregor 047d2effea Use a ContinuousRangeMap to map from the global declaration ID in the
AST reader down to the AST file + local ID within that file, rather
than lamely walking the PCH chain. There's no actual functionality
change now, but this is cleaner and more general.

llvm-svn: 135548
2011-07-20 00:27:43 +00:00
Richard Smith e3daab2449 Replace r134583's fix for PR10290 with one which also works for non-value-dependent cases.
llvm-svn: 135543
2011-07-20 00:12:52 +00:00
Richard Smith 2b5c61197f Use the zero from the correct enumeration when initializing this variable.
llvm-svn: 135541
2011-07-20 00:10:13 +00:00
Anna Zaks df92ddf846 Add FixItHints in case a C++ function call is missing * or & operators on one/several of it's parameters (addresses http://llvm.org/PR5941).
llvm-svn: 135509
2011-07-19 19:49:12 +00:00
Argyrios Kyrtzidis d571363e45 [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

llvm-svn: 135491
2011-07-19 17:20:03 +00:00
Jeffrey Yasskin 7ac472e22a Name the "c++0x-compat" warning group, and fix the names of two
warnings that were intended to be inside it.

llvm-svn: 135487
2011-07-19 16:38:48 +00:00
Douglas Gregor 925296b4c2 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.

llvm-svn: 135484
2011-07-19 16:10:42 +00:00
Ted Kremenek 8b46c00b5f Add hooks into the CFG builder to force that specific expressions are always CFGElements.
llvm-svn: 135479
2011-07-19 14:18:43 +00:00
Jeffrey Yasskin d2af962eee Define DiagnosticBuilder<<APValue so it's easy to include APValues in
diagnostics.

llvm-svn: 135398
2011-07-18 16:43:53 +00:00
Nick Lewycky 26da4ddfa6 In C99, emit an inline function when encountering an extern redeclaration.
Fixes PR10233!

llvm-svn: 135377
2011-07-18 05:26:13 +00:00
Ted Kremenek c85964ed90 [analyzer] Place checking for Core Foundation "Create" rule into a proper API. No functionality change.
llvm-svn: 135349
2011-07-16 19:50:32 +00:00
Argyrios Kyrtzidis 238ea53793 Revert r135304 and apply fix in clang_getCanonicalCursor per Doug's, Fariborz's comments.
llvm-svn: 135314
2011-07-15 22:27:18 +00:00
Douglas Gregor 3d0adb3201 Augment the interface of ExternalASTSource::FindExternalLexicalDecls()
to allow clients to specify that they've already (correctly) loaded
declarations, and that no further action is needed. 

Also, make sure that we clear the "has external lexical declarations"
bit before calling FindExternalLexicalDecls(), to avoid infinite
recursion.

llvm-svn: 135306
2011-07-15 21:46:17 +00:00
Argyrios Kyrtzidis f5d99dc2cc The canonical decl for an ObjCImplDecl is it's interface class. Fixes rdar://8728637.
llvm-svn: 135304
2011-07-15 21:39:32 +00:00
Douglas Gregor e9d62935d3 Store bracket locations for array subscript expressions, from Erik Verbruggen!
llvm-svn: 135275
2011-07-15 16:25:15 +00:00
Chandler Carruth f92ac9eb7d Move the Serialization library from 'instantiation' to 'expansion', with
the exception of its uses of SourceManager and SourceLocation APIs.

llvm-svn: 135260
2011-07-15 07:25:21 +00:00
John McCall fa19404c27 Add serialization support for SubstNonTypeTemplateParmExpr.
Also add the missing serialization support for SEHTryStmt,
SEHFinallyStmt, and SEHExceptStmt, and fix and finish the
serialization support for AsTypeExpr.  In addition, change
the code so that it will no longer link if a Stmt subclass
is missing serialization support.

llvm-svn: 135258
2011-07-15 07:00:14 +00:00
John McCall b33fb3670b Fix the definition of AsTypeExpr. I'm still not sure this
is right --- shouldn't there be a TypeLoc in here somewhere? ---
but at least it doesn't have a redundant QualType and a broken
children() method.

Noticed this while doing things in serialization.

llvm-svn: 135257
2011-07-15 06:56:33 +00:00
John McCall 7c454bb8ce Create a new expression node, SubstNonTypeTemplateParmExpr,
to represent a fully-substituted non-type template parameter.
This should improve source fidelity, as well as being generically
useful for diagnostics and such.

llvm-svn: 135243
2011-07-15 05:09:51 +00:00
Ted Kremenek 105f8db1f6 Add 'Contains()' method to GRStateTrait for ImmutableList. Patch by Rui Paulo.
llvm-svn: 135241
2011-07-15 03:32:56 +00:00
Chandler Carruth d755d08c52 Switch help text in the CC1 driver from 'instantiation' to 'expansion'.
llvm-svn: 135225
2011-07-15 00:04:38 +00:00
Sebastian Redl 112aa826c7 Remove InitializationSequence::ReferenceBinding, the last redundant sequence kind.
llvm-svn: 135175
2011-07-14 19:07:55 +00:00