Added the capability (turned off for now) to mark a
method as __attribute__ ((used)) when adding it to a
class. This functionality is useful when stopped in
anonymous namespaces: expressions attached to classes
in anonymous namespaces are typically elided by Clang's
CodeGen because they have no namespaces are intended
not to be externally visible. __attribute__ ((used))
forces CodeGen to emit the function.
Right now, __attribute__ ((used)) causes the JIT not to
emit the function, so we're not enabling it until we
fix that.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@143469 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Expression/ClangExpressionDeclMap.cpp b/source/Expression/ClangExpressionDeclMap.cpp
index 6235417..6c760a7 100644
--- a/source/Expression/ClangExpressionDeclMap.cpp
+++ b/source/Expression/ClangExpressionDeclMap.cpp
@@ -3005,17 +3005,18 @@
args[0] = ClangASTContext::GetVoidPtrType(parser_ast_context, false);
- void *method_type = ClangASTContext::CreateFunctionType (parser_ast_context,
- ClangASTContext::GetBuiltInType_void(parser_ast_context),
- args,
- 1,
- false,
- ClangASTContext::GetTypeQualifiers(copied_type));
-
+ clang_type_t method_type = ClangASTContext::CreateFunctionType (parser_ast_context,
+ ClangASTContext::GetBuiltInType_void(parser_ast_context),
+ args,
+ 1,
+ false,
+ ClangASTContext::GetTypeQualifiers(copied_type));
+
const bool is_virtual = false;
const bool is_static = false;
const bool is_inline = false;
const bool is_explicit = false;
+ const bool is_attr_used = false;
ClangASTContext::AddMethodToCXXRecordType (parser_ast_context,
copied_type,
@@ -3025,7 +3026,8 @@
is_virtual,
is_static,
is_inline,
- is_explicit);
+ is_explicit,
+ is_attr_used);
}
context.AddTypeDecl(copied_type);