| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
from Enea Zaffanella!
llvm-svn: 74831
|
|
|
|
|
|
|
| |
Remove ASTContext parameter from DeclContext's methods. This change cascaded down to other Decl's methods and changes to call sites started "escalating".
Timings using pre-tokenized "cocoa.h" showed only a ~1% increase in time run between and after this commit.
llvm-svn: 74506
|
|
|
|
|
|
|
|
| |
subclasses.
Timings showed no significant difference before and after the commit.
llvm-svn: 74504
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 74501
|
|
|
|
| |
llvm-svn: 74386
|
|
|
|
| |
llvm-svn: 74359
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
templates.
For example, this now type-checks (but does not instantiate the body
of deref<int>):
template<typename T> T& deref(T* t) { return *t; }
void test(int *ip) {
int &ir = deref(ip);
}
Specific changes/additions:
* Template argument deduction from a call to a function template.
* Instantiation of a function template specializations (just the
declarations) from the template arguments deduced from a call.
* FunctionTemplateDecls are stored directly in declaration contexts
and found via name lookup (all forms), rather than finding the
FunctionDecl and then realizing it is a template. This is
responsible for most of the churn, since some of the core
declaration matching and lookup code assumes that all functions are
FunctionDecls.
llvm-svn: 74213
|
|
|
|
| |
llvm-svn: 74195
|
|
|
|
|
|
| |
ActOnFunctionDeclarator for function template definitions
llvm-svn: 74040
|
|
|
|
| |
llvm-svn: 74030
|
|
|
|
|
|
| |
and associate it with the FunctionDecl.
llvm-svn: 74028
|
|
|
|
|
|
|
| |
handle function templates. There's no actual code for function
templates yet, but at least we complain about typedef templates.
llvm-svn: 74021
|
|
|
|
|
|
| |
very weird way to pass "false". No functionality change
llvm-svn: 74007
|
|
|
|
|
|
| |
instead. Do the implicit default ctor checking in MarkDeclarationReferenced.
llvm-svn: 73888
|
|
|
|
| |
llvm-svn: 73812
|
|
|
|
|
|
|
|
|
|
|
|
| |
C++. This logic is required to trigger implicit instantiation of
function templates and member functions of class templates, which will
be implemented separately.
This commit includes support for -Wunused-parameter, printing warnings
for named parameters that are not used within a function/Objective-C
method/block. Fixes <rdar://problem/6505209>.
llvm-svn: 73797
|
|
|
|
|
|
| |
work in progress.
llvm-svn: 73782
|
|
|
|
| |
llvm-svn: 73702
|
|
|
|
|
|
|
|
|
|
| |
<rdar://problem/6952203>.
To do this, we actually remove a not-quite-correct optimization in the
C++ name lookup routines. We'll revisit this optimization for the
general case once more C++ is working.
llvm-svn: 73659
|
|
|
|
|
|
| |
No functionality change.
llvm-svn: 73657
|
|
|
|
|
|
| |
Sema::EnterDeclaratorContext/ExitDeclaratorContext.
llvm-svn: 73655
|
|
|
|
| |
llvm-svn: 73651
|
|
|
|
|
|
| |
thereof. Patch by Anders Johnsen!
llvm-svn: 73641
|
|
|
|
| |
llvm-svn: 73316
|
|
|
|
|
|
|
|
| |
visible anywhere normally because the printf format checks for
this case, and we don't print out attribute values anywhere. Original
patch by Roberto Bagnara.
llvm-svn: 73157
|
|
|
|
|
|
| |
change. More to follow.
llvm-svn: 72951
|
|
|
|
| |
llvm-svn: 72926
|
|
|
|
|
|
| |
right approach, but I'm still not sure what the best way to go about this is.
llvm-svn: 72912
|
|
|
|
| |
llvm-svn: 72901
|
|
|
|
|
|
|
|
| |
definition variadic. I'm not completely sure it's legal, but the
standard can be interpreted as making it legal, and gcc seems to think
it's legal, so I didn't add an extension warning.
llvm-svn: 72689
|
|
|
|
| |
llvm-svn: 72664
|
|
|
|
| |
llvm-svn: 72640
|
|
|
|
|
|
| |
need to take a VarDecl anymore. (It still does, but it won't for long)
llvm-svn: 72630
|
|
|
|
|
|
| |
virtual member functions. Use this instead of regular name lookup when checking for overriding functions so we will see declarations that would otherwise be hidden. Fixes 6902298.
llvm-svn: 72601
|
|
|
|
|
|
|
|
|
| |
walks through DeclContexts properly, and prints more of the
information available in the AST. The functionality is still available
via -ast-print, -ast-dump, etc., and also via the new member functions
Decl::dump() and Decl::print().
llvm-svn: 72597
|
|
|
|
| |
llvm-svn: 72580
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
instantiation of tags local to member functions of class templates
(and, eventually, function templates) works when the tag is defined as
part of the decl-specifier-seq, e.g.,
struct S { T x, y; } s1;
Also, make sure that we don't try to default-initialize a dependent
type.
llvm-svn: 72568
|
|
|
|
|
|
| |
to the DeclGroup.
llvm-svn: 72559
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
specifier resulted in the creation of a new TagDecl node, which
happens either when the tag specifier was a definition or when the tag
specifier was the first declaration of that tag type. This information
has several uses, the first of which is implemented in this commit:
1) In C++, one is not allowed to define tag types within a type
specifier (e.g., static_cast<struct S { int x; } *>(0) is
ill-formed) or within the result or parameter types of a
function. We now diagnose this.
2) We can extend DeclGroups to contain information about any tags
that are declared/defined within the declaration specifiers of a
variable, e.g.,
struct Point { int x, y, z; } p;
This will help improve AST printing and template instantiation,
among other things.
3) For C99, we can keep track of whether a tag type is defined
within the type of a parameter, to properly cope with cases like,
e.g.,
int bar(struct T2 { int x; } y) {
struct T2 z;
}
We can also do similar things wherever there is a type specifier,
e.g., to keep track of where the definition of S occurs in this
legal C99 code:
(struct S { int x, y; } *)0
llvm-svn: 72555
|
|
|
|
|
|
| |
keep the spec out of the canonical type this time. Net effect is currently nothing, because the spec isn't checked anywhere.
llvm-svn: 72498
|
|
|
|
|
|
| |
improve some error recovery with explicit template instantiation.
llvm-svn: 72484
|
|
|
|
| |
llvm-svn: 72474
|
|
|
|
|
|
|
|
| |
an integral constant expression, maintain a cache of the value and the
is-an-ICE flag within the VarDecl itself. This eliminates
exponential-time behavior of the Fibonacci template metaprogram.
llvm-svn: 72428
|
|
|
|
| |
llvm-svn: 72210
|
|
|
|
| |
llvm-svn: 72027
|
|
|
|
| |
llvm-svn: 71969
|
|
|
|
|
|
| |
This makes me think that we should make hasExternalStorage perform this check...
llvm-svn: 71962
|
|
|
|
|
|
|
|
|
|
|
|
| |
alternatives, but please correct me if I'm wrong.
I eventually plan to assert in mergeTypes that we aren't in C++ mode
because composite types are fundamentally not a part of C++. The
remaining callers for code in the regression tests are
Sema::WarnConflictingTypedMethods and CodeGenFunction::EmitFunctionProlog;
I'm not quite sure what the correct approach is for those callers.
llvm-svn: 71946
|
|
|
|
|
|
| |
types.
llvm-svn: 71941
|
|
|
|
| |
llvm-svn: 71930
|