Commit Graph

31577 Commits

Author SHA1 Message Date
Anna Zaks 9ab728bb05 KeychainAPI checker: only check the paths on which the allocator function returned noErr. (+ minor cleanup)
llvm-svn: 136694
2011-08-02 17:11:03 +00:00
Douglas Gregor 5204bded1d Implement a proper local -> global type ID remapping scheme in the AST
reader. This scheme permits an AST file to be loaded with its type IDs
shifted anywhere in the type ID space. 

At present, the type indices are still allocated in the same boring
way they always have been, just by adding up the number of types in
each PCH file within the chain. However, I've done testing with this
patch by randomly sliding the base indices at load time, to ensure
that remapping is occurring as expected. I may eventually formalize
this in some testing flag, but loading multiple (non-chained) AST
files at once will eventually exercise the same code.

There is one known problem with this patch, which involves name lookup
of operator names (e.g., "x.operator int*()") in cases where multiple
PCH files in the chain. The hash function itself depends on having a
stable type ID, which doesn't happen with chained PCH and *certainly*
doesn't happen when sliding type IDs around. We'll need another
approach. I'll tackle that next.

llvm-svn: 136693
2011-08-02 16:26:37 +00:00
Douglas Gregor 1cc9c0675c Add a debugging dump for Module (also emitted as part of the AST
reader statistics), to show the local-to-global mappings. The only
such mapping we have (at least, for now) is for source location
offsets.

llvm-svn: 136687
2011-08-02 11:12:41 +00:00
Douglas Gregor 006599011d Generalize the module offset map to include mapping information for
all of the kinds of IDs that can be offset. No effectively
functionality change; this is preparation for adding remapping for
IDs.

llvm-svn: 136686
2011-08-02 10:56:51 +00:00
Benjamin Kramer 3c05b7c161 Make helper functions static.
llvm-svn: 136679
2011-08-02 04:50:49 +00:00
Richard Trieu cfc491d308 Fix formatting of SemaExpr.cpp, mainly fixing lines greater than 80 characters.
No functional change.

llvm-svn: 136678
2011-08-02 04:35:43 +00:00
Bob Wilson 8e2b75dbad Revert "Re-enable byval for ARM in clang. rdar://problem/7662569"
This reverts commit 67d097e1232b7d66f58989c16a45b8a11721f76e.
We found a miscompile with ARM byval, which is still being investigated.
In the meantime, this works around the problem by disabling ARM byval.

Conflicts:
	lib/CodeGen/TargetInfo.cpp

llvm-svn: 136662
2011-08-01 23:39:04 +00:00
Anna Zaks 15f496c118 Add a skeleton for the Keychain Services API Checker. Register it as OSX experimental for now. Note, the checker still does not handle tracking of escaped values, taking into account the return value of the allocator functions, nor the actual bug reporting..
llvm-svn: 136659
2011-08-01 22:40:01 +00:00
Fariborz Jahanian e1506cbfda objective-c: reverse patch for // rdar://9818354
llvm-svn: 136658
2011-08-01 22:39:49 +00:00
Akira Hatanaka fb1d9f325c Implement MipsABIInfo::EmitVAArg. This fix enables clang to complete compilation
without bailing out when va_arg is an aggregate expression. However, 
alignment checking needs to be added in isSafeToEliminateVarargsCast in
InstCombineCalls.cpp in order to produce correct mips code (see link below).

http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-July/042047.html

llvm-svn: 136647
2011-08-01 20:48:01 +00:00
Chad Rosier 96d690ccdf Driver: When compiling i386 -fapple-kext code, we fallback to llvmgcc.
Unfortunately, llvmgcc doesn't always work when writing temporary output to
/dev/null.  Therefore, create a temp file that is later deleted.
rdar://9837692

llvm-svn: 136644
2011-08-01 19:58:48 +00:00
Akira Hatanaka df425dbf04 Pass records with non-trivial destructors or constructors indirectly.
llvm-svn: 136630
2011-08-01 18:09:58 +00:00
David Chisnall 28dc7f94f8 Fix linkage type for tentative definition of ivar offset variables (GNUstep runtime)
llvm-svn: 136628
2011-08-01 17:36:53 +00:00
Douglas Gregor 2df17cbeeb Move the serialization of the MODULE_OFFSET_MAP out of the source-manager-writing code and into the general chained-PCH writing code
llvm-svn: 136624
2011-08-01 16:54:33 +00:00
Douglas Gregor 5a1797c67b Rename the AST file's SOURCE_LOCATION_MAP to MODULE_OFFSET_MAP, to indicate the greater role it will soon play in remapping.
llvm-svn: 136619
2011-08-01 16:01:55 +00:00
Fariborz Jahanian c81decc0f5 Test for // rdar://9846759
llvm-svn: 136602
2011-07-31 20:27:31 +00:00
Benjamin Kramer 558e37858b Remove dead code flagged by GCC's -Wunused-but-set-variable.
llvm-svn: 136581
2011-07-31 01:06:41 +00:00
Argyrios Kyrtzidis 582ae9916a Not sure why we bother updating FunctionDecl's EndRangeLoc in FunctionDecl::setParams.
EndRangeLoc should always be set to at least the ending paren or brace.

llvm-svn: 136573
2011-07-30 17:23:28 +00:00
Argyrios Kyrtzidis 4c6efa62e0 [libclang] Annotation of parameters that got default args from a previous declarations was
broken because the end location of the parameter was the end location of the default arg,
resulting in a source range that could begin in one file and end in another.

llvm-svn: 136572
2011-07-30 17:23:26 +00:00
Douglas Gregor 5ff4e98c61 Introduce a Fix-It for the "missing sentinel" warning, adding an
appropriate sentinel at the end of the argument list. Also, put the
sentinel warnings under -Wsentinel. Fixes <rdar://problem/8764236>.

llvm-svn: 136566
2011-07-30 08:57:03 +00:00
Douglas Gregor 4ecb7209bf Add code completion to produce "else" blocks after an "if"
statement. Fixes <rdar://problem/9229438>.

llvm-svn: 136564
2011-07-30 08:36:53 +00:00
Douglas Gregor 0c50531a46 When producing code completion results for variadic macros, fold the
variadic bit (", ..." or ", args...") into the prior placeholder, like
we do with functions and methods. Fixes <rdar://problem/9740808>.

llvm-svn: 136563
2011-07-30 08:17:44 +00:00
Douglas Gregor 8f08d74ee5 Add the various parameter-passing keywords for Distributed Objects
(such as in, inout, byref, and oneway) to code completion
results. Fixes <rdar://problem/8844158>.

llvm-svn: 136562
2011-07-30 07:55:26 +00:00
Douglas Gregor 6d40c57009 Fix a thinko in my __is_empty/__is_pod commit.
llvm-svn: 136561
2011-07-30 07:08:19 +00:00
Douglas Gregor df445f0ae1 Turn off __has_feature(is_empty) and __has_feature(is_pod) if the
libstdc++ hack has reverted these type traits to keywords. Icky, but
fixes <rdar://problem/9836262>.

llvm-svn: 136560
2011-07-30 07:01:49 +00:00
Douglas Gregor 2c595adf2e When performing code completion after at @interface, allow both
already-defined and forward-declared results. Already-defined results
are fine because they could be the start of a category. Fixes
<rdar://problem/9811691>.

llvm-svn: 136559
2011-07-30 06:55:39 +00:00
Douglas Gregor 7e1eb935db When complaining about a non-POD second argument to va_arg, use a
special diagnostic for ARC ownership-qualified types. We wouldn't want
to expose Objective-C programmers to the term "POD", would we? Fixes
<rdar://problem/9772982>.

llvm-svn: 136558
2011-07-30 06:45:27 +00:00
Douglas Gregor d8575e1e1d Use the "Bar.h" -> <Foo/Bar.h> remapping for index header maps only as
a fallback, if normal header search fails. Another attempt at
<rdar://problem/9824020>.

llvm-svn: 136557
2011-07-30 06:28:34 +00:00
Fariborz Jahanian d560ed7f1b objc rewriter - my last patch was not quite right.
Fixed again. // rdar://9846759

llvm-svn: 136550
2011-07-30 01:21:41 +00:00
Fariborz Jahanian bce9ee2ae6 objc rewriter - set the flag passed to _Block_object_assign/_Block_object_dispose correctly
for copying a captured block object. // rdar://9846759

llvm-svn: 136549
2011-07-30 01:07:55 +00:00
Douglas Gregor d451ea9ca9 Teach the ASTImporter to cope with cases where we have already
imported a forward declaration, but later the full definition of the
same entity becomes available. When this happens, import the definition.

llvm-svn: 136537
2011-07-29 23:31:30 +00:00
Eric Christopher b081ba651c Add support for the 'Q' arm memory constraint.
Fixes rdar://9866494

llvm-svn: 136524
2011-07-29 21:20:35 +00:00
Ted Kremenek 67d7136f26 [analyzer] Remove recursive visitation in ExprEngine::VisitDeclStmt because it isn't needed anymore.
llvm-svn: 136522
2011-07-29 21:18:41 +00:00
Ted Kremenek e905c68cbd [analyzer] Remove recursive visitation in ExprEngine::VisitCompoundLiteralExpr because it isn't needed anymore.
llvm-svn: 136521
2011-07-29 21:18:39 +00:00
Ted Kremenek dc492c29f7 [analyzer] Remove recursive visitation in ExprEngine::VisitCastExpr because it isn't needed anymore.
llvm-svn: 136520
2011-07-29 21:18:37 +00:00
Ted Kremenek cf36b0c64d [analyzer] Remove recursive visitation in ExprEngine::VisitObjCForCollectionStmt because it isn't needed anymore.
llvm-svn: 136519
2011-07-29 21:18:35 +00:00
Ted Kremenek 65eefed6c6 [analyzer] Remove explicit argument processing from ExprEngine::VisitObjCMessage() since it is no longer needed.
llvm-svn: 136518
2011-07-29 21:18:31 +00:00
Ted Kremenek 4e577fae2c [analyzer] Remove recursive visitation in ExprEngine::VisitLValObjCIvarRefExpr because it isn't needed anymore.
llvm-svn: 136517
2011-07-29 21:18:28 +00:00
Ted Kremenek 003ec6ff83 [analyzer] tighten up ExprEngine::VisitObjCAtSynchronizationStmt().
llvm-svn: 136516
2011-07-29 21:18:26 +00:00
Ted Kremenek f8c0bcf101 [analyzer] Remove recursive visitation in ExprEngine::VisitObjCPropertyRefExpr because it isn't needed anymore.
llvm-svn: 136515
2011-07-29 21:18:24 +00:00
Ted Kremenek 298e5cc7f4 [analyzer] Remove recursive visitation in ExprEngine::VisitCallExpr because it isn't needed anymore.
llvm-svn: 136514
2011-07-29 21:18:22 +00:00
Ted Kremenek 22a1e65532 [analyzer] Remove recursive visitation in ExprEngine::VisitMemberExpr because it isn't needed anymore.
llvm-svn: 136513
2011-07-29 21:18:19 +00:00
Ted Kremenek db835cc213 [analyzer] Remove recursive visitation in ExprEngine::VisitLvalArraySubscriptExpr() because it is no longer needed.
llvm-svn: 136512
2011-07-29 21:18:17 +00:00
Douglas Gregor f4016fdf71 On Darwin, libc++ may be installed alongside the compiler in
lib/c++/v1. Look there first, before falling back to the normal
/usr/include/c++/v1. <rdar://problem/9866149>

llvm-svn: 136507
2011-07-29 20:21:18 +00:00
Jonathan D. Turner 10d52011d8 Renamed Loaded member to ImportedBy, as it's easier to read. Added another set to represent the modules a module imports.
llvm-svn: 136476
2011-07-29 18:09:09 +00:00
Douglas Gregor 9ea0537d23 Add a missing \endcode for Doxygen
llvm-svn: 136469
2011-07-29 17:35:37 +00:00
Jay Foad 5709f7c5f7 Remove some unnecessary single element array temporaries.
llvm-svn: 136461
2011-07-29 13:56:53 +00:00
Argyrios Kyrtzidis 1fa8b4b204 Make DiagnosticErrorTrap keep a count of the errors that occurred so multiple
DiagnosticErrorTraps can be composed (e.g. a trap inside another trap).

Fixes http://llvm.org/PR10462 & rdar://9852007.

llvm-svn: 136447
2011-07-29 01:25:44 +00:00
Douglas Gregor 5e6fcb108f This patch makes the string/character literal tests run in C,
C++98/03, and C++0x mode, from Craig Topper!

llvm-svn: 136443
2011-07-29 01:08:54 +00:00
Douglas Gregor f6f2810c1f Remove unused debug function
llvm-svn: 136442
2011-07-29 00:59:35 +00:00