summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Simplify warning flag value handling from r206826Alp Toker2014-07-091-1/+1
| | | | | | Also give the field it a more appropriate name and improve the docs. llvm-svn: 212584
* Turn some Twine locals into const char * variables.Benjamin Kramer2014-07-081-4/+4
| | | | | | | No functionality change, just stylistic cleanup. Change made by clang-tidy and clang-format. llvm-svn: 212544
* Improve memory ownership of vfs::Files in the FileSystemStatCache by using ↵David Blaikie2014-07-081-1/+2
| | | | | | | | | std::unique_ptr Spotted after a memory leak (due to the complexities of manual memory management) was fixed in 212466. llvm-svn: 212541
* Move ChainedIncludesSource into the implementationAlp Toker2014-07-072-9/+53
| | | | | | This doesn't need to be in the headers. llvm-svn: 212451
* ChainedIncludesSource: avoid copying n*(n+1)/2 file contents into memoryAlp Toker2014-07-071-12/+6
| | | | | | Just reference the data instead with shallow MemoryBuffer instances. llvm-svn: 212450
* Remove unused sys/stat.h includesAlp Toker2014-07-071-1/+0
| | | | | | The facility was abstracted to LLVM in r187364. llvm-svn: 212441
* Peel away old-style file remapping typedefs and cruftAlp Toker2014-07-072-69/+40
| | | | llvm-svn: 212438
* Fix layering of file remapping and header search initializationAlp Toker2014-07-072-72/+67
| | | | | | | | These two functions initialize the source manager and header search objects and shouldn't be in InitPreprocessor which is concerned with priming the preprocessor itself and predefining macros. llvm-svn: 212434
* Update for llvm api change.Rafael Espindola2014-07-062-8/+14
| | | | llvm-svn: 212408
* Use non-intrusive refcounting for TargetOptionsAlp Toker2014-07-063-24/+22
| | | | llvm-svn: 212388
* Use non-intrusive refcounting for LangOptionsAlp Toker2014-07-061-2/+2
| | | | | | | This type is only refcounted in a couple of places so making ownership explicit improves clarity. llvm-svn: 212387
* Constify a read-only parameter and give function a better nameAlp Toker2014-07-062-6/+6
| | | | | | | This makes it clear that TargetInfo doesn't capture the LangOptions object, rather uses it to apply adjustments. llvm-svn: 212386
* Use PlistSupport in a few more placesAlp Toker2014-07-061-48/+35
| | | | | | Switch over LogDiagnosticPrinter and introduce an integer helper. llvm-svn: 212384
* clang-cl: /showIncludes output should go to stdout, not stderr. Fixes PR20217.Nico Weber2014-07-061-1/+1
| | | | llvm-svn: 212383
* Track IntrusiveRefCntPtr::get() changes from LLVM r212366Alp Toker2014-07-056-12/+12
| | | | llvm-svn: 212369
* Driver: Handle /GR- in a compatible way with MSVCDavid Majnemer2014-07-011-0/+1
| | | | | | | | | | | | | | | | | There are slight differences between /GR- and -fno-rtti which made mapping one to the other inappropriate. -fno-rtti disables dynamic_cast, typeid, and does not emit RTTI related information for the v-table. /GR- does not generate complete object locators and thus will not reference them in vftables. However, constructs like dynamic_cast and typeid are permitted. This should bring our implementation of RTTI up to semantic parity with MSVC modulo bugs. llvm-svn: 212138
* Do not define __STRICT_ANSI__ in clang-clEhsan Akhgari2014-06-301-1/+1
| | | | llvm-svn: 212066
* Consider module depedencies when checking a preamble in libclangBen Langmuir2014-06-303-15/+114
| | | | | | | | | | | | | Add module dependencies (header files, module map files) to the list of files to check when deciding whether to rebuild a preamble. That fixes using preambles with module imports so long as they are in non-overridden files. My intent is to use to unify the existing dependency collectors to the new “DependencyCollectory” interface from this commit, starting with the DependencyFileGenerator. llvm-svn: 212060
* Remove 'const' from MemoryBuffers used through the SourceManagerDavid Blaikie2014-06-271-1/+1
| | | | | | | | | | | | | | This removes a const_cast added in r211884 that occurred due to an inconsistency in how MemoryBuffers are handled between some parts of clang and LLVM. MemoryBuffers are immutable and the general convention in the LLVM project is to omit const from immutable types as it's simply redundant/verbose (see llvm::Type, for example). While this change doesn't remove "const" from /every/ MemoryBuffer, it at least makes this chain of ownership/usage consistent. llvm-svn: 211915
* Implement predefined stdint macrosJF Bastien2014-06-251-8/+114
| | | | | | | | | | | | Add predefined stdint macros that match the given patterns: U?INT{_,_FAST,_LEAST}{8,16,32,64}_{MAX,TYPE} U?INT{PTR,MAX}_{MAX,TYPE} http://reviews.llvm.org/D4141 Author: binji llvm-svn: 211657
* Add new debug kind LocTrackingOnly.Diego Novillo2014-06-241-3/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This new debug emission kind supports emitting line location information in all instructions, but stops code generation from emitting debug info to the final output. This mode is useful when the backend wants to track source locations during code generation, but it does not want to produce debug info. This is currently used by optimization remarks (-Rpass, -Rpass-missed and -Rpass-analysis). When one of the -Rpass flags is used, the front end will enable location tracking, only if no other debug option is enabled. To prevent debug information from being generated, a new debug info kind LocTrackingOnly causes DIBuilder::createCompileUnit() to not emit the llvm.dbg.cu annotation. This blocks final code generation from generating debug info in the back end. Depends on D4234. Reviewers: echristo, dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4235 llvm-svn: 211610
* Driver: correct behaviour of -fmsc-version=MAJORSaleem Abdulrasool2014-06-231-1/+5
| | | | | | | | | Ensure that we properly handle the case where just the major version component is provided by the user. Thanks to Alp Toker for pointing out that this was not handled correctly! llvm-svn: 211506
* Stop sharing the FileManager in ASTUnit::ParseBen Langmuir2014-06-231-1/+7
| | | | | | | | | | We were using old stat values for any files that had previously been looked up, leading to badness. There might be a more elegant solution in invalidating the cache for those file (since we already know which ones they are), but it seems too likely there are existing references to them hiding somewhere. llvm-svn: 211504
* TextDiagnosticPrinter: use the mapped level for remark flag computationAlp Toker2014-06-221-1/+1
| | | | | | | | | Custom diagnostics don't have a builtin class so this wouldn't have worked. Reduces surface area of remark-related changes. No test coverage. llvm-svn: 211462
* DiagnosticRenderer: emit basic notes as real diagnosticsAlp Toker2014-06-212-11/+6
| | | | | | | Fixes terminal column wrapping and vestigial 'note:' prefixes that would appear when using emitBasicNote(). llvm-svn: 211448
* TextDiagnostic: print remark level diagnostics in bold tooAlp Toker2014-06-211-19/+14
| | | | | | | | | | | The purpose of bolding these is to make them visually distinct from continuations (supplemental note diagnostics). Therefore, the bolding applies to all severities _including_ remarks -- it's not in any way an indicator of priority. Also simplify and comment. No tests. llvm-svn: 211447
* Driver: enhance MSC version compatibilitySaleem Abdulrasool2014-06-202-2/+53
| | | | | | | | | | | | | | | | | | | | | | | | | The version information for Visual Studio is spread over multiple variables. The newer Windows SDK has started making use of some of the extended versioning variables that were previously undefined. Enhance our compatibility definitions for these cases. _MSC_VER is defined to be the Major * 100 + Minor. _MSC_FULL_VER is defined to be Major * 10000000 + Minor * 100000 + Build. And _MSC_BUILD is the build revision of the compiler. Extend the -fmsc-version option in a compatible manner. If the value is the previous form of MMmm, then we assume that the build number is 0. Otherwise, a specific build number may be passed by using the form MMmmbbbbb. Due to bitwidth limitations of the option, it is currently not possible to define a revision value. The version information can be passed as either the decimal encoded value (_MSC_FULL_VER or _MSC_VER) or as a dot-delimited value. The change to the TextDiagnostic is to deal with the updated encoding of the version information. llvm-svn: 211420
* [C++1z] Implement N3981: Disable trigraphs by default in C++1z mode.Richard Smith2014-06-201-1/+2
| | | | llvm-svn: 211392
* Frontend: Disentangle removePathTraversal from concatenating pathsJustin Bogner2014-06-201-8/+15
| | | | | | | | | This reimplements part of r211303 in a bit of a cleaner way. Doing so allows us to use a proper absolute path when calling addFileMapping rather than relying on a substring being one, which should fix the tests on Windows. llvm-svn: 211338
* Frontend: Fix a typoJustin Bogner2014-06-191-1/+1
| | | | llvm-svn: 211306
* Frontend: Add a CC1 flag to dump module dependencies to a directoryJustin Bogner2014-06-194-0/+134
| | | | | | | | | | | | | | | | | | This adds the -module-dependency-dir to clang -cc1, which specifies a directory to copy all of a module's dependencies into in a form suitable to be used as a VFS using -ivfsoverlay with the generated vfs.yaml. This is useful for crashdumps that involve modules, so that the module dependencies will be intact when a crash report script is used to reproduce a problem on another machine. We currently encode the absolute path to the dump directory, due to limitations in the VFS system. Until we can handle relative paths in the VFS, users of the VFS map may need to run a simple search and replace in the file. llvm-svn: 211303
* Retry building modules that were compiled by other instances and are out-of-dateBen Langmuir2014-06-171-26/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When another clang instance builds a module, it may still be considered "out of date" for the current instance in a couple of cases*. This patch prevents us from giving spurious errors when compilers race to build a module by allowing the module load to fail when the pcm was built by a different compiler instance. * Cases where a module can be out of date despite just having been built: 1) There are different -I paths between invocations that result in finding a different module map file for some dependent module. This is not an error, and should never be diagnosed. <rdar://problem/16843887> 2) There are file system races where the headers making up a module are touched or moved. Although this can sometimes mean trouble, diagnosing it only during a build-race is worse than useless and we cannot detect this in general. It is more robust to just rebuild. This was causing spurious issues in some setups where only the modtime of headers was bumped during a build. <rdar://problem/16157638> llvm-svn: 211129
* Remove dead code.Diego Novillo2014-06-171-11/+0
| | | | | | | | The parsing for -Rpass= had been factored into the function GenerateOptimizationRemarkRegex, but at the time I forgot to remove the original code that just handled OPT_Rpass_EQ. llvm-svn: 211122
* Add -std=c++1z flag for C++17 features.Richard Smith2014-06-162-1/+5
| | | | llvm-svn: 211030
* Update for llvm api change.Rafael Espindola2014-06-131-1/+2
| | | | llvm-svn: 210921
OpenPOWER on IntegriCloud