| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
| |
instead of converting them to strings first. This also fixes a
bunch of minor inconsistencies in the diagnostics emitted by clang
and adds a bunch of FIXME's to DiagnosticKinds.def.
llvm-svn: 59948
|
| |
|
|
|
|
|
|
|
|
|
| |
uses of getName() with uses of getDeclName(). This upgrades a bunch of
diags to take DeclNames instead of std::strings.
This also tweaks a couple of diagnostics to be cleaner and changes
CheckInitializerTypes/PerformInitializationByConstructor to pass
around DeclarationNames instead of std::strings.
llvm-svn: 59947
|
| |
|
|
|
|
| |
"previously defined here" diagnostics all notes.
llvm-svn: 59920
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
with implicit quotes around them. This has a bunch of follow-on
effects and requires tweaking to a whole lot of code. This causes
a regression in two tests (xfailed) by causing it to emit things like:
Line 10: duplicate interface declaration for category 'MyClass1' ('Category1')
instead of:
Line 10: duplicate interface declaration for category 'MyClass1(Category1)'
I will fix this in a follow-up commit.
As part of this, I had to start switching stuff to use ->getDeclName() instead
of Decl::getName() for consistency. This is good, but I was planning to do this
as an independent patch. There will be several follow-on patches
to clean up some of the mess, but this patch is already too big.
llvm-svn: 59917
|
| |
|
|
|
|
| |
in the overload diagnostics.
llvm-svn: 59871
|
| |
|
|
| |
llvm-svn: 59805
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
strings. This allows us to have considerable flexibility in how
these things are displayed and provides extra information that
allows us to merge away diagnostics that are very similar.
Diagnostic modifiers are a string of characters with the regex
[-a-z]+ that occur between the % and digit. They may
optionally have an argument that can parameterize them.
For now, I've added two example modifiers. One is a very useful
tool that allows you to factor commonality across diagnostics
that need single words or phrases combined. Basically you can
use %select{a|b|c}4 with with an integer argument that selects
either a/b/c based on an integer value in the range [0..3).
The second modifier is also an integer modifier, aimed to help
English diagnostics handle plurality. "%s3" prints to 's' if
integer argument #3 is not 1, otherwise it prints to nothing.
I'm fully aware that 's' is an English concept and doesn't
apply to all situations (mouse vs mice). However, this is very
useful and we can add other crazy modifiers once we add support
for polish! ;-)
I converted a couple C++ diagnostics over to use this as an
example, I'd appreciate it if others could merge the other
likely candiates. If you have other modifiers that you want,
lets talk on cfe-dev.
llvm-svn: 59803
|
| |
|
|
| |
llvm-svn: 59789
|
| |
|
|
| |
llvm-svn: 59714
|
| |
|
|
| |
llvm-svn: 59713
|
| |
|
|
| |
llvm-svn: 59712
|
| |
|
|
| |
llvm-svn: 59609
|
| |
|
|
|
|
|
|
| |
strings
first. This should allow removal of a bunch of II->getName() calls.
llvm-svn: 59601
|
| |
|
|
| |
llvm-svn: 59600
|
| |
|
|
| |
llvm-svn: 59589
|
| |
|
|
|
|
|
|
| |
__builtin_prefetch code to only emit one diagnostic per builtin_prefetch.
While this has nothing to do with the rest of the patch, the code seemed
like overkill when I was updating it.
llvm-svn: 59588
|
| |
|
|
| |
llvm-svn: 59561
|
| |
|
|
| |
llvm-svn: 59470
|
| |
|
|
|
|
|
|
|
| |
destructors, and conversion functions. The placeholders were used to
work around the fact that the parser and some of Sema really wanted
declarators to have simple identifiers; now, the code that deals with
declarators will use DeclarationNames.
llvm-svn: 59469
|
| |
|
|
| |
llvm-svn: 59443
|
| |
|
|
|
|
| |
operators
llvm-svn: 59442
|
| |
|
|
|
|
|
|
| |
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.
llvm-svn: 59441
|
| |
|
|
|
|
| |
Thanks to Doug for the review. Actual effects of mutable to follow.
llvm-svn: 59331
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
conversion functions. Instead, we just use a placeholder identifier
for these (e.g., "<constructor>") and override NamedDecl::getName() to
provide a human-readable name.
This is one potential solution to the problem; another solution would
be to replace the use of IdentifierInfo* in NamedDecl with a different
class that deals with identifiers better. I'm also prototyping that to
see how it compares, but this commit is better than what we had
previously.
llvm-svn: 59193
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
functions for built-in operators, e.g., the builtin
bool operator==(int const*, int const*)
can be used for the expression "x1 == x2" given:
struct X {
operator int const*();
} x1, x2;
The scheme for handling these built-in operators is relatively simple:
for each candidate required by the standard, create a special kind of
candidate function for the built-in. If overload resolution picks the
built-in operator, we perform the appropriate conversions on the
arguments and then let the normal built-in operator take care of it.
There may be some optimization opportunity left: if we can reduce the
number of built-in operator overloads we generate, overload resolution
for these cases will go faster. However, one must be careful when
doing this: GCC generates too few operator overloads in our little
test program, and fails to compile it because none of the overloads it
generates match.
Note that we only support operator overload for non-member binary
operators at the moment. The other operators will follow.
As part of this change, ImplicitCastExpr can now be an lvalue.
llvm-svn: 59148
|
| |
|
|
| |
llvm-svn: 59000
|
| |
|
|
| |
llvm-svn: 58988
|
| |
|
|
| |
llvm-svn: 58987
|
| |
|
|
|
|
| |
Thanks to Sebastian for the review
llvm-svn: 58986
|
| |
|
|
| |
llvm-svn: 58916
|
| |
|
|
|
|
|
|
| |
Parser side.
No Sema functionality change, just the signatures of the Action/Sema methods.
llvm-svn: 58913
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
functions in C++, e.g.,
struct X {
operator bool() const;
};
Note that these conversions don't actually do anything, since we don't
yet have the ability to use them for implicit or explicit conversions.
llvm-svn: 58860
|
| |
|
|
|
|
|
|
|
| |
operators in C++. Overloaded operators can be called directly via
their operator-function-ids, e.g., "operator+(foo, bar)", but we don't
yet implement the semantics of operator overloading to handle, e.g.,
"foo + bar".
llvm-svn: 58817
|
| |
|
|
| |
llvm-svn: 58804
|
| |
|
|
|
|
|
|
|
|
|
| |
Implicit declaration of destructors (when necessary).
Extended Declarator to store information about parsed constructors
and destructors; this will be extended to deal with declarators that
name overloaded operators (e.g., "operator +") and user-defined
conversion operators (e.g., "operator int").
llvm-svn: 58767
|
| |
|
|
|
|
| |
initialization of non-aggregates with initializer lists.
llvm-svn: 58757
|
| |
|
|
|
|
|
|
| |
duplication in the handling of copy-initialization by constructor,
which occurs both for initialization of a declaration and for
overloading. The initialization code is due for some refactoring.
llvm-svn: 58756
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
for constructor initializations, e.g.,
class A { };
class B : public A {
int m;
public:
B() : A(), m(17) { };
};
llvm-svn: 58749
|
| |
|
|
|
|
| |
expression. Remove CXXThis from PredefinedExpr
llvm-svn: 58695
|
| |
|
|
|
|
| |
default arguments
llvm-svn: 58692
|
| |
|
|
|
|
| |
correcting my bogus assertion about it already being handled
llvm-svn: 58691
|
| |
|
|
|
|
| |
already implemented
llvm-svn: 58649
|
| |
|
|
|
|
| |
X x(5, 7);
llvm-svn: 58641
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
cope with the case where a user-defined conversion is actually a copy
construction, and therefore can be compared against other standard
conversion sequences. While I called this a hack before, now I'm
convinced that it's the right way to go.
Compare overloads based on derived-to-base conversions that invoke
copy constructors.
Suppress user-defined conversions when attempting to call a
user-defined conversion.
llvm-svn: 58629
|
| |
|
|
|
|
|
|
|
|
|
| |
when appropriate.
Conversions for class types now make use of copy constructors. I've
replaced the egregious hack allowing class-to-class conversions with a
slightly less egregious hack calling these conversions standard
conversions (for overloading reasons).
llvm-svn: 58622
|
| |
|
|
|
|
| |
default/copy constructors
llvm-svn: 58538
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
conversions.
Notes:
- Overload resolution for converting constructors need to prohibit
user-defined conversions (hence, the test isn't -verify safe yet).
- We still use hacks for conversions from a class type to itself.
This will be the case until we start implicitly declaring the appropriate
special member functions. (That's next on my list)
llvm-svn: 58513
|
| |
|
|
|
|
|
|
|
|
| |
etc more generic. For some targets, long may not be equal to pointer size. For
example: PIC16 has int as i16, ptr as i16 but long as i32.
Also fixed a few build warnings in assert() functions in CFRefCount.cpp,
CGDecl.cpp, SemaDeclCXX.cpp and ParseDeclCXX.cpp.
llvm-svn: 58501
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Notes:
- Constructors are never found by name lookup, so they'll never get
pushed into any scope. Instead, they are stored as an
OverloadedFunctionDecl in CXXRecordDecl for easy overloading.
- There's a new action isCurrentClassName that determines whether an
identifier is the name of the innermost class currently being defined;
we use this to identify the declarator-id grammar rule that refers to
a type-name.
- MinimalAction does *not* support parsing constructors.
- We now handle virtual and explicit function specifiers.
llvm-svn: 58499
|
| |
|
|
| |
llvm-svn: 58404
|