Граф коммитов

3588 Коммитов

Автор SHA1 Сообщение Дата
Chris Lattner a868a203a1 implement semantic analysis for @synchronized, fixing a crash on invalid
rdar://6810940 - @synchronized has no sema checks


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69670 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 06:11:25 +00:00
Chris Lattner 46c3c4ba78 add support for goto checking and @synchronized blocks,
rdar://6810106


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69667 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 06:01:00 +00:00
Chris Lattner e116ccf140 Split preprocessor initialization logic out of clang-cc into
libfrontend.  Patch by Alexei Svitkine!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69664 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 05:40:52 +00:00
Chris Lattner 182e09240a rename -fprint-source-range-info -> -fdiagnostics-print-source-range-info.
Temporarily accept both of them, I'll rip out the old one after awhile.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69662 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 05:34:31 +00:00
Chris Lattner ce84c16a95 downgrade from extwarn to warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69660 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 04:54:03 +00:00
Chris Lattner 2451b528fe improve MacroInfo to track the source range of the macro definition,
patch by Alexei Svitkine!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69659 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 04:46:33 +00:00
Chris Lattner 41c17473e3 add a preprocessor callback function for #undef, patch by
Alexei Svitkine!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69656 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 03:42:09 +00:00
Anders Carlsson 19d28a650c Add a CXXDestroyExpr. Add classof member functions to CXXTempVarDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 02:22:11 +00:00
Sanjiv Gupta 4bc11af9be Use an APInt of target int size to detect overflow while parsing multichars.
So 'abc' on i16 platforms will warn but not on i32 platforms.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69653 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 02:21:29 +00:00
Anders Carlsson 86fa750270 Add the beginnings of a CXXTempVarDecl class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69652 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 01:57:48 +00:00
Daniel Dunbar 525c9b7bae Kill ASTContext::[gs]etFieldForDecl, instead we just lookup things
when we need them -- which is exactly what some code was already
doing!
 - No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69648 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 01:19:28 +00:00
Mike Stump 75b163f4c8 Fixup codegen for write barriers for block variables. Radar 6786715
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69642 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 00:51:43 +00:00
Daniel Dunbar 3bfb885583 Mark TypeForDecl mutable.
- Let the const propogation begin.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69628 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 21:52:34 +00:00
Douglas Gregor 3251ceb90b Write the identifier table into the PCH file as an on-disk hash table
that also includes the contents of the IdentifierInfo itself (the
various fields and flags, along with the chain of identifiers visible
at the top level that have that name).

We don't make any use of the hash table yet, except that our
identifier ID -> string mapping points into the hash table now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69625 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 20:36:09 +00:00
Steve Naroff 28e71cf851 Fix spelling error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 20:16:02 +00:00
Steve Naroff 33feeb019a Add pch reader/writer support for ObjCContainerDecl, ObjCInterfaceDecl, & ObjCIvarDecl.
Next step: Add selector support to PCHWriter::AddDeclarationName().



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69619 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 20:09:33 +00:00
Chris Lattner cf2a7211b4 the __gnuc_inline__ attribute is actually named __gnu_inline__,
PR4023


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69618 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 19:12:28 +00:00
Douglas Gregor 24022803af Allow the Info type used in the on-disk hash table generator to have state
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69616 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 19:03:54 +00:00
Chris Lattner df9bcd568c clean up anonymous bitfield diagnostics, PR4017
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69608 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 17:29:38 +00:00
Douglas Gregor e778504010 Introduce the notion of a SemaConsumer, which is an ASTConsumer that
also gets access to the Sema object performing semantic analysis. This
will be used by the PCH writer to serialize Sema state.

No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69595 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 15:53:59 +00:00
Steve Naroff 53c9d8a4b8 Add pch reader/writer support for ObjCMethodDecl.
Test will be enabled with ObjCInterfaceDecl is added.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69594 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 15:06:07 +00:00
Douglas Gregor 3432fa591c Make the on-disk hash table usable with non-file
raw_ostreams. Requires LLVM r69583.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69584 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 07:36:26 +00:00
Douglas Gregor 9378ba44b3 Move the on-disk hash table code into its own header. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69580 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 07:08:21 +00:00
Daniel Dunbar 153bfe5795 Make FieldDecl parameter to getObjCEncodingForType... const.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69578 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 06:37:24 +00:00
Zhongxing Xu 5cbe5f9105 Remove loc::FuncVal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69577 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 06:35:22 +00:00
Chris Lattner 9da8a683f2 Add option groups for -Wimplicit-int and -Wimplicit.
remove special case hack for -Werror-implicit-function-declaration



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69571 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 05:45:34 +00:00
Zhongxing Xu 369f447ede get a CodeTextRegion when visiting FunctionDecl reference.
get FunctionDecl with more general utility method.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69570 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 05:24:46 +00:00
Eli Friedman 0272b56dae Hook up -Wunused-value to the unused expression warning. This is
useful for macro-heavy codebases that tend to trigger this warning a 
lot.

Note that a make clean is required to get the option working; the 
dependencies for DiagnosticGroups.inc appear to be broken.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69564 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 01:56:54 +00:00
Daniel Dunbar 60952f94cf Remove non-const form of lookupFieldDeclForIvar.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69563 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-20 00:37:55 +00:00
Chris Lattner edaf877d24 implement "#pragma GCC diagnostic". Besides being a nice feature, this
will let us test for multiple different warning modes in the same
file in regression tests.

This implements rdar://2362963, a 10-year old feature request :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69560 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 23:16:58 +00:00
Chris Lattner 3bc172bc6a move group twiddling options into Diagnostic.cpp instead of
Warnings.cpp.  Warnings.cpp now doesn't need to #include
tblgen produced output directly.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69559 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 22:34:23 +00:00
Chris Lattner 4d8aac3778 Warn about uses of #pragma STDC FENV_ACCESS ON, since we don't
support it.  I don't know what evaluation method we use for complex
arithmetic, so I don't know whether/if we should warn about use of
CX_LIMITED_RANGE.

This concludes my planned hacking on STDC pragmas, flame away :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69556 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 21:55:32 +00:00
Chris Lattner 6c5cf4a2e2 diagnose invalid syntax of STDC pragmas.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 21:50:08 +00:00
Eli Friedman 4fb71b0cc3 Print an error for uses of __thread on targets which don't support it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 21:48:33 +00:00
Eli Friedman b030f02725 Add target property for whether thread-local storage is supported.
Let me know if I messed up for some target.  Note that for Windows, we 
should be able to support it (MSVC supports "__declspec(thread)"), but 
I'm pretty sure LLVM doesn't know how to generate the correct code.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69552 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 21:38:35 +00:00
Chris Lattner f545be5552 reject invalid stuff in the STDC namespace.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69551 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 21:25:37 +00:00
Daniel Dunbar 7695fba302 Forward f[no-]dollars-in-identifiers to clang, when specified.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69549 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 21:20:32 +00:00
Chris Lattner af7cdf45da basic support for -Wunknown-pragmas, more coming.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69547 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 21:10:26 +00:00
Daniel Dunbar 49138fc59e Forward -fno-diagnostics-fixit-info to clang-cc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69546 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 21:09:34 +00:00
Eli Friedman 63054b39a2 Add more thorough/correct checking for invalid __thread specifiers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69542 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 20:27:55 +00:00
Chris Lattner aa5bf2e8dc implement compiler support for -fno-diagnostics-fixit-info,
rdar://6805442


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69525 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 07:44:08 +00:00
Chris Lattner b5cf1ea6f4 second half of indirect jump checking: make sure that any
address taken labels are in function scope


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69499 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 01:16:06 +00:00
Chris Lattner 04ea2b633a First half of jump scope checking for indirect goto.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69498 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 01:05:26 +00:00
Chris Lattner ad56d68425 Add location info for indirect goto.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69497 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-19 01:04:21 +00:00
Chris Lattner 033749571f add a new Lexer::SkipEscapedNewLines method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69483 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18 22:27:02 +00:00
Chris Lattner 24f0e48c0a factor escape newline measuring out into its own helper function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69482 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18 22:05:41 +00:00
Chris Lattner 07e775d5a1 reject invalid jumps among pieces of @try blocks. This seems to work
reasonably well except for the problem that @catches are nested within
each other in the AST, giving the ugly diagnostics in L8.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69477 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18 21:28:52 +00:00
Anders Carlsson 6ea8e2152e Add functions for iterating over the argument types of an ObjCMethodDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69468 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18 20:18:04 +00:00
Chris Lattner a9768b72bb Improve switch diagnostic to emit the "jump" message on the
specific bad case instead of on the switch.  Putting it on the
switch means you don't know what case is the problem. For 
example:

scope-check.c:54:3: error: illegal switch case into protected scope
  case 2:
  ^
scope-check.c:53:9: note: jump bypasses initialization of variable length array
    int a[x];
        ^




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69462 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18 19:50:02 +00:00
Chris Lattner 366920a45e first step to getting switches giving "jump into vla scope" errors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-18 19:42:37 +00:00