summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* [ASTUnit] Unlike LoadFromCommandLine, LoadFromCompilerInvocation causes a ↵Argyrios Kyrtzidis2013-01-211-0/+2
| | | | | | | | | | crash if Precompilepreamble is set to true because there is no FileManager at that point. Patch by Hurcan Solter! llvm-svn: 173071
* Add top-level Clang flag -f(no-)sanitize-address-zero-base-shadow that makes ↵Alexey Samsonov2013-01-201-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
* Nuke SetUpBuildDumpLog.Sean Silva2013-01-204-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
* Fix what appears to be a copy-paste error.Sean Silva2013-01-201-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
* [ubsan] Add support for -fsanitize-blacklistWill Dietz2013-01-181-1/+1
| | | | llvm-svn: 172808
* Add -fmodules-autolink/-fno-modules-autolink (defaults to on) so thatDouglas Gregor2013-01-161-0/+1
| | | | | | users can explicitly enable/disable modules autolinking. llvm-svn: 172592
* Add -fopenmp -cc1 option and wire it up to define _OPENMP, from Alexey Bataev!Douglas Gregor2013-01-152-0/+13
| | | | llvm-svn: 172509
* [driver] Warnings for warning options are handled by the frontend. The ↵Chad Rosier2013-01-151-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
* Constify argument of Preprocessor::getMacroInfoHistory and propagate toDmitri Gribenko2013-01-141-1/+1
| | | | | | callers, removing unneeded const_cast llvm-svn: 172372
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-129-28/+26
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Provide Decl::getOwningModule(), which determines the (sub)module inDouglas Gregor2013-01-121-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
* [libclang] In ASTUnit::getMainFileName() Invocation may be null because the ↵Argyrios Kyrtzidis2013-01-111-1/+15
| | | | | | | | ASTUnit came from loading a PCH/module. llvm-svn: 172259
* Be more careful about updating the failed-modules setDouglas Gregor2013-01-101-2/+3
| | | | llvm-svn: 172035
* Make sure clang puts tokens from different files on separate lines in "-E ↵Eli Friedman2013-01-091-1/+4
| | | | | | | | -P" mode. <rdar://problem/12774044> llvm-svn: 171944
* Remove -Wmodule-build; it was a dumb idea anyway. <rdar://problem/12957525>Douglas Gregor2013-01-041-2/+0
| | | | llvm-svn: 171478
* Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate toChandler Carruth2013-01-021-1/+1
| | | | | | | | reflect the migration in r171366. Re-sort the #include lines to reflect the new paths. llvm-svn: 171369
* s/CPlusPlus0x/CPlusPlus11/gRichard Smith2013-01-023-4/+4
| | | | llvm-svn: 171367
* [ubsan] Recover by default, use -fno-sanitize-recover to disable.Will Dietz2012-12-301-1/+1
| | | | llvm-svn: 171264
* Support -fsanitize-memory-track-origins.Evgeniy Stepanov2012-12-241-0/+2
| | | | llvm-svn: 171020
* DiagnosticRenderer.cpp: Prune one description in ↵NAKAMURA Takumi2012-12-241-1/+0
| | | | | | | | DiagnosticRenderer::emitMacroExpansions(). [-Wdocumentation] /// \param MacroSkipEnd The depth to stop skipping macro expansions. llvm-svn: 171012
* [libclang] Don't try to translate diagnostics from the precompiled preamble ↵Argyrios Kyrtzidis2012-12-221-11/+0
| | | | | | | | | | | to the code-completion results, the SourceManager state may be slightly different when code-completing. And we don't even care for diagnostics when code-completing, anyway. llvm-svn: 170979
* Sort the includes according to the coding standard.Roman Divacky2012-12-211-1/+1
| | | | llvm-svn: 170905
* Remove duplicate includes.Roman Divacky2012-12-211-1/+0
| | | | llvm-svn: 170903
* Simplify logic to use SourceManager::getFileLoc(), per Argyrios's feedback.Ted Kremenek2012-12-191-4/+2
| | | | llvm-svn: 170487
* Be defensive when printing module import locations; the diagnostic printer ↵Douglas Gregor2012-12-181-1/+1
| | | | | | needs to be robust llvm-svn: 170466
* More conservative fix for <rdar://problem/12847524> (a crash printing ↵Eli Friedman2012-12-181-0/+7
| | | | | | | | diagnostic ranges). I'm not really happy with this fix, but I'm confident it's correct. llvm-svn: 170397
* Revert 170049 because it fails with an assertion on one of the spec2000 ↵Nadav Rotem2012-12-131-72/+24
| | | | | | workloads. llvm-svn: 170143
* More hacking on mapDiagnosticRanges to make it handle more cases.Eli Friedman2012-12-131-24/+72
| | | | | | | | | | | | | | | | | | | | | | | | This still isn't quite right, but it fixes a crash. I factored out findCommonParent because we need it on the result of getImmediateExpansionRange: for a function macro, the beginning and end of an expansion range can come out of different macros/macro arguments, which means the resulting range is a complete mess to handle consistently. I also made some changes to how findCommonParent works; it works somewhat better in some cases, and somewhat worse in others, but I think overall it's a better balance. I'm coming to the conclusion that mapDiagnosticRanges isn't using the right algorithm, though: chasing the caret is fundamentally more complicated than any algorithm which only considers one FileID for the caret can handle because each SourceLocation doesn't really have a single parent. We need to follow the same path of choosing expansion locations and spelling locations which the caret used to come up with the correct range in the general case. Fixes <rdar://problem/12847524>. llvm-svn: 170049
* Extend stat query APIs to explicitly specify if the query is forArgyrios Kyrtzidis2012-12-111-2/+2
| | | | | | | | | | a file or directory, allowing just a stat call if a file descriptor is not needed. Doing just 'stat' is faster than 'open/fstat/close'. This has the effect of cutting down system time for validating the input files of a PCH. llvm-svn: 169831
* Escape % in the TextDiagnosticBuffer so they aren't interpreted twice when ↵Benjamin Kramer2012-12-081-3/+23
| | | | | | | | fed into the diagnostic formatting machinery again. Fixes PR14543. llvm-svn: 169677
* [driver, ms-inline asm] -fms-compatibility enables -fms-extensions, so this ↵Chad Rosier2012-12-051-1/+1
| | | | | | | | | should enable the AsmBlocks language extension as well. rdar://12808010 llvm-svn: 169448
* [driver, ms-inline asm] Have -fms-extensions enable the AsmBlocks languageChad Rosier2012-12-051-1/+1
| | | | | | | | option. MS-style inline asm can now be enabled by either -fasm-blocks or -fms-extensions. rdar://12808010 llvm-svn: 169445
* [driver, ms-inline asm] MS-Style inline assembly is controlled by theChad Rosier2012-12-051-0/+1
| | | | | | | -fasm-blocks flag, not the -fms-extensions flag. rdar://12808010 llvm-svn: 169422
* PR14049: Don't say "expanded from macro 'foo'" when 'foo' just happens to beRichard Smith2012-12-051-2/+10
| | | | | | | the LHS of a token paste. Use "expanded from here" instead when we're not sure it's actually a macro. llvm-svn: 169373
* Minor reorganization. No functionality change.Richard Smith2012-12-051-30/+30
| | | | llvm-svn: 169367
* Simplify slightly by seperating out the responsibility for emission of a caretRichard Smith2012-12-051-34/+42
| | | | | | | | diagnostic from the emission of macro backtraces. Incidentally, we now get the displayed source location for a diagnostic and the location for the caret from the same place, rather than computing them separately. No functionality change. llvm-svn: 169357
* Simplify diagnostic emission. No functionality change intended.Richard Smith2012-12-051-20/+19
| | | | llvm-svn: 169351
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-0422-91/+89
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* Refactor recording the preprocessor conditional directive regions out ofArgyrios Kyrtzidis2012-12-041-1/+1
| | | | | | | | | PreprocessingRecord and into its own class, PPConditionalDirectiveRecord. Decoupling allows a client to use the functionality of PPConditionalDirectiveRecord without needing a PreprocessingRecord. llvm-svn: 169229
* Add Clang flags -fsanitize-blacklist and -fno-sanitize-blacklist. Make this ↵Alexey Samsonov2012-12-031-0/+1
| | | | | | flag usable for ASan. Blacklisting can be used to disable sanitizer checks for particular file/function/object. llvm-svn: 169144
* [ubsan] Add flag to enable recovery from checks when possible.Will Dietz2012-12-021-0/+1
| | | | llvm-svn: 169114
* Make helper classes anonymous. Make helper functions static instead of ↵Benjamin Kramer2012-12-011-155/+156
| | | | | | | | private members so the anonymous class doesn't leak out. No functionality change. llvm-svn: 169099
* Teach the serialized diagnostic writer to clone() itself, sharingDouglas Gregor2012-11-301-67/+112
| | | | | | | | | | state so that all of the various clones end up rendering their diagnostics into the same serialized-diagnostics file. This is important when we actually want failures during module build to be reported back to the translation unit that tried to import the not-yet-built or out-of-date module. <rdar://problem/12565727> llvm-svn: 169057
* Rename ModuleBuildPath -> ModuleBuildStack. Thanks, Dmitri!Douglas Gregor2012-11-302-16/+16
| | | | llvm-svn: 169045
* When we're emitting a diagnostic with a source location in an importedDouglas Gregor2012-11-302-8/+84
| | | | | | | | | | | | | | module, provide a module import stack similar to what we would get for an include stack, e.g., In module 'DependsOnModule' imported from build-fail-notes.m:4: In module 'Module' imported from DependsOnModule.framework/Headers/DependsOnModule.h:1: Inputs/Module.framework/Headers/Module.h:15:12: note: previous definition is here @interface Module <rdar://problem/12696425> llvm-svn: 169042
* When an error occurs while building a module on demand, provide "WhileDouglas Gregor2012-11-303-15/+68
| | | | | | | | | building module 'Foo' imported from..." notes (the same we we provide "In file included from..." notes) in the diagnostic, so that we know how this module got included in the first place. This is part of <rdar://problem/12696425>. llvm-svn: 169021
* Fix the computation of highlight ranges so we produce something sane whenEli Friedman2012-11-301-10/+30
| | | | | | | the beginning and end of the range are in different macro arguments. PR14399. llvm-svn: 168984
* Keep track of modules that have failed to build. If we encounter anDouglas Gregor2012-11-291-18/+55
| | | | | | | | | | | | import of that module elsewhere, don't try to build the module again: it won't work, and the experience is quite dreadful. We track this information somewhat globally, shared among all of the related CompilerInvocations used to build modules on-the-fly, so that a particular Clang instance will only try to build a given module once. Fixes <rdar://problem/12552849>. llvm-svn: 168961
* Reject uses of __int128 on platforms that don't support it. Also move the uglyRichard Smith2012-11-291-0/+2
| | | | | | | 'getPointerWidth(0) >= 64' test to be a method on TargetInfo, ready to be properly cleaned up. llvm-svn: 168856
* Remove some dead code. CLANG_IS_PRODUCTION is now just a build flag andRafael Espindola2012-11-271-1/+1
| | | | | | is not used in any #ifdef. llvm-svn: 168703
OpenPOWER on IntegriCloud