aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic
AgeCommit message (Collapse)Author
2011-02-25Teach TextDiagnosticPrinter to print out '-Werror' in addition to the ↵Ted Kremenek
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] git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126466 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-23Switch the VerifyDiagnosticsClient to use PresumedLocs now that theyChandler Carruth
exist. Cheat and do this by adding some wrappers around the PresumedLoc machinery that directly return the line and column number. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126281 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-21Targets/Darwin: mcount name on Darwin needs to be unmangled.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126152 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-20Test commit.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126063 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19Re-instate r125819 and r125820 with no functionality changePeter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126060 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-19Revert 125820 and 125819 to fix PR9266.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126050 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18Selector::getIdentifierInfoForSlot() can return NULL values, a factDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125977 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18[Heikki Kultala] This patch contains the ABI changes for the TCE target.NAKAMURA Takumi
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125833 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-18Move TargetInfo::adjustInlineAsmType to TargetCodeGenInfoPeter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125819 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-17Triple::MinGW64 is deprecated and removed. We can use Triple::MinGW32 instead.NAKAMURA Takumi
No one uses *-mingw64. mingw-w64 is represented as {i686|x86_64}-w64-mingw32. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125742 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-16Fix a thinko with llvm::Optional, which is clearly the most dangerous class ↵Douglas Gregor
template in the universe git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125679 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-14OpenCL: add support for __kernel, kernel keywords and EXTENSION,Peter Collingbourne
FP_CONTRACT pragmas. Patch originally by ARM. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125475 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11Add CMake dependencies so that LLVM_USED_LIBS order doesn't matter.Jeffrey Yasskin
I also sorted the tools/driver dependencies since their order no longer matters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125417 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11Uses llvm::sys::path instead of hand-rolled algorithm in FileManager.Zhanyong Wan
Reviewed by dgregor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125407 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11Improves Clang's virtual file handling.Zhanyong Wan
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125384 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-11Don't compare llvm::Optional<> objects directly; compare theirDouglas Gregor
contents when it's safe. I just *love* C++ some days. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125378 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10Implement two related optimizations that make de-serialization ofDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125286 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10Implement mcount profiling, enabled via -pg.Roman Divacky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125282 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-10CMake: LLVM_NO_RTTI must be obsolete now!NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125275 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-08Update for API change.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@125129 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-05Improve our uniquing of file entries when files are re-saved or areDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124971 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03If any Fix-Its attached to a diagnostic have invalid source locationsDouglas Gregor
or source locations that refer into a macro instantiation, delete all of the Fix-Its on that diagnostic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124833 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03Teach SourceManager::getLocation() how to cope with a source fileDouglas Gregor
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(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124800 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03Revert 124754 and 124760 as they made clang unusable in the presence of symbolicRafael Espindola
links. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124776 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-03Improve the performance of filename canonicalization by avoidingDouglas Gregor
redundant searches in the string. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124760 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-02Canonicalize path names in the file manager before performing a lookupDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124754 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-01Support EFI target triple, from Carl Norum!Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124660 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-31Harden Lexer::GetBeginningOfToken() against bogus source locations andDouglas Gregor
the disappearance/alteration of files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124616 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-31Teach Diagnostic::setClient() to free the existing, ownedDouglas Gregor
client. Fixes a libclang leak. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124614 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-27Separate the access-control diagnostics from other diagnostics that do not ↵Douglas Gregor
have SFINAE behavior. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124441 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-27TextDiagnosticPrinter.cpp: Show diagnostics as far as possible even with ↵Axel Naumann
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124374 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-17lib/Basic/Targets.cpp: __builtin_va_list is as same on win64 mingw64!NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123691 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-17lib/Basic/Targets.cpp: Fix __declspec() on Mingw-w64.NAKAMURA Takumi
It should be defined as-is. Some headers would detect existence of __declspec and use one. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123690 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-17lib/Basic/Targets.cpp: Set user_label_prefix on Win64 both mingw and msvc.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123689 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-14Properly propagate #pragma diagnostic mappings from PCH but not command-line ↵Argyrios Kyrtzidis
warning flags. Addresses rdar://8435969&8852495 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123462 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-12wint_t is defined as 'unsigned int' on Linux. Fixes PR8938.Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123320 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-07Update AST reader/writer to handle new AppleKext.Fariborz Jahanian
Fix an unexpected hickup caused by exceeding size of generated table (and a misleading comment). Improve on help message for -fapple-kext. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123003 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06Add cortex-m3 CPU to getCPUDefineSuffix mapping.Bob Wilson
Patch by Sylvère Teissier. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122965 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-06PowerPC fixes.Roman Divacky
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-29set features for k8-sse3Roman Divacky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122629 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-25The -fshort-wchar option causes wchar_t to become unsigned, in addition to beingChris Lattner
16-bits in size. Implement this by splitting WChar into two enums, like we have for char. This fixes a miscompmilation of XULRunner, PR8856. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122558 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-24Handle locations coming from macro instantiations properly in ↵Argyrios Kyrtzidis
SourceManager::isBeforeInTranslationUnit(). Fixes rdar://8790245 and http://llvm.org/PR8821. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122536 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21In C++, if the user redeclares a builtin function with a type that isDouglas Gregor
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122351 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-21Replace all uses of PathV1::makeAbsolute with PathV2::fs::make_absolute.Michael J. Spencer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122340 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-19Add missing standard includes. Patch by Joerg Sonnenberger!Nick Lewycky
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122194 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-17Replace all uses of PathV1::isAbsolute with PathV2::is_{absolute,relative}.Michael J. Spencer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122087 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-16MemoryBuffer API update.Michael J. Spencer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-15Fix diagnostic pragmas.Argyrios Kyrtzidis
Diagnostic pragmas are broken because we don't keep track of the diagnostic state changes and we only check the current/latest state. Problems manifest if a diagnostic is emitted for a source line that has different diagnostic state than the current state; this can affect a lot of places, like C++ inline methods, template instantiations, the lexer, etc. Fix the issue by having the Diagnostic object keep track of the source location of the pragmas so that it is able to know what is the diagnostic state at any given source location. Fixes rdar://8365684. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-12Change MBlaze target to have the same description string as its LLVM equivalent.Wesley Peck
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121640 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-09Use error_code instead of std::string* for MemoryBuffer.Michael J. Spencer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@121378 91177308-0d34-0410-b5e6-96231b3b80d8