diff options
author | Alp Toker <alp@nuanti.com> | 2014-06-05 22:10:59 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2014-06-05 22:10:59 +0000 |
commit | fb8d02b179732b17897f1d4024583949a56b0bb5 (patch) | |
tree | 9773c072cdc1e0f4a6ccfba97f3ed6cda7f2d958 /clang/lib/CodeGen/CodeGenModule.h | |
parent | 66f676e9e53aaaba12fd9848a94915346ab76b87 (diff) | |
download | bcm5719-llvm-fb8d02b179732b17897f1d4024583949a56b0bb5.tar.gz bcm5719-llvm-fb8d02b179732b17897f1d4024583949a56b0bb5.zip |
Implement -Wframe-larger-than backend diagnostic
Add driver and frontend support for the GCC -Wframe-larger-than=bytes warning.
This is the first GCC-compatible backend diagnostic built around LLVM's
reporting feature.
This commit adds infrastructure to perform reverse lookup from mangled names
emitted after LLVM IR generation. We use that to resolve precise locations and
originating AST functions, lambdas or block declarations to produce seamless
codegen-guided diagnostics.
An associated change, StringMap now maintains unique mangled name strings
instead of allocating copies. This is a net memory saving in C++ and a small
hit for C where we no longer reuse IdentifierInfo storage, pending further
optimisation.
llvm-svn: 210293
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.h b/clang/lib/CodeGen/CodeGenModule.h index f157d20e6cf..6cb4fc17c5e 100644 --- a/clang/lib/CodeGen/CodeGenModule.h +++ b/clang/lib/CodeGen/CodeGenModule.h @@ -287,7 +287,7 @@ class CodeGenModule : public CodeGenTypeCache { /// for emission and therefore should only be output if they are actually /// used. If a decl is in this, then it is known to have not been referenced /// yet. - llvm::StringMap<GlobalDecl> DeferredDecls; + std::map<StringRef, GlobalDecl> DeferredDecls; /// This is a list of deferred decls which we have seen that *are* actually /// referenced. These get code generated when the module is done. @@ -327,8 +327,8 @@ class CodeGenModule : public CodeGenTypeCache { /// A map of canonical GlobalDecls to their mangled names. llvm::DenseMap<GlobalDecl, StringRef> MangledDeclNames; - llvm::BumpPtrAllocator MangledNamesAllocator; - + llvm::StringMap<GlobalDecl, llvm::BumpPtrAllocator> Manglings; + /// Global annotations. std::vector<llvm::Constant*> Annotations; @@ -522,6 +522,9 @@ public: StaticLocalDeclGuardMap[D] = C; } + bool lookupRepresentativeDecl(StringRef MangledName, + GlobalDecl &Result) const; + llvm::Constant *getAtomicSetterHelperFnMap(QualType Ty) { return AtomicSetterHelperFnMap[Ty]; } @@ -922,7 +925,7 @@ public: bool AttrOnCallSite); StringRef getMangledName(GlobalDecl GD); - std::string getBlockMangledName(GlobalDecl GD, const BlockDecl *BD); + StringRef getBlockMangledName(GlobalDecl GD, const BlockDecl *BD); void EmitTentativeDefinition(const VarDecl *D); |