Commit Graph

25675 Commits

Author SHA1 Message Date
Ted Kremenek ed12f1b9f9 Add ObjCAtSynchronizedStmt to the CFG and add GRExprEngine support (PreVisit for checkers).
llvm-svn: 113572
2010-09-10 03:05:33 +00:00
Ted Kremenek 516484c71e Update checker build.
llvm-svn: 113569
2010-09-10 01:20:17 +00:00
Tom Care 4545b2df42 Added AnalyzerStatsChecker, a path sensitive check that reports visitation statistics about analysis. Running clang with the -analyzer-stats flag will emit warnings containing the information. We can then run a postanalysis script to take this data and give useful information about how much the analyzer missed in a project.
llvm-svn: 113568
2010-09-10 00:44:44 +00:00
Douglas Gregor a93ab66331 Add libclang support for label statements, gotos, and taking the
address of a label (GNU extension).

llvm-svn: 113564
2010-09-10 00:22:18 +00:00
Douglas Gregor d198047ef3 Add libclang visitation for C99 designated initializers.
llvm-svn: 113560
2010-09-09 23:28:23 +00:00
Douglas Gregor 0d4d88cf38 Add libclang visitation for __builtin_offsetof's components (fields
and array references).

llvm-svn: 113556
2010-09-09 23:10:46 +00:00
Fariborz Jahanian e89d03f619 property reference expression used on lhs of assignment
follows objective's semantics and is not overload'able
with an assignment operator. Fixes a crash and a missing
diagnostics. Radar 8379892.

llvm-svn: 113555
2010-09-09 23:01:10 +00:00
Ted Kremenek 5cdaeaaa1d Clean up obtuse wording of checker diagnostic of using an uninitialized value in a function call.
Fixes: <rdar://problem/8409480> “warning: Pass-by-value argument in function call is undefined” message can be improved
llvm-svn: 113554
2010-09-09 22:51:55 +00:00
Douglas Gregor c7d6576d54 When we parse a pragma, keep track of how that pragma was originally
spelled (#pragma, _Pragma, __pragma). In -E mode, use that information
to add appropriate newlines when translating _Pragma and __pragma into
#pragma, like GCC does. Fixes <rdar://problem/8412013>.

llvm-svn: 113553
2010-09-09 22:45:38 +00:00
Daniel Dunbar ccbc45262b Driver/Darwin: Make the compilation object available in AddLinkArgs.
llvm-svn: 113549
2010-09-09 21:51:05 +00:00
Douglas Gregor f3af311382 Teach libclang to walk the base and member initializers of a
constructor, in source order. Also introduces a new reference kind for
class members, which is used here (for member initializers) and will
also be used for designated initializers and offsetof.

llvm-svn: 113545
2010-09-09 21:42:20 +00:00
Daniel Dunbar 7ce4686958 Fix typo in diagnostic.
llvm-svn: 113542
2010-09-09 21:27:25 +00:00
Daniel Dunbar 859dba6637 Driver: Mark function as nounwind when -mkernel or -fapple-kext is present.
llvm-svn: 113541
2010-09-09 21:17:44 +00:00
Bill Wendling 324f8b798f Remove the 'rc' suffix. It indicates a "release candidate" during LLVM release
qualification.

llvm-svn: 113534
2010-09-09 20:27:36 +00:00
Ted Kremenek ff3a4ff6e9 Use FindReportInEquivalenceClass to identify all the nodes used for the trimmed graph (in BugReporter). This fixes a problem where a leak that happened to occur on both an exit() path and a non-exit() path was getting reported with the exit() path (which users don't care about).
This fixes:

<rdar://problem/8331641> leak reports should not show paths that end with exit() (but ones that don't end with exit())

llvm-svn: 113524
2010-09-09 19:05:34 +00:00
Daniel Dunbar 0166c95fdd Frontend: Add -cxx-system-include option which can be used to specify an
explicit list for the C++ system include directories at the -cc1 level, as an
alternative to the horrible AddDefaultCPlusPlusIncludePaths().

llvm-svn: 113505
2010-09-09 17:38:22 +00:00
Daniel Dunbar 1cf2d54987 Fix indentation.
llvm-svn: 113504
2010-09-09 17:38:18 +00:00
Douglas Gregor 9f0e1aa0f2 Simplify template instantiation for C++ exception declarations,
eliminating an unnecessary use of TemporaryBase in the process.

llvm-svn: 113500
2010-09-09 17:09:21 +00:00
Douglas Gregor 3b29b2c795 Eliminate some unnecessary uses of TreeTransform::TemporaryBase. There
are still a few (legitimate, unfortunate) uses of this hack around,
but at least now there are fewer.

llvm-svn: 113498
2010-09-09 16:55:46 +00:00
Douglas Gregor ce5aa33385 Eliminate the comma locations from all of the Sema routines that deal
with comma-separated lists. We never actually used the comma
locations, nor did we store them in the AST, but we did manage to
waste time during template instantiation to produce fake locations.

llvm-svn: 113495
2010-09-09 16:33:13 +00:00
Douglas Gregor 57df3b4b12 Use temporary files for this test, to see if we can flush out an inexplicable error on Windows
llvm-svn: 113493
2010-09-09 16:16:39 +00:00
Douglas Gregor 54e5b13a27 Add proper type-source information to UnaryTypeTraitExpr, including
libclang visitation.

llvm-svn: 113492
2010-09-09 16:14:44 +00:00
Douglas Gregor c9199f522f Clean up CMake dependencies
llvm-svn: 113489
2010-09-09 15:44:58 +00:00
Benjamin Kramer d4b4b7e8a1 Remove unused variable.
llvm-svn: 113482
2010-09-09 12:27:34 +00:00
Argyrios Kyrtzidis e262a9558e Fix C++ PCH issue.
Another beating by boost in this test case: http://llvm.org/PR8117
A function specialization wasn't properly initialized if it wasn't canonical.

I wish there was a nice little test case but this was boost.

llvm-svn: 113481
2010-09-09 11:28:23 +00:00
Gabor Greif 230ddf37af do not bind temporaries to non-const references
this fixes all analyser test failures in my gcc34-based
environment

how the cast result could bind to the non-const ref is
somewhat mysterious and remains to be investigated; to
avoid similar miscompilations (by gcc34 only?)

llvm-svn: 113480
2010-09-09 10:51:37 +00:00
Ted Kremenek 5f256da834 Rename GRState::getSVal() -> getRawSVal() and getSimplifiedSVal() -> getSVal().
The end result is now we eagarly constant-fold symbols in the analyzer that are perfectly constrained
to be a constant value.  This allows us to recover some path-sensitivity in some cases by lowering
the required level of reasoning power needed to evaluate some expressions.

The net win from this change is that the false positive in PR 8015 is fixed, and we also
find more idempotent operations bugs.

We do, however, regress with the BugReporterVisitors, which need to be modified to understand
this constant folding (and look past it).  This causes some diagnostic regressions in plist-output.m
which will get addressed in a future patch.  plist-output.m is now marked XFAIL, while
plist-output-alternate.m now tests that the plist output is working, but with the suboptimal
diagnostics.  This second test file will eventually be removed.

llvm-svn: 113477
2010-09-09 07:13:00 +00:00
Ted Kremenek 02627a22cf Fix indentation.
llvm-svn: 113476
2010-09-09 06:53:59 +00:00
Ted Kremenek b8176da314 Check format strings when a called function has more than one FormatAttr (one for 'scanf' and one for 'printf'). Fixes <rdar://problem/8409437>.
llvm-svn: 113472
2010-09-09 04:33:05 +00:00
Ted Kremenek 1520dae606 It appears that technically a null format string is not warned under -Wformat-nonliteral, as
the function processing the format string can decided whether or not to accept a null format string (e.g., asl_log).  Fixes <rdar://problem/8269537>.

llvm-svn: 113469
2010-09-09 03:51:42 +00:00
Ted Kremenek 808829351e Avoid redundant recursive calls in SemaCheckStringLiteral by just updating the expression
and trying again.

llvm-svn: 113468
2010-09-09 03:51:39 +00:00
Ted Kremenek bc5860b652 Remove tabs I accidentally introduced.
llvm-svn: 113467
2010-09-09 02:57:51 +00:00
Ted Kremenek f146cd1fa3 Remove stray ';' and convert tabs to spaces.
llvm-svn: 113466
2010-09-09 02:57:48 +00:00
Tom Care 68df12f0c4 Simplified reachability checking in IdempotentOperationChecker and added a helper function for path display.
- Created private class CFGReachabilityAnalysis, which provides cached reachability lookups in the CFG
- Simplified PathWasCompletelyAnalyzed to use the new reachability class
- Added getLastRelevantNodes function for future use with path displaying in BugReporter

llvm-svn: 113465
2010-09-09 02:04:52 +00:00
Ted Kremenek 0f107e4386 Relax __attribute_((nonnull)) checking to allow the attribute on functions with no pointer arguments. GCC doesn't warn
in this case, and the attribute is trivially satisfied (and benign).  Fixes <rdar://problem/8364828>.

llvm-svn: 113464
2010-09-09 01:17:32 +00:00
Ted Kremenek 5ebb6156d8 Include test case for <rdar://problem/5880430>.
llvm-svn: 113458
2010-09-09 00:40:43 +00:00
Ted Kremenek 8f0e834c4c Static analyzer fix: <rdar://problem/5880430> Switch on enum should not consider default case live if all enum values are covered
llvm-svn: 113457
2010-09-09 00:40:40 +00:00
Fariborz Jahanian cfddabf5a3 Block ivar layout must assume that the 'isa'
field of the block descriptor is GC'able (scanned)
as this what the runtime expects (one can send it 
messages). Radar 8394947.

llvm-svn: 113454
2010-09-09 00:21:45 +00:00
Ted Kremenek f2b0a1bfa0 Enhance -Wunreachable-code to not consider the 'default:' branch of a switch statement live if a switch on an enum value has
explicit 'case:' statements for each enum value.

llvm-svn: 113451
2010-09-09 00:06:10 +00:00
Ted Kremenek 50205744c3 Enhance -Wreturn-type to not warn when control-flow is most likely limited by a switch statement explicitly covering
all the cases for an enum value.

llvm-svn: 113450
2010-09-09 00:06:07 +00:00
Ted Kremenek b037185b52 Add 'filtered_pred_iterator' and 'filtered_succ_iterator' to CFGBlock. This allows a client
to selectively walk successors/predecessors based on commonly used filters.  For starters, add
a filter to ignore 'default:' cases for SwitchStmts when all enum values are covered by CaseStmts.

llvm-svn: 113449
2010-09-09 00:06:04 +00:00
Ted Kremenek fd525ef338 Initialize 'AllEnumCasesCovered' in SwitchStmt's constructor.
llvm-svn: 113448
2010-09-09 00:06:01 +00:00
Ted Kremenek c42f345157 When building SwitchStmts in Sema, record whether all the enum values of a switch(enum) where
covered by individual case statements.  Flow-based analyses may wish to consult this information,
and recording this in the AST allows us to obviate reconstructing this information later when
we build the CFG.

llvm-svn: 113447
2010-09-09 00:05:53 +00:00
Douglas Gregor a5614c5fe8 Push the range associated with a nested-name-specifier further through
TreeTransform, since we were getting an empty source range where we
shouldn't. Sadly, the test case is Boost.Proto, and isn't worth
reducing.

llvm-svn: 113446
2010-09-08 23:56:00 +00:00
Francois Pichet 5cc0a67f08 Fix warnings caused by new CXXUuidofExprClass enumerator.
llvm-svn: 113444
2010-09-08 23:47:05 +00:00
Daniel Dunbar c6f6df088f Add another missing CMake dependency.
llvm-svn: 113443
2010-09-08 23:40:30 +00:00
Douglas Gregor 4c7c109eec Fix a few minor issues with parsing and semantic analysis of C++
typeid expressions: 
  - make sure we have a proper source location for the closing ')'
  - cache the declaration of std::type_info once we've found it

llvm-svn: 113441
2010-09-08 23:14:30 +00:00
Dawn Perchik a42039d5eb Add support for a few MS extensions supported by the Borland compiler
(__uuidof, _fastcall, etc.).

llvm-svn: 113434
2010-09-08 22:56:24 +00:00
Douglas Gregor 67da50e18d When providing a completion for a function/method parameter of block
pointer type, actually provide a usable block literal expression.

llvm-svn: 113431
2010-09-08 22:47:51 +00:00
Fariborz Jahanian 5138b62edc Test removed.
llvm-svn: 113428
2010-09-08 22:36:14 +00:00
Argyrios Kyrtzidis e177863afc Decl::CheckAccessDeclContext() keeps asserting. Access is not set in some cases.
llvm-svn: 113419
2010-09-08 21:58:42 +00:00
Fariborz Jahanian d4ec16ca71 Removed test case.
llvm-svn: 113418
2010-09-08 21:55:57 +00:00
Douglas Gregor b2f0713ddc Clean up some of the CMake dependencies
llvm-svn: 113416
2010-09-08 21:40:53 +00:00
Douglas Gregor 8ec5173f9a Use the new-initialization code for initializing scalars with a
function-style cast. Previously, we had a (redundant, incorrect)
semantic-checking path for non-class types, which allowed
value-initialization of a reference type and then crashed.

llvm-svn: 113415
2010-09-08 21:40:08 +00:00
Fariborz Jahanian db45278cbd Reverse r113397 until we decide what to do with
use of 'struct objc_object*' for 'is' (and others)
in clang.

llvm-svn: 113414
2010-09-08 21:36:35 +00:00
Argyrios Kyrtzidis 260b4a8e92 Re-enable CheckAccessDeclContext and make sure it doesn't trigger assertions.
llvm-svn: 113413
2010-09-08 21:32:35 +00:00
Bill Wendling 73f59c433d Initialize the MSVCGuidDecl variable in the correct order.
llvm-svn: 113412
2010-09-08 21:30:16 +00:00
Fariborz Jahanian 40efc0feb4 Fix a crash when overloading id with objc_object*.
Radar 8400356.

llvm-svn: 113397
2010-09-08 20:08:18 +00:00
Argyrios Kyrtzidis f4bc0d87ee Fix C++ PCH issues.
PCH got a severe beating by the boost-using test case reported here: http://llvm.org/PR8099
Fix issues like:

-When PCH reading, make sure Decl's getASTContext() doesn't get called since a Decl in the parent hierarchy may be initializing.
-In ASTDeclReader::VisitFunctionDecl VisitRedeclarable should be called before using FunctionDecl's isCanonicalDecl()
-In ASTDeclReader::VisitRedeclarableTemplateDecl CommonOrPrev must be initialized before anything else.

llvm-svn: 113391
2010-09-08 19:31:22 +00:00
Daniel Dunbar 04ebde017f Frontend/-H: Add comment on why I used a temporary string here.
llvm-svn: 113379
2010-09-08 18:19:55 +00:00
Francois Pichet 9f4f2078d6 Microsoft's __uuidof operator implementation part 1.
llvm-svn: 113356
2010-09-08 12:20:18 +00:00
Francois Pichet 4ad4b58639 Allow type definitions inside anonymous struct/union in Microsoft mode.
llvm-svn: 113354
2010-09-08 11:32:25 +00:00
Sebastian Redl 02f1eebdc0 Don't give 'global constructor' warnings for function statics, even if they have a direct initializer. Fixes PR8095.
llvm-svn: 113344
2010-09-08 04:46:19 +00:00
John McCall 83556c1a80 Put the tautological-comparison-of-unsigned-against-zero warnings in
-Wtautological-compare instead of -Wsign-compare, which also implies turning
them on by default.

Restoration of r112877.

llvm-svn: 113334
2010-09-08 02:01:27 +00:00
John McCall 68ff03728a Implement ARM static local initialization guards, which are more compact than
Itanium guards and use a slightly different compiled-in API.

llvm-svn: 113330
2010-09-08 01:44:27 +00:00
Sebastian Redl a190d3605f Allow (cv) void and incomplete arrays to be passed to the type traits.
Fixes PR8110, and thus PR8109, PR8097, and parts of PR8101, PR8105 and PR8107. Only a few traits have tests for incomplete arrays, since I'm not yet clear what the result for them should be; Howards wants to file a DR to change the standard.

llvm-svn: 113326
2010-09-08 00:48:43 +00:00
Gabor Greif 80c218386f add a fixit when 'main' does ot return 'int'; review welcome
llvm-svn: 113324
2010-09-08 00:31:13 +00:00
Douglas Gregor 2b88c115f9 Provide proper type-source location information for
CXXTemporaryObjectExpr, CXXScalarValueInitExpr, and
CXXUnresolvedConstructExpr, getting rid of a bunch of FIXMEs in the
process.

llvm-svn: 113319
2010-09-08 00:15:04 +00:00
Fariborz Jahanian 366a94822b Local static block variable referecned in its
block-literal initializer expression causes IRgen to crash.
This patch fixes by saving it in StaticLocalDecl map
already used for such purposes. (radar 8390455).

llvm-svn: 113307
2010-09-07 23:26:17 +00:00
Daniel Dunbar 53c9ac30f9 tests: Use -ffreestanding when including stdint.h, to avoid platform dependencies.
llvm-svn: 113301
2010-09-07 22:54:28 +00:00
Ted Kremenek 41994fd45d Fix DeclPrinter to not include '=' in printing when no initializer is provided for a VarDecl. Patch by Jim Goodnow II!
llvm-svn: 113296
2010-09-07 22:21:59 +00:00
Gabor Greif 7af952801e typo
llvm-svn: 113295
2010-09-07 22:17:12 +00:00
Douglas Gregor 0744ef6371 Improve source-location information for CXXNewExpr, by hanging on to
the TypeSourceInfo for the allocated type. Fixes PR7501.

llvm-svn: 113291
2010-09-07 21:49:58 +00:00
Ted Kremenek aba4958db2 Fix null pointer dereference in StreamChecker::Fseek (reported in PR 8081) and simplify surrounding checking logic.
llvm-svn: 113282
2010-09-07 20:45:26 +00:00
Tom Care bc9eaef24c Re-enabled truncation/extension checking in IdempotentOperationChecker and added a test case.
llvm-svn: 113269
2010-09-07 20:27:56 +00:00
Douglas Gregor e9b76c2a41 Add function attributes to the output of -ast-print-xml, from Martin Vejnar!
llvm-svn: 113266
2010-09-07 20:16:43 +00:00
Fariborz Jahanian 535618b927 get rid of a warning.
llvm-svn: 113256
2010-09-07 19:57:04 +00:00
Fariborz Jahanian 56603ef7b2 Have Sema check for validity of CGString literal
instead of asserting in IRGen. Fixes radar 8390459.

llvm-svn: 113253
2010-09-07 19:38:13 +00:00
Dale Johannesen 8499f47ef4 Allow 'o' and 'V' as constraints for output asm operands.
Allow '<' and '>' as constraints for input or output.

llvm-svn: 113246
2010-09-07 18:40:41 +00:00
John McCall 1ca73da0e6 Improve error recovery when we see ':' and expect a ';'.
I, at least, make this typo all the time.

llvm-svn: 113243
2010-09-07 18:31:03 +00:00
Dale Johannesen 2002e1f1bf Adjust a test that's expecting optimizations to be done
on MMX palignr; we don't do this for the intrinsics.

llvm-svn: 113234
2010-09-07 18:11:53 +00:00
Daniel Dunbar 3d7e0e2c6b Driver/Darwin: Catch another case where ld ends up using ld_classic.
llvm-svn: 113226
2010-09-07 17:50:41 +00:00
Daniel Dunbar 1eaf5c6abb Driver/Darwin: Don't pass -demangle to the linker when we know it is going to
use ld_classic. This is a temporary workaround, the linkr itself should handle
this.

llvm-svn: 113212
2010-09-07 17:07:49 +00:00
Douglas Gregor a7d6e3d0f5 Provide a specific diagnostic when trying to redefine an "extern
inline" function outside of GNU89 mode. Fixes
<rdar://problem/6880464>.

llvm-svn: 113204
2010-09-07 15:51:01 +00:00
Douglas Gregor 45d6bdfa88 Improve recovery when there is a stray ']' or ')' before the ';' at
the end of a statement. Fixes <rdar://problem/6896493>.

llvm-svn: 113202
2010-09-07 15:23:11 +00:00
Douglas Gregor ce66d02877 Improve recovery when a comma is missing between enumerators in an
enumeration definition. Fixes <rdar://problem/7159693>.

llvm-svn: 113201
2010-09-07 14:51:08 +00:00
Douglas Gregor 3465e26102 Improve diagnostic and recovery when missing a comma between base or
member initializers in a C++ constructor. Fixes <rdar://problem/7796492>.

llvm-svn: 113199
2010-09-07 14:35:10 +00:00
Benjamin Kramer 25f9ea6f0a Replace loops with SmallVector::append.
llvm-svn: 113185
2010-09-06 23:43:28 +00:00
Chris Lattner 03483613c2 Due to asmparser improvements, this error message is now better
llvm-svn: 113177
2010-09-06 22:09:27 +00:00
Argyrios Kyrtzidis d05f3e3730 Fix a C++ PCH problem which was exposed by r113019. CXXBaseOrMemberInitializer's IsWritten and source order is not set.
llvm-svn: 113161
2010-09-06 19:04:27 +00:00
Chris Lattner d7ff9f91bf remove curly quotes, patch by Dimitry Andric!
llvm-svn: 113156
2010-09-06 17:52:29 +00:00
Argyrios Kyrtzidis 2fdb5b5955 LastFieldBitfield in CGObjCCommonMac::BuildAggrIvarLayout keeps bitfields or unnamed fields but later the code
assumes that it's always a bitfield. This can lead to a crash (reported at rdar://8368320).

llvm-svn: 113154
2010-09-06 12:00:10 +00:00
Zhongxing Xu 33dfc07b00 FinishBlock() is essentially doing nothing except returning '!badCFG'.
llvm-svn: 113149
2010-09-06 07:32:31 +00:00
Zhongxing Xu b1e10aa670 Simplify CFG construction: bail out early when we have a bad CFG.
llvm-svn: 113148
2010-09-06 07:04:06 +00:00
Rafael Espindola b2d0d40c3d Make "-ccc-cxx" option work on Linux.
Patch by nobled.

I also took the opportunity to make the field private since now it is only ready from the
outside.

llvm-svn: 113138
2010-09-06 02:36:23 +00:00
Eli Friedman 08e3cdcffa Get rid of unnecessary return.
llvm-svn: 113132
2010-09-06 00:31:37 +00:00
Eli Friedman abebebf742 Update test for r113128.
llvm-svn: 113131
2010-09-06 00:30:50 +00:00
Chris Lattner 52bcf96384 move the hackaround for PR6537 to catch unions as well,
fixing the ICE in PR7151

llvm-svn: 113130
2010-09-06 00:13:11 +00:00
Chris Lattner f53c096813 clean up some formatting.
llvm-svn: 113129
2010-09-06 00:11:41 +00:00
Eli Friedman 0b1fbd1394 PR7242: Make sure to use a different context for evaluating constant
initializers, so the result of the evaluation doesn't leak through
inconsistently.  Also, don't evaluate references to variables with
initializers with side-effects.

llvm-svn: 113128
2010-09-06 00:10:32 +00:00
Chris Lattner ee8df8f167 fix PR7192 by defining wchar_t in a more conventional way. The
type of L"x" can change based on command line arguments.

llvm-svn: 113127
2010-09-05 23:29:49 +00:00
Steven Watanabe 2ba828f36d Tell the VS headers that char16_t and char32_t are keywords, so yvals.h doesn't try to define them as typedefs.
llvm-svn: 113126
2010-09-05 23:16:22 +00:00
Chris Lattner f0b0497343 fix 7320: we can't delete a trailing space if it doesn't exist.
llvm-svn: 113125
2010-09-05 23:16:09 +00:00
Eli Friedman 8ed2bac65d PR8023: Don't crash on invalid uses of __real__ on class types in C++.
llvm-svn: 113124
2010-09-05 23:15:52 +00:00
Nick Lewycky 1b36b55f89 No functional change. Replace Out << 'a' << 'b' with Out << "ab" and spell
David Vandevoorde's name correctly.

llvm-svn: 113103
2010-09-05 03:40:33 +00:00
Chris Lattner 938cebc076 "const id<NSFoo> *" instead of "id<NSFoo> const *".
I think this wraps up all the legal cases.

llvm-svn: 113096
2010-09-05 00:43:21 +00:00
Chris Lattner edead1266e "const id<NSFoo> *" not "id<NSFoo> const*"
llvm-svn: 113095
2010-09-05 00:36:44 +00:00
Chris Lattner 7f2c7f4ef3 "const std::vector<int>*" not "std::vector<int> const*"
llvm-svn: 113094
2010-09-05 00:27:00 +00:00
Chris Lattner c4bf372e43 "const _Complex float *" not "_Complex float const *"
llvm-svn: 113093
2010-09-05 00:22:25 +00:00
Chris Lattner 24b89469ac 'const std::type_info*' instead of 'std::type_info const*'
llvm-svn: 113092
2010-09-05 00:17:29 +00:00
Chris Lattner 9dd55103c1 print "const intptr_t" instead of "intptr_t const"
llvm-svn: 113091
2010-09-05 00:07:29 +00:00
Chris Lattner 53fa04909c make clang print types as "const int *" instead of "int const*",
which is should have done from the beginning.  As usual, the most
fun with this sort of change is updating all the testcases.

llvm-svn: 113090
2010-09-05 00:04:01 +00:00
Chris Lattner 1c2cc0adba revert this, it isn't safe.
llvm-svn: 113088
2010-09-04 23:43:40 +00:00
Chris Lattner 5ad6bc6f35 tidy up
llvm-svn: 113087
2010-09-04 23:37:43 +00:00
Chris Lattner edbdff64c7 revise r112365 to fix the actual problem: the isa<TagType>(Underlying)
check in the "typedef for anonymous type" check should have been a
getAs.

llvm-svn: 113085
2010-09-04 23:16:01 +00:00
Fariborz Jahanian 60babfb8a1 Casting of a property reference to 'void' did not
generate the necessary code. This patch fixes it.
// rdar://8389655

llvm-svn: 113079
2010-09-04 19:49:18 +00:00
Chris Lattner a3d232ad27 zap more dead code.
llvm-svn: 113076
2010-09-04 18:19:08 +00:00
Chris Lattner 9795b39113 zap dead code.
llvm-svn: 113074
2010-09-04 18:12:20 +00:00
John McCall 2917bd0fb4 Petty optimization.
llvm-svn: 113049
2010-09-04 01:26:37 +00:00
Zhanyong Wan 18ca8bf850 fix a crash in RecursiveASTVisitor's child classes (PR8403); reviewed by chandlerc.
llvm-svn: 113038
2010-09-03 23:50:56 +00:00
Douglas Gregor 09c0eb1510 Synchronize code-completion cursor kinds with indexing cursor
kinds. How shameful that this code was duplicated!

llvm-svn: 113033
2010-09-03 23:30:36 +00:00
Fariborz Jahanian 087206dbcd Truncate block variable of bool type to i1 when its
value is used. This matches with non-block variable
use of bool type. (Fixes radar 8390062).

llvm-svn: 113027
2010-09-03 23:07:53 +00:00
Chandler Carruth f92bd8cf22 Fix PR7402 when it strikes via template instantiation.
llvm-svn: 113019
2010-09-03 21:54:20 +00:00
Anders Carlsson f849774495 It's OK for classes to have flexible array elements (but not unions).
llvm-svn: 113018
2010-09-03 21:53:49 +00:00
Fariborz Jahanian 9d798d13f3 Cope with llvm's reference to bool type of 'i1' vs. clang's
type of 'i8' for the same for __block variables of
type bool. refixes radar 8382559.

llvm-svn: 113015
2010-09-03 21:36:02 +00:00
Chandler Carruth b916499161 Clean up some whitespace and comments from this test that were remnants of
a previous iteration of the test.

llvm-svn: 113013
2010-09-03 21:17:53 +00:00
Chandler Carruth 9bb67f4d1a Allow anonymous and local types. The support was already in place for these,
but this makes them work even as an extension in C++98. This resolves PR8077.

llvm-svn: 113011
2010-09-03 21:12:34 +00:00
John McCall 56f57589af A constant initializer never matches the type of the variable it's
initializing;  it at best matches the element type of the variable
it's initializing.  Fixes PR8073.

llvm-svn: 112992
2010-09-03 18:58:50 +00:00
Douglas Gregor 901a0fabfc Implement libclang visitation for UnresolvedMemberExpr. This is the
last of the C++-specific expressions where we have decent source
information in the AST already. In particular, various
object-construction expressions (CXXNewExpr, CXXTemporaryObjectExpr)
still have poor source-location information that needs to be addressed.

llvm-svn: 112981
2010-09-03 18:01:25 +00:00
Fariborz Jahanian dadfc1c144 Use std::string instead of llvm::StringRef to avoid dangling ref.
Per Chris's comment.

llvm-svn: 112979
2010-09-03 18:01:09 +00:00
Douglas Gregor 4583827e13 libclang visitation for CXXDependentScopeMemberExpr
llvm-svn: 112978
2010-09-03 17:35:34 +00:00
Fariborz Jahanian 9e42a952d7 Use getSpelling to get original text of the
c++ operator token. (radar 8328250).

llvm-svn: 112977
2010-09-03 17:33:04 +00:00
Douglas Gregor 4ae34afaf9 libclang visitation for DependentScopeDeclRefExpr
llvm-svn: 112975
2010-09-03 17:24:10 +00:00
Douglas Gregor 6368235c5a Add missing #include
llvm-svn: 112974
2010-09-03 17:16:03 +00:00
Dawn Perchik 90ca316167 Put the info on testing from the command line into its own section
titled "Testing on the Command Line".

llvm-svn: 112972
2010-09-03 17:01:13 +00:00
Chris Lattner d7e9383ba0 fix a hard coded version number, PR8031. Patch by 'nobled'.
llvm-svn: 112970
2010-09-03 16:47:03 +00:00
Chris Lattner c766b6edd1 fix lookup of bits/c++config.h on mingw, patch by Ismail Donmez!
llvm-svn: 112969
2010-09-03 16:45:53 +00:00
Douglas Gregor c4ef180dd2 Simplify code-completion result sorting a bit
llvm-svn: 112968
2010-09-03 16:23:44 +00:00
Daniel Dunbar bf257a652d Avoid unnecessary redirect, so that stderr shows up in output.
llvm-svn: 112965
2010-09-03 15:45:00 +00:00
Francois Pichet a5a5f470f1 First test commit by Francois Pichet. _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES is not a predefined macro, remove it.
llvm-svn: 112953
2010-09-03 08:42:01 +00:00
John McCall e37a619715 Update the internals manual for the removal of Action, as well as other
changes that are much older.

llvm-svn: 112951
2010-09-03 05:07:55 +00:00
John McCall 417e74491c Add a quick-and-dirty hack to give a better diagnostic for [class.protected]
restrictions.  The note's not really on the right place given its wording,
but putting a second note on the call site (or muddying the wording) doesn't
appeal.

There are corner cases where this can be wrong, but I'm not concerned.

llvm-svn: 112950
2010-09-03 04:56:05 +00:00
Chris Lattner 3dd48bd169 "I see dead code". IdempotentOperationChecker::isTruncationExtensionAssignment
should probably be removed if it has no purpose, but I just #if'd it out
in case it's usefulIdempotentOperationChecker::isTruncationExtensionAssignment
should probably be removed if it has no purpose, but I just #if'd it out
in case it's useful

llvm-svn: 112949
2010-09-03 04:34:38 +00:00
John McCall 96326e447c Devirtualize Sema, kill off DeleteExpr and DeleteStmt, and reformat.
llvm-svn: 112945
2010-09-03 02:10:08 +00:00
Daniel Dunbar 2f8df98c92 IRgen: Fix silly thinko in r112021, which was generating code for the same expr
twice. This showed up as an assert on the odd test case because we generated the
decl map entry twice.

llvm-svn: 112943
2010-09-03 02:07:00 +00:00
Dawn Perchik 335e16bad4 Add symantic support for the Pascal calling convention via
"__attribute((pascal))" or "__pascal" (and "_pascal" under
-fborland-extensions).  Support still needs to be added to llvm.

llvm-svn: 112939
2010-09-03 01:29:35 +00:00
Bob Wilson 6061b05d51 Translate NEON vabdl, vaba, and vabal builtins to be implemented using the
vabd intrinsic combined with zext and add operations.

llvm-svn: 112937
2010-09-03 01:27:09 +00:00
John McCall 0d635f53a8 Re-commit r112916 with an additional fix for the self-host failures.
I've audited the remaining getFunctionInfo call sites.

llvm-svn: 112936
2010-09-03 01:26:39 +00:00
Fariborz Jahanian 0389df4a45 Patch to allow alternative representation of c++
operators (and, or, etc.) to be used as selectors
to match g++'s behavior.

llvm-svn: 112935
2010-09-03 01:26:16 +00:00
Anders Carlsson 4013404eff Static local variables don't result in global constructors being emitted.
llvm-svn: 112933
2010-09-03 01:11:38 +00:00