summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* Add [extern_c] attribute for modules, allowing a C module to be imported ↵Richard Smith2014-03-021-7/+14
| | | | | | within an extern "C" block in C++ code. llvm-svn: 202615
* [C++11] Replace verbose functors with succinct lambdasBenjamin Kramer2014-03-012-30/+8
| | | | | | No functionality change. llvm-svn: 202590
* Reapply fixed "Honour 'use-external-names' in FileManager"Ben Langmuir2014-02-281-1/+1
| | | | | | | | | | | | | | | | Was r202442 There were two issues with the original patch that have now been fixed. 1. We were memset'ing over a FileEntry in a test case. After adding a std::string to FileEntry, this still happened to not break for me. 2. I didn't pass the FileManager into the new compiler instance in compileModule. This was hidden in some cases by the fact I didn't clear the module cache in the test. Also, I changed the copy constructor for FileEntry, which was memcpy'ing in a (now) unsafe way. llvm-svn: 202539
* Add 'remark' diagnostic type in 'clang'Tobias Grosser2014-02-283-0/+8
| | | | | | | | | | | | | | | | | | | | | | | A 'remark' is information that is not an error or a warning, but rather some additional information provided to the user. In contrast to a 'note' a 'remark' is an independent diagnostic, whereas a 'note' always depends on another diagnostic. A typical use case for remark nodes is information provided to the user, e.g. information provided by the vectorizer about loops that have been vectorized. This patch provides the initial implementation of 'remarks'. It includes the actual definiton of the remark nodes, their printing as well as basic parameter handling. We are reusing the existing diagnostic parameters which means a remark can be enabled with normal '-Wdiagnostic-name' flags and can be upgraded to an error using '-Werror=diagnostic-name'. '-Werror' alone does not upgrade remarks. This patch is by intention minimal in terms of parameter handling. More experience and more discussions will most likely lead to further enhancements in the parameter handling. llvm-svn: 202475
* [ASTUnit] Don't let the preamble diagnostics out-live the CompilerInstance ↵Argyrios Kyrtzidis2014-02-281-51/+93
| | | | | | | | | | that created them, this is inherently unsafe. Instead get the diagnostic info into a SourceManager-independent form. llvm-svn: 202471
* Split FileEntry name vs. isValidBen Langmuir2014-02-272-3/+3
| | | | | | | This is a small bit of refactoring in preparation for FileEntry owning the storage for its own name. llvm-svn: 202412
* [ASTUnit] Fix use-after-free bug in ↵Argyrios Kyrtzidis2014-02-274-45/+35
| | | | | | | | | | | | | | | ASTUnit::getMainBufferWithPrecompiledPreamble(). With r197755 we started reading the contents of buffer file entries, but the buffers may point to ASTReader blobs that have been disposed. Fix this by having the CompilerInstance object keep a reference to the ASTReader as well as having the ASTContext keep reference to the ExternalASTSource. This was very difficult to construct a test case for. rdar://16149782 llvm-svn: 202346
* [CMake] Use LINK_LIBS instead of target_link_libraries().NAKAMURA Takumi2014-02-261-2/+1
| | | | llvm-svn: 202238
* Add a driver option -ivfsoverlayBen Langmuir2014-02-252-0/+30
| | | | | | | Reads the description of a virtual filesystem from a file and overlays it over the real file system. llvm-svn: 202176
* If preprocessing results in a token with leading whitespace that was expandedRichard Smith2014-02-241-0/+7
| | | | | | | from a macro in column 0, ensure that we print whitespace before it in the -E output. Patch by Harald van Dijk! llvm-svn: 202070
* Implement -fno-short-wcharRichard Barton2014-02-241-1/+1
| | | | llvm-svn: 202058
* Update for llvm api change.Rafael Espindola2014-02-245-10/+11
| | | | llvm-svn: 202053
* Don't assume that F_None is the default. It is about to change.Rafael Espindola2014-02-243-3/+3
| | | | llvm-svn: 202040
* Update __cplusplus to match the value in the C++14 DIS preview (D3937).Richard Smith2014-02-241-3/+5
| | | | llvm-svn: 202003
* [CMake] Resurrect mis-dropped dependency to ClangDriverOptions since r201842.NAKAMURA Takumi2014-02-231-0/+3
| | | | llvm-svn: 201978
* clang: add -f{no-,}integrate-as as consistent parametersSaleem Abdulrasool2014-02-231-1/+1
| | | | | | | | The integrated assembler is a feature. This makes the new flags the default option, and the previous versions aliases. Ideally, at some point the aliases would be entirely removed. llvm-svn: 201963
* [CMake] Get rid of explicit dependencies to include/clang/*.inc and ↵NAKAMURA Takumi2014-02-211-16/+0
| | | | | | | | | | | | | | | | | | | introduce CLANG_TABLEGEN_TARGETS. This does; - clang_tablegen() adds each tblgen'd target to global property CLANG_TABLEGEN_TARGETS as list. - List of targets is added to LLVM_COMMON_DEPENDS. - all clang libraries and targets depend on generated headers. You might wonder this would be regression, but in fact, this is little loss. - Almost all of clang libraries depend on tblgen'd files and clang-tblgen. - clang-tblgen may cause short stall-out but doesn't cause unconditional rebuild. - Each library's dependencies to tblgen'd files might vary along headers' structure. It made hard to track and update *really optimal* dependencies. Each dependency to intrinsics_gen and ClangSACheckers is left as DEPENDS. llvm-svn: 201842
* Accept -no-integrated-as in -cc1 and forward it to llvm.Rafael Espindola2014-02-211-0/+1
| | | | llvm-svn: 201837
* Expand macros in pragmas with -fms-extensions and -EReid Kleckner2014-02-201-36/+7
| | | | | | | | | | | | | | gcc never expands macros in pragmas and MSVC always expands macros before processing pragmas. Clang usually allows macro expansion, except in a handful of pragmas, most of which are handled by the lexer. Also remove PPCallbacks for pragmas that are currently handled in the parser. Without a Parser, such as with clang -E, these callbacks would never be called. Fixes PR18576. llvm-svn: 201821
* 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
OpenPOWER on IntegriCloud