]> granicus.if.org Git - clang/log
clang
14 years agoFix indentation.
Daniel Dunbar [Thu, 9 Sep 2010 17:38:18 +0000 (17:38 +0000)]
Fix indentation.

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

14 years agoSimplify template instantiation for C++ exception declarations,
Douglas Gregor [Thu, 9 Sep 2010 17:09:21 +0000 (17:09 +0000)]
Simplify template instantiation for C++ exception declarations,
eliminating an unnecessary use of TemporaryBase in the process.

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

14 years agoEliminate some unnecessary uses of TreeTransform::TemporaryBase. There
Douglas Gregor [Thu, 9 Sep 2010 16:55:46 +0000 (16:55 +0000)]
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.

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

14 years agoEliminate the comma locations from all of the Sema routines that deal
Douglas Gregor [Thu, 9 Sep 2010 16:33:13 +0000 (16:33 +0000)]
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.

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

14 years agoUse temporary files for this test, to see if we can flush out an inexplicable error...
Douglas Gregor [Thu, 9 Sep 2010 16:16:39 +0000 (16:16 +0000)]
Use temporary files for this test, to see if we can flush out an inexplicable error on Windows

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

14 years agoAdd proper type-source information to UnaryTypeTraitExpr, including
Douglas Gregor [Thu, 9 Sep 2010 16:14:44 +0000 (16:14 +0000)]
Add proper type-source information to UnaryTypeTraitExpr, including
libclang visitation.

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

14 years agoClean up CMake dependencies
Douglas Gregor [Thu, 9 Sep 2010 15:44:58 +0000 (15:44 +0000)]
Clean up CMake dependencies

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

14 years agoRemove unused variable.
Benjamin Kramer [Thu, 9 Sep 2010 12:27:34 +0000 (12:27 +0000)]
Remove unused variable.

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

14 years agoFix C++ PCH issue.
Argyrios Kyrtzidis [Thu, 9 Sep 2010 11:28:23 +0000 (11:28 +0000)]
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.

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

14 years agodo not bind temporaries to non-const references
Gabor Greif [Thu, 9 Sep 2010 10:51:37 +0000 (10:51 +0000)]
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?)

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

14 years agoRename GRState::getSVal() -> getRawSVal() and getSimplifiedSVal() -> getSVal().
Ted Kremenek [Thu, 9 Sep 2010 07:13:00 +0000 (07:13 +0000)]
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.

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

14 years agoFix indentation.
Ted Kremenek [Thu, 9 Sep 2010 06:53:59 +0000 (06:53 +0000)]
Fix indentation.

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

14 years agoCheck format strings when a called function has more than one FormatAttr (one for...
Ted Kremenek [Thu, 9 Sep 2010 04:33:05 +0000 (04:33 +0000)]
Check format strings when a called function has more than one FormatAttr (one for 'scanf' and one for 'printf').  Fixes <rdar://problem/8409437>.

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

14 years agoIt appears that technically a null format string is not warned under -Wformat-nonlite...
Ted Kremenek [Thu, 9 Sep 2010 03:51:42 +0000 (03:51 +0000)]
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>.

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

14 years agoAvoid redundant recursive calls in SemaCheckStringLiteral by just updating the expression
Ted Kremenek [Thu, 9 Sep 2010 03:51:39 +0000 (03:51 +0000)]
Avoid redundant recursive calls in SemaCheckStringLiteral by just updating the expression
and trying again.

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

14 years agoRemove tabs I accidentally introduced.
Ted Kremenek [Thu, 9 Sep 2010 02:57:51 +0000 (02:57 +0000)]
Remove tabs I accidentally introduced.

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

14 years agoRemove stray ';' and convert tabs to spaces.
Ted Kremenek [Thu, 9 Sep 2010 02:57:48 +0000 (02:57 +0000)]
Remove stray ';' and convert tabs to spaces.

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

14 years agoSimplified reachability checking in IdempotentOperationChecker and added a helper...
Tom Care [Thu, 9 Sep 2010 02:04:52 +0000 (02:04 +0000)]
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

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

14 years agoRelax __attribute_((nonnull)) checking to allow the attribute on functions with no...
Ted Kremenek [Thu, 9 Sep 2010 01:17:32 +0000 (01:17 +0000)]
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>.

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

14 years agoInclude test case for <rdar://problem/5880430>.
Ted Kremenek [Thu, 9 Sep 2010 00:40:43 +0000 (00:40 +0000)]
Include test case for <rdar://problem/5880430>.

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

14 years agoStatic analyzer fix: <rdar://problem/5880430> Switch on enum should not consider...
Ted Kremenek [Thu, 9 Sep 2010 00:40:40 +0000 (00:40 +0000)]
Static analyzer fix: <rdar://problem/5880430> Switch on enum should not consider default case live if all enum values are covered

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

14 years agoBlock ivar layout must assume that the 'isa'
Fariborz Jahanian [Thu, 9 Sep 2010 00:21:45 +0000 (00:21 +0000)]
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.

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

14 years agoEnhance -Wunreachable-code to not consider the 'default:' branch of a switch statemen...
Ted Kremenek [Thu, 9 Sep 2010 00:06:10 +0000 (00:06 +0000)]
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.

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

14 years agoEnhance -Wreturn-type to not warn when control-flow is most likely limited by a switc...
Ted Kremenek [Thu, 9 Sep 2010 00:06:07 +0000 (00:06 +0000)]
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.

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

14 years agoAdd 'filtered_pred_iterator' and 'filtered_succ_iterator' to CFGBlock. This allows...
Ted Kremenek [Thu, 9 Sep 2010 00:06:04 +0000 (00:06 +0000)]
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.

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

14 years agoInitialize 'AllEnumCasesCovered' in SwitchStmt's constructor.
Ted Kremenek [Thu, 9 Sep 2010 00:06:01 +0000 (00:06 +0000)]
Initialize 'AllEnumCasesCovered' in SwitchStmt's constructor.

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

14 years agoWhen building SwitchStmts in Sema, record whether all the enum values of a switch...
Ted Kremenek [Thu, 9 Sep 2010 00:05:53 +0000 (00:05 +0000)]
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.

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

14 years agoPush the range associated with a nested-name-specifier further through
Douglas Gregor [Wed, 8 Sep 2010 23:56:00 +0000 (23:56 +0000)]
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.

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

14 years agoFix warnings caused by new CXXUuidofExprClass enumerator.
Francois Pichet [Wed, 8 Sep 2010 23:47:05 +0000 (23:47 +0000)]
Fix warnings caused by new CXXUuidofExprClass enumerator.

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

14 years agoAdd another missing CMake dependency.
Daniel Dunbar [Wed, 8 Sep 2010 23:40:30 +0000 (23:40 +0000)]
Add another missing CMake dependency.

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

14 years agoFix a few minor issues with parsing and semantic analysis of C++
Douglas Gregor [Wed, 8 Sep 2010 23:14:30 +0000 (23:14 +0000)]
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

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

14 years agoAdd support for a few MS extensions supported by the Borland compiler
Dawn Perchik [Wed, 8 Sep 2010 22:56:24 +0000 (22:56 +0000)]
Add support for a few MS extensions supported by the Borland compiler
(__uuidof, _fastcall, etc.).

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

14 years agoWhen providing a completion for a function/method parameter of block
Douglas Gregor [Wed, 8 Sep 2010 22:47:51 +0000 (22:47 +0000)]
When providing a completion for a function/method parameter of block
pointer type, actually provide a usable block literal expression.

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

14 years agoTest removed.
Fariborz Jahanian [Wed, 8 Sep 2010 22:36:14 +0000 (22:36 +0000)]
Test removed.

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

14 years agoDecl::CheckAccessDeclContext() keeps asserting. Access is not set in some cases.
Argyrios Kyrtzidis [Wed, 8 Sep 2010 21:58:42 +0000 (21:58 +0000)]
Decl::CheckAccessDeclContext() keeps asserting. Access is not set in some cases.

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

14 years agoRemoved test case.
Fariborz Jahanian [Wed, 8 Sep 2010 21:55:57 +0000 (21:55 +0000)]
Removed test case.

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

14 years agoClean up some of the CMake dependencies
Douglas Gregor [Wed, 8 Sep 2010 21:40:53 +0000 (21:40 +0000)]
Clean up some of the CMake dependencies

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

14 years agoUse the new-initialization code for initializing scalars with a
Douglas Gregor [Wed, 8 Sep 2010 21:40:08 +0000 (21:40 +0000)]
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.

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

14 years agoReverse r113397 until we decide what to do with
Fariborz Jahanian [Wed, 8 Sep 2010 21:36:35 +0000 (21:36 +0000)]
Reverse r113397 until we decide what to do with
use of 'struct objc_object*' for 'is' (and others)
in clang.

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

14 years agoRe-enable CheckAccessDeclContext and make sure it doesn't trigger assertions.
Argyrios Kyrtzidis [Wed, 8 Sep 2010 21:32:35 +0000 (21:32 +0000)]
Re-enable CheckAccessDeclContext and make sure it doesn't trigger assertions.

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

14 years agoInitialize the MSVCGuidDecl variable in the correct order.
Bill Wendling [Wed, 8 Sep 2010 21:30:16 +0000 (21:30 +0000)]
Initialize the MSVCGuidDecl variable in the correct order.

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

14 years agoFix a crash when overloading id with objc_object*.
Fariborz Jahanian [Wed, 8 Sep 2010 20:08:18 +0000 (20:08 +0000)]
Fix a crash when overloading id with objc_object*.
Radar 8400356.

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

14 years agoFix C++ PCH issues.
Argyrios Kyrtzidis [Wed, 8 Sep 2010 19:31:22 +0000 (19:31 +0000)]
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.

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

14 years agoFrontend/-H: Add comment on why I used a temporary string here.
Daniel Dunbar [Wed, 8 Sep 2010 18:19:55 +0000 (18:19 +0000)]
Frontend/-H: Add comment on why I used a temporary string here.

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

14 years agoMicrosoft's __uuidof operator implementation part 1.
Francois Pichet [Wed, 8 Sep 2010 12:20:18 +0000 (12:20 +0000)]
Microsoft's __uuidof operator implementation part 1.

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

14 years agoAllow type definitions inside anonymous struct/union in Microsoft mode.
Francois Pichet [Wed, 8 Sep 2010 11:32:25 +0000 (11:32 +0000)]
Allow type definitions inside anonymous struct/union in Microsoft mode.

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

14 years agoDon't give 'global constructor' warnings for function statics, even if they have...
Sebastian Redl [Wed, 8 Sep 2010 04:46:19 +0000 (04:46 +0000)]
Don't give 'global constructor' warnings for function statics, even if they have a direct initializer. Fixes PR8095.

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

14 years agoPut the tautological-comparison-of-unsigned-against-zero warnings in
John McCall [Wed, 8 Sep 2010 02:01:27 +0000 (02:01 +0000)]
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.

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

14 years agoImplement ARM static local initialization guards, which are more compact than
John McCall [Wed, 8 Sep 2010 01:44:27 +0000 (01:44 +0000)]
Implement ARM static local initialization guards, which are more compact than
Itanium guards and use a slightly different compiled-in API.

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

14 years agoAllow (cv) void and incomplete arrays to be passed to the type traits.
Sebastian Redl [Wed, 8 Sep 2010 00:48:43 +0000 (00:48 +0000)]
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.

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

14 years agoadd a fixit when 'main' does ot return 'int'; review welcome
Gabor Greif [Wed, 8 Sep 2010 00:31:13 +0000 (00:31 +0000)]
add a fixit when 'main' does ot return 'int'; review welcome

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

14 years agoProvide proper type-source location information for
Douglas Gregor [Wed, 8 Sep 2010 00:15:04 +0000 (00:15 +0000)]
Provide proper type-source location information for
CXXTemporaryObjectExpr, CXXScalarValueInitExpr, and
CXXUnresolvedConstructExpr, getting rid of a bunch of FIXMEs in the
process.

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

14 years agoLocal static block variable referecned in its
Fariborz Jahanian [Tue, 7 Sep 2010 23:26:17 +0000 (23:26 +0000)]
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).

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

14 years agotests: Use -ffreestanding when including stdint.h, to avoid platform dependencies.
Daniel Dunbar [Tue, 7 Sep 2010 22:54:28 +0000 (22:54 +0000)]
tests: Use -ffreestanding when including stdint.h, to avoid platform dependencies.

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

14 years agoFix DeclPrinter to not include '=' in printing when no initializer is provided for...
Ted Kremenek [Tue, 7 Sep 2010 22:21:59 +0000 (22:21 +0000)]
Fix DeclPrinter to not include '=' in printing when no initializer is provided for a VarDecl.  Patch by Jim Goodnow II!

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

14 years agotypo
Gabor Greif [Tue, 7 Sep 2010 22:17:12 +0000 (22:17 +0000)]
typo

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

14 years agoImprove source-location information for CXXNewExpr, by hanging on to
Douglas Gregor [Tue, 7 Sep 2010 21:49:58 +0000 (21:49 +0000)]
Improve source-location information for CXXNewExpr, by hanging on to
the TypeSourceInfo for the allocated type. Fixes PR7501.

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

14 years agoFix null pointer dereference in StreamChecker::Fseek (reported in PR 8081) and simpli...
Ted Kremenek [Tue, 7 Sep 2010 20:45:26 +0000 (20:45 +0000)]
Fix null pointer dereference in StreamChecker::Fseek (reported in PR 8081) and simplify surrounding checking logic.

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

14 years agoRe-enabled truncation/extension checking in IdempotentOperationChecker and added...
Tom Care [Tue, 7 Sep 2010 20:27:56 +0000 (20:27 +0000)]
Re-enabled truncation/extension checking in IdempotentOperationChecker and added a test case.

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

14 years agoAdd function attributes to the output of -ast-print-xml, from Martin Vejnar!
Douglas Gregor [Tue, 7 Sep 2010 20:16:43 +0000 (20:16 +0000)]
Add function attributes to the output of -ast-print-xml, from Martin Vejnar!

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

14 years agoget rid of a warning.
Fariborz Jahanian [Tue, 7 Sep 2010 19:57:04 +0000 (19:57 +0000)]
get rid of a warning.

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

14 years agoHave Sema check for validity of CGString literal
Fariborz Jahanian [Tue, 7 Sep 2010 19:38:13 +0000 (19:38 +0000)]
Have Sema check for validity of CGString literal
instead of asserting in IRGen. Fixes radar 8390459.

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

14 years agoAllow 'o' and 'V' as constraints for output asm operands.
Dale Johannesen [Tue, 7 Sep 2010 18:40:41 +0000 (18:40 +0000)]
Allow 'o' and 'V' as constraints for output asm operands.
Allow '<' and '>' as constraints for input or output.

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

14 years agoImprove error recovery when we see ':' and expect a ';'.
John McCall [Tue, 7 Sep 2010 18:31:03 +0000 (18:31 +0000)]
Improve error recovery when we see ':' and expect a ';'.
I, at least, make this typo all the time.

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

14 years agoAdjust a test that's expecting optimizations to be done
Dale Johannesen [Tue, 7 Sep 2010 18:11:53 +0000 (18:11 +0000)]
Adjust a test that's expecting optimizations to be done
on MMX palignr; we don't do this for the intrinsics.

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

14 years agoDriver/Darwin: Catch another case where ld ends up using ld_classic.
Daniel Dunbar [Tue, 7 Sep 2010 17:50:41 +0000 (17:50 +0000)]
Driver/Darwin: Catch another case where ld ends up using ld_classic.

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

14 years agoDriver/Darwin: Don't pass -demangle to the linker when we know it is going to
Daniel Dunbar [Tue, 7 Sep 2010 17:07:49 +0000 (17:07 +0000)]
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.

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

14 years agoProvide a specific diagnostic when trying to redefine an "extern
Douglas Gregor [Tue, 7 Sep 2010 15:51:01 +0000 (15:51 +0000)]
Provide a specific diagnostic when trying to redefine an "extern
inline" function outside of GNU89 mode. Fixes
<rdar://problem/6880464>.

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

14 years agoImprove recovery when there is a stray ']' or ')' before the ';' at
Douglas Gregor [Tue, 7 Sep 2010 15:23:11 +0000 (15:23 +0000)]
Improve recovery when there is a stray ']' or ')' before the ';' at
the end of a statement. Fixes <rdar://problem/6896493>.

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

14 years agoImprove recovery when a comma is missing between enumerators in an
Douglas Gregor [Tue, 7 Sep 2010 14:51:08 +0000 (14:51 +0000)]
Improve recovery when a comma is missing between enumerators in an
enumeration definition. Fixes <rdar://problem/7159693>.

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

14 years agoImprove diagnostic and recovery when missing a comma between base or
Douglas Gregor [Tue, 7 Sep 2010 14:35:10 +0000 (14:35 +0000)]
Improve diagnostic and recovery when missing a comma between base or
member initializers in a C++ constructor. Fixes <rdar://problem/7796492>.

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

14 years agoReplace loops with SmallVector::append.
Benjamin Kramer [Mon, 6 Sep 2010 23:43:28 +0000 (23:43 +0000)]
Replace loops with SmallVector::append.

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

14 years agoDue to asmparser improvements, this error message is now better
Chris Lattner [Mon, 6 Sep 2010 22:09:27 +0000 (22:09 +0000)]
Due to asmparser improvements, this error message is now better

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

14 years agoFix a C++ PCH problem which was exposed by r113019. CXXBaseOrMemberInitializer's...
Argyrios Kyrtzidis [Mon, 6 Sep 2010 19:04:27 +0000 (19:04 +0000)]
Fix a C++ PCH problem which was exposed by r113019. CXXBaseOrMemberInitializer's IsWritten and source order is not set.

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

14 years agoremove curly quotes, patch by Dimitry Andric!
Chris Lattner [Mon, 6 Sep 2010 17:52:29 +0000 (17:52 +0000)]
remove curly quotes, patch by Dimitry Andric!

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

14 years agoLastFieldBitfield in CGObjCCommonMac::BuildAggrIvarLayout keeps bitfields or unnamed...
Argyrios Kyrtzidis [Mon, 6 Sep 2010 12:00:10 +0000 (12:00 +0000)]
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).

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

14 years agoFinishBlock() is essentially doing nothing except returning '!badCFG'.
Zhongxing Xu [Mon, 6 Sep 2010 07:32:31 +0000 (07:32 +0000)]
FinishBlock() is essentially doing nothing except returning '!badCFG'.

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

14 years agoSimplify CFG construction: bail out early when we have a bad CFG.
Zhongxing Xu [Mon, 6 Sep 2010 07:04:06 +0000 (07:04 +0000)]
Simplify CFG construction: bail out early when we have a bad CFG.

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

14 years agoMake "-ccc-cxx" option work on Linux.
Rafael Espindola [Mon, 6 Sep 2010 02:36:23 +0000 (02:36 +0000)]
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.

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

14 years agoGet rid of unnecessary return.
Eli Friedman [Mon, 6 Sep 2010 00:31:37 +0000 (00:31 +0000)]
Get rid of unnecessary return.

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

14 years agoUpdate test for r113128.
Eli Friedman [Mon, 6 Sep 2010 00:30:50 +0000 (00:30 +0000)]
Update test for r113128.

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

14 years agomove the hackaround for PR6537 to catch unions as well,
Chris Lattner [Mon, 6 Sep 2010 00:13:11 +0000 (00:13 +0000)]
move the hackaround for PR6537 to catch unions as well,
fixing the ICE in PR7151

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

14 years agoclean up some formatting.
Chris Lattner [Mon, 6 Sep 2010 00:11:41 +0000 (00:11 +0000)]
clean up some formatting.

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

14 years agoPR7242: Make sure to use a different context for evaluating constant
Eli Friedman [Mon, 6 Sep 2010 00:10:32 +0000 (00:10 +0000)]
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.

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

14 years agofix PR7192 by defining wchar_t in a more conventional way. The
Chris Lattner [Sun, 5 Sep 2010 23:29:49 +0000 (23:29 +0000)]
fix PR7192 by defining wchar_t in a more conventional way.  The
type of L"x" can change based on command line arguments.

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

14 years agoTell the VS headers that char16_t and char32_t are keywords, so yvals.h doesn't try...
Steven Watanabe [Sun, 5 Sep 2010 23:16:22 +0000 (23:16 +0000)]
Tell the VS headers that char16_t and char32_t are keywords, so yvals.h doesn't try to define them as typedefs.

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

14 years agofix 7320: we can't delete a trailing space if it doesn't exist.
Chris Lattner [Sun, 5 Sep 2010 23:16:09 +0000 (23:16 +0000)]
fix 7320: we can't delete a trailing space if it doesn't exist.

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

14 years agoPR8023: Don't crash on invalid uses of __real__ on class types in C++.
Eli Friedman [Sun, 5 Sep 2010 23:15:52 +0000 (23:15 +0000)]
PR8023: Don't crash on invalid uses of __real__ on class types in C++.

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

14 years agoNo functional change. Replace Out << 'a' << 'b' with Out << "ab" and spell
Nick Lewycky [Sun, 5 Sep 2010 03:40:33 +0000 (03:40 +0000)]
No functional change. Replace Out << 'a' << 'b' with Out << "ab" and spell
David Vandevoorde's name correctly.

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

14 years ago"const id<NSFoo> *" instead of "id<NSFoo> const *".
Chris Lattner [Sun, 5 Sep 2010 00:43:21 +0000 (00:43 +0000)]
"const id<NSFoo> *" instead of "id<NSFoo> const *".

I think this wraps up all the legal cases.

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

14 years ago"const id<NSFoo> *" not "id<NSFoo> const*"
Chris Lattner [Sun, 5 Sep 2010 00:36:44 +0000 (00:36 +0000)]
"const id<NSFoo> *" not "id<NSFoo> const*"

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

14 years ago"const std::vector<int>*" not "std::vector<int> const*"
Chris Lattner [Sun, 5 Sep 2010 00:27:00 +0000 (00:27 +0000)]
"const std::vector<int>*" not "std::vector<int> const*"

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

14 years ago"const _Complex float *" not "_Complex float const *"
Chris Lattner [Sun, 5 Sep 2010 00:22:25 +0000 (00:22 +0000)]
"const _Complex float *" not "_Complex float const *"

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

14 years ago'const std::type_info*' instead of 'std::type_info const*'
Chris Lattner [Sun, 5 Sep 2010 00:17:29 +0000 (00:17 +0000)]
'const std::type_info*' instead of 'std::type_info const*'

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

14 years agoprint "const intptr_t" instead of "intptr_t const"
Chris Lattner [Sun, 5 Sep 2010 00:07:29 +0000 (00:07 +0000)]
print "const intptr_t" instead of "intptr_t const"

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

14 years agomake clang print types as "const int *" instead of "int const*",
Chris Lattner [Sun, 5 Sep 2010 00:04:01 +0000 (00:04 +0000)]
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.

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

14 years agorevert this, it isn't safe.
Chris Lattner [Sat, 4 Sep 2010 23:43:40 +0000 (23:43 +0000)]
revert this, it isn't safe.

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

14 years agotidy up
Chris Lattner [Sat, 4 Sep 2010 23:37:43 +0000 (23:37 +0000)]
tidy up

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

14 years agorevise r112365 to fix the actual problem: the isa<TagType>(Underlying)
Chris Lattner [Sat, 4 Sep 2010 23:16:01 +0000 (23:16 +0000)]
revise r112365 to fix the actual problem: the isa<TagType>(Underlying)
check in the "typedef for anonymous type" check should have been a
getAs.

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

14 years agoCasting of a property reference to 'void' did not
Fariborz Jahanian [Sat, 4 Sep 2010 19:49:18 +0000 (19:49 +0000)]
Casting of a property reference to 'void' did not
generate the necessary code. This patch fixes it.
// rdar://8389655

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