Граф коммитов

3246 Коммитов

Автор SHA1 Сообщение Дата
Chris Lattner 19e8e2cffc next round of diagnostics cleanups, moving some
diags around, eliminating #defines, etc.  Patch by
Anders Johnsen!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63318 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 17:46:13 +00:00
Douglas Gregor 3498bdb9e9 Introduce a new expression node, ImplicitValueInitExpr, that
represents an implicit value-initialization of a subobject of a
particular type. This replaces the (ab)use of CXXZeroValueInitExpr
within initializer lists for the "holes" that occur due to the use of
C99 designated initializers.

The new test case is currently XFAIL'd, because CodeGen's
ConstExprEmitter (in lib/CodeGen/CGExprConstant.cpp) needs to be
taught to value-initialize when it sees ImplicitValueInitExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63317 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 17:44:32 +00:00
Douglas Gregor 0bb76897be Clean up designated initialization of unions, so that CodeGen doesn't
have to try to guess which member is being initialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63315 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 16:53:55 +00:00
Douglas Gregor 5d2ff63254 Suppress a warning
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63310 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 16:09:46 +00:00
Daniel Dunbar f04d69bbb2 x86_64 ABI: Handle fields / complex components which straddle
eightbyte boundaries.
 - Getting harder to test now that we handle cases gcc & llvm-gcc get
   wrong ( { _Complex char; _Complex int; } is a good example). :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63305 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 09:42:07 +00:00
Daniel Dunbar 7f102f8c81 x86_64 ABI: Tweak merging algorithm so that we always bail early when
we see a Memory classification.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63295 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 08:35:40 +00:00
Daniel Dunbar cc039fea2e ABI: When emitting calls which return an ignored argument, make sure
to still return an RValue of the correct type.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63294 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 08:24:57 +00:00
Daniel Dunbar 99037e5a21 x86_64 ABI: Implement classification for records.
- This is my best initial guess at what the "spec" means, although it is not
   particularly clear on a number of points. Will refine through testing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63292 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 08:13:58 +00:00
Daniel Dunbar b0e14f2a87 x86_64: Support cases which map to returning multiple values in LLVM
(e.g., _Complex double -> { double, double } return).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63285 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 07:36:07 +00:00
Daniel Dunbar eac48dc189 x86_64 ABI: Classify _Complex ints as integer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63283 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 07:22:20 +00:00
Chris Lattner 88eccaf06f Fix -Wimplicit-function-declaration, which required some refactoring and
changes in various diagnostics code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63282 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 06:55:46 +00:00
Daniel Dunbar 56f0d16c11 Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63281 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 06:44:03 +00:00
Daniel Dunbar 4087e24f73 Evaluate ==,!= for complex types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63280 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 06:43:41 +00:00
Daniel Dunbar a2cfd34952 Evaluate casts to complex.
- Lift (int,float) -> (int,float) conversion into separate routines.

 - Fix handling of, e.g., char -> _Complex int, which was producing a
   _Complex char value instead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63278 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 06:16:07 +00:00
Chris Lattner 500d3297d2 move library-specific diagnostic headers into library private dirs. Reduce
redundant #includes.  Patch by Anders Johnsen!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63271 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 05:15:15 +00:00
Chris Lattner 68355a57bb fix an absolutely inscrutible gcc 4.0 error:
llvm[0]: Compiling SemaInit.cpp for Debug build 
SemaInit.cpp:171: error: ‘InitListChecker’ has not been declared
SemaInit.cpp:171: error: ISO C++ forbids declaration of ‘InitListChecker’ with no type
SemaInit.cpp: In function ‘int InitListChecker(clang::Sema*, clang::InitListExpr*, clang::QualType&)’:
SemaInit.cpp:172: error: ‘hadError’ was not declared in this scope
SemaInit.cpp:173: error: ‘SemaRef’ was not declared in this scope
SemaInit.cpp:177: error: ‘FullyStructuredList’ was not declared in this scope



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63270 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 05:10:57 +00:00
Daniel Dunbar 3f2798757c Add folding for complex mul and fix some major bugs in complex float
evaluation (alternate part of real/imag init was being set to 3 not 0
because the wrong APFloat constructor was being called).
 - Test cases coming once some more support is in.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63264 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 01:32:56 +00:00
Douglas Gregor 9e80f7252e Better documentation for our initialization checker
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63261 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 01:05:33 +00:00
Douglas Gregor c34ee5ef2b Move InitListChecker out of Sema.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63258 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 00:45:39 +00:00
Douglas Gregor 6fbdc6bd38 Eliminate infinite looping in a wacky case with designated initializers. Simplifies (somewhat) the actually checking of the initializer expression following the designators
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 00:39:20 +00:00
Steve Naroff 3e8ffd2e96 Refactor Sema::LookupDecl() into 2 functions: LookupDeclInScope() and LookupDeclInContext().
The previous interface was very confusing. This is much more explicit, which will be easier to understand/optimize/convert.

The plan is to eventually deprecate both of these functions. For now, I'm focused on performance.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63256 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29 00:07:50 +00:00
Douglas Gregor 54f0728c2a Remove Expr::hasSideEffects. It doesn't work anyway
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63254 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 23:43:32 +00:00
Douglas Gregor 34e7946831 Improvements to code-generation and semantic analysis of designated
initializers.

  - We now initialize unions properly when a member other than the
    first is named by a designated initializer.
  - We now provide proper semantic analysis and code generation for
    GNU array-range designators *except* that side effects will occur
    more than once. We warn about this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63253 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 23:36:17 +00:00
Fariborz Jahanian 939abced90 Add setter/getter methods to the list of methods
of class's meta-data (related to objc2 nonfragile abi).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63251 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 22:46:49 +00:00
Ted Kremenek ea4bc889a6 Remove '#if 0' code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63250 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 22:35:55 +00:00
Ted Kremenek b2bf7cda46 Remove method 'AddNE' from the public interface of ConstraintManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63249 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 22:27:59 +00:00
Daniel Dunbar a5fd07bbc5 Implement basic _Complex integer constant folding.
- Merged into single ComplexEvaluator, these share too much logic to
   be worth splitting for float/int (IMHO). Will split on request.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63248 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 22:24:07 +00:00
Fariborz Jahanian 5de14dc879 property metadata for objc2's nonfragile abi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63246 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 22:18:42 +00:00
Douglas Gregor 4c67834407 Code generation support for C99 designated initializers.
The approach I've taken in this patch is relatively straightforward,
although the code itself is non-trivial. Essentially, as we process
an initializer list we build up a fully-explicit representation of the
initializer list, where each of the subobject initializations occurs
in order. Designators serve to "fill in" subobject initializations in
a non-linear way. The fully-explicit representation makes initializer
lists (both with and without designators) easy to grok for codegen and
later semantic analyses. We keep the syntactic form of the initializer
list linked into the AST for those clients interested in exactly what
the user wrote.

Known limitations:
  - Designating a member of a union that isn't the first member may
    result in bogus initialization (we warn about this)
  - GNU array-range designators are not supported (we warn about this)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63242 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 21:54:33 +00:00
Ted Kremenek abf439731b retain/release checker: Always generate an "autorelease" summary for an "autorelease" message, and have the summary processing logic treat it as a no-op in GC mode. This change is motivated to encode more of the semantics in the summaries themselves for eventual better diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63241 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 21:44:40 +00:00
Daniel Dunbar 64cfdb7da3 Handle complex types in ASTContext::mergeTypes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63238 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 21:22:12 +00:00
Ted Kremenek 26555b18aa Add more PTH diagnostics for invalid PTH files, etc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63232 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 21:02:43 +00:00
Ted Kremenek 8a6aec620d Enhance PTHManager::Create() to take an optional Diagnostic* argument that can be used to report issues such as a missing PTH file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 20:49:33 +00:00
Ted Kremenek 05f3957c20 Fix TextDiagnosticPrinter::HandleDiagnostic to handle invalid FullSourceLocs that do not have a SourceManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63230 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 20:47:47 +00:00
Ted Kremenek 3632a35e81 Add method FullSourceLoc::getBufferData().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63229 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 20:46:26 +00:00
Steve Naroff b43a50ff1b Name change (isTypeName->getTypeName).
Since it doesn't return a bool, is shouldn't be prefixed with 'is'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63226 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 19:39:02 +00:00
Steve Naroff 2d081c47cd Change Parser::ParseFunctionDeclarator() to annotate typename tokens.
This removes ~10% of the calls to Sema::isTypeName(), which amount to a little less than a 1% reduction in usertime (for Cocoa.h).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63219 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 19:16:40 +00:00
Fariborz Jahanian 46b86c610e Some refactoring of common code. No change in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63218 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 19:12:34 +00:00
Sebastian Redl 21593acb93 Implement pointer to member handling in static_cast.
Fix a stupid mistake in UnwrapSimilarPointers that made any two member pointers compatible as long as the pointee was the same.
Make a few style corrections as suggested by Chris.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63215 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 18:33:18 +00:00
Douglas Gregor 6697312178 Complete semantic checking for typedef redeclarations in C++. The
rules are slightly different than in C, and now we handle both
dialects properly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63211 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 17:15:10 +00:00
Steve Naroff 133147d2d3 Remove 'NamespaceNameOnly' argument to Sema::LookupDecl(). It is unused.
Even though Sema::LookupDecl() is deprecated, it's still used all over the place. Simplifying the interface will make it easier to understand/optimize/convert.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63210 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 16:09:22 +00:00
Steve Naroff 939837f67e Remove 'enableLazyBuiltinCreation' argument to Sema::LookupDecl(). It is unused.
Even though Sema::LookupDecl() is deprecated, it's still used all over the place. Simplifying the interface will make it easier to understand/optimize/convert.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63208 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 15:51:12 +00:00
Chris Lattner 778601f8d3 long long and double have 64-bit alignment on x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 06:58:19 +00:00
Ted Kremenek 23b8eaa836 retain/release checker: Improve diagnostics to indicate that CF objects are not automatically garbage collected.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63187 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 06:25:48 +00:00
Ted Kremenek 961b61d6b4 retain/release checker: Indicate whether a tracked object is a Core Foundation or Objective-C object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63186 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 06:06:36 +00:00
Ted Kremenek a102c0c706 retain/release checker: More diagnostic refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63184 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 06:01:42 +00:00
Ted Kremenek 2d1652e0f5 retain/release checker: Embed an "object type" into the RetEffect/RetVal objects to help distinguish between Objective-C and Core Foundation objects (for better diagnostics).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63183 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 05:56:51 +00:00
Ted Kremenek 611a15a18f retain/release checker: More cleanups (no real functionality change).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63181 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 05:29:13 +00:00
Ted Kremenek 103a185af4 Fix diagnostic truncated by my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63180 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 05:18:08 +00:00
Ted Kremenek 5c1cd520db retain/release checker: More diagnostic refactoring.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63179 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 05:15:02 +00:00