| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
| |
statement. Fixes <rdar://problem/9229438>.
llvm-svn: 136564
|
|
|
|
|
|
|
|
|
|
|
| |
for-in statements; specifically, make sure to close over any
temporaries or cleanups it might require. In ARC, this has
implications for the lifetime of the collection, so emit it
with a retain and release it upon exit from the loop.
rdar://problem/9817306
llvm-svn: 136204
|
|
|
|
|
|
| |
SourceManager and FullSourceLoc.
llvm-svn: 135969
|
|
|
|
|
|
|
|
| |
LLVM.h imports
them into the clang namespace.
llvm-svn: 135852
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
variants to 'expand'. This changed a couple of public APIs, including
one public type "MacroInstantiation" which is now "MacroExpansion". The
rest of the codebase was updated to reflect this, especially the
libclang code. Two of the C++ (and thus easily changed) libclang APIs
were updated as well because they pertained directly to the old
MacroInstantiation class.
No functionality changed.
llvm-svn: 135139
|
|
|
|
|
|
|
|
|
|
|
|
| |
throw-expressions, such that we don't consider the NRVO when the
non-volatile automatic object comes from outside the innermost try
scope (C++0x [class.copymove]p13). In C++98/03, our ASTs were
incorrect but it didn't matter because IR generation doesn't actually
apply the NRVO here. In C++0x, however, we were moving from an object
when in fact we should have copied from it. Fixes PR10142 /
<rdar://problem/9714312>.
llvm-svn: 134548
|
|
|
|
| |
llvm-svn: 132994
|
|
|
|
|
|
|
| |
- Move the diagnostic to the case statement instead of at the end of the switch
- Add a fix-it hint as to how to fix the compilation error
llvm-svn: 132903
|
|
|
|
| |
llvm-svn: 131050
|
|
|
|
|
|
|
|
|
|
|
|
| |
function definition.
Allow to include or exclude code depending on if a symbol exists or not. Just like a #ifdef but for C/C++ symbols.
More doc: http://msdn.microsoft.com/en-us/library/x7wy9xh3(v=VS.100).aspx
Support at class and namespace scopes will be added later.
llvm-svn: 131014
|
|
|
|
| |
llvm-svn: 130377
|
|
|
|
|
|
|
|
| |
Patch authored by Sohail Somani.
Provide parsing and AST support for Windows structured exception handling.
llvm-svn: 130366
|
|
|
|
|
|
|
| |
ClassifyName() builds a primary expression, generate one of these
annotation tokens rather than jumping into the parser.
llvm-svn: 130297
|
|
|
|
| |
llvm-svn: 130295
|
|
|
|
|
|
|
| |
creating a type-annotation token rather than jumping into the
declaration parsing.
llvm-svn: 130293
|
|
|
|
|
|
|
|
| |
source location
in NullStmt.
llvm-svn: 130289
|
|
|
|
|
|
|
|
|
| |
in the classification of template names and using declarations. We now
properly typo-correct the leading identifiers in statements to types,
templates, values, etc. As an added bonus, this reduces the number of
lookups required for disambiguation.
llvm-svn: 130288
|
|
|
|
|
|
|
| |
invalid expression rather than the far-more-generic "error". Fixes a
mild regression in error recovery uncovered by the GCC testsuite.
llvm-svn: 130128
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
performs name lookup for an identifier and resolves it to a
type/expression/template/etc. in the same step. This scheme is
intended to improve both performance (by reducing the number of
redundant name lookups for a given identifier token) and error
recovery (by giving Sema a chance to correct type names before the
parser has decided that the identifier isn't a type name). For
example, this allows us to properly typo-correct type names at the
beginning of a statement:
t.c:6:3: error: use of undeclared identifier 'integer'; did you mean
'Integer'?
integer *i = 0;
^~~~~~~
Integer
t.c:1:13: note: 'Integer' declared here
typedef int Integer;
^
Previously, we wouldn't give a Fix-It because the typo correction
occurred after the parser had checked whether "integer" was a type
name (via Sema::getTypeName(), which isn't allowed to typo-correct)
and therefore decided to parse "integer * i = 0" as an expression. By
typo-correcting earlier, we typo-correct to the type name Integer and
parse this as a declaration.
Moreover, in this context, we can also typo-correct identifiers to
keywords, e.g.,
t.c:7:3: error: use of undeclared identifier 'vid'; did you mean
'void'?
vid *p = i;
^~~
void
and recover appropriately.
Note that this is very much a work-in-progress. The new
Sema::ClassifyName is only used for expression-or-declaration
disambiguation in C at the statement level. The next steps will be to
make this work for the same disambiguation in C++ (where
functional-style casts make some trouble), then push it
further into the parser to eliminate more redundant name lookups.
Fixes <rdar://problem/7963833> for C and starts us down the path of
<rdar://problem/8172000>.
llvm-svn: 130082
|
|
|
|
|
|
| |
but the condition is the same either way.
llvm-svn: 129948
|
|
|
|
|
|
|
|
|
|
|
| |
instance, in the following code, 'case ' will be suggested before the '1:'
switch (x) {
1: return 0;
default: return 1;
}
llvm-svn: 129943
|
|
|
|
|
|
| |
draft standard (N3291).
llvm-svn: 129541
|
|
|
|
|
|
|
|
|
| |
AttributeLists do not accumulate over the lifetime of parsing, but are
instead reused. Also make the arguments array not require a separate
allocation, and make availability attributes store their stuff in
augmented memory, too.
llvm-svn: 128209
|
|
|
|
|
|
|
|
|
|
|
| |
ActOnFinishFunctionBody/ActOnBlockStmtExpr. This way, we ensure that
we diagnose undefined labels before the jump-scope checker gets run,
since the jump-scope checker requires (as its invariant) that all of
the GotoStmts be wired up correctly.
Fixes PR9495.
llvm-svn: 127738
|
|
|
|
|
|
|
|
|
|
|
| |
headers, which use C++0x generalized initializer lists. Per PR7069, it
appears that the only use is as the return type of a function, so this
commit enables this extension just in that narrow case. If it's enough
for libstdc++ 4.5, or if it can be trivially extended to work with
libstdc++ 4.5, we'll keep it. Otherwise, or if this breaks anything,
we'll revert and wait for the real feature.
llvm-svn: 127507
|
|
|
|
| |
llvm-svn: 127094
|
|
|
|
|
|
|
|
|
| |
bugs from other clients that don't expect to see a LabelDecl in a DeclStmt,
but if so they should be easy to fix.
This implements most of PR3429 and rdar://8287027
llvm-svn: 125817
|
|
|
|
|
|
|
| |
own weird little DenseMap. Hey look, we now emit unused label
warnings deterministically, amazing.
llvm-svn: 125813
|
|
|
|
| |
llvm-svn: 125722
|
|
|
|
| |
llvm-svn: 124025
|
|
|
|
|
|
| |
-Wint-to-pointer-cast.
llvm-svn: 123719
|
|
|
|
|
|
|
| |
This allows us to cache a "#pragma unused" that occurs inside an inline C++ member function.
Fixes rdar://8829590&8770988.
llvm-svn: 123666
|
|
|
|
|
|
|
|
| |
trySkippingFunctionBodyForCodeCompletion and check isCodeCompletionEnabled() before doing the call.
Suggestions by Chris.
llvm-svn: 122792
|
|
|
|
| |
llvm-svn: 122781
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we are in code-completion mode, skip parsing of all function bodies except the one where the
code-completion point resides.
For big .cpp files like 'SemaExpr.cpp' the improvement makes a huge difference, in some cases cutting down
code-completion time -62% !
We don't get diagnostics for the bodies though, so modify the code-completion tests that check for errors.
See rdar://8814203.
llvm-svn: 122765
|
|
|
|
|
|
|
| |
on array and function declarators. This is pretty far from complete, and I'll
revisit it later if someone doesn't beat me to it.
llvm-svn: 122535
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
and 'default' statements, including a Fix-It to add the colon:
test/Parser/switch-recovery.cpp:13:12: error: expected ':' after 'case'
case 17 // expected-error{{expected ':' after 'case'}}
^
:
test/Parser/switch-recovery.cpp:16:12: error: expected ':' after 'default'
default // expected-error{{expected ':' after 'default'}}
^
:
llvm-svn: 122522
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
not actually frequently used, because ImpCastExprToType only creates a node
if the types differ. So explicitly create an ICE in the lvalue-to-rvalue
conversion code in DefaultFunctionArrayLvalueConversion() as well as several
other new places, and consistently deal with the consequences throughout the
compiler.
In addition, introduce a new cast kind for loading an ObjCProperty l-value,
and make sure we emit those nodes whenever an ObjCProperty l-value appears
that's not on the LHS of an assignment operator.
This breaks a couple of rewriter tests, which I've x-failed until future
development occurs on the rewriter.
Ted Kremenek kindly contributed the analyzer workarounds in this patch.
llvm-svn: 120890
|
|
|
|
| |
llvm-svn: 120724
|
|
|
|
|
|
|
|
|
|
| |
expands to nothing"
and use a better and more general approach, where NullStmt has a flag to indicate whether it was preceded by an empty macro.
Thanks to Abramo Bagnara for the hint!
llvm-svn: 119887
|
|
|
|
|
|
|
|
|
| |
if (condition)
CALL(0); // empty macro but don't warn for empty body.
Fixes rdar://8436021.
llvm-svn: 119838
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
manually managing them
using new/delete and OwningPtrs. After memory profiling Clang, I witnessed periodic leaks of these
objects; digging deeper into the code, it was clear that our management of these objects was a mess. The ownership rules were murky at best, and not always followed. Worse, there are plenty of error paths where we could screw up.
This patch introduces AttributeList::Factory, which is a factory class that creates AttributeList
objects and then blows them away all at once. While conceptually simple, most of the changes in
this patch just have to do with migrating over to the new interface. Most of the changes have resulted in some nice simplifications.
This new strategy currently holds on to all AttributeList objects during the lifetime of the Parser
object. This is easily tunable. If we desire to have more bound the lifetime of AttributeList
objects more precisely, we can have the AttributeList::Factory object (in Parser) push/pop its
underlying allocator as we enter/leave key methods in the Parser. This means that we get
simple memory management while still having the ability to finely control memory use if necessary.
Note that because AttributeList objects are now BumpPtrAllocated, we may reduce malloc() traffic
in many large files with attributes.
This fixes the leak reported in: <rdar://problem/8650003>
llvm-svn: 118675
|
|
|
|
|
|
| |
Previously the temporaries would get destroyed before the asm call.
llvm-svn: 118001
|
|
|
|
| |
llvm-svn: 117961
|
|
|
|
|
|
| |
Fixes rdar://8476159.
llvm-svn: 114982
|
|
|
|
|
|
| |
rdar://8483139.
llvm-svn: 114954
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
part of parser recovery. For example, given:
a method1:arg];
we detect after parsing the expression "a" that we have the start of a
message send expression. We pretend we've seen a '[' prior to the a,
then parse the remainder as a message send. We'll then give a
diagnostic+fix-it such as:
fixit-objc-message.m:17:3: error: missing '[' at start of message
send expression
a method1:arg];
^
[
The algorithm here is very simple, and always assumes that the open
bracket goes at the beginning of the message send. It also only works
for non-super instance message sends at this time.
llvm-svn: 113968
|
|
|
|
|
|
| |
the end of a statement. Fixes <rdar://problem/6896493>.
llvm-svn: 113202
|
|
|
|
|
|
| |
a "to match this {" note, pointing out the opener.
llvm-svn: 112709
|
|
|
|
|
|
| |
some issues being sorted out.
llvm-svn: 112493
|