aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-04-18first step to getting switches giving "jump into vla scope" errors.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18add some block goto test cases.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69460 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18fix error recovery in the case of a jump to a label with no definitionChris Lattner
to create a well formed AST instead of a dangling pointer. This resolves several fixme's. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69459 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18glibc plays some weird games with multiple different definitions ofChris Lattner
int8_t and games it with strange *_defined macros. Emulate its weirdness for better compatibility with linux etc. Problem pointed out by anders johnson. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69458 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18make sure to verify that the "non pch" runs worked.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69457 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18improve wording of scope violation error messages.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69456 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18rename testChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69455 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18more fun with line markers: the digit string is required to be interpretedChris Lattner
as decimal, even if it starts with 0. Also, since things like 0x1 are completely illegal, don't even bother using numericliteralparser for them. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69454 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18Don't emit name-lookup tables for functions or methods in the PCH filesDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69449 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18Fix test to output LLVM to a temporary file, which we grep as part of the testDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18rewrite the goto scope checking code to be more efficient, simpler,Chris Lattner
produce better diagnostics, and be more correct in ObjC cases (fixing rdar://6803963). An example is that we now diagnose: int test1(int x) { goto L; int a[x]; int b[x]; L: return sizeof a; } with: scope-check.c:15:3: error: illegal goto into protected scope goto L; ^ scope-check.c:17:7: note: scope created by variable length array int b[x]; ^ scope-check.c:16:7: note: scope created by variable length array int a[x]; ^ instead of just saying "invalid jump". An ObjC example is: void test1() { goto L; @try { L: ; } @finally { } } t.m:6:3: error: illegal goto into protected scope goto L; ^ t.m:7:3: note: scope created by @try block @try { ^ There are a whole ton of fixme's for stuff to do, but I believe that this is a monotonic improvement over what we had. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18add accessor.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18Use getAsPointerType instead of using getCanonicalType directly.Daniel Dunbar
- <rdar://problem/6803995> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69435 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18Fix a bug found by inspection, class/meta references could be emittedDaniel Dunbar
into the wrong section (they shared the same lookup table). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69433 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18add another testcaseChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18don't evaluate ->child_end() every time through the loop, or *i frequently ↵Chris Lattner
within it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69431 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18split code out into a new CheckFunctionJumpScopes routine,Chris Lattner
add some comments, change type from void* -> Stmt*, use smallvector instead of vector. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69430 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18make scope checking be static functions instead of sema methods.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69429 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18fix incorrect lowering of __builtin_ia32_shufpd, rdar://6803924Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18rename file.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69427 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18don't dump .ll file in this dir.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69426 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18__builtin_prefetch should be declared as "void __builtin_prefetch(const void ↵Chris Lattner
*)", not "const void __builtin_prefetch(void *)". This fixes PR3912. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69425 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18rename testChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69424 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18fix PR3927 by being more careful about the pp test for identifier.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69423 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18second half of PR3940: #line requires simple digit sequence.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69422 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18Store the type ID for __builtin_va_list in the PCH file, so that theDouglas Gregor
AST context's __builtin_va_list type will be set when the PCH file is loaded. This fixes the crash when CodeGen'ing a va_arg expression pulled in from a PCH file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18this is really just a recommendation, not a requirement.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18enforce requirements imposed by C90 6.8 TC1, fixing PR3919.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69415 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18Fix PR3938 by taking into account C99 6.10p4.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18convert test to -verify style.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69412 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18Substantially restructure function-like macro argument parsing.Chris Lattner
Highlights: PP::isNextPPTokenLParen() no longer eats the ( when present. We now simplify slightly the logic parsing macro arguments. We now handle PR3937 and other related cases correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69411 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18Preliminary PCH support in the driverDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69410 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18Lazy deserialization of function bodies for PCH files. For the CarbonDouglas Gregor
"Hello, World!", this takes us from deserializing 6469 statements/expressions down to deserializing 1 statement/expression. It only translated into a 1% improvement on the Carbon-prefixed 403.gcc, but (a) it's the right thing to do, and (b) we expect this to matter more once we lazily deserialize identifiers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18FunctionDecl::getBody() is getting an ASTContext argument for use inDouglas Gregor
lazy PCH deserialization. Propagate that argument wherever it needs to be. No functionality change, except that I've tightened up a few PCH tests in preparation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17remove dead diagnostic.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69405 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17Fix two problems from PR3916, and one problem I noticed while hackingChris Lattner
on the code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17implement PR3940: #line numbers not fully checkedChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69403 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17#line is allowed to have macros that expand to nothing after them.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69401 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17Keep track of the number of statements/expressions written to and readDouglas Gregor
from a PCH file. It turns out that "Hello, World!" is bringing in 19% of all of the statements in Carbon.h, so we need to be lazy. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69393 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17fix a crash compiling code with its own definition of objc_assign_weak.Chris Lattner
rdar://6800430 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69392 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17tweak redefinition of a typedef a bit to fix a couple of problems:Chris Lattner
1. We had logic in sema to decide whether or not to emit the error based on manually checking whether in a system header file. 2. we were allowing redefinitions of typedefs in class scope in C++ if in header file. 3. there was no way to force typedef redefinitions to be accepted by the C compiler, which annoys me when stripping linemarkers out of .i files. The fix is to split the C++ class typedef redefinition path from the C path, and change the C path to be a warning that normally maps to error. This causes it to properly be ignored in system headers, etc. and gives us a way to control it. Passing -Wtypedef-redefinition now turns the error into a warning. One behavior change is that we now diagnose cases where you redefine a typedef in your .c file that was defined in a header file. This seems like reasonable behavior, and the diagnostic now indicates that it can be controlled with -Wtypedef-redefinition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69391 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17Fix two embarrassing PCH bugs:Douglas Gregor
1) Accidentally used delete [] on an array of statements that was allocated with ASTContext's allocator 2) Deserialization of names with multiple declarations (e.g., a struct and a function) used the wrong mangling constant, causing it to view declaration IDs as Decl*s. 403.gcc builds and links properly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69390 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17Use PresumedLoc to record line number in debug info entries.Devang Patel
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69389 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17Don't put msgrefs in used globals (in particular, we don't wantDaniel Dunbar
no-dead-strip set on them). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69388 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17Appropriately set file name and directory name in debug info compile units.Devang Patel
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69387 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17implement a new clang-cc option -dump-build-information=filename which ↵Chris Lattner
causes the compiler to dump random stuff from the build into the file. Right now this amounts to dumping command line arguments and diagnostics to the file. The idea is that you can set an envvar, do a world build of an OS, then grep through all the logs for interesting things or something. Daniel, please wire the driver up to do something with this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69386 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17PCH support for inline assembly statements.Douglas Gregor
This completes support for all of C (+ extensions). We can (again) build a PCH file for Carbon.h. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69385 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17refactor htmldiags to be created up front like the other diag clients.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17add a virtual method to DiagnosticClient to get rid of some fragileChris Lattner
casting in clang-cc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69377 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17PCH tests for va_arg expressions. Verified that the blocks test does create ↵Douglas Gregor
a BlockDeclRefExpr git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69376 91177308-0d34-0410-b5e6-96231b3b80d8