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

2791 Коммитов

Автор SHA1 Сообщение Дата
Douglas Gregor 1a49af9681 Add QualifiedDeclRefExpr, which retains additional source-location
information for declarations that were referenced via a qualified-id,
e.g., N::C::value. We keep track of the location of the start of the
nested-name-specifier. Note that the difference between
QualifiedDeclRefExpr and DeclRefExpr does have an effect on the
semantics of function calls in two ways:
  1) The use of a qualified-id instead of an unqualified-id suppresses
     argument-dependent lookup
  2) If the name refers to a virtual function, the qualified-id
  version will call the function determined statically while the
  unqualified-id version will call the function determined dynamically
  (by looking up the appropriate function in the vtable).

Neither of these features is implemented yet, but we do print out
qualified names for QualifiedDeclRefExprs as part of the AST printing.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61789 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 05:10:23 +00:00
Chris Lattner b31757b68a rename tok::annot_qualtypename -> tok::annot_typename, which is both
shorter and  more accurate.  The type name might not be qualified.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61788 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06 05:06:21 +00:00
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
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
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
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 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
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 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 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
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
Douglas Gregor 70316a065b Add support for out-of-line definitions of conversion functions and member operators
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61442 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 15:00:45 +00:00
Anders Carlsson 4bcd44d3b3 Fix implementation of _mm_pause.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61441 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 02:22:10 +00:00
Anders Carlsson 4fd3e63cb0 OK, all tests pass. Let's start using the SSE2 header
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61440 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 00:57:11 +00:00
Anton Korobeynikov 2f402708e6 Add full dllimport / dllexport support: both sema checks and codegen.
Patch by Ilya Okonsky

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61437 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 00:52:02 +00:00
Anders Carlsson 92d66868a1 Fix formatting
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61435 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 00:50:47 +00:00
Anders Carlsson f1bc66008e Add _mm_pause and _MM_SHUFFLE
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61434 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 00:49:43 +00:00
Anders Carlsson 4547075dbb More SSE2 intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61433 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-26 00:45:50 +00:00
Anders Carlsson 0727df0c41 More SSE2 intrinsics
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61432 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-25 23:48:58 +00:00
Steve Naroff 86bc6cf05a Add parser support for __forceinline, __w64, __ptr64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61431 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-25 14:41:26 +00:00
Steve Naroff 239f07384f Add parser support for __cdecl, __stdcall, and __fastcall.
Change preprocessor implementation of _cdecl to reference __cdecl.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61430 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-25 14:16:32 +00:00