aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend
AgeCommit message (Collapse)AuthorFilesLines
2012-11-30Teach the serialized diagnostic writer to clone() itself, sharingDouglas Gregor1-67/+112
state so that all of the various clones end up rendering their diagnostics into the same serialized-diagnostics file. This is important when we actually want failures during module build to be reported back to the translation unit that tried to import the not-yet-built or out-of-date module. <rdar://problem/12565727> llvm-svn: 169057
2012-11-30Rename ModuleBuildPath -> ModuleBuildStack. Thanks, Dmitri!Douglas Gregor2-16/+16
llvm-svn: 169045
2012-11-30When we're emitting a diagnostic with a source location in an importedDouglas Gregor2-8/+84
module, provide a module import stack similar to what we would get for an include stack, e.g., In module 'DependsOnModule' imported from build-fail-notes.m:4: In module 'Module' imported from DependsOnModule.framework/Headers/DependsOnModule.h:1: Inputs/Module.framework/Headers/Module.h:15:12: note: previous definition is here @interface Module <rdar://problem/12696425> llvm-svn: 169042
2012-11-30When an error occurs while building a module on demand, provide "WhileDouglas Gregor3-15/+68
building module 'Foo' imported from..." notes (the same we we provide "In file included from..." notes) in the diagnostic, so that we know how this module got included in the first place. This is part of <rdar://problem/12696425>. llvm-svn: 169021
2012-11-30Fix the computation of highlight ranges so we produce something sane whenEli Friedman1-10/+30
the beginning and end of the range are in different macro arguments. PR14399. llvm-svn: 168984
2012-11-29Keep track of modules that have failed to build. If we encounter anDouglas Gregor1-18/+55
import of that module elsewhere, don't try to build the module again: it won't work, and the experience is quite dreadful. We track this information somewhat globally, shared among all of the related CompilerInvocations used to build modules on-the-fly, so that a particular Clang instance will only try to build a given module once. Fixes <rdar://problem/12552849>. llvm-svn: 168961
2012-11-29Reject uses of __int128 on platforms that don't support it. Also move the uglyRichard Smith1-0/+2
'getPointerWidth(0) >= 64' test to be a method on TargetInfo, ready to be properly cleaned up. llvm-svn: 168856
2012-11-27Remove some dead code. CLANG_IS_PRODUCTION is now just a build flag andRafael Espindola1-1/+1
is not used in any #ifdef. llvm-svn: 168703
2012-11-27Frontend: Create a virtual file for named pipe inputs.Daniel Dunbar1-1/+5
- This ensures we see the right buffer size for the file. llvm-svn: 168636
2012-11-23PR14306: Move -fbounds-checking to -fsanitize=bounds.Joey Gouly1-2/+0
llvm-svn: 168510
2012-11-21Use color for -ast-dump-filter only when it is supportedDmitri Gribenko1-3/+6
Patch by Philip Craig. llvm-svn: 168420
2012-11-16Since CreateTargetInfo is taking ownership of the target options, passDouglas Gregor3-8/+8
it as a pointer. llvm-svn: 168136
2012-11-16[libclang] When caching code-completion results, pass the ↵Argyrios Kyrtzidis1-4/+5
CachedCompletionAllocator to the CodeCompletionTUInfo that is going to be used to get the results. Previously we would use ASTUnit's CodeCompletionTUInfo which has its own allocator that will go away when we reparse. That could result in a use-after-free bug when getting the parent context name from a CodeCompletionString. Addresses rdar://12568377. llvm-svn: 168133
2012-11-16CPP Output: Do not emit an enter file marker for the main file.Daniel Dunbar1-0/+11
- This diverges from gcc, and confuses tools (like dtrace) which track # line markers as a way to determine which content is in the context of the main file. llvm-svn: 168128
2012-11-15block extended signatur option. Change previous optionFariborz Jahanian1-2/+2
to a cc1 -fencode-extended-block-signature and pass it to cc1 and recognize this option to produce extended block type signature. // rdar://12109031 llvm-svn: 168063
2012-11-15[modules] Use a memory buffer directly as input for the module includes,Argyrios Kyrtzidis1-13/+5
instead of messing with virtual files. llvm-svn: 168062
2012-11-15[modules] Setup the import location of a module file and use itArgyrios Kyrtzidis3-4/+5
as the include location of the main file of an imported module. llvm-svn: 168061
2012-11-15Use empty parens for empty function parameter list instead of '(void)'.Dmitri Gribenko1-2/+2
llvm-svn: 168041
2012-11-15Make -ffp-contract a codegen option, rather than a laguage option. This makesLang Hames1-12/+12
more sense anyway - it determines how expressions are codegen'd. It also ensures that -ffp-contract=fast has the intended effect when compiling LLVM IR. llvm-svn: 168027
2012-11-14Add -cc1 option -fno-diagnostics-use-presumed-location, a handy mode forRichard Smith2-2/+3
working with preprocessed testcases. This causes source locations in diagnostics to point at the spelling location instead of the presumed location, while still keeping the semantic effects of the line directives (entering and leaving system-header mode, primarily). llvm-svn: 168004
2012-11-14objective-C blocks: under cc1 flag -encode-extended-block-signature,Fariborz Jahanian1-0/+2
generate expanded signature encoding to include types as we already do this for protocol method lists. // rdar://12109031 llvm-svn: 167997
2012-11-11s/BCPLComment/LineComment/Nico Weber1-1/+1
llvm-svn: 167690
2012-11-10Make __LDBL_MAX__ etc. have the correct type on targets where long ↵Eli Friedman1-24/+24
double/double/etc. have the same format. PR14285. Based on patch by Jeroen Dobbelaere. llvm-svn: 167649
2012-11-09Add a FileCharacteristic parameter to SourceManager::createFileIDForMemBufferArgyrios Kyrtzidis1-1/+9
for completeness and use it in CompilerInstance::InitializeSourceManager if the input is a memory buffer. llvm-svn: 167628
2012-11-09Turn FrontendInputFile into an immutable class and have it also acceptArgyrios Kyrtzidis4-32/+33
a memory buffer instead of only a filename. llvm-svn: 167627
2012-11-09Make CompilerInstance::InitializeSourceManager accept a FrontendInputFile,Argyrios Kyrtzidis3-12/+11
no functionality change. llvm-svn: 167626
2012-11-09Implement -mstrict-align using '-backend-option -arm-strict-align' as this savesChad Rosier1-1/+0
us from having to make any backend changes. llvm-svn: 167623
2012-11-09[driver] Add a -mstrict-align compiler option for ARM targets.Chad Rosier1-0/+1
rdar://12340498 llvm-svn: 167619
2012-11-08Remove code to fall back to llvm-gcc for i386 kexts.Bob Wilson1-5/+0
More cleanups to follow in separate commits.... llvm-svn: 167566
2012-11-07When loading a module fails because it is out of date, rebuild thatDouglas Gregor1-3/+26
module in place. <rdar://problem/10138913> llvm-svn: 167539
2012-11-05Split the instrinsic header wmmintrin.h into AES and PCLMUL parts, soDouglas Gregor1-1/+1
that we can model them as separate submodules. llvm-svn: 167420
2012-11-05Frontend: Add support for reading named pipes as the main file.Daniel Dunbar1-0/+13
- The whole {File,Source}Manager is built around wanting to pre-determine the size of files, so we can't fit this in naturally. Instead, we handle it like we do STDIN, where we just replace the main file contents upfront. llvm-svn: 167419
2012-11-05Use the individual -fsanitize=<...> arguments to control which of the UBSanRichard Smith1-3/+0
checks to enable. Remove frontend support for -fcatch-undefined-behavior, -faddress-sanitizer and -fthread-sanitizer now that they don't do anything. llvm-svn: 167413
2012-11-05Add -fsanitize=<sanitizers> argument to driver and frontend, and addRichard Smith1-0/+31
-fno-sanitize=<sanitizers> argument to driver. These allow ASan, TSan, and the various UBSan checks to be enabled and disabled separately. Right now, the different modes can't be combined, but the intention is that combining UBSan and the other sanitizers will be permitted in the near future. Currently, the UBSan checks will all be enabled if any of them is; that will be fixed by the next patch. llvm-svn: 167411
2012-11-05Rename LangOptions members for address sanitizer and thread sanitizer fromRichard Smith1-2/+2
*Sanitizer to Sanitize* in preparation for later patches. llvm-svn: 167405
2012-11-05Hash the various compiler version, target, preprocessor, andDouglas Gregor1-34/+31
header-search options into the module hash. We're just using ADT/Hashing.hpp for this, which isn't as cryptographically strong as I'd like, but it'll do. If someone contributes (say) and MD4 implementation, we'd happily switch to that. llvm-svn: 167397
2012-11-03only truncate source lines in text diagnostics whenSeth Cantrell1-2/+2
the ellipsis is shorter than the text it replaces llvm-svn: 167364
2012-11-03don't step into the middle of multibyte sequencesSeth Cantrell1-2/+2
llvm-svn: 167361
2012-11-03fix bug in SourceColumnMap::startOfPreviousColumnSeth Cantrell1-1/+1
llvm-svn: 167360
2012-11-03Add a proper algorithm to compute accurate source ranges for diagnostics withEli Friedman2-26/+62
caret locations and source ranges in macros. Makes ranges more accurate in some cases, and fixes an assertion failure. Fixes <rdar://problem/12472249>. llvm-svn: 167353
2012-11-02When code-completing don't disable the preprocessing record if modules are ↵Argyrios Kyrtzidis1-2/+3
enabled. llvm-svn: 167325
2012-11-01Remove first argument from Arg::getValue; it's been unused since r105760.Richard Smith1-55/+55
llvm-svn: 167211
2012-11-01Remove CompilerInvocation::toArgs and clang -cc1test mode. These were untestedRichard Smith1-908/+1
and apparently unused (and since they are untested, they're presumably also broken). llvm-svn: 167210
2012-10-31[PCH] Remove the stat cache from the PCH file.Argyrios Kyrtzidis3-11/+3
The stat cache became essentially useless ever since we started validating all file entries in the PCH. But the motivating reason for removing it now is that it also affected correctness in this situation: -You have a header without include guards (using "#pragma once" or #import) -When creating the PCH: -The same header is referenced in an #include with different filename cases. -In the PCH, of course, we record only one file entry for the header file -But we cache in the PCH file the stat info for both filename cases -Then the source files are updated and the header file is updated in a way that its size and modification time are the same but its inode changes -When using the PCH: -We validate the headers, we check that header file and we create a file entry with its current inode -There's another #include with a filename with different case than the previously created file entry -In order to get its stat info we go through the cached stat info of the PCH and we receive the old inode -because of the different inodes, we think they are different files so we go ahead and include its contents. Removing the stat cache will potentially break clients that are attempting to use the stat cache as a way of avoiding having the actual input files available. If that use case is important, patches are welcome to bring it back in a way that will actually work correctly (i.e., emit a PCH that is self-contained, coping with literal strings, line/column computations, etc.). This fixes rdar://5502805 llvm-svn: 167172
2012-10-31Fix for -ast-dump-filterAlexander Kornienko1-3/+1
Summary: -ast-dump-filter implementation used to stop AST traversal after traversing a NULL Decl node. Added test and fixed. Reviewers: djasper, klimek, rsmith Reviewed By: djasper CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D93 llvm-svn: 167155
2012-10-31Decouple code-completion for the SkipFunctionBodies frontend option andArgyrios Kyrtzidis2-3/+0
add a test to make sure code-completion skips bodies. llvm-svn: 167141
2012-10-30remove duplicate data arraySeth Cantrell1-14/+1
llvm-svn: 167007
2012-10-30fix calculation of end pointerSeth Cantrell1-1/+1
llvm-svn: 167006
2012-10-29Move getOriginalSourceFileName inline. Patch by Laszlo Nagy.Rafael Espindola1-4/+0
llvm-svn: 166981
2012-10-29Remove spurious mode marker from .cpp file.Nick Lewycky1-1/+1
llvm-svn: 166915