summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* return a std::unique_ptr from getMainBufferWithPrecompiledPreamble. NFC.Rafael Espindola2014-08-181-19/+22
| | | | llvm-svn: 215927
* Simplify ASTUnit::Parse a bit by passing a std::unique_ptr to it.Rafael Espindola2014-08-181-28/+19
| | | | llvm-svn: 215900
* Add the break in the switch case (even if there is llvm_unreachable. It will ↵Sylvestre Ledru2014-08-181-1/+1
| | | | | | silent coverity warning CID 1231654 llvm-svn: 215897
* Repace SmallPtrSet with SmallPtrSetImpl in function arguments to avoid ↵Craig Topper2014-08-172-4/+4
| | | | | | needing to mention the size. llvm-svn: 215869
* Convert a few ownership comments with std::unique_ptr.Rafael Espindola2014-08-171-1/+1
| | | | llvm-svn: 215853
* Delete support for AuroraUX.Rafael Espindola2014-08-141-5/+0
| | | | | | auroraux.org is not resolving. llvm-svn: 215644
* Small cleanup: Don't duplicate default behavior.Rafael Espindola2014-08-131-2/+2
| | | | | | | | std::unique_ptr is null initialized and reset default to null. Thanks to David Blaikie for noticing. llvm-svn: 215560
* Use std::unique_ptr to simplify memory management a bit.Rafael Espindola2014-08-131-12/+6
| | | | llvm-svn: 215559
* Use StringRef instead of MemoryBuffer&.Rafael Espindola2014-08-122-3/+4
| | | | | | | This code doesn't care where the data it is processing comes from, so a StringRef is probably the most natural interface. llvm-svn: 215448
* Correctly implement -include search logic.Manuel Klimek2014-08-122-17/+16
| | | | | | | | | | | | | | | According to the gcc docs, -include uses the current working directory for the lookup instead of the main source file. This patch gets rid of NormalizeIncludePath (which relied on an implementation detail of FileManager / FileEntry for the include path logic to work), and instead hands the correct lookup information down to LookupFile. This will allow us to change the FileEntry's behavior regarding its Name caching. llvm-svn: 215433
* Modify behavior of -ast-dump-lookups: if -ast-dump is not also provided, dumpRichard Smith2014-08-113-5/+15
| | | | | | | | anyway. If -ast-dump *is* also provided, then dump the AST declarations as well as the lookup results. This is invaluable for cross-correlating the lookup information with the declarations actually found. llvm-svn: 215393
* Change MemoryBuffer* to MemoryBuffer& parameter to Lexer::ComputePreambleDavid Blaikie2014-08-112-5/+5
| | | | | | | | | | | | | (dropping const from the reference as MemoryBuffer is immutable already, so const is just redundant - and while I'd personally put const everywhere, that's not the LLVM Way (see llvm::Type for another example of an immutable type where "const" is omitted for brevity)) Changing the pointer argument to a reference parameter makes call sites identical between callers with unique_ptrs or raw pointers, minimizing the churn in a pending unique_ptr migrations. llvm-svn: 215391
* unique_ptr-ify FileSystemStatCache::setNextStatCacheDavid Blaikie2014-08-111-2/+4
| | | | | | | | | | And in the process, discover that FileManager::removeStatCache had a double-delete when removing an element from the middle of the list (at the beginning or the end of the list, there was no problem) and add a unit test to exercise the code path (which successfully crashed when run (with modifications to match the old API) without this patch applied) llvm-svn: 215388
* Revert r215331, "unique_ptrify CompilerInstance::OutputFile(s) and remove a ↵NAKAMURA Takumi2014-08-111-16/+14
| | | | | | | | | | | | | | | | | | | | | unique_ptr around a non-owning raw_ostream in CodeGenAction::CreateASTConsumer" It cannot be compiled on Visual Studio 2012. clang\include\clang/Frontend/CompilerInstance.h(153): error C2248: 'std::unique_ptr<_Ty>::unique_ptr' : cannot access private member declared in class 'std::unique_ptr<_Ty>' with [ _Ty=llvm::raw_ostream ] D:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\include\memory(1447) : see declaration of 'std::unique_ptr<_Ty>::unique_ptr' with [ _Ty=llvm::raw_ostream ] This diagnostic occurred in the compiler generated function 'clang::CompilerInstance::OutputFile::OutputFile(const clang::CompilerInstance::OutputFile &)' llvm-svn: 215346
* unique_ptrify CompilerInstance::OutputFile(s) and remove a unique_ptr around ↵David Blaikie2014-08-101-14/+16
| | | | | | a non-owning raw_ostream in CodeGenAction::CreateASTConsumer llvm-svn: 215331
* Out-of-line CompilerInstance::takeSema to avoid a header dependence from ↵David Blaikie2014-08-101-1/+5
| | | | | | | | | CompilerInstance.h on Sema.h Hopefully this fixes the libstdc++ build on some of the buildbots after r215321. llvm-svn: 215325
* Recommit 213307: unique_ptr-ify ownership of ASTConsumers (reverted in r213325)David Blaikie2014-08-1012-166/+169
| | | | | | | | After post-commit review and community discussion, this seems like a reasonable direction to continue, making ownership semantics explicit in the source using the type system. llvm-svn: 215323
* unique_ptr-ify CompilerInstance::takeSemaDavid Blaikie2014-08-101-1/+1
| | | | llvm-svn: 215321
* std::unique_ptr-ify the result of ASTUnit::LoadFromASTFileDavid Blaikie2014-08-103-16/+11
| | | | llvm-svn: 215320
* unique_ptr-ify FrontendAction::takeCurrentASTUnitDavid Blaikie2014-08-101-6/+7
| | | | llvm-svn: 215319
* unique_ptr-ify ASTReaderListener in the ASTReaderDavid Blaikie2014-08-103-7/+6
| | | | llvm-svn: 215317
* Refactor the module map file used for uniquing a module name out ofBen Langmuir2014-08-092-5/+8
| | | | | | | | | class Module. It's almost always going to be the same as getContainingModule() for top-level modules, so just add a map to cover the remaining cases. This lets us do less bookkeeping to keep the ModuleMap fields up to date. llvm-svn: 215268
* Predefine IB_DESIGNABLE and IBInspectable macros. <rdar://problem/17441860>Bob Wilson2014-08-081-0/+2
| | | | | | | | | These macros are used as markers for Interface Builder and need to be defined to empty strings since they have no impact on the code. Patch by Ted Kremenek. llvm-svn: 215259
* Add a cc1 "dump-coverage-mapping" for testing coverage mapping.Alex Lorenz2014-08-081-0/+1
| | | | | | Differential Revision: http://reviews.llvm.org/D4799 llvm-svn: 215258
* Flip the order the preprocessor and frontendaction are informed of the end ↵Benjamin Kramer2014-08-071-4/+4
| | | | | | | | | | | of a file. This allows using EndOfMainFile from a PPCallback to access data from the action. The pattern of PPCallback referencing an action is common in clang-tidy. Differential Revision: http://reviews.llvm.org/D4773 llvm-svn: 215145
* Use -Rblah, not -Wblah, to control remark diagnostics. This was always theRichard Smith2014-08-072-21/+19
| | | | | | | | | | | | | | | | | | | | | | intent when we added remark support, but was never implemented in the general case, because the first -R flags didn't need it. (-Rpass= had special handling to accomodate its argument.) -Rno-foo, -Reverything, and -Rno-everything can be used to turn off a remark, or to turn on or off all remarks. Per discussion on cfe-commits, -Weverything does not affect remarks, and -Reverything does not affect warnings or errors. The only "real" -R flag we have right now is -Rmodule-build; that flag is effectively renamed from -Wmodule-build to -Rmodule-build by this change. -Wpass and -Wno-pass (and their friends) are also renamed to -Rpass and -Rno-pass by this change; it's not completely clear whether we intended to have a -Rpass (with no =pattern), but that is unchanged by this commit, other than the flag name. The default pattern is effectively one which matches no passes. In future, we may want to make the default pattern be .*, so that -Reverything works for -Rpass properly. llvm-svn: 215046
* Introduce f[no-]max-unknown-pointer-align=[number] optionFariborz Jahanian2014-08-051-0/+1
| | | | | | | | | to instruct the code generator to not enforce a higher alignment than the given number (of bytes) when accessing memory via an opaque pointer or reference. Patch reviewed by John McCall (with post-commit review pending). rdar://16254558 llvm-svn: 214911
* Add coverage mapping generation.Alex Lorenz2014-08-041-0/+1
| | | | | | | | | | This patch adds the '-fcoverage-mapping' option which allows clang to generate the coverage mapping information that can be used to provide code coverage analysis using the execution counts obtained from the instrumentation based profiling (-fprofile-instr-generate). llvm-svn: 214752
* Add a missing close quote in "while building module 'Foo:" diagnostic.Jordan Rose2014-07-261-1/+1
| | | | | | | This isn't a real diagnostic kind, only a location note, and this form isn't even used if the SourceManager can provide a valid presumed location. But still. llvm-svn: 214002
* Add stopgap option -fmodule-implementation-of <name>Ben Langmuir2014-07-232-2/+16
| | | | | | | | | | | | | | | | | | This flag specifies that we are building an implementation file of the module <name>, preventing importing <name> as a module. This does not consider this to be the 'current module' for the purposes of doing modular checks like decluse or non-modular-include warnings, unlike -fmodule-name. This is needed as a stopgap until: 1) we can resolve relative includes to a VFS-mapped module (or can safely import a header textually and as part of a module) and ideally 2) we can safely do incremental rebuilding when implementation files import submodules. llvm-svn: 213767
* AArch64: update Clang for merged arm64/aarch64 triples.Tim Northover2014-07-231-1/+0
| | | | | | | | | | | | | | The main subtlety here is that the Darwin tools still need to be given "-arch arm64" rather than "-arch aarch64". Fortunately this already goes via a custom function to handle weird edge-cases in other architectures, and it tested. I removed a few arm64_be tests because that really isn't an interesting thing to worry about. No-one using big-endian is also referring to the target as arm64 (at least as far as toolchains go). Mostly they date from when arm64 was a separate target and we *did* need a parallel name simply to test it at all. Now aarch64_be is sufficient. llvm-svn: 213744
* If a module build reports errors, don't try to load itBen Langmuir2014-07-191-13/+21
| | | | | | ... just to find out that it didn't build. llvm-svn: 213454
* Remove uses of the redundant ".reset(nullptr)" of unique_ptr, in favor of ↵David Blaikie2014-07-192-2/+2
| | | | | | | | | | | ".reset()" It's also possible to just write "= nullptr", but there's some question of whether that's as readable, so I leave it up to authors to pick which they prefer for now. If we want to discuss standardizing on one or the other, we can do that at some point in the future. llvm-svn: 213439
* Revert "unique_ptr-ify ownership of ASTConsumers"David Blaikie2014-07-1712-169/+166
| | | | | | | | | This reverts commit r213307. Reverting to have some on-list discussion/confirmation about the ongoing direction of smart pointer usage in the LLVM project. llvm-svn: 213325
* unique_ptr-ify ownership of ASTConsumersDavid Blaikie2014-07-1712-166/+169
| | | | | | | | | (after fixing a bug in MultiplexConsumer I noticed the ownership of the nested consumers was implemented with raw pointers - so this fixes that... and follows the source back to its origin pushing unique_ptr ownership up through there too) llvm-svn: 213307
* If char/short are shorter than int, do not use U as suffix forJoerg Sonnenberger2014-07-171-3/+3
| | | | | | | | constants. Comparing int against a constant of the given type like UINT8_MAX will otherwise force a promotion to unsigned int, which is typically not expected. llvm-svn: 213301
* Always set the C suffix macro, even if it is empty.Joerg Sonnenberger2014-07-171-6/+2
| | | | llvm-svn: 213299
* clang-cl: Flush stdout after writing the /showIncludes outputEhsan Akhgari2014-07-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: Before this patch, you could get lines in the output such as: Note: including file: ../../dist/include/js/Tc:/path/to/foo.cpp(1,1) : error(clang): static_assert failed... This patch ensures that the stdout output from showIncludes won't be garbled in the terminal like this, and it also helps applications that use the output to generate dependency information if they happen to capture both stdout and stderr. Test Plan: Tested locally, it's hard to write an automated test for this as the behavior depends on the buffering of the ostreams. Reviewers: nico Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4559 llvm-svn: 213297
* Provide __SIG_ATOMIC_MAX__ next to __SIG_ATOMIC_WIDTH__.Joerg Sonnenberger2014-07-171-0/+1
| | | | llvm-svn: 213289
* DebugInfo: Forward HandleTagDeclRequiredDefinition through MultiplexConsumer ↵David Blaikie2014-07-161-0/+25
| | | | | | | | | | | | | | | | | | | to fix debug info emission in the presence of plugins. When plugins are used the Multiplex(AST)Consumer is employed to dispatch to both the plugin ASTConsumers and the IRGen ASTConsumer. It wasn't dispatching a critical call for debug info, resulting in plugin users having a negative debugging experience. While I'm here, forward a bunch of other missing calls through the consumer that seem like they should be there. To test this, use the example plugin (requires plugins and examples) and split the test case up so that the plugin testing can be done under that requirement while the non-plugin testing will execute even in builds that don't include plugin support or examples. llvm-svn: 213213
* Make clang's rewrite engine a core featureAlp Toker2014-07-1612-1/+15052
| | | | | | | | | | | | | | | The rewrite facility's footprint is small so it's not worth going to these lengths to support disabling at configure time, particularly since key compiler features now depend on it. Meanwhile the Objective-C rewriters have been moved under the ENABLE_CLANG_ARCMT umbrella for now as they're comparatively heavy and still potentially worth excluding from lightweight builds. Tests are now passing with any combination of feature flags. The flags historically haven't been tested by LLVM's build servers so caveat emptor. llvm-svn: 213171
* Driver: bifurcate extended and basic MSC versioningSaleem Abdulrasool2014-07-162-21/+5
| | | | | | | | | | | | | | | | | | | | | | | This restores the original behaviour of -fmsc-version. The older option remains as a mechanism for specifying the basic version information. A secondary option, -fms-compatibility-version permits the user to specify an extended version to the driver. The new version takes the value as a dot-separated value rather than the major * 100 + minor format that -fmsc-version format. This makes it easier to specify the value as well as a more flexible manner for specifying the value. Specifying both values is considered an error. The older parameter is left solely as a driver option, which is normalised into the newer parameter. This allows us to retain a single code path in the compiler itself whilst preserving the semantics of the old parameter as well as avoid having to determine which of two formats are being used by the invocation. The test changes are due to the fact that the compiler no longer supports the old option, and is a direct conversion to the new option. llvm-svn: 213119
* Add __INTMAX_C_SUFFIX__ and __UINTMAX_C_SUFFIX__.Joerg Sonnenberger2014-07-151-0/+4
| | | | llvm-svn: 213097
* Don't create non-temporary twines.Joerg Sonnenberger2014-07-151-3/+2
| | | | llvm-svn: 213066
* Make sure int64_t and uint64_t are consistent.Joerg Sonnenberger2014-07-151-2/+2
| | | | llvm-svn: 213065
* Provide builtin macros as template for PRIab and SCNab, matching theJoerg Sonnenberger2014-07-151-0/+22
| | | | | | underlaying types. llvm-svn: 213063
* [x32] Add __ILP32__ macro for ILP32 platformsPavel Chupin2014-07-141-0/+6
| | | | | | | | | | | | | | | | Summary: Add __ILP32__ and _ILP32 macro for corresponding platforms. Cover x86_64-*-*-gnux32 with test. Test Plan: test added Reviewers: chandlerc, atanasyan Subscribers: cfe-commits, dschuff, zinovy.nis Differential Revision: http://reviews.llvm.org/D4473 llvm-svn: 212931
* Instantiate llvm::Registry<clang::PluginASTAction> in FrontendAction.cpp.NAKAMURA Takumi2014-07-111-0/+2
| | | | | | | - Plugins don't need to export _ZN4llvm8Registry*. - Win32.DLL cannot merge common symbols among DLLs. Static members in llvm::Registry should be instantiated in a parent. llvm-svn: 212821
* Avoid definining more GCC specific predefined macros in clang-clEhsan Akhgari2014-07-101-29/+31
| | | | | | | | | | Reviewers: hansw, rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4419 llvm-svn: 212753
* Provide -verify support to match "any" line for diagnostics in included files.Andy Gibbs2014-07-101-15/+30
| | | | | | | | Allow diagnostic checks that originate in included files to be matched without necessarily determining the line number that the diagnostic occurs on. The new syntax replaces the line number with '*'. This extension is limited to diagnostics in included files and may be used where the include file is not part of the test-suite itself. Expected uses are for diagnostics originating in system headers, or for users who use -verify in testing 3rd-party library code where the location of diagnostics in header files may change from revision to revision and their precise location is not important to the success of the test-case. llvm-svn: 212735
OpenPOWER on IntegriCloud