summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* Recommit virtual file systemBen Langmuir2014-02-204-7/+16
| | | | | | | | | | | Previously reverted in r201755 due to causing an assertion failure. I've removed the offending assertion, and taught the CompilerInstance to create a default virtual file system inside createFileManager. In the future, we should be able to reach into the CompilerInvocation to customize this behaviour without breaking clients that don't care. llvm-svn: 201818
* Reverting the virtual file system implementation, because it triggers an ↵Juergen Ributzka2014-02-205-16/+7
| | | | | | | | | | assertion in our internal build bots. This reverts commits 201618, 201635, 201636, 201639, 201685, 201691, and 201696. llvm-svn: 201755
* Use llvm::DeleteContainerSeconds when possibleReid Kleckner2014-02-191-4/+1
| | | | llvm-svn: 201739
* Pass VFS from CompilerInstance to FileManagerBen Langmuir2014-02-191-1/+1
| | | | | | This change was somehow missed from r201618 llvm-svn: 201636
* Initial implementation of virtual file systemBen Langmuir2014-02-195-6/+15
| | | | | | | | | | | | This adds the minimum virtual file system support to start migrating FileManager onto the VFS. Originally discussed here: http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-February/035188.html Differential Revision: http://llvm-reviews.chandlerc.com/D2745 llvm-svn: 201618
* MS ABI: Implement #pragma vtordisp() and clang-cl /vdNReid Kleckner2014-02-121-0/+1
| | | | | | | | | | | | | | | | | These features are new in VS 2013 and are necessary in order to layout std::ostream correctly. Currently we have an ABI incompatibility when self-hosting with the 2013 stdlib in our convertible_fwd_ostream wrapper in gtest. This change adds another implicit attribute, MSVtorDispAttr, because implicit attributes are currently the best way to make sure the information stays on class templates through instantiation. Reviewers: majnemer Differential Revision: http://llvm-reviews.chandlerc.com/D2746 llvm-svn: 201274
* Add an option to allow Clang verify source files for a module only once duringDmitri Gribenko2014-02-122-18/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the build When Clang loads the module, it verifies the user source files that the module was built from. If any file was changed, the module is rebuilt. There are two problems with this: 1. correctness: we don't verify system files (there are too many of them, and stat'ing all of them would take a lot of time); 2. performance: the same module file is verified again and again during a single build. This change allows the build system to optimize source file verification. The idea is based on the fact that while the project is being built, the source files don't change. This allows us to verify the module only once during a single build session. The build system passes a flag, -fbuild-session-timestamp=, to inform Clang of the time when the build started. The build system also requests to enable this feature by passing -fmodules-validate-once-per-build-session. If these flags are not passed, the behavior is not changed. When Clang verifies the module the first time, it writes out a timestamp file. Then, when Clang loads the module the second time, it finds a timestamp file, so it can compare the verification timestamp of the module with the time when the build started. If the verification timestamp is too old, the module is verified again, and the timestamp file is updated. llvm-svn: 201224
* Fix memory leak introduced by r201010.Daniel Jasper2014-02-121-0/+1
| | | | llvm-svn: 201220
* MS ABI: Add support for the -vm{b,g,s,m,v} flagsDavid Majnemer2014-02-111-0/+18
| | | | | | | | | These flags control the inheritance model initially used by the translation unit. Differential Revision: http://llvm-reviews.chandlerc.com/D2741 llvm-svn: 201175
* [stackprotector] Add command line option -fstack-protector-strongJosh Magee2014-02-112-2/+5
| | | | | | | | | | This option has the following effects: * It adds the sspstrong IR attribute to each function within the CU. * It defines the macro __SSP_STRONG__ with the value of 2. Differential Revision: http://llvm-reviews.chandlerc.com/D2717 llvm-svn: 201120
* ASTUnit: simplify remapping files by using the exact same logic in PreprocessorDmitri Gribenko2014-02-101-16/+4
| | | | llvm-svn: 201082
* Preprocessor: Add __ALIGNOF_MAX_ALIGN_T__David Majnemer2014-02-091-0/+3
| | | | | | | | | | TargetInfo::getSuitableAlign() was introduced in r146762 and is defined as alignof(std::max_align_t). Introduce __ALIGNOF_MAX_ALIGN_T__ which exposes getSuitableAlign() so that libc++ may take advantage of it. llvm-svn: 201037
* Remove the -fhidden-weak-vtables -cc1 option. It was dead,John McCall2014-02-081-1/+0
| | | | | | gross, and increasingly replaced through other mechanisms. llvm-svn: 201011
* ASTUnit: remove dead code in remapping filesDmitri Gribenko2014-02-081-73/+22
| | | | | | | ASTUnit contains code to remap files to other files on disk. This code is not used. We only remap files to MemoryBuffers. llvm-svn: 201010
* Stat system dependencies when using -verify-pchBen Langmuir2014-02-073-13/+20
| | | | | | | | We don't stat the system headers to check for stalenes during regular PCH loading for performance reasons. When explicitly saying -verify-pch, we want to check all the dependencies - user or system. llvm-svn: 200979
* ASTUnit: ArrayRef'ize RemappedFilesDmitri Gribenko2014-02-071-11/+8
| | | | llvm-svn: 200975
* Add a CC1 option -verify-pchBen Langmuir2014-02-054-1/+25
| | | | | | | | | This option will: - load the given pch file - verify it is not out of date by stat'ing dependencies, and - return 0 on success and non-zero on error llvm-svn: 200884
* Fix a -Wformat warning in ASTUnit.cppReid Kleckner2014-02-031-2/+2
| | | | | | | | | | llvm::sys::cas_flag is 'long' instead of 'uint32_t' on win32, because that's what InterlockedIncrement is defined to accept. I still don't know if we should be calling fprintf from ASTUnit.cpp behind a getenv check. llvm-svn: 200718
* Revert "Fix assertion failures on annot_* tokens in clang -E"Ben Langmuir2014-01-301-4/+5
| | | | | | | This is causing a failure in the msan buildbot that I am having trouble reproducing. Reverting until I can figure out what went wrong. llvm-svn: 200492
* Fix assertion failures on annot_* tokens in clang -EBen Langmuir2014-01-301-5/+4
| | | | | | | In particular, #pragma clang __debug, and #include implicitly changed into @import were causing assertion failures. llvm-svn: 200475
* Require a module.map file to load a moduleBen Langmuir2014-01-221-23/+10
| | | | | | | | Removes some old code that allowed a module to be loaded from a pcm file even if the module.map could not be found. Also update a number of tests that relied on the old behavior. llvm-svn: 199852
* [asan] Remove -fsanitize-address-zero-base-shadow command lineEvgeniy Stepanov2014-01-161-2/+0
| | | | | | | | | | | | | | | | flag from clang, and disable zero-base shadow support on all platforms where it is not the default behavior. - It is completely unused, as far as we know. - It is ABI-incompatible with non-zero-base shadow, which means all objects in a process must be built with the same setting. Failing to do so results in a segmentation fault at runtime. - It introduces a backward dependency of compiler-rt on user code, which is uncommon and complicates testing. This is the Clang part of a larger change. llvm-svn: 199372
* Remove the -cxx-abi command-line flag.Hans Wennborg2014-01-142-9/+1
| | | | | | | | | | | | | | | This makes the C++ ABI depend entirely on the target: MS ABI for -win32 triples, Itanium otherwise. It's no longer possible to do weird combinations. To be able to run a test with a specific ABI without constraining it to a specific triple, new substitutions are added to lit: %itanium_abi_triple and %ms_abi_triple can be used to get the current target triple adjusted to the desired ABI. For example, if the test suite is running with the i686-pc-win32 target, %itanium_abi_triple will expand to i686-pc-mingw32. Differential Revision: http://llvm-reviews.chandlerc.com/D2545 llvm-svn: 199250
* Switch around the order of MSVCCompat and MicrosoftExtAlp Toker2014-01-141-2/+1
| | | | | | | | | | | | Full language modes usually get listed before minor language extensions in LangOpts, so that subsequent sub-modes can predicate on the major modes. This also lends to a cleanup in CompilerInvocation to better indicate to the reader that MSVCCompat is a superset of MicrosoftExt. Cleanup only. llvm-svn: 199210
* Rename language option MicrosoftMode to MSVCCompatAlp Toker2014-01-142-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | There's been long-standing confusion over the role of these two options. This commit makes the necessary changes to differentiate them clearly, following up from r198936. MicrosoftExt (aka. fms-extensions): Enable largely unobjectionable Microsoft language extensions to ease portability. This mode, also supported by gcc, is used for building software like FreeBSD and Linux kernel extensions that share code with Windows drivers. MSVCCompat (aka. -fms-compatibility, formerly MicrosoftMode): Turn on a special mode supporting 'heinous' extensions for drop-in compatibility with the Microsoft Visual C++ product. Standards-compilant C and C++ code isn't guaranteed to work in this mode. Implies MicrosoftExt. Note that full -fms-compatibility mode is currently enabled by default on the Windows target, which may need tuning to serve as a reasonable default. See cfe-commits for the full discourse, thread 'r198497 - Move MS predefined type_info out of InitializePredefinedMacros' No change in behaviour. llvm-svn: 199209
* Use the MS ABI for Win32 targets by defaultHans Wennborg2014-01-131-2/+5
| | | | | | | | | | In addition to being a sensible default, this is a huge improvement in test coverage for the MS ABI: any bot that targets Win32 will now run the test suite using the MS ABI by default. Differential Revision: http://llvm-reviews.chandlerc.com/D2401 llvm-svn: 199131
* Use the simpler version of llvm::sys::fs::remove when possible.Rafael Espindola2014-01-103-12/+6
| | | | llvm-svn: 198957
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-071-1/+1
| | | | | | | encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. llvm-svn: 198686
* Implement a new -fstandalone-debug option. rdar://problem/15685848Adrian Prantl2014-01-071-8/+14
| | | | | | | | | | | | | | It controls everything that -flimit-debug-info used to, plus the vtable type optimization. The old -fno-limit-debug-info option is now an alias to -fstandalone-debug and vice versa. Standalone is the default on Darwin until dtrace is updated to work with non-standalone debug info (rdar://problem/15758808). Note: I kept the LimitedDebugInfo name in CodeGenOptions::DebugInfoKind because NoStandaloneDebugInfo sounded even more confusing. llvm-svn: 198655
* Driver: Accept -fprofile-instr-use and -fprofile-instr-generateJustin Bogner2014-01-061-0/+2
| | | | | | These flags will be used for instrumentation based PGO. llvm-svn: 198639
* Move MS predefined type_info out of InitializePredefinedMacrosAlp Toker2014-01-041-1/+0
| | | | | | | | | | | Instead of keeping it in amongst the macros, build the declaration at Sema init the same way we do with other predeclared and builtin types. In practice this means the declaration is marked implicit and therefore won't show up as an unwanted user-declared type in tooling which has been a frequently reported issue (though I haven't been able to cook up a test). llvm-svn: 198497
* Silence a dubious GCC warning about a set but unused global. Indeed, theChandler Carruth2013-12-281-1/+1
| | | | | | purpose of this global is to be set and not used. =] llvm-svn: 198094
* Bury leaked pointers in a global array to silence a leak detector in ↵Kostya Serebryany2013-12-272-2/+19
| | | | | | | | | | | | | | | | --disable-free mode Summary: This is an alternative to http://llvm-reviews.chandlerc.com/D2475 suggested by Chandler. Reviewers: chandlerc, rnk, dblaikie CC: cfe-commits, earthdok Differential Revision: http://llvm-reviews.chandlerc.com/D2478 llvm-svn: 198073
* TextDiagnosticBuffer: Fix copy-paste mistake in r197856Alp Toker2013-12-231-6/+3
| | | | | | | | | | | | | The TextDiagnosticBuffer is meant to scrub SourceLocations as the input/output SourceManagers may be different. To be safe this commit restores the original behaviour though in practice all current users seem to share a single SM. Would be nice to replace TextDiagnosticBuffer now that more capable interfaces like CaptureDiagnosticConsumer / StoredDiagnosticConsumer exist. llvm-svn: 197902
* Fix getCustomDiagID() usage in CodeGen and TextDiagnosticBufferAlp Toker2013-12-211-26/+9
| | | | | | | | | | DiagIDs are a cached resource generally only constructed from compile-time constant or stable format strings. Escaping arbitrary messages and constructing DiagIDs from them didn't make sense. llvm-svn: 197856
* Remove obsolete preamble FIXMEAlp Toker2013-12-201-2/+0
| | | | | | | The MD5 is checked since r197755 which is as good as comparing buffer contents in this context. llvm-svn: 197842
* Correctly compute the size in bytes of PreambleFileHash.MD5Dmitri Gribenko2013-12-201-2/+2
| | | | llvm-svn: 197762
* ASTUnit::getMainBufferWithPrecompiledPreamble: use MD5 hash of the remappedDmitri Gribenko2013-12-201-12/+51
| | | | | | | | | | | files to tell if they were changed since the last time we have computed the preamble We used to check only the buffer size, so if the new remapped buffer has the same size as the previous one, we would think that the buffer did not change, and we did not rebuild the preambule, which sometimes caused us to crash. llvm-svn: 197755
* Simplify codeDmitri Gribenko2013-12-191-1/+1
| | | | llvm-svn: 197748
* Modules: Don't warn upon missing headers while reading the module map.Daniel Jasper2013-12-172-9/+24
| | | | | | | | | | | | | | | Instead, mark the module as unavailable so that clang errors as soon as someone tries to build this module. This works towards the long-term goal of not stat'ing the header files at all while reading the module map and instead read them only when the module is being built (there is a corresponding FIXME in parseHeaderDecl()). However, it seems non-trivial to get there and this unblock us and moves us into the right direction. Also changed the implementation to reuse the same DiagnosticsEngine. llvm-svn: 197485
* Revert "Don't require -re suffix on -verify directives with regexes."Alp Toker2013-12-141-3/+19
| | | | | | | | | | This patch was submitted to the list for review and didn't receive a LGTM. (In fact one explicit objection and one query were raised.) This reverts commit r197295. llvm-svn: 197299
* Don't require -re suffix on -verify directives with regexes.Hans Wennborg2013-12-141-19/+3
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2392 llvm-svn: 197295
* With the new update to the ABI, we should not look for installationsYaron Keren2013-12-121-16/+12
| | | | | | | | | | | of MinGW older than 4.7 with incompatible C++ libraries. This patch makes clang look for all MinGW versions from 4.7: 4.7.0, 4.7.1, 4.7.2, 4.7.3 4.8.0, 4.8.1, 4.8.2. llvm-svn: 197176
* Use llvm::Regex::Escape in VerifyDiagnosticConsumer.cppHans Wennborg2013-12-121-31/+1
| | | | | | This depends on LLVM r197096. llvm-svn: 197101
* Change semantics of regex expectations in the diagnostic verifierHans Wennborg2013-12-111-6/+91
| | | | | | | | | | | | | | | | | | | | | | | Previously, a line like // expected-error-re {{foo}} treats the entirety of foo as a regex. This is inconvenient when matching type names containing regex characters. For example, to match "void *(class test8::A::*)(void)" inside such a regex, one would have to type "void \*\(class test8::A::\*\)\(void\)". This patch changes the semantics of expected-error-re to only treat the parts of the directive wrapped in double curly braces as regexes. This avoids the escaping problem and leads to nicer patterns for those cases; see e.g. the change to test/Sema/format-strings-scanf.c. (The balanced search for closing }} of a directive also makes us handle the full directive in test\SemaCXX\constexpr-printing.cpp:41 and :53.) Differential Revision: http://llvm-reviews.chandlerc.com/D2388 llvm-svn: 197092
* [Driver] Rename '-objcmt-white-list-dir-path' option to ↵Argyrios Kyrtzidis2013-12-101-1/+1
| | | | | | '-objcmt-whitelist-dir-path' and add an alias for now. llvm-svn: 196944
* [objcmt] Add a modernization option to infer and suggest designated ↵Argyrios Kyrtzidis2013-12-101-0/+2
| | | | | | | | initializers. rdar://15509284 llvm-svn: 196943
* [CMake] clang/lib: Satisfy dependencies to add *actually used* libraries on ↵NAKAMURA Takumi2013-12-091-0/+5
| | | | | | | | target_link_libraries() and LLVM_LINK_COMPONENTS. I will prune redundant dependencies later. llvm-svn: 196800
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-053-3/+4
| | | | llvm-svn: 196510
* Revert r196372, "do not warn about unknown pragmas in modes that do not ↵NAKAMURA Takumi2013-12-042-2/+2
| | | | | | | | handle them (pr9537)" It broke clang tests on some hosts with +Asserts. Seems "STDC" clashes. llvm-svn: 196376
OpenPOWER on IntegriCloud