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

29 Коммитов

Автор SHA1 Сообщение Дата
John McCall 2d88708cbe Split out a header to hold APIs meant for the Sema implementation from Sema.h.
Clients of Sema don't need to know (for example) the list of diagnostics we
support.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112093 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-25 22:03:47 +00:00
Sean Hunt cf807c4dfd Generate Attr subclasses with TableGen.
Now all classes derived from Attr are generated from TableGen.
Additionally, Attr* is no longer its own linked list; SmallVectors or
Attr* are used. The accompanying LLVM commit contains the updates to
TableGen necessary for this.

Some other notes about newly-generated attribute classes:

 - The constructor arguments are a SourceLocation and a Context&,
   followed by the attributes arguments in the order that they were
   defined in Attr.td

 - Every argument in Attr.td has an appropriate accessor named getFoo,
   and there are sometimes a few extra ones (such as to get the length
   of a variadic argument).

Additionally, specific_attr_iterator has been introduced, which will
iterate over an AttrVec, but only over attributes of a certain type. It
can be accessed through either Decl::specific_attr_begin/end or
the global functions of the same name.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111455 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-18 23:23:40 +00:00
Douglas Gregor e737f5041a Move Sema's headers into include/clang/Sema, renaming a few along the way.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110945 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-12 20:07:10 +00:00
Eli Friedman aa8b0d1924 Implement #pragma GCC visibility.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110315 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-05 06:57:20 +00:00
Douglas Gregor ff331c1572 Remove the vast majority of the Destroy methods from the AST library,
since we aren't going to be calling them ever.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109377 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-25 18:17:45 +00:00
Daniel Dunbar ddc6ff6b9a Sema: Fix a bug with #pragma options align=reset, reset against an empty stack
is well defined, it resets to the default alignment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108508 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-16 04:54:16 +00:00
Daniel Dunbar d6b305dcba Sema: Fix comment, apparently #pragma options align=power is just the same as
align=native, at least for the platforms we support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105000 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 20:08:00 +00:00
Daniel Dunbar 450f793408 Sema: Just ignore '#pragma options align=power' for now, this is no worse than
what we used to be doing, and makes sure that paired '#pragma options
align=reset' won't fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104998 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-28 19:43:33 +00:00
Daniel Dunbar 6f739145b9 Parse/Sema: Add support for '#pragma options align=packed', which, it should be
noted, is not the same as __attribute__((packed)). That would be ridiculous!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104865 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 18:42:17 +00:00
Daniel Dunbar 638e7cf3a0 Parse/Sema: Add support for '#pragma options align=native'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104864 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 18:42:09 +00:00
Daniel Dunbar c6082fe347 Sema: Add initial support for '#pragma options align=mac68k'.
- Docs are fairly sketchy, if someone wants to pore through gcc to look for
   holes I'd appreciate any failing test cases!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104809 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 05:45:51 +00:00
Daniel Dunbar ae2232b995 Sema: Factor out struct for alignment stack entries.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104799 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 02:25:27 +00:00
Daniel Dunbar 9f21f89c32 Sema: Replace getPragmaPackAlignment with AddAlignmentAttributesForRecord, which
exposes less details.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104797 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 01:53:40 +00:00
Daniel Dunbar 613fd67e57 Sema: Reject '#pragma options align=mac68k' everywhere except i386-apple-darwin.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 00:35:16 +00:00
Daniel Dunbar ea75a8286f Sema: Support for #pragma options align={reset,natural}. '#pragma options align'
shares the stack with '#pragma pack', who knew!?

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104786 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-27 00:04:40 +00:00
Douglas Gregor ac06a0e1e3 Protect isIntegerConstantExpr from seeing type- or value-dependent
expressions in attributes, pragmas.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104083 91177308-0d34-0410-b5e6-96231b3b80d8
2010-05-18 23:01:22 +00:00
John McCall 1bcee0a5a2 Rip out the last remaining implicit use of OverloadedFunctionDecl in Sema:
LookupResult::getAsSingleDecl() is no more.  Shift Sema::LookupSingleName to
return null on overloaded results.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90309 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 08:25:40 +00:00
John McCall 7d384dd5ac Split LookupResult into its own header.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-18 07:57:50 +00:00
John McCall a24dc2e38c Carry lookup configuration throughout lookup on the LookupResult. Give
LookupResult RAII powers to diagnose ambiguity in the results.  Other diagnostics
(e.g. access control and deprecation) will be moved to automatically trigger
during lookup as part of this same mechanism.

This abstraction makes it much easier to encapsulate aliasing declarations
(e.g. using declarations) inside the lookup system:  eventually, lookup will
just produce the aliases in the LookupResult, and the standard access methods
will naturally strip the aliases off.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89027 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-17 02:14:36 +00:00
John McCall f36e02d4af Refactor the LookupResult API to simplify most common operations. Require users to
pass a LookupResult reference to lookup routines.  Call out uses which assume a single
result.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83674 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-09 21:13:30 +00:00
Mike Stump 1eb4433ac4 Remove tabs, and whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-09 15:08:12 +00:00
Ted Kremenek 7a02a3733c Per advice that Doug Gregor gave me several months ago, clean up the
implementation of '#pragma unused' by not constructing intermediate
DeclRefExprs, but instead do the name lookup directly.  The
implementation is greatly simplified.

Along the way, degrade '#pragma unused(undeclaredvariable)' to a
warning instead of being a hard error.  This implements:

<rdar://problem/6761874> [sema] allow #pragma unused to reference undefined variable (with warning)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-03 23:24:57 +00:00
Argyrios Kyrtzidis 40b598eea1 Remove the ASTContext parameter from the attribute-related methods of Decl.
The implementations of these methods can Use Decl::getASTContext() to get the ASTContext.

This commit touches a lot of files since call sites for these methods are everywhere.
I used pre-tokenized "carbon.h" and "cocoa.h" headers to do some timings, and there was no real time difference between before the commit and after it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@74501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-30 02:34:44 +00:00
Douglas Gregor 68584ed35a Move the static DeclAttrs map into ASTContext. Fixes <rdar://problem/6983177>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-18 16:11:24 +00:00
Ted Kremenek 45a3c05640 Deallocate 'DeclRefExpr's in correctly formed '#pragma unused'
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67573 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-23 22:50:47 +00:00
Ted Kremenek 4726d03ab3 Implement '#pragma unused'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67569 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-23 22:28:25 +00:00
Daniel Dunbar 79cd11620c Handle #pragma pack(0). I left this out of diagnostic because users should
really use pack() instead.
 - <rdar://problem/6650243> clang warns about '#pragma pack(0)'


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66287 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06 20:45:54 +00:00
Chris Lattner 574aa40703 Make PragmaPackStack be a private class in SemaAttr and make its
instance in Sema be a pimpl.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64718 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 01:09:29 +00:00
Chris Lattner 5a0c351501 move attribute(packed) sema support out of SemaDecl into a new SemaAttr.cpp file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64711 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17 00:57:29 +00:00