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

7137 Коммитов

Автор SHA1 Сообщение Дата
Ted Kremenek c16c208e85 Misc changes to SourceManager::ContentCache:
- 'Buffer' is now private and must be accessed via 'getBuffer()'.
   This paves the way for lazily mapping in source files on demand.
- Added 'getSize()' (which gets the size of the content without
   necessarily accessing the MemBuffer) and 'getSizeBytesMapped()'.
- Modifed SourceManager to use these new methods.  This reduces the
  number of places that actually access the MemBuffer object for a file
  to those that actually look at the character data.

These changes result in no performance change for -fsyntax-only on Cocoa.h.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61782 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 01:55:26 +00:00
Daniel Dunbar 1e5f3ebb29 ccc: Introduce ArgList for keeping input argv & parsed Args together.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61780 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 01:35:44 +00:00
Chris Lattner 48eb4613c6 rename these tests to match the attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61770 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 23:10:19 +00:00
Chris Lattner c19e8a2b92 Optimize stringification a bit to avoid std::string thrashing and
avoid the version of Preprocessor::getSpelling that returns an 
std::string.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61769 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 23:04:18 +00:00
Daniel Dunbar 523aa600be Remainder is only valid on integer vector operands.
Improve ext vector test case.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61766 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 22:55:36 +00:00
Daniel Dunbar 8141b755d3 Back out code for handling VectorType's in getFloatingRank.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61764 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 22:44:35 +00:00
Daniel Dunbar 69d1d00293 Use CheckVectorOperands when % is applied to a vector type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61763 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 22:42:10 +00:00
Daniel Dunbar d786f6a6b7 Implement getFloatingRank() for extended vectors.
- I'm not sure this is appropriate, but it seems reasonable to be
   able to call getFloatingRank on anything which isFloatingType().


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61758 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 22:14:37 +00:00
Sebastian Redl 3ef5db646a Silence a GCC warning
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61747 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 20:53:53 +00:00
Sebastian Redl 64b45f7e0d PODness and Type Traits
Make C++ classes track the POD property (C++ [class]p4)
Track the existence of a copy assignment operator.
Implicitly declare the copy assignment operator if none is provided.
Implement most of the parsing job for the G++ type traits extension.
Fully implement the low-hanging fruit of the type traits:
__is_pod: Whether a type is a POD.
__is_class: Whether a type is a (non-union) class.
__is_union: Whether a type is a union.
__is_enum: Whether a type is an enum.
__is_polymorphic: Whether a type is polymorphic (C++ [class.virtual]p1).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61746 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 20:52:13 +00:00
Daniel Dunbar a5677511d1 Add prototype ccc rewrite.
- Entry point is tools/ccc/xcc until we are a functional replacement
   for ccc.

This is highly experimental (FIXME/LOC ratio of 3.4%), quite crufty,
and barely usable (and then only on my specific Darwin). However, many
of the right ideas are present, and it already fixes a number of
things gcc gets wrong.

The major missing component is argument translation for tools
(translating driver arguments into cc1/ld/as/etc. arguments). This is
a large part of the driver functionality and will probably double the
LOC, but my hope is that the current architecture is relatively
stable.

Documentation & motivation to follow soon...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61739 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 19:53:30 +00:00
Douglas Gregor 6c6fce03ea Add forgotten test case for linkage specifications
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61737 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 19:50:09 +00:00
Douglas Gregor 074149e11b Introduce support for "transparent" DeclContexts, which are
DeclContexts whose members are visible from enclosing DeclContexts up
to (and including) the innermost enclosing non-transparent
DeclContexts. Transparent DeclContexts unify the mechanism to be used
for various language features, including C enumerations, anonymous
unions, C++0x inline namespaces, and C++ linkage
specifications. Please refer to the documentation in the Clang
internals manual for more information.

Only enumerations and linkage specifications currently use transparent
DeclContexts.

Still to do: use transparent DeclContexts to implement anonymous
unions and GCC's anonymous structs extension, and, later, the C++0x
features. We also need to tighten up the DeclContext/ScopedDecl link
to ensure that every ScopedDecl is in a single DeclContext, which
will ensure that we can then enforce ownership and reduce the memory
footprint of DeclContext.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61735 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 19:45:36 +00:00
Chris Lattner e1dccaefe2 simplify Preprocessor::getSpelling now that identifiers carry around
their length.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61734 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 19:44:41 +00:00
Douglas Gregor 6b54bd160b Fix an uninitialized-variable warning
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61700 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 17:18:30 +00:00
Chris Lattner 5b4547318b remove optimization to avoid looking ahead for cases like ::foo. This
isn't worth the complexity and the code already does a ton of lookahead.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 03:55:46 +00:00
Chris Lattner 357089dea0 simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61668 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 02:07:19 +00:00
Chris Lattner 608d1fc9c4 Rearrange some code in TryAnnotateTypeOrScopeToken to make it
early exit for C and avoid template lookup for C.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 01:49:50 +00:00
Chris Lattner 83cf05a3b0 Fix a bug where we'd try to look beyond the current cached tokens when
not in backtracking mode.  This was just using the wrong predicate.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61666 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 01:42:04 +00:00
Anders Carlsson e90b0acaa1 Pass '-undefined- to the linker
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61663 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 01:24:39 +00:00
Chris Lattner 7452c6fc56 TryAnnotateTypeOrScopeToken and TryAnnotateCXXScopeToken can
only be called when they might be needed now, so make them assert
that their current token is :: or identifier.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 01:24:05 +00:00
Anders Carlsson 835c909696 Generate debug info for VLA types
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61661 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 01:23:29 +00:00
Chris Lattner a67865c64e add a testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61660 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 00:59:08 +00:00
Chris Lattner 55a7cefc84 ParseCXXSimpleTypeSpecifier can only be called on things that are
verified to be simple type specifiers, so there is no need for it
to call TryAnnotateTypeOrScopeToken.

Make MaybeParseCXXScopeSpecifier reject ::new and ::delete with a 
hard error now that it may never be transitively called in a 
context where these are legal.  This allows me to start 
disentangling things more.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61659 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 00:13:00 +00:00
Chris Lattner 5e02c47a70 sink a call to TryAnnotateCXXScopeToken down into the
applicable cases in ParseDeclarationSpecifiers. 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61657 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 00:07:25 +00:00
Chris Lattner 532e19b4e1 Simplify some control flow and remove a call to TryAnnotateCXXScopeToken
that isn't doing what is desired. It was annotating the current token
not the 'next' token.  This code should be fixed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61656 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 23:51:17 +00:00
Chris Lattner e26ff02654 code simplification
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 23:46:59 +00:00
Chris Lattner 166a8fccc3 sink calls to TryAnnotateTypeOrScopeToken down into the only cases that they
can interact with.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 23:41:41 +00:00
Chris Lattner e584926b86 push the call in isCXXDeclarationSpecifier to TryAnnotateTypeOrScopeToken
down into the two cases that it can possibly affect.  This avoids calls
to it that obviously can't do anything.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61651 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 23:33:56 +00:00
Chris Lattner a7bc7c880f my previous patch caused sema to drop the global qualifier, make
sure to pass it down.  This makes the code a bit gross, I will clean
it up in subsequent commits.





git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61650 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 23:23:14 +00:00
Chris Lattner 74ba410e4d sink the call to TryAnnotateTypeOrScopeToken in
ParseCastExpression into the switch.  This gets it out of the hot
path through ParseCastExpression for all the non-identifier and 
non-:: tokens.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61643 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 22:52:14 +00:00
Chris Lattner 6ec76d45bd use early exits to reduce nesting.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61642 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 22:32:19 +00:00
Chris Lattner 2dcaab3de6 simplify control flow by removing a goto.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61641 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 22:28:21 +00:00
Chris Lattner 59232d35f5 eliminate lookahead when parsing ::new / ::delete.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61638 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 21:25:24 +00:00
Chris Lattner e607e808c2 minor simplifications.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61637 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 21:14:15 +00:00
Anders Carlsson b723f7520b Fix the bug that would cause Python to crash at startup.
When emitting the static variables we need to make sure that the order is preserved. 
Fix this by making StaticDecls a std::list which has O(1) random removal.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61621 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-04 02:08:04 +00:00
Bill Wendling 5c5a7ee242 Rename AddReadAttrs to FunctionAttrs. This is related to Duncan's patch r61525.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61534 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-31 19:51:31 +00:00
Anders Carlsson 562489e0c8 Perform default function/array conversion for input arguments to inline asm statements if the input expr can be a memory operand
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61515 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-31 07:27:38 +00:00
Douglas Gregor f780abc21c Parser support for C++ using directives, from Piotr Rak
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61486 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-30 03:27:21 +00:00
Fariborz Jahanian fc820a4394 Remove hasKind(). Use existing getKind().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61476 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-29 19:57:17 +00:00
Sebastian Redl 39e98008eb Fill in C++ status table for statements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61457 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-28 17:18:13 +00:00
Sebastian Redl 117054a99f Convert a two more statement actions to smart pointers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61456 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-28 16:13:43 +00:00
Sebastian Redl b8ab5eb7d7 Fix a grep error that caused CodeGenObjC/encode-test.m to fail.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61455 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-28 15:48:05 +00:00
Sebastian Redl a4ed0d8d75 Diagnose declarations that don't declare anything, and fix PR3020.
Examples:
int;
typedef int;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61454 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-28 15:28:59 +00:00
Sebastian Redl 3c902ced87 Fix filename typo.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61453 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-28 14:19:27 +00:00
Nuno Lopes 9c08f27ca5 add RUN line
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61452 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-27 23:47:34 +00:00
Anders Carlsson 12868cc25c Add a MS specific intrinsic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61446 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-27 04:26:15 +00:00
Anders Carlsson 6b06b7a882 Eli noticed that I had forgotten some #defines. Add them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61445 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 22:49:10 +00:00
Anders Carlsson 629c5b4c2d Add float.h header. Eli, please review :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61444 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 17:10:18 +00:00
Anders Carlsson cfd489c46c Add __builtin_flt_rounds
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61443 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 16:43:35 +00:00