aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend
AgeCommit message (Collapse)AuthorFilesLines
2013-02-07Rename -fmodule-cache-path <blah> to -fmodules-cache-path=<blah> for ↵Douglas Gregor1-1/+1
consistency. llvm-svn: 174645
2013-02-07Simplify FindExternalVisibleDeclsByName by making it return a bool indicatingRichard Smith1-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
2013-02-07Be a little more permissive with -fmodules-ignore-macro= by removing ↵Douglas Gregor2-16/+6
everything after the second '=' if it is there. llvm-svn: 174567
2013-02-07Introduce -fmodules-ignore-macro=NNN to ignore a macro when building/loading ↵Douglas Gregor2-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
2013-02-06Detect when we end up trying to load conflicting module files.Douglas Gregor1-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
2013-02-05[frontend] Don't put a PCH/PTH filename into the set of includes in the ↵Argyrios Kyrtzidis3-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
2013-02-05TextDiagnostic.cpp: Suppress a warning to use ptrdiff_t on i686-clang. ↵NAKAMURA Takumi1-1/+1
[-Wsign-compare] llvm-svn: 174353
2013-02-01For ModuleLoader::makeModuleVisible() also pass the source location where theArgyrios Kyrtzidis1-4/+6
module import occurred. llvm-svn: 174191
2013-01-30Diagnostics: Clarify name of line-length-limiting constant in r173976.Jordan Rose1-3/+3
Thanks, Sean. llvm-svn: 173981
2013-01-30Diagnostics: if a line is longer than 4096 characters, don't print it.Jordan Rose1-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
2013-01-30[analyzer] Make shallow mode more shallow.Anna Zaks1-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
2013-01-30[analyzer] Use analyzer config for max-inlinable-size option.Anna Zaks1-3/+0
llvm-svn: 173957
2013-01-30Move UTF conversion routines from clang/lib/Basic to llvm/lib/SupportDmitri Gribenko1-1/+1
This is required to use them in TableGen. llvm-svn: 173924
2013-01-30Don't warn about Unicode characters in -E mode.Jordan Rose2-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
2013-01-30[Frontend] Factor AddUnmappedPath() out of AddPath() and simplify.Daniel Dunbar1-15/+33
llvm-svn: 173871
2013-01-30[Frontend] Remove HeaderSearchOptions::Entry::IsInternal, which is unused.Daniel Dunbar1-2/+1
llvm-svn: 173866
2013-01-30[Frontend] Add an ExternCSystem include entry group.Daniel Dunbar2-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
2013-01-29[Frontend] Make the include dir group independent from the "use sysroot" bit.Daniel Dunbar2-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
2013-01-29[Frontend] Rename a member variable to clarify its intent.Daniel Dunbar1-5/+6
llvm-svn: 173854
2013-01-29[Frontend] Factor out helper function, for clarity.Daniel Dunbar1-9/+10
llvm-svn: 173853
2013-01-29[ubsan] Implement the -fcatch-undefined-behavior flag using a trappingChad Rosier1-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
2013-01-28Enable the global module index by default. Introduce theDouglas Gregor1-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
2013-01-28Fix the indentation of the first line of preprocessor outputHal Finkel1-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
2013-01-25[Frontend] Remove another IsUserSpecified member variable that is now unused.Daniel Dunbar1-14/+12
llvm-svn: 173412
2013-01-25[Frontend] Drop the isUserSupplied argument to InitHeaderSearch, it is unused.Daniel Dunbar1-72/+63
llvm-svn: 173411
2013-01-25[Frontend] The -iwithprefix option belongs in the After category, according toDaniel Dunbar1-2/+2
GCC docs. - Found by inspection. llvm-svn: 173410
2013-01-25[Lex] Remove DirectoryLookup.UserSpecified, which is unused.Daniel Dunbar1-4/+5
llvm-svn: 173409
2013-01-25Implement the reader of the global module index and wire it into theDouglas Gregor1-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
2013-01-25Rename the -cc1 option "-generate-module-index" toDouglas Gregor3-13/+26
"-fmodules-global-index" and expand its behavior to include both the use and generation of the global module index. llvm-svn: 173404
2013-01-24[analyzer] Replace "-analyzer-ipa" with "-analyzer-config ipa".Anna Zaks1-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
2013-01-23Implement the writer side of the global module index. Douglas Gregor3-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
2013-01-23Use 'const Decl *' throughout code completion in SemaDmitri Gribenko1-2/+2
llvm-svn: 173277
2013-01-23Add a new LangOpt NativeHalfType. This option allows for native half/fp16Joey Gouly1-0/+1
operations (as opposed to storage only half/fp16). Also add some semantic checks for OpenCL half types. llvm-svn: 173254
2013-01-23Documentation cleanup: fixing documentation for FrontendAction.James Dennett1-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
2013-01-22[ms-inline asm] Remove the -fenable-experimental-ms-inline-asm flag. MS-styleChad Rosier1-2/+0
inline assembly can be enable with -fasm-blocks or -fms-extensions alone. llvm-svn: 173186
2013-01-21[ASTUnit] Unlike LoadFromCommandLine, LoadFromCompilerInvocation causes a ↵Argyrios Kyrtzidis1-0/+2
crash if Precompilepreamble is set to true because there is no FileManager at that point. Patch by Hurcan Solter! llvm-svn: 173071
2013-01-20Add top-level Clang flag -f(no-)sanitize-address-zero-base-shadow that makes ↵Alexey Samsonov1-1/+3
AddressSanitizer use bottom of the address space for the shadow memory. On Linux it can be used with -fPIE/-pie to improve performance. llvm-svn: 172974
2013-01-20Nuke SetUpBuildDumpLog.Sean Silva4-41/+6
Also, it was the only reason that `argc` and `argv` were being passed into createDiagnostics, so remove those parameters and clean up callers. llvm-svn: 172945
2013-01-20Fix what appears to be a copy-paste error.Sean Silva1-1/+1
This looks like it was copied from SetUpBuildDumpLog, which dumps to the file `DiagOpts->DumpBuildInformation`. There is another member `DiagOpts->DiagnosticLogFile` which appears to be unused. The fact that this feature doesn't even print to the output file specified on the command line makes me think that it should be ripped out. llvm-svn: 172944
2013-01-18[ubsan] Add support for -fsanitize-blacklistWill Dietz1-1/+1
llvm-svn: 172808
2013-01-16Add -fmodules-autolink/-fno-modules-autolink (defaults to on) so thatDouglas Gregor1-0/+1
users can explicitly enable/disable modules autolinking. llvm-svn: 172592
2013-01-15Add -fopenmp -cc1 option and wire it up to define _OPENMP, from Alexey Bataev!Douglas Gregor2-0/+13
llvm-svn: 172509
2013-01-15[driver] Warnings for warning options are handled by the frontend. The ↵Chad Rosier1-1/+8
driver needs to process the warning options to setup diagnostic state, but should not be emitting warnings as these would be rudndant with what the frontend emits. rdar://13001556 llvm-svn: 172497
2013-01-14Constify argument of Preprocessor::getMacroInfoHistory and propagate toDmitri Gribenko1-1/+1
callers, removing unneeded const_cast llvm-svn: 172372
2013-01-12Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko9-28/+26
brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
2013-01-12Provide Decl::getOwningModule(), which determines the (sub)module inDouglas Gregor1-0/+6
which a particular declaration resides. Use this information to customize the "definition of 'blah' must be imported from another module" diagnostic with the module the user actually has to import. Additionally, recover by importing that module, so we don't complain about other names in that module. Still TODO: coming up with decent Fix-Its for these cases, and expand this recovery approach for other name lookup failures. llvm-svn: 172290
2013-01-11[libclang] In ASTUnit::getMainFileName() Invocation may be null because the ↵Argyrios Kyrtzidis1-1/+15
ASTUnit came from loading a PCH/module. llvm-svn: 172259
2013-01-10Be more careful about updating the failed-modules setDouglas Gregor1-2/+3
llvm-svn: 172035
2013-01-09Make sure clang puts tokens from different files on separate lines in "-E ↵Eli Friedman1-1/+4
-P" mode. <rdar://problem/12774044> llvm-svn: 171944
2013-01-04Remove -Wmodule-build; it was a dumb idea anyway. <rdar://problem/12957525>Douglas Gregor1-2/+0
llvm-svn: 171478