summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic
Commit message (Collapse)AuthorAgeFilesLines
...
* Get rid of the static FileManager::FixupRelativePath.Anders Carlsson2011-03-141-8/+4
| | | | llvm-svn: 127573
* Add 'OverridenFilesKeepOriginalName' field in SourceManager which if true ↵Argyrios Kyrtzidis2011-03-081-2/+4
| | | | | | | | | | | the SourceManager should report the original file name for contents of files that were overriden by other files, otherwise it should report the name of the new file. Default is true. Also add similar field in PreprocessorOptions and pass similar parameter in ASTUnit::LoadFromCommandLine. llvm-svn: 127289
* lib/Basic/Targets.cpp: mingw-w64 should define __MINGW32__, too.NAKAMURA Takumi2011-03-081-0/+1
| | | | llvm-svn: 127238
* Check in the implementation as well...Anders Carlsson2011-03-071-3/+7
| | | | llvm-svn: 127144
* Convert FileManager::FixupRelativePath over to using PathV2.Anders Carlsson2011-03-061-8/+10
| | | | llvm-svn: 127133
* Currently we can only remap a file by creating a MemoryBuffer and replacing ↵Argyrios Kyrtzidis2011-03-051-18/+38
| | | | | | | | | the file contents with it. Allow remapping a file by specifying another filename whose contents should be loaded if the original file gets loaded. This allows to override files without having to create & load buffers in advance. llvm-svn: 127052
* Move some of the logic about classifying Objective-C methods intoJohn McCall2011-03-021-0/+50
| | | | | | | | conventional categories into Basic and AST. Update the self-init checker to use this logic; CFRefCountChecker is complicated enough that I didn't want to touch it. llvm-svn: 126817
* Teach TextDiagnosticPrinter to print out '-Werror' in addition to the ↵Ted Kremenek2011-02-251-3/+8
| | | | | | | | | | warning flag for a warning mapped to an error. For example: t.c:7:9: error: using the result of an assignment as a condition without parentheses [-Werror,-Wparentheses] llvm-svn: 126466
* Switch the VerifyDiagnosticsClient to use PresumedLocs now that theyChandler Carruth2011-02-231-3/+14
| | | | | | | exist. Cheat and do this by adding some wrappers around the PresumedLoc machinery that directly return the line and column number. llvm-svn: 126281
* Targets/Darwin: mcount name on Darwin needs to be unmangled.Daniel Dunbar2011-02-211-0/+1
| | | | llvm-svn: 126152
* Test commit.Richard Smith2011-02-201-1/+0
| | | | llvm-svn: 126063
* Re-instate r125819 and r125820 with no functionality changePeter Collingbourne2011-02-191-12/+0
| | | | llvm-svn: 126060
* Revert 125820 and 125819 to fix PR9266.Rafael Espindola2011-02-191-0/+12
| | | | llvm-svn: 126050
* Selector::getIdentifierInfoForSlot() can return NULL values, a factDouglas Gregor2011-02-181-0/+5
| | | | | | | | | | | | that was ignored in a few places (most notably, code completion). Introduce Selector::getNameForSlot() for the common case where we only care about the name. Audit all uses of getIdentifierInfoForSlot(), switching many over to getNameForSlot(), fixing a few crashers. Fixed <rdar://problem/8939352>, a code-completion crasher. llvm-svn: 125977
* [Heikki Kultala] This patch contains the ABI changes for the TCE target.NAKAMURA Takumi2011-02-181-2/+2
| | | | | | TCE target has some too strict alignment rules (that the HW really does not require, but which caused problems elsewhere) for data types and an ABI change was decided. llvm-svn: 125833
* Move TargetInfo::adjustInlineAsmType to TargetCodeGenInfoPeter Collingbourne2011-02-181-12/+0
| | | | llvm-svn: 125819
* Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 instead.NAKAMURA Takumi2011-02-171-1/+1
| | | | | | No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32. llvm-svn: 125742
* Fix a thinko with llvm::Optional, which is clearly the most dangerous class ↵Douglas Gregor2011-02-161-4/+8
| | | | | | template in the universe llvm-svn: 125679
* OpenCL: add support for __kernel, kernel keywords and EXTENSION,Peter Collingbourne2011-02-141-1/+3
| | | | | | FP_CONTRACT pragmas. Patch originally by ARM. llvm-svn: 125475
* Add CMake dependencies so that LLVM_USED_LIBS order doesn't matter.Jeffrey Yasskin2011-02-111-0/+2
| | | | | | | I also sorted the tools/driver dependencies since their order no longer matters. llvm-svn: 125417
* Uses llvm::sys::path instead of hand-rolled algorithm in FileManager.Zhanyong Wan2011-02-111-32/+11
| | | | | | Reviewed by dgregor. llvm-svn: 125407
* Improves Clang's virtual file handling.Zhanyong Wan2011-02-111-85/+146
| | | | | | | | | | | | | | | | | | | | | | | This patch contains: - making some of the existing comments more accurate in the presence of virtual files/directories. - renaming some private data members of FileManager to match their roles better. - creating 'DirectorEntry's for the parent directories of virtual files, such that we can tell whether two virtual files are from the same directory. This is useful for injecting virtual files whose directories don't exist in the real file system. - minor clean-ups and adding comments for class FileManager::UniqueDirContainer and FileManager::UniqueFileContainer. - adding statistics on virtual files to FileManager::PrintStats(). - adding unit tests to verify the existing and new behavior of FileManager. llvm-svn: 125384
* Don't compare llvm::Optional<> objects directly; compare theirDouglas Gregor2011-02-111-8/+14
| | | | | | contents when it's safe. I just *love* C++ some days. llvm-svn: 125378
* Implement two related optimizations that make de-serialization ofDouglas Gregor2011-02-101-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AST/PCH files more lazy: - Don't preload all of the file source-location entries when reading the AST file. Instead, load them lazily, when needed. - Only look up header-search information (whether a header was already #import'd, how many times it's been included, etc.) when it's needed by the preprocessor, rather than pre-populating it. Previously, we would pre-load all of the file source-location entries, which also populated the header-search information structure. This was a relatively minor performance issue, since we would end up stat()'ing all of the headers stored within a AST/PCH file when the AST/PCH file was loaded. In the normal PCH use case, the stat()s were cached, so the cost--of preloading ~860 source-location entries in the Cocoa.h case---was relatively low. However, the recent optimization that replaced stat+open with open+fstat turned this into a major problem, since the preloading of source-location entries would now end up opening those files. Worse, those files wouldn't be closed until the file manager was destroyed, so just opening a Cocoa.h PCH file would hold on to ~860 file descriptors, and it was easy to blow through the process's limit on the number of open file descriptors. By eliminating the preloading of these files, we neither open nor stat the headers stored in the PCH/AST file until they're actually needed for something. Concretely, we went from *** HeaderSearch Stats: 835 files tracked. 364 #import/#pragma once files. 823 included exactly once. 6 max times a file is included. 3 #include/#include_next/#import. 0 #includes skipped due to the multi-include optimization. 1 framework lookups. 0 subframework lookups. *** Source Manager Stats: 835 files mapped, 3 mem buffers mapped. 37460 SLocEntry's allocated, 11215575B of Sloc address space used. 62 bytes of files mapped, 0 files with line #'s computed. with a trivial program that uses a chained PCH including a Cocoa PCH to *** HeaderSearch Stats: 4 files tracked. 1 #import/#pragma once files. 3 included exactly once. 2 max times a file is included. 3 #include/#include_next/#import. 0 #includes skipped due to the multi-include optimization. 1 framework lookups. 0 subframework lookups. *** Source Manager Stats: 3 files mapped, 3 mem buffers mapped. 37460 SLocEntry's allocated, 11215575B of Sloc address space used. 62 bytes of files mapped, 0 files with line #'s computed. for the same program. llvm-svn: 125286
* Implement mcount profiling, enabled via -pg.Roman Divacky2011-02-102-0/+20
| | | | llvm-svn: 125282
* CMake: LLVM_NO_RTTI must be obsolete now!NAKAMURA Takumi2011-02-101-2/+0
| | | | llvm-svn: 125275
* Update for API change.Rafael Espindola2011-02-081-2/+2
| | | | llvm-svn: 125129
* Improve our uniquing of file entries when files are re-saved or areDouglas Gregor2011-02-051-21/+36
| | | | | | | | | | | | | | overridden via remapping. Thus, when we create a "virtual" file in the file manager, we still stat() the real file that lives behind it so that we can provide proper uniquing based on inodes. This helps keep the file manager much more consistent. To take advantage of this when reparsing files in libclang, we disable the use of the stat() cache when reparsing or performing code completion, since the stat() cache is very likely to be out of date in this use case. llvm-svn: 124971
* If any Fix-Its attached to a diagnostic have invalid source locationsDouglas Gregor2011-02-031-0/+13
| | | | | | | or source locations that refer into a macro instantiation, delete all of the Fix-Its on that diagnostic. llvm-svn: 124833
* Teach SourceManager::getLocation() how to cope with a source fileDouglas Gregor2011-02-031-18/+84
| | | | | | | | | | | | | | | | whose inode has changed since the file was first created and that is being seen through a different path name (e.g., due to symlinks or relative path elements), such that its FileEntry pointer doesn't match a known FileEntry pointer. Since this requires a system call (to stat()), we only perform this deeper checking if we can't find the file by comparing FileEntry pointers. Also, add a micro-optimization where we don't bother to compute line numbers when given the location (1, 1). This improves the efficiency of clang_getLocationForOffset(). llvm-svn: 124800
* Revert 124754 and 124760 as they made clang unusable in the presence of symbolicRafael Espindola2011-02-031-84/+0
| | | | | | links. llvm-svn: 124776
* Improve the performance of filename canonicalization by avoidingDouglas Gregor2011-02-031-1/+8
| | | | | | redundant searches in the string. No functionality change. llvm-svn: 124760
* Canonicalize path names in the file manager before performing a lookupDouglas Gregor2011-02-021-0/+77
| | | | | | | | | | | | | | | on that name. Canonicalization eliminates silliness such as "." and "foo/.." that breaks the uniquing of files in the presence of virtual files or files whose inode numbers have changed during parsing/re-parsing. c-index-test isn't able to create this crazy situation, so I've resorted to testing outside of the Clang tree. Fixes <rdar://problem/8928220>. Note that this hackery will go away once we have a real virtual file system on which we can layer FileManager; the virtual-files hack is showing cracks. llvm-svn: 124754
* Support EFI target triple, from Carl Norum!Douglas Gregor2011-02-011-1/+4
| | | | llvm-svn: 124660
* Harden Lexer::GetBeginningOfToken() against bogus source locations andDouglas Gregor2011-01-311-2/+11
| | | | | | the disappearance/alteration of files. llvm-svn: 124616
* Teach Diagnostic::setClient() to free the existing, ownedDouglas Gregor2011-01-311-0/+7
| | | | | | client. Fixes a libclang leak. llvm-svn: 124614
* Separate the access-control diagnostics from other diagnostics that do not ↵Douglas Gregor2011-01-271-5/+9
| | | | | | have SFINAE behavior. llvm-svn: 124441
* TextDiagnosticPrinter.cpp: Show diagnostics as far as possible even with ↵Axel Naumann2011-01-271-6/+10
| | | | | | | | | | | | | | invalid PresomedLoc, instead of just silencing it. FileManager.cpp: Allow virtual files in nonexistent directories. FileManager.cpp: Close FileDescriptor for virtual files that correspond to actual files. FileManager.cpp: Enable virtual files to be created even for files that were flagged as NON_EXISTENT_FILE, e.g. by a prior (unsuccessful) addFile(). ASTReader.cpp: Read a PCH even if the original source files cannot be found. Add a test for reading a PCH of a file that has been removed and diagnostics referencing that file. llvm-svn: 124374
* lib/Basic/Targets.cpp: __builtin_va_list is as same on win64 mingw64!NAKAMURA Takumi2011-01-171-3/+3
| | | | llvm-svn: 123691
* lib/Basic/Targets.cpp: Fix __declspec() on Mingw-w64.NAKAMURA Takumi2011-01-171-1/+1
| | | | | | It should be defined as-is. Some headers would detect existence of __declspec and use one. llvm-svn: 123690
* lib/Basic/Targets.cpp: Set user_label_prefix on Win64 both mingw and msvc.NAKAMURA Takumi2011-01-171-0/+1
| | | | llvm-svn: 123689
* Properly propagate #pragma diagnostic mappings from PCH but not command-line ↵Argyrios Kyrtzidis2011-01-142-6/+7
| | | | | | | | warning flags. Addresses rdar://8435969&8852495 llvm-svn: 123462
* wint_t is defined as 'unsigned int' on Linux. Fixes PR8938.Douglas Gregor2011-01-121-0/+1
| | | | llvm-svn: 123320
* Update AST reader/writer to handle new AppleKext.Fariborz Jahanian2011-01-071-1/+1
| | | | | | | | Fix an unexpected hickup caused by exceeding size of generated table (and a misleading comment). Improve on help message for -fapple-kext. llvm-svn: 123003
* Add cortex-m3 CPU to getCPUDefineSuffix mapping.Bob Wilson2011-01-061-0/+1
| | | | | | Patch by Sylvère Teissier. llvm-svn: 122965
* PowerPC fixes.Roman Divacky2011-01-062-17/+25
| | | | | | | | | | | | | Fix the width and align of bool type on Darwin to be 32bits while keeping it 8 everywhere else. Change the definition of va_list to default to SV4 ABI one and let darwin subtarget override this. Both changes submitted by Nathan Whitehorn and reviewed by Rafael Espindola. llvm-svn: 122956
* set features for k8-sse3Roman Divacky2010-12-291-0/+3
| | | | llvm-svn: 122629
* The -fshort-wchar option causes wchar_t to become unsigned, in addition to beingChris Lattner2010-12-251-1/+1
| | | | | | | 16-bits in size. Implement this by splitting WChar into two enums, like we have for char. This fixes a miscompmilation of XULRunner, PR8856. llvm-svn: 122558
* Handle locations coming from macro instantiations properly in ↵Argyrios Kyrtzidis2010-12-241-0/+7
| | | | | | | | SourceManager::isBeforeInTranslationUnit(). Fixes rdar://8790245 and http://llvm.org/PR8821. llvm-svn: 122536
* In C++, if the user redeclares a builtin function with a type that isDouglas Gregor2010-12-211-0/+4
| | | | | | | | | | | | | | | inconsistent with the type that the builtin *should* have, forget about the builtin altogether: we don't want subsequence analyses, CodeGen, etc., to think that we have a proper builtin function. C is protected from errors here because it allows one to use a library builtin without having a declaration, and detects inconsistent (re-)declarations of builtins during declaration merging. C++ was unprotected, and therefore would crash. Fixes PR8839. llvm-svn: 122351
OpenPOWER on IntegriCloud