summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* revert r176531 due to clan-native-arm failsWeiming Zhao2013-03-061-18/+2
| | | | llvm-svn: 176544
* Preprocessor: don't keep comments under -traditional-cpp.Jordan Rose2013-03-051-1/+10
| | | | | | | | | | | This patch is designed for minimal intrusion into normal preprocessing and compilation; under -E -traditional-cpp, the lexer will still generate tok::comment nodes since it is preserving all whitespace, but the output printer will then throw it away. <rdar://problem/13338680> llvm-svn: 176534
* PR 11326: Lack diagnosic message when ABI conflicts on ARMWeiming Zhao2013-03-051-2/+18
| | | | | | When both Triple and -mabi are used, it may result into conflicting ABI value. llvm-svn: 176531
* [libclang] When logging a CXTranslationUnit that came from an AST file, ↵Argyrios Kyrtzidis2013-03-051-0/+9
| | | | | | print out the filename. llvm-svn: 176511
* [preprocessor] Use MacroDirective in the preprocessor callbacks to make ↵Argyrios Kyrtzidis2013-02-242-5/+7
| | | | | | | | available the full information about the macro (e.g if it was imported and where). llvm-svn: 175978
* Add streamed versions of getQualifiedNameAsString.Benjamin Kramer2013-02-231-1/+2
| | | | | | Move the cold virtual method getNameForDiagnostic out of line. llvm-svn: 175966
* Propagate the split dwarf file information through into the backendEric Christopher2013-02-221-0/+1
| | | | | | | | | and through to the debug info in the module. In order to make the testcase a bit more efficient allow the filename to go through compilation for compile and not assemble jobs and turn off the extract for cases where we don't create an object. llvm-svn: 175935
* Comment parsing: add CommentOptions to allow specifying custom comment block ↵Dmitri Gribenko2013-02-222-0/+10
| | | | | | | | | | | | | | | | commands Add an ability to specify custom documentation block comment commands via a new class CommentOptions. The intention is that this class will hold future customizations for comment parsing, including defining documentation comments with specific numbers of parameters, etc. CommentOptions instance is a member of LangOptions. CommentOptions is controlled by a new command-line parameter -fcomment-block-commands=Foo,Bar,Baz. llvm-svn: 175892
* Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,Richard Smith2013-02-221-0/+1
| | | | | | | | | | | to control the check for the C 5.2.4.1 / C++ [implimits] restriction on nesting levels for parentheses, brackets and braces. Some code with heavy macro use exceeds the default limit of 256, but we don't want to increase it generally to avoid stack overflow on stack-constrained systems. llvm-svn: 175855
* Teach serialized diagnostics about notes without locations.Ted Kremenek2013-02-211-0/+10
| | | | | | | | Along the way, improve a diagnostic for "previous declaration here" for implicit parameters. Fixes <rdar://problem/13211384>. llvm-svn: 175802
* Preprocessor: preserve whitespace in -traditional-cpp mode.Jordan Rose2013-02-211-2/+2
| | | | | | | | | Note that unlike GNU cpp we currently do not preserve whitespace in macros (even in -traditional-cpp mode). <rdar://problem/12897179> llvm-svn: 175778
* [preprocessor] Split the MacroInfo class into two separate concepts, ↵Argyrios Kyrtzidis2013-02-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | MacroInfo class for the data specific to a macro definition (e.g. what the tokens are), and MacroDirective class which encapsulates the changes to the "macro namespace" (e.g. the location where the macro name became active, the location where it was undefined, etc.) (A MacroDirective always points to a MacroInfo object.) Usually a macro definition (MacroInfo) is where a macro name becomes active (MacroDirective) but splitting the concepts allows us to better model the effect of modules to the macro namespace (also as a bonus it allows better modeling of push_macro/pop_macro #pragmas). Modules can have their own macro history, separate from the local (current translation unit) macro history; MacroDirectives will be used to model the macro history (changes to macro namespace). For example, if "@import A;" imports macro FOO, there will be a new local MacroDirective created to indicate that "FOO" became active at the import location. Module "A" itself will contain another MacroDirective in its macro history (at the point of the definition of FOO) and both MacroDirectives will point to the same MacroInfo object. Introducing the separation of macro concepts is the first part towards better modeling of module macros. llvm-svn: 175585
* Add support for -fvisibility-ms-compat.John McCall2013-02-191-11/+31
| | | | | | | | | | | | | | | We treat this as an alternative to -fvisibility=<?> which changes the default value visibility to "hidden" and the default type visibility to "default". Expose a -cc1 option for changing the default type visibility, repurposing -fvisibility as the default value visibility option (also setting type visibility from it in the absence of a specific option). rdar://13079314 llvm-svn: 175480
* Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h.Jordan Rose2013-02-084-29/+27
| | | | | | | Nearly all of these changes are one-to-one replacements; the few that aren't have to do with custom identifier validation. llvm-svn: 174768
* Never cache the result of a module file lookup.Douglas Gregor2013-02-081-3/+4
| | | | llvm-svn: 174744
* Rename -fmodule-cache-path <blah> to -fmodules-cache-path=<blah> for ↵Douglas Gregor2013-02-071-1/+1
| | | | | | consistency. llvm-svn: 174645
* Simplify FindExternalVisibleDeclsByName by making it return a bool indicatingRichard Smith2013-02-071-1/+1
| | | | | | | | | | | | if it found any decls, rather than returning a list of found decls. This removes a returning-ArrayRef-to-deleted-storage bug from MultiplexExternalSemaSource (in code not exercised by any of the clang binaries), reduces the work required in the found-no-decls case with PCH, and importantly removes the need for DeclContext::lookup to be reentrant. No functionality change intended! llvm-svn: 174576
* Be a little more permissive with -fmodules-ignore-macro= by removing ↵Douglas Gregor2013-02-072-16/+6
| | | | | | everything after the second '=' if it is there. llvm-svn: 174567
* Introduce -fmodules-ignore-macro=NNN to ignore a macro when building/loading ↵Douglas Gregor2013-02-072-2/+52
| | | | | | | | | | | | | | | | | | | | | modules. The use of this flag enables a modules optimization where a given set of macros can be labeled as "ignored" by the modules system. Definitions of those macros will be completely ignored when building the module hash and will be stripped when actually building modules. The overall effect is that this flag can be used to drastically reduce the number of Eventually, we'll want modules to tell us what set of macros they respond to (the "configuration macros"), and anything not in that set will be excluded. However, that requires a lot of per-module information that must be accurate, whereas this option can be used more readily. Fixes the rest of <rdar://problem/13165109>. llvm-svn: 174560
* Detect when we end up trying to load conflicting module files.Douglas Gregor2013-02-061-3/+18
| | | | | | | | | | | | This can happen when one abuses precompiled headers by passing more -D options when using a precompiled hedaer than when it was built. This is intentionally permitted by precompiled headers (and is exploited by some build environments), but causes problems for modules. First part of <rdar://problem/13165109>, detecting when something when horribly wrong. llvm-svn: 174554
* [frontend] Don't put a PCH/PTH filename into the set of includes in the ↵Argyrios Kyrtzidis2013-02-053-18/+10
| | | | | | | | | | | | | preprocessor options; since only one of them is allowed in command-line, process them separately. Otherwise, if more than one is specified in the command-line, one is processed normally and the others are going to be treated and included as header files. Related to radar://13140508 llvm-svn: 174385
* TextDiagnostic.cpp: Suppress a warning to use ptrdiff_t on i686-clang. ↵NAKAMURA Takumi2013-02-051-1/+1
| | | | | | [-Wsign-compare] llvm-svn: 174353
* For ModuleLoader::makeModuleVisible() also pass the source location where theArgyrios Kyrtzidis2013-02-011-4/+6
| | | | | | module import occurred. llvm-svn: 174191
* Diagnostics: Clarify name of line-length-limiting constant in r173976.Jordan Rose2013-01-301-3/+3
| | | | | | Thanks, Sean. llvm-svn: 173981
* Diagnostics: if a line is longer than 4096 characters, don't print it.Jordan Rose2013-01-301-1/+9
| | | | | | | | | | | | | Specifically, don't print snippets, caret diagnostics, or ranges for lines over 4096 characters. We copy the line around a few times in our diagnostics machinery, and we have to print a caret line that's just as long. This uses a lot of memory just to create a poor user experience as we print out a line much too long for anyone to read...or spend extra energy trying to fit it to -fmessage-length. <rdar://problem/13106850> llvm-svn: 173976
* [analyzer] Make shallow mode more shallow.Anna Zaks2013-01-301-1/+0
| | | | | | | | | | | | | | | | Redefine the shallow mode to inline all functions for which we have a definite definition (ipa=inlining). However, only inline functions that are up to 4 basic blocks large and cut the max exploded nodes generated per top level function in half. This makes shallow faster and allows us to keep inlining small functions. For example, we would keep inlining wrapper functions and constructors/destructors. With the new shallow, it takes 104s to analyze sqlite3, whereas the deep mode is 658s and previous shallow is 209s. llvm-svn: 173958
* [analyzer] Use analyzer config for max-inlinable-size option.Anna Zaks2013-01-301-3/+0
| | | | llvm-svn: 173957
* Move UTF conversion routines from clang/lib/Basic to llvm/lib/SupportDmitri Gribenko2013-01-301-1/+1
| | | | | | This is required to use them in TableGen. llvm-svn: 173924
* Don't warn about Unicode characters in -E mode.Jordan Rose2013-01-302-3/+45
| | | | | | | | | | | | | | | People use the C preprocessor for things other than C files. Some of them have Unicode characters. We shouldn't warn about Unicode characters appearing outside of identifiers in this case. There's not currently a way for the preprocessor to tell if it's in -E mode, so I added a new flag, derived from the PreprocessorOutputOptions. This is only used by the Unicode warnings for now, but could conceivably be used by other warnings or even behavioral differences later. <rdar://problem/13107323> llvm-svn: 173881
* [Frontend] Factor AddUnmappedPath() out of AddPath() and simplify.Daniel Dunbar2013-01-301-15/+33
| | | | llvm-svn: 173871
* [Frontend] Remove HeaderSearchOptions::Entry::IsInternal, which is unused.Daniel Dunbar2013-01-301-2/+1
| | | | llvm-svn: 173866
* [Frontend] Add an ExternCSystem include entry group.Daniel Dunbar2013-01-302-78/+76
| | | | | | | | - The only group where it makes sense for the "ExternC" bit is System, so this simplifies having to have the extra isCXXAware (or ImplicitExternC, depending on what code you talk to) bit caried around. llvm-svn: 173859
* [Frontend] Make the include dir group independent from the "use sysroot" bit.Daniel Dunbar2013-01-292-8/+6
| | | | | | | | | - This slightly decouples the path handling, since before the group sometimes dominated the "use sysroot" bit, but it was still passed in via the API. - No functionality change. llvm-svn: 173855
* [Frontend] Rename a member variable to clarify its intent.Daniel Dunbar2013-01-291-5/+6
| | | | llvm-svn: 173854
* [Frontend] Factor out helper function, for clarity.Daniel Dunbar2013-01-291-9/+10
| | | | llvm-svn: 173853
* [ubsan] Implement the -fcatch-undefined-behavior flag using a trappingChad Rosier2013-01-291-0/+2
| | | | | | | | | | | implementation; this is much more inline with the original implementation (i.e., pre-ubsan) and does not require run-time library support. The trapping implementation can be invoked using either '-fcatch-undefined-behavior' or '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error', with the latter being preferred. Eventually, the -fcatch-undefined-behavior' flag will be removed. llvm-svn: 173848
* Enable the global module index by default. Introduce theDouglas Gregor2013-01-281-1/+1
| | | | | | | | -fno-modules-global-index -cc1 option to allow one to disable the index for performance testing purposes, but with a 10% win in -fsyntax-only time, there is no reason a user would do this. llvm-svn: 173707
* Fix the indentation of the first line of preprocessor outputHal Finkel2013-01-281-1/+5
| | | | | | | | | | The -E output from clang did not produce the correct indentation on the first line. This is because MoveToLine returned false, and when this happens, the regular process for producing initial indentation is skipped. Thanks to Eli for suggesting a way to simplify this to a one-line change. llvm-svn: 173657
* [Frontend] Remove another IsUserSpecified member variable that is now unused.Daniel Dunbar2013-01-251-14/+12
| | | | llvm-svn: 173412
* [Frontend] Drop the isUserSupplied argument to InitHeaderSearch, it is unused.Daniel Dunbar2013-01-251-72/+63
| | | | llvm-svn: 173411
* [Frontend] The -iwithprefix option belongs in the After category, according toDaniel Dunbar2013-01-251-2/+2
| | | | | | | GCC docs. - Found by inspection. llvm-svn: 173410
* [Lex] Remove DirectoryLookup.UserSpecified, which is unused.Daniel Dunbar2013-01-251-4/+5
| | | | llvm-svn: 173409
* Implement the reader of the global module index and wire it into theDouglas Gregor2013-01-251-1/+3
| | | | | | | | | | | | | | | | | | | | | | | AST reader. The global module index tracks all of the identifiers known to a set of module files. Lookup of those identifiers looks first in the global module index, which returns the set of module files in which that identifier can be found. The AST reader only needs to look into those module files and any module files not known to the global index (e.g., because they were (re)built after the global index), reducing the number of on-disk hash tables to visit. For an example source I'm looking at, we go from 237844 total identifier lookups into on-disk hash tables down to 126817. Unfortunately, this does not translate into a performance advantage. At best, it's a wash once the global module index has been built, but that's ignore the cost of building the global module index (which is itself fairly large). Profiles show that the global module index code is far less efficient than it should be; optimizing it might give enough of an advantage to justify its continued inclusion. llvm-svn: 173405
* Rename the -cc1 option "-generate-module-index" toDouglas Gregor2013-01-253-13/+26
| | | | | | | "-fmodules-global-index" and expand its behavior to include both the use and generation of the global module index. llvm-svn: 173404
* [analyzer] Replace "-analyzer-ipa" with "-analyzer-config ipa".Anna Zaks2013-01-241-16/+0
| | | | | | | | | The idea is to eventually place all analyzer options under "analyzer-config". In addition, this lays the ground for introduction of a high-level analyzer mode option, which will influence the default setting for IPAMode. llvm-svn: 173385
* Implement the writer side of the global module index. Douglas Gregor2013-01-233-2/+22
| | | | | | | | | | | | | | | | | | | | The global module index is a "global" index for all of the module files within a particular subdirectory in the module cache, which keeps track of all of the "interesting" identifiers and selectors known in each of the module files. One can perform a fast lookup in the index to determine which module files will have more information about entities with a particular name/selector. This information can help eliminate redundant lookups into module files (a serious performance problem) and help with creating auto-import/auto-include Fix-Its. The global module index is created or updated at the end of a translation unit that has triggered a (re)build of a module by scraping all of the .pcm files out of the module cache subdirectory, so it catches everything. As with module rebuilds, we use the file system's atomicity to synchronize. llvm-svn: 173301
* Use 'const Decl *' throughout code completion in SemaDmitri Gribenko2013-01-231-2/+2
| | | | llvm-svn: 173277
* Add a new LangOpt NativeHalfType. This option allows for native half/fp16Joey Gouly2013-01-231-0/+1
| | | | | | | | operations (as opposed to storage only half/fp16). Also add some semantic checks for OpenCL half types. llvm-svn: 173254
* Documentation cleanup: fixing documentation for FrontendAction.James Dennett2013-01-231-3/+3
| | | | | | | | | | | | | | * Fix a typo, s/BeginSourceAction/BeginSourceFile/, so that the documentation for FrontendAction::BeginSourceFileAction links correctly to BeginSourceFile; * Add some basic \file documentation for FrontendAction.h; * More use of "\brief" instead of repeating the name of the entity being documented; * Stop using Doxygen-style "///" comments in FrontendAction.cpp, as they were polluting the documentation for BeginSourceFile; * Drop incorrect "\see" markup that broke Doxygen's formatting; * Other minor documentation fixes. llvm-svn: 173213
* [ms-inline asm] Remove the -fenable-experimental-ms-inline-asm flag. MS-styleChad Rosier2013-01-221-2/+0
| | | | | | inline assembly can be enable with -fasm-blocks or -fms-extensions alone. llvm-svn: 173186
OpenPOWER on IntegriCloud