| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 141270
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
increasingly prevailing case to the point that new features
like ARC don't even support the fragile ABI anymore.
This required a little bit of reshuffling with exceptions
because a check was assuming that ObjCNonFragileABI was
only being set in ObjC mode, and that's actually a bit
obnoxious to do.
Most, though, it involved a perl script to translate a ton
of test cases.
Mostly no functionality change for driver users, although
there are corner cases with disabling language-specific
exceptions that we should handle more correctly now.
llvm-svn: 140957
|
|
|
|
|
|
| |
on declarators written as types.
llvm-svn: 140931
|
|
|
|
|
|
| |
error recovery in both dialects. This should fix the GCC test suite failures as well.
llvm-svn: 140847
|
|
|
|
|
|
| |
and handle asm comments using semicolons correctly. (The comments are actually surprisingly tricky.)
llvm-svn: 140837
|
|
|
|
| |
llvm-svn: 140802
|
|
|
|
|
|
|
| |
support for the C++0x draft [[align]] attribute and add the C1X
standard header file stdalign.h
llvm-svn: 140796
|
|
|
|
|
|
| |
attribute-specifiers
llvm-svn: 140794
|
|
|
|
|
|
| |
end of a decl-specifier-seq
llvm-svn: 140793
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The token stream was not getting properly reset when leaving
ParseLexedMethodDef in some error cases. In the testcase, that caused later
accesses to the token stream to touch memory which had been freed as we
finished parsing the class definition. Major hat-tip to AddressSanitizer for
helping pinpoint the use-after-free, including the allocation and deallocation
points:
==21510== ERROR: AddressSanitizer heap-use-after-free on address 0x7feb3de87848 at pc 0x249f4e2 bp 0x7fff15a89df0 sp 0x7fff15a89ce0
READ of size 1 at 0x7feb3de87848 thread T0
#0 0x249f4e2 clang::TokenLexer::Lex()
#1 0x1c834a0 clang::Parser::ConsumeToken()
#2 0x1c7dc0f clang::Parser::ParseDeclarationOrFunctionDefinition()
#3 0x1c7e16b clang::Parser::ParseDeclarationOrFunctionDefinition()
<snip>
0x7feb3de87848 is located 1992 bytes inside of 3816-byte region [0x7feb3de87080,0x7feb3de87f68)
freed by thread T0 here:
#0 0x3a22c19 free
#1 0x1d136a1 clang::Parser::LexedMethod::~LexedMethod()
#2 0x1cef528 clang::Parser::DeallocateParsedClasses()
#3 0x1cef676 clang::Parser::PopParsingClass()
#4 0x1cea094 clang::Parser::ParseCXXMemberSpecification()
#5 0x1ce7ae5 clang::Parser::ParseClassSpecifier()
#6 0x1cfe588 clang::Parser::ParseDeclarationSpecifiers()
#7 0x1c7dbe8 clang::Parser::ParseDeclarationOrFunctionDefinition()
#8 0x1c7e16b clang::Parser::ParseDeclarationOrFunctionDefinition()
<snip>
previously allocated by thread T0 here:
#0 0x3a2302d realloc
#1 0x39d7c97 llvm::SmallVectorBase::grow_pod()
#2 0x1ac588e llvm::SmallVectorImpl<>::push_back()
#3 0x1d12d8b clang::Parser::ConsumeAndStoreUntil()
#4 0x1c9c24d clang::Parser::ConsumeAndStoreUntil()
#5 0x1d12c1e clang::Parser::ConsumeAndStoreUntil()
#6 0x1c9c24d clang::Parser::ConsumeAndStoreUntil()
#7 0x1d10042 clang::Parser::ParseCXXInlineMethodDef()
#8 0x1cec51a clang::Parser::ParseCXXClassMemberDeclaration()
#9 0x1ce9de5 clang::Parser::ParseCXXMemberSpecification()
#10 0x1ce7ae5 clang::Parser::ParseClassSpecifier()
#11 0x1cfe588 clang::Parser::ParseDeclarationSpecifiers()
#12 0x1c7dbe8 clang::Parser::ParseDeclarationOrFunctionDefinition()
#13 0x1c7e16b clang::Parser::ParseDeclarationOrFunctionDefinition()
<snip>
llvm-svn: 140427
|
|
|
|
|
|
|
|
|
|
| |
reentering the delayed function context correctly. The problem was that all template params were reintroduced inside the same scope. So if we had a situation where we had 2 template params with the same name at different scope then clang would generate an error about ambiguous name.
The solution is to create a new ParseScope(Scope::TemplateParamScope) for each template scope that we want to reenter. (from the outmost to the innermost scope)
This fixes some errors when parsing MFC code with clang.
llvm-svn: 140344
|
|
|
|
|
|
|
| |
erronously trigger the digraph correction fix-it. Include a new test to catch
this in the future.
llvm-svn: 140175
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For instance:
template <class T> void E() {};
class F {};
void test() {
::E<::F>();
E<::F>();
}
Gives the following error messages:
error: found '<::' after a template name which forms the
digraph '<:' (aka '[') and a ':', did you mean '< ::'?
::E<::F>();
^~~
< ::
error: expected expression
E<::F>();
^
error: expected ']'
note: to match this '['
E<::F>();
This patch adds the digraph fix-it check right before the name lookup,
moves the shared checking code to a new function, and adds new
tests to catch future regressions.
llvm-svn: 140039
|
|
|
|
|
|
|
|
|
| |
collision between C99 hexfloats and C++0x user-defined literals by
giving C99 hexfloats precedence. Also, warning about user-defined
literals that conflict with hexfloats and those that have names that
are reserved by the implementation. Fixes <rdar://problem/9940194>.
llvm-svn: 138839
|
|
|
|
|
|
| |
Patch by Chris Cudmore!
llvm-svn: 138533
|
|
|
|
|
|
|
| |
entirely use the existing -Wunused-value infrastructure. This also fixes
a few missed cases for -Wunused in general.
llvm-svn: 137916
|
|
|
|
|
|
| |
David Blaikie!
llvm-svn: 136876
|
|
|
|
|
|
| |
C++98/03, and C++0x mode, from Craig Topper!
llvm-svn: 136443
|
|
|
|
| |
llvm-svn: 136210
|
|
|
|
|
|
| |
arguments.
llvm-svn: 135552
|
|
|
|
| |
llvm-svn: 134869
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
diagnostics.
When a macro instantiation occurs, reserve a SLocEntry chunk with length the
full length of the macro definition source. Set the spelling location of this chunk
to point to the start of the macro definition and any tokens that are lexed directly
from the macro definition will get a location from this chunk with the appropriate offset.
For any tokens that come from argument expansion, '##' paste operator, etc. have their
instantiation location point at the appropriate place in the instantiated macro definition
(the argument identifier and the '##' token respectively).
This improves macro instantiation diagnostics:
Before:
t.c:5:9: error: invalid operands to binary expression ('struct S' and 'int')
int y = M(/);
^~~~
t.c:5:11: note: instantiated from:
int y = M(/);
^
After:
t.c:5:9: error: invalid operands to binary expression ('struct S' and 'int')
int y = M(/);
^~~~
t.c:3:20: note: instantiated from:
\#define M(op) (foo op 3);
~~~ ^ ~
t.c:5:11: note: instantiated from:
int y = M(/);
^
The memory savings for a candidate boost library that abuses the preprocessor are:
- 32% less SLocEntries (37M -> 25M)
- 30% reduction in PCH file size (900M -> 635M)
- 50% reduction in memory usage for the SLocEntry table (1.6G -> 800M)
llvm-svn: 134587
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
int f(int x) {
if (int foo = f(bar)) {}
return 0;
}
Clang produces the following error messages:
paren_imbalance.cc:2:19: error: use of undeclared identifier 'bar'
if (int foo = f(bar)) {}
^
paren_imbalance.cc:2:26: error: expected ')'
if (int foo = f(bar)) {}
^
paren_imbalance.cc:2:6: note: to match this '('
if (int foo = f(bar)) {}
^
The second error is incorrect. This patch will stop Clang from producing an error on parenthesis imbalance during error recovery when there isn't one.
llvm-svn: 134258
|
|
|
|
|
|
|
|
|
|
| |
macro instantiation
if the location given points at the last token of the macro instantiation.
Fixes rdar://9045701.
llvm-svn: 133804
|
|
|
|
|
|
|
| |
- 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: 132878
|
|
|
|
|
|
|
| |
This fixes a memory error on FreeBSD (and is the right thing to do
in any case).
llvm-svn: 132750
|
|
|
|
|
|
|
| |
__builtin_astype(): Used to reinterpreted as another data type of the same size using for both scalar and vector data types.
Added test case.
llvm-svn: 132612
|
|
|
|
|
|
| |
This will give a better error message for cases such as "namespace foo::bar::baz {}" and a suggested fix-it of "namespace foo { namespace bar { namespace baz {} } }"
llvm-svn: 132138
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Example:
typedef int TYPE;
class C {
__if_exists(TYPE) {
TYPE a;
}
__if_not_exists(TYPE) {
this will never be parsed.
}
};
llvm-svn: 132052
|
|
|
|
|
|
|
| |
More comprehensive testing once copy {constructors,assignment operators}
can be defaulted.
llvm-svn: 131275
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
class scope.
This removes 2 errors when parsing MFC code with clang
Example:
class A {
virtual void f() = 0 { }
}
llvm-svn: 131175
|
|
|
|
|
|
|
|
| |
that they are C++0x extensions, and put them in the appropriate
group. We already support most of the semantics. Addresses
<rdar://problem/9407525>.
llvm-svn: 131153
|
|
|
|
|
|
| |
Also some -fdelayed-template-parsing test refactoring.
llvm-svn: 131113
|
|
|
|
|
|
|
|
|
|
|
| |
extension.
http://msdn.microsoft.com/en-us/library/hzc8ytsz(v=VS.100).aspx
Microsoft doc claims this is a C++/CLI feature but it is really always enabled.
This removes 2 error when parsing MFC code with clang.
llvm-svn: 131051
|
|
|
|
| |
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: 130491
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This idiom is used everywhere in MFC/COM code and as such this patch removes hundreds of errors when parsing MFC code with clang.
Example:
template <class T, const GUID* g = &__uuidof(T)>
class ComTemplate { };
typedef ComTemplate<struct_with_uuid, &__uuidof(struct_with_uuid)> COM_TYPE;
Of course this is just parsing support. Trying to use this in CodeGen will generate:
error: cannot yet mangle expression type CXXUuidofExpr
llvm-svn: 130381
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
defines to real types.
Otherwise statements like:
__int64 var = __int64(0);
would be expanded to:
long long var = long long(0);
and fail to compile.
llvm-svn: 130369
|
|
|
|
|
|
| |
basically a normal class containing just pure virtual functions. No urgency to enforce that restriction in clang for now, so make __interface an "class" alias.
llvm-svn: 130290
|
|
|
|
|
|
|
| |
only a few lines of the file. Also set their properties to have explicitly
native eol sytle.
llvm-svn: 130124
|
|
|
|
|
|
|
|
| |
update.
Despite the diff, nothing but line endings changed here.
llvm-svn: 130121
|
|
|
|
|
|
|
|
| |
This fixes 1 error when parsing MSVC 2008 headers with clang.
Must "return true;" even if it is a warning because the rest of the code path assumes that SS is set to something. The parser will get back on its feet and continue parsing the rest of the declaration correctly so it is not a problem.
llvm-svn: 130088
|
|
|
|
|
|
| |
-flate-template-parsing mode.
llvm-svn: 130030
|
|
|
|
|
|
|
|
|
| |
function definitions are parsed at the end of the translation unit only if it is required by an actual instantiation. As such all the symbols of the TU are available during name lookup.
Using this flag is necessary for compatibility with Microsoft template code.
This also provides some parsing speed improvement.
llvm-svn: 130022
|
|
|
|
|
|
|
|
|
|
|
| |
ObjC NeXt runtime where method pointer registered in
metadata belongs to an unrelated method. Ast part of this fix,
I turned at @end missing warning (for class
implementations) into an error as we can never
be sure that meta-data being generated is correct.
// rdar://9072317
llvm-svn: 130019
|
|
|
|
|
|
|
|
|
|
|
| |
instance, in the following code, 'case ' will be suggested before the '1:'
switch (x) {
1: return 0;
default: return 1;
}
llvm-svn: 129943
|
|
|
|
|
|
| |
// rdar://9132143
llvm-svn: 129822
|
|
|
|
|
|
|
| |
As an extension, generic selection support has been added for all
supported languages. The syntax is the same as for C1X.
llvm-svn: 129554
|