hanchenye-llvm-project/clang/lib/Frontend
Stepan Dyatkovskiy 5a63792239 Add new methods for TargetInfo:
getRealTypeByWidth and getIntTypeByWidth
  for ASTContext names are almost same(invokes new methods from TargetInfo):
     getIntTypeForBitwidth and getRealTypeForBitwidth.

As first commit for PR16752 fix: 'mode' attribute for unusual targets doesn't work properly
Description:
Troubles could be happened due to some assumptions in handleModeAttr function (see SemaDeclAttr.cpp).
For example, it assumes that 32 bit integer is 'int', while it could be 16 bit only.
Instead of asking target: 'which type do you want to use for int32_t ?' it just hardcodes general opinion. That doesn't looks pretty correct.
Please consider the next solution:
1. In Basic/TargetInfo add getIntTypeByWidth and getRealTypeByWidth virtual methods. By default current behaviour could be implemented here.
2. Fix handleModeAttr according to new methods in TargetInfo.
This approach is implemented in the patch attached to this post.

Fixes:
1st Commit (Current): Add new methods for TargetInfo:
     getRealTypeByWidth and getIntTypeByWidth
  for ASTContext names are almost same(invokes new methods from TargetInfo):
     getIntTypeForBitwidth and getRealTypeForBitwidth

2nd Commit (Next): Fix SemaDeclAttr, handleModeAttr function.

llvm-svn: 190044
2013-09-05 11:23:21 +00:00
..
ASTConsumers.cpp Add -ast-dump-lookups switch to -cc1 to dump DeclContext lookup maps. Test to 2013-06-24 01:45:33 +00:00
ASTMerge.cpp When building a module, forward diagnostics to the outer diagnostic consumer. 2013-05-03 22:58:43 +00:00
ASTUnit.cpp This wasn't headers, just missing namespaces. 2013-08-24 13:22:59 +00:00
CMakeLists.txt clang/lib: [CMake] Update tblgen'd dependencies. 2012-07-27 06:18:33 +00:00
CacheTokens.cpp Use llvm::sys::fs::UniqueID for windows and unix. 2013-08-01 21:42:11 +00:00
ChainedDiagnosticConsumer.cpp Remove spurious mode marker from .cpp file. 2012-10-29 06:05:01 +00:00
ChainedIncludesSource.cpp Use SmallVectorImpl& for function arguments instead of SmallVector. 2013-07-05 19:34:19 +00:00
CompilerInstance.cpp SourceManager intialization tweaks. 2013-08-12 13:46:52 +00:00
CompilerInvocation.cpp Attempt to migrate default dwarf version to 4 for linux. 2013-09-03 16:10:12 +00:00
CreateInvocationFromCommandLine.cpp [Driver] Refactor clang driver to use LLVM's Option library 2013-06-14 17:17:23 +00:00
DependencyFile.cpp Modernize some low-hanging PathV1 uses. 2013-06-13 14:26:04 +00:00
DependencyGraph.cpp Remove useless 'llvm::' qualifier from names like StringRef and others that are 2013-01-12 19:30:44 +00:00
DiagnosticRenderer.cpp Replace ArrayRef<T>() with None, now that we have an implicit ArrayRef constructor from None 2013-05-05 00:41:58 +00:00
FrontendAction.cpp Avoid crashing if a directory has no pch files. 2013-07-28 13:23:37 +00:00
FrontendActions.cpp Add -ast-dump-lookups switch to -cc1 to dump DeclContext lookup maps. Test to 2013-06-24 01:45:33 +00:00
FrontendOptions.cpp Remove duplicated case. 2013-06-22 16:44:45 +00:00
HeaderIncludeGen.cpp clang-cl: Support /showIncludes 2013-08-09 00:32:23 +00:00
InitHeaderSearch.cpp InitHeaderSearch.cpp: [Cygwin] Add 4.7.3. 2013-08-18 15:03:03 +00:00
InitPreprocessor.cpp Add new methods for TargetInfo: 2013-09-05 11:23:21 +00:00
LangStandards.cpp Remove unnecessary default cases in switches over enums. 2012-01-17 02:30:50 +00:00
LayoutOverrideSource.cpp Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h. 2013-02-08 22:30:41 +00:00
LogDiagnosticPrinter.cpp Remove DiagnosticConsumer::clone(), a bad idea that is now unused. 2013-05-03 23:07:45 +00:00
Makefile
MultiplexConsumer.cpp Note when a decl is used in AST files. 2013-09-05 00:02:25 +00:00
PrintPreprocessedOutput.cpp Properly escape filenames in line directives. 2013-08-29 01:42:42 +00:00
SerializedDiagnosticPrinter.cpp Remove DiagnosticConsumer::clone(), a bad idea that is now unused. 2013-05-03 23:07:45 +00:00
TextDiagnostic.cpp Use llvm::sys::fs::UniqueID for windows and unix. 2013-08-01 21:42:11 +00:00
TextDiagnosticBuffer.cpp Remove DiagnosticConsumer::clone(), a bad idea that is now unused. 2013-05-03 23:07:45 +00:00
TextDiagnosticPrinter.cpp Remove DiagnosticConsumer::clone(), a bad idea that is now unused. 2013-05-03 23:07:45 +00:00
VerifyDiagnosticConsumer.cpp Split isFromMainFile into two functions. 2013-08-22 00:27:10 +00:00
Warnings.cpp Revert r177218. 2013-05-03 23:20:27 +00:00