Douglas Gregor
07665a69e8
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.
llvm-svn: 61735
2009-01-05 19:45:36 +00:00
Chris Lattner
07ebf302e5
simplify Preprocessor::getSpelling now that identifiers carry around
...
their length.
llvm-svn: 61734
2009-01-05 19:44:41 +00:00
Douglas Gregor
cfc7022a7b
Fix an uninitialized-variable warning
...
llvm-svn: 61700
2009-01-05 17:18:30 +00:00
Chris Lattner
8a7d10d753
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.
llvm-svn: 61671
2009-01-05 03:55:46 +00:00
Chris Lattner
6b87b9d84e
simplify some code.
...
llvm-svn: 61668
2009-01-05 02:07:19 +00:00
Chris Lattner
da0300870f
Rearrange some code in TryAnnotateTypeOrScopeToken to make it
...
early exit for C and avoid template lookup for C.
llvm-svn: 61667
2009-01-05 01:49:50 +00:00
Chris Lattner
c69537feb5
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.
llvm-svn: 61666
2009-01-05 01:42:04 +00:00
Chris Lattner
b5134c05b9
TryAnnotateTypeOrScopeToken and TryAnnotateCXXScopeToken can
...
only be called when they might be needed now, so make them assert
that their current token is :: or identifier.
llvm-svn: 61662
2009-01-05 01:24:05 +00:00
Anders Carlsson
d8cd7b6c34
Generate debug info for VLA types
...
llvm-svn: 61661
2009-01-05 01:23:29 +00:00
Chris Lattner
45ddec319e
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.
llvm-svn: 61659
2009-01-05 00:13:00 +00:00
Chris Lattner
bd31aa3b05
sink a call to TryAnnotateCXXScopeToken down into the
...
applicable cases in ParseDeclarationSpecifiers.
llvm-svn: 61657
2009-01-05 00:07:25 +00:00
Chris Lattner
a21db61ed9
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.
llvm-svn: 61656
2009-01-04 23:51:17 +00:00
Chris Lattner
1f69ebb5fa
code simplification
...
llvm-svn: 61654
2009-01-04 23:46:59 +00:00
Chris Lattner
020bab992e
sink calls to TryAnnotateTypeOrScopeToken down into the only cases that they
...
can interact with.
llvm-svn: 61652
2009-01-04 23:41:41 +00:00
Chris Lattner
b7895c4180
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.
llvm-svn: 61651
2009-01-04 23:33:56 +00:00
Chris Lattner
9a8968b50d
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.
llvm-svn: 61650
2009-01-04 23:23:14 +00:00
Chris Lattner
122db26b28
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.
llvm-svn: 61643
2009-01-04 22:52:14 +00:00
Chris Lattner
dfa1a45abd
use early exits to reduce nesting.
...
llvm-svn: 61642
2009-01-04 22:32:19 +00:00
Chris Lattner
8a38aa83da
simplify control flow by removing a goto.
...
llvm-svn: 61641
2009-01-04 22:28:21 +00:00
Chris Lattner
109faf2b8b
eliminate lookahead when parsing ::new / ::delete.
...
llvm-svn: 61638
2009-01-04 21:25:24 +00:00
Chris Lattner
f9b2cd4d92
minor simplifications.
...
llvm-svn: 61637
2009-01-04 21:14:15 +00:00
Anders Carlsson
762e162284
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.
llvm-svn: 61621
2009-01-04 02:08:04 +00:00
Anders Carlsson
37e0088610
Perform default function/array conversion for input arguments to inline asm statements if the input expr can be a memory operand
...
llvm-svn: 61515
2008-12-31 07:27:38 +00:00
Douglas Gregor
d7c4d984d0
Parser support for C++ using directives, from Piotr Rak
...
llvm-svn: 61486
2008-12-30 03:27:21 +00:00
Fariborz Jahanian
408035072b
Remove hasKind(). Use existing getKind().
...
llvm-svn: 61476
2008-12-29 19:57:17 +00:00
Sebastian Redl
1cbb59182c
Convert a two more statement actions to smart pointers.
...
llvm-svn: 61456
2008-12-28 16:13:43 +00:00
Sebastian Redl
a2b5e31cb1
Diagnose declarations that don't declare anything, and fix PR3020.
...
Examples:
int;
typedef int;
llvm-svn: 61454
2008-12-28 15:28:59 +00:00
Anders Carlsson
f562b39e80
Add a MS specific intrinsic.
...
llvm-svn: 61446
2008-12-27 04:26:15 +00:00
Anders Carlsson
a7e0e61b9d
Eli noticed that I had forgotten some #defines. Add them.
...
llvm-svn: 61445
2008-12-26 22:49:10 +00:00
Anders Carlsson
70f8da06d3
Add float.h header. Eli, please review :)
...
llvm-svn: 61444
2008-12-26 17:10:18 +00:00
Douglas Gregor
1dc9826a46
Add support for out-of-line definitions of conversion functions and member operators
...
llvm-svn: 61442
2008-12-26 15:00:45 +00:00
Anders Carlsson
88b53663fb
Fix implementation of _mm_pause.
...
llvm-svn: 61441
2008-12-26 02:22:10 +00:00
Anders Carlsson
19ef5d49d4
OK, all tests pass. Let's start using the SSE2 header
...
llvm-svn: 61440
2008-12-26 00:57:11 +00:00
Anton Korobeynikov
d72f47aa05
Add full dllimport / dllexport support: both sema checks and codegen.
...
Patch by Ilya Okonsky
llvm-svn: 61437
2008-12-26 00:52:02 +00:00
Anders Carlsson
37ba1a5927
Fix formatting
...
llvm-svn: 61435
2008-12-26 00:50:47 +00:00
Anders Carlsson
37c2371a88
Add _mm_pause and _MM_SHUFFLE
...
llvm-svn: 61434
2008-12-26 00:49:43 +00:00
Anders Carlsson
85eb1247a3
More SSE2 intrinsics
...
llvm-svn: 61433
2008-12-26 00:45:50 +00:00
Anders Carlsson
a0d5ca2773
More SSE2 intrinsics
...
llvm-svn: 61432
2008-12-25 23:48:58 +00:00
Steve Naroff
f9c29d4200
Add parser support for __forceinline, __w64, __ptr64.
...
llvm-svn: 61431
2008-12-25 14:41:26 +00:00
Steve Naroff
44ac777741
Add parser support for __cdecl, __stdcall, and __fastcall.
...
Change preprocessor implementation of _cdecl to reference __cdecl.
llvm-svn: 61430
2008-12-25 14:16:32 +00:00
Zhongxing Xu
4c1661102e
Add Fedora 10 GCC paths.
...
llvm-svn: 61429
2008-12-25 09:28:01 +00:00
Anders Carlsson
51beccbd0b
Make _mm_add_si64 inlined
...
llvm-svn: 61428
2008-12-25 07:07:08 +00:00
Steve Naroff
3a9b7e0cff
Add explicit "fuzzy" parse support for Microsoft declspec.
...
Remove previous __declspec macro that would effectively erase the construct prior to parsing.
llvm-svn: 61422
2008-12-24 20:59:21 +00:00
Sebastian Redl
068b13d62a
Fix try statement deserialization.
...
llvm-svn: 61421
2008-12-24 13:02:38 +00:00
Ted Kremenek
2907ab7d77
Add a bunch of comments and FIXMEs.
...
llvm-svn: 61419
2008-12-24 07:46:32 +00:00
Zhongxing Xu
c7a2792817
set region default value if there are not enough init values for array and struct.
...
llvm-svn: 61418
2008-12-24 07:29:24 +00:00
Zhongxing Xu
be2d5535f6
Add serialization support for TypeOfType.
...
llvm-svn: 61417
2008-12-24 07:22:26 +00:00
Zhongxing Xu
329f204b1b
Add serialization support for TypeOfExpr.
...
llvm-svn: 61416
2008-12-24 06:36:01 +00:00
Douglas Gregor
b9bd8a994c
Keep track of template arguments when we parse them. Right now, we don't actually do anything with the template arguments, but they'll be used to create template declarations
...
llvm-svn: 61413
2008-12-24 02:52:09 +00:00
Anders Carlsson
a283f91a67
Add integer arithmetic intrinsics
...
llvm-svn: 61412
2008-12-24 02:41:00 +00:00